Skip to content

Commit d3b5bd5

Browse files
authored
Adding test crumbs for requirements (#1511)
1 parent 1330ad1 commit d3b5bd5

File tree

2 files changed

+35
-0
lines changed

2 files changed

+35
-0
lines changed

armi/physics/neutronics/tests/test_energyGroups.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,16 @@ def test_consistenciesBetweenGroupStructureAndGroupStructureType(self):
5353
energyGroups.getGroupStructure(groupStructureType)
5454
),
5555
)
56+
57+
def test_getFastFluxGroupCutoff(self):
58+
"""Test ability to get the ARMI energy group index contained in energy threshold.
59+
60+
.. test:: Return the energy group index which contains a given energy threshold.
61+
:id: T_ARMI_EG_FE
62+
:tests: R_ARMI_EG_FE
63+
"""
64+
group, frac = energyGroups.getFastFluxGroupCutoff(
65+
[100002, 100001, 100000, 99999, 0]
66+
)
67+
68+
self.assertListEqual([group, frac], [2, 0])

armi/reactor/tests/test_components.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,28 @@ def test_getBoundingCircleOuterDiameter(self):
320320
* self.component.getThermalExpansionFactor(self.component.temperatureInC),
321321
)
322322

323+
def test_component_less_than(self):
324+
"""Ensure that comparisons between components properly reference bounding circle outer diameter.
325+
326+
.. test:: Order components by their outermost diameter
327+
:id: T_ARMI_COMP_ORDER
328+
:tests: R_ARMI_COMP_ORDER
329+
"""
330+
componentCls = UnshapedComponent
331+
componentMaterial = "HT9"
332+
333+
smallDims = {"Tinput": 25.0, "Thot": 430.0, "area": 0.5 * math.pi}
334+
sameDims = {"Tinput": 25.0, "Thot": 430.0, "area": 1.0 * math.pi}
335+
bigDims = {"Tinput": 25.0, "Thot": 430.0, "area": 2.0 * math.pi}
336+
337+
smallComponent = componentCls("TestComponent", componentMaterial, **smallDims)
338+
sameComponent = componentCls("TestComponent", componentMaterial, **sameDims)
339+
bigComponent = componentCls("TestComponent", componentMaterial, **bigDims)
340+
341+
self.assertTrue(smallComponent < self.component)
342+
self.assertFalse(bigComponent < self.component)
343+
self.assertFalse(sameComponent < self.component)
344+
323345
def test_fromComponent(self):
324346
circle = components.Circle("testCircle", "HT9", 25, 500, 1.0)
325347
unshaped = components.UnshapedComponent.fromComponent(circle)

0 commit comments

Comments
 (0)