Skip to content

Commit

Permalink
Adding energy group crumbs
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science committed Nov 29, 2023
1 parent 067b61d commit 521fb7e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
11 changes: 10 additions & 1 deletion armi/physics/neutronics/energyGroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@


def getFastFluxGroupCutoff(eGrpStruc):
"""Given a constant "fast" energy threshold, return which ARMI energy group index contains this threshold."""
"""Given a constant "fast" energy threshold, return which ARMI energy group index contains this threshold.
.. impl:: Return the energy group index which contains a given energy threshold.
:id: I_ARMI_EG_FE
:implements: R_ARMI_EG_FE
"""
gThres = -1
for g, eV in enumerate(eGrpStruc):
if eV < FAST_FLUX_THRESHOLD_EV:
Expand Down Expand Up @@ -67,6 +72,10 @@ def getGroupStructure(name):
"""
Return descending neutron energy group upper bounds in eV for a given structure name.
.. impl:: Provide the neutron energy group bounds for a given group structure.
:id: I_ARMI_EG_NE
:implements: R_ARMI_EG_NE
Notes
-----
Copy of the group structure is return so that modifications of the energy bounds does
Expand Down
11 changes: 10 additions & 1 deletion armi/physics/neutronics/tests/test_energyGroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@

class TestEnergyGroups(unittest.TestCase):
def test_invalidGroupStructureType(self):
"""Test that the reverse lookup fails on non-existent energy group bounds."""
"""Test that the reverse lookup fails on non-existent energy group bounds.
.. test:: Check the neutron energy group bounds logic fails correctly for the wrong structure.
:id: T_ARMI_EG_NE0
:tests: R_ARMI_EG_NE
"""
modifier = 1e-5
for groupStructureType in energyGroups.GROUP_STRUCTURE:
energyBounds = energyGroups.getGroupStructure(groupStructureType)
Expand All @@ -32,6 +37,10 @@ def test_consistenciesBetweenGroupStructureAndGroupStructureType(self):
"""
Test that the reverse lookup of the energy group structures work.
.. test:: Check the neutron energy group bounds for a given group structure.
:id: T_ARMI_EG_NE1
:tests: R_ARMI_EG_NE
Notes
-----
Several group structures point to the same energy group structure so the reverse lookup will fail to
Expand Down

0 comments on commit 521fb7e

Please sign in to comment.