Skip to content

Fix armi/materials/b4c.py::density3 to utilize TD frac #942

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Oct 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 16 additions & 11 deletions armi/materials/b4c.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,18 +159,23 @@ def getMassEnrichmentFromNumEnrich(naturalB10NumberFraction: float) -> float:

def density(self, Tk: float = None, Tc: float = None) -> float:
"""
mass density
Return density that preserves mass when thermally expanded in 2D.

Notes
-----
- applies theoretical density of B4C to parent method
"""
density = material.Material.density(self, Tk, Tc)
theoreticalDensityFrac = self.p.theoreticalDensityFrac
if theoreticalDensityFrac is None:
theoreticalDensityFrac = 1.0
runLog.warning(
"Assumption: 100% theoretical density",
label="Assumption: B4C is at 100% theoretical density",
single=True,
)
return density * theoreticalDensityFrac # g/cc
return material.Material.density(self, Tk, Tc) * self.p.theoreticalDensityFrac

def density3(self, Tk: float = None, Tc: float = None) -> float:
"""
Return density that preserves mass when thermally expanded in 3D.

Notes
-----
- applies theoretical density of B4C to parent method
"""
return material.Material.density3(self, Tk, Tc) * self.p.theoreticalDensityFrac

def linearExpansionPercent(self, Tk: float = None, Tc: float = None) -> float:
"""Boron carbide expansion. Very preliminary"""
Expand Down
47 changes: 30 additions & 17 deletions armi/reactor/tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,28 +494,39 @@ def test_changeNumberDensities(self):


class TestComponentExpansion(unittest.TestCase):
# when comparing to 3D density, the comparison is not quite correct.
# We need a bigger delta, this will be investigated/fixed in another PR
tCold = 20
tWarm = 50
tHot = 500
coldOuterDiameter = 1.0

def test_ComponentMassIndependentOfInputTemp(self):
coldT = 20
circle1 = Circle("circle", "HT9", coldT, self.tHot, self.coldOuterDiameter)
coldT += 200
def test_HT9Expansion(self):
self.runExpansionTests(mat="HT9", isotope="FE")

def test_UZrExpansion(self):
self.runExpansionTests(mat="UZr", isotope="U235")

def test_B4CExpansion(self):
self.runExpansionTests(mat="B4C", isotope="B10")

def runExpansionTests(self, mat: str, isotope: str):
self.componentMassIndependentOfInputTemp(mat)
self.expansionConservationHotHeightDefined(mat, isotope)
self.expansionConservationColdHeightDefined(mat)

def componentMassIndependentOfInputTemp(self, mat: str):
circle1 = Circle("circle", mat, self.tCold, self.tHot, self.coldOuterDiameter)
# pick the input dimension to get the same hot component
hotterDim = self.coldOuterDiameter * (
1 + circle1.material.linearExpansionFactor(coldT, 20)
1 + circle1.material.linearExpansionFactor(self.tCold + 200, self.tCold)
)
circle2 = Circle("circle", "HT9", coldT, self.tHot, hotterDim)
circle2 = Circle("circle", mat, self.tCold + 200, self.tHot, hotterDim)
self.assertAlmostEqual(circle1.getDimension("od"), circle2.getDimension("od"))
self.assertAlmostEqual(circle1.getArea(), circle2.getArea())
self.assertAlmostEqual(circle1.getMassDensity(), circle2.getMassDensity())

def test_ExpansionConservationHotHeightDefined(self):
def expansionConservationHotHeightDefined(self, mat: str, isotope: str):
"""
Demonstrate tutorial for how to expand and relation ships conserved at during expansion.
Demonstrate tutorial for how to expand and relationships conserved at during expansion.

Notes
-----
Expand All @@ -524,13 +535,13 @@ def test_ExpansionConservationHotHeightDefined(self):
"""
hotHeight = 1.0

circle1 = Circle("circle", "HT9", 20, self.tWarm, self.coldOuterDiameter)
circle2 = Circle("circle", "HT9", 20, self.tHot, self.coldOuterDiameter)
circle1 = Circle("circle", mat, self.tCold, self.tWarm, self.coldOuterDiameter)
circle2 = Circle("circle", mat, self.tCold, self.tHot, self.coldOuterDiameter)

# mass density is proportional to Fe number density and derived from
# all the number densities and atomic masses
self.assertAlmostEqual(
circle1.p.numberDensities["FE"] / circle2.p.numberDensities["FE"],
circle1.p.numberDensities[isotope] / circle2.p.numberDensities[isotope],
circle1.getMassDensity() / circle2.getMassDensity(),
)

Expand Down Expand Up @@ -615,7 +626,7 @@ def test_ExpansionConservationHotHeightDefined(self):
mass1, circle1.getMassDensity() * circle1.getArea() * hotHeight
)

def test_ExpansionConservationColdHeightDefined(self):
def expansionConservationColdHeightDefined(self, mat: str):
"""
Demonstrate that material is conserved at during expansion

Expand All @@ -625,10 +636,12 @@ def test_ExpansionConservationColdHeightDefined(self):
inputHeightsConsideredHot = False
"""
coldHeight = 1.0
circle1 = Circle("circle", "HT9", 20, self.tWarm, self.coldOuterDiameter)
circle2 = Circle("circle", "HT9", 20, self.tHot, self.coldOuterDiameter)
circle1 = Circle("circle", mat, self.tCold, self.tWarm, self.coldOuterDiameter)
circle2 = Circle("circle", mat, self.tCold, self.tHot, self.coldOuterDiameter)
# same as 1 but we will make like 2
circle1AdjustTo2 = Circle("circle", "HT9", 20, self.tWarm, 1.0)
circle1AdjustTo2 = Circle(
"circle", mat, self.tCold, self.tWarm, self.coldOuterDiameter
)

# make it hot like 2
circle1AdjustTo2.adjustDensityForHeightExpansion(self.tHot)
Expand Down
1 change: 1 addition & 0 deletions doc/release/0.2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ What's new in ARMI

Bug fixes
---------
#. Adjusted density3 in armi/materials/b4C.py to include the theoretical density. (`PR#942 <https://github.com/terrapower/armi/pull/942>`_)
#. Fixed bug in ``fastFlux`` block parameter mapping in the ``UniformMeshConverter`` by applying it to the ``detailedAxialExpansion`` category.


Expand Down