From 521fb7e227bc22710fa01032dfaf9bf8c6aa103e Mon Sep 17 00:00:00 2001 From: jstilley Date: Wed, 29 Nov 2023 10:58:12 -0800 Subject: [PATCH] Adding energy group crumbs --- armi/physics/neutronics/energyGroups.py | 11 ++++++++++- armi/physics/neutronics/tests/test_energyGroups.py | 11 ++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/armi/physics/neutronics/energyGroups.py b/armi/physics/neutronics/energyGroups.py index 5ecda047d..3f430326a 100644 --- a/armi/physics/neutronics/energyGroups.py +++ b/armi/physics/neutronics/energyGroups.py @@ -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: @@ -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 diff --git a/armi/physics/neutronics/tests/test_energyGroups.py b/armi/physics/neutronics/tests/test_energyGroups.py index 23f7d903f..6cb2b9673 100644 --- a/armi/physics/neutronics/tests/test_energyGroups.py +++ b/armi/physics/neutronics/tests/test_energyGroups.py @@ -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) @@ -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