From d3b5bd5d5a044172c797f41b0bb20dfefd1a9ca7 Mon Sep 17 00:00:00 2001 From: bdlafleur Date: Thu, 30 Nov 2023 17:43:38 -0600 Subject: [PATCH] Adding test crumbs for requirements (#1511) --- .../neutronics/tests/test_energyGroups.py | 13 +++++++++++ armi/reactor/tests/test_components.py | 22 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/armi/physics/neutronics/tests/test_energyGroups.py b/armi/physics/neutronics/tests/test_energyGroups.py index 6cb2b9673..cb68011ae 100644 --- a/armi/physics/neutronics/tests/test_energyGroups.py +++ b/armi/physics/neutronics/tests/test_energyGroups.py @@ -53,3 +53,16 @@ def test_consistenciesBetweenGroupStructureAndGroupStructureType(self): energyGroups.getGroupStructure(groupStructureType) ), ) + + def test_getFastFluxGroupCutoff(self): + """Test ability to get the ARMI energy group index contained in energy threshold. + + .. test:: Return the energy group index which contains a given energy threshold. + :id: T_ARMI_EG_FE + :tests: R_ARMI_EG_FE + """ + group, frac = energyGroups.getFastFluxGroupCutoff( + [100002, 100001, 100000, 99999, 0] + ) + + self.assertListEqual([group, frac], [2, 0]) diff --git a/armi/reactor/tests/test_components.py b/armi/reactor/tests/test_components.py index f67e5f019..d89bd4da5 100644 --- a/armi/reactor/tests/test_components.py +++ b/armi/reactor/tests/test_components.py @@ -320,6 +320,28 @@ def test_getBoundingCircleOuterDiameter(self): * self.component.getThermalExpansionFactor(self.component.temperatureInC), ) + def test_component_less_than(self): + """Ensure that comparisons between components properly reference bounding circle outer diameter. + + .. test:: Order components by their outermost diameter + :id: T_ARMI_COMP_ORDER + :tests: R_ARMI_COMP_ORDER + """ + componentCls = UnshapedComponent + componentMaterial = "HT9" + + smallDims = {"Tinput": 25.0, "Thot": 430.0, "area": 0.5 * math.pi} + sameDims = {"Tinput": 25.0, "Thot": 430.0, "area": 1.0 * math.pi} + bigDims = {"Tinput": 25.0, "Thot": 430.0, "area": 2.0 * math.pi} + + smallComponent = componentCls("TestComponent", componentMaterial, **smallDims) + sameComponent = componentCls("TestComponent", componentMaterial, **sameDims) + bigComponent = componentCls("TestComponent", componentMaterial, **bigDims) + + self.assertTrue(smallComponent < self.component) + self.assertFalse(bigComponent < self.component) + self.assertFalse(sameComponent < self.component) + def test_fromComponent(self): circle = components.Circle("testCircle", "HT9", 25, 500, 1.0) unshaped = components.UnshapedComponent.fromComponent(circle)