Skip to content
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

Add nucTempHelper to CylindricalComponentsAverageBlockCollection #1363

Merged
merged 10 commits into from
Oct 25, 2023
13 changes: 13 additions & 0 deletions armi/physics/neutronics/crossSectionGroupManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,19 @@ def _orderComponentsInGroup(self, repBlock):
componentLists = [list(sorted(b)) for b in self.getCandidateBlocks()]
return [list(comps) for comps in zip(*componentLists)]

def _getNucTempHelper(self):
"""All candidate blocks are used in the average."""
nvt = numpy.zeros(len(self.allNuclidesInProblem))
nv = numpy.zeros(len(self.allNuclidesInProblem))
for block in self.getCandidateBlocks():
wt = self.getWeight(block)
nvtBlock, nvBlock = getBlockNuclideTemperatureAvgTerms(
block, self.allNuclidesInProblem
)
nvt += nvtBlock * wt
nv += nvBlock * wt
return nvt, nv


class SlabComponentsAverageBlockCollection(BlockCollection):
"""
Expand Down
2 changes: 2 additions & 0 deletions armi/physics/neutronics/tests/test_crossSectionManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,8 @@ def test_ComponentAverage1DCylinder(self):

xsgm.interactBOL()

xsgm.updateNuclideTemperatures()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is just a check to see that the NotImplementedError doesn't arise? Not sure if it's easy to add more to this test?


# Check that the correct defaults are propagated after the interactBOL
# from the cross section group manager is called.
xsOpt = self.o.cs[CONF_CROSS_SECTION]["ZA"]
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 @@ -14,6 +14,7 @@ What's new in ARMI
#. 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>`_)
#. Add a _getNucTempHelper method for CylindricalComponentsAverageBlockCollection. (`PR#1363 <https://github.com/terrapower/armi/pull/1363>`_)
#. TBD

Bug fixes
Expand Down