Skip to content

Commit

Permalink
Relax Error Check for 1D cylindrical collection (#1347)
Browse files Browse the repository at this point in the history
Co-authored-by: Chris Keckler <[email protected]>
  • Loading branch information
mgjarrett and keckler authored Jul 28, 2023
1 parent 9b854ba commit e888b23
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
8 changes: 7 additions & 1 deletion armi/physics/neutronics/crossSectionGroupManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,6 +468,9 @@ def _checkComponentConsistency(b, repBlock):
f"Blocks {b} and {repBlock} have differing number "
f"of components and cannot be homogenized"
)
# Using Fe-56 as a proxy for structure and Na-23 as proxy for coolant is undesirably SFR-centric
# This should be generalized in the future, if possible
consistentNucs = {"PU239", "U238", "U235", "U234", "FE56", "NA23", "O16"}
for c, repC in zip(sorted(b), sorted(repBlock)):
compString = (
f"Component {repC} in block {repBlock} and component {c} in block {b}"
Expand All @@ -480,7 +483,10 @@ def _checkComponentConsistency(b, repBlock):

theseNucs = set(c.getNuclides())
thoseNucs = set(repC.getNuclides())
diffNucs = theseNucs.symmetric_difference(thoseNucs)
# check for any differences between which `consistentNucs` the components have
diffNucs = theseNucs.symmetric_difference(thoseNucs).intersection(
consistentNucs
)
if diffNucs:
raise ValueError(
f"{compString} are in the same location, but nuclides "
Expand Down
20 changes: 20 additions & 0 deletions armi/physics/neutronics/tests/test_crossSectionManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,8 +376,28 @@ def test_checkComponentConsistency(self):
nucDiffBlock.add(clad)
nucDiffBlock.add(coolant)

# additional non-important nuclides
negligibleNucDiffBlock = HexBlock("blockNegligibleNucDiff")
negligibleNuc = {"N14": 1.0e-5}
modControl = baseComponents[0].getNumberDensities()
modClad = baseComponents[2].getNumberDensities()
modCoolant = baseComponents[4].getNumberDensities()
modControl.update(negligibleNuc)
modClad.update(negligibleNuc)
modCoolant.update(negligibleNuc)
mixedDensities = {
"control": modControl,
"clad": modClad,
"coolant": modCoolant,
}
control, clad, coolant = self._makeComponents(7, mixedDensities)
negligibleNucDiffBlock.add(control)
negligibleNucDiffBlock.add(clad)
negligibleNucDiffBlock.add(coolant)

blockCollection._checkComponentConsistency(refBlock, matchingBlock)
blockCollection._checkComponentConsistency(refBlock, unsortedBlock)
blockCollection._checkComponentConsistency(refBlock, negligibleNucDiffBlock)
for b in (nonMatchingMultBlock, nonMatchingLengthBlock, nucDiffBlock):
with self.assertRaises(ValueError):
blockCollection._checkComponentConsistency(refBlock, b)
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 @@ -13,6 +13,7 @@ What's new in ARMI
#. Removed redundant ``Material.name`` variable. (`PR#1335 <https://github.com/terrapower/armi/pull/1335>`_)
#. Added SHA1 hashes of XS control files to the welcome text. (`PR#1334 <https://github.com/terrapower/armi/pull/1334>`_)
#. Put back ``avgFuelTemp`` block parameter. (`PR#1362 <https://github.com/terrapower/armi/pull/1362>`_)
#. Make cylindrical component block collection less strict about pre-homogenization checks. (`PR#1347 <https://github.com/terrapower/armi/pull/1347>`_)
#. TBD

Bug fixes
Expand Down

0 comments on commit e888b23

Please sign in to comment.