diff --git a/armi/materials/b4c.py b/armi/materials/b4c.py index b9d8ad65a..b8444014c 100644 --- a/armi/materials/b4c.py +++ b/armi/materials/b4c.py @@ -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""" diff --git a/armi/reactor/tests/test_components.py b/armi/reactor/tests/test_components.py index 5ce88a202..3fda5277f 100644 --- a/armi/reactor/tests/test_components.py +++ b/armi/reactor/tests/test_components.py @@ -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 ----- @@ -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(), ) @@ -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 @@ -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) diff --git a/doc/release/0.2.rst b/doc/release/0.2.rst index d0330d4a5..855c0bd8e 100644 --- a/doc/release/0.2.rst +++ b/doc/release/0.2.rst @@ -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 `_) #. Fixed bug in ``fastFlux`` block parameter mapping in the ``UniformMeshConverter`` by applying it to the ``detailedAxialExpansion`` category.