Skip to content

Commit

Permalink
Adding test crumbs for requirements (#1511)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdlafleur authored Nov 30, 2023
1 parent 1330ad1 commit d3b5bd5
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
13 changes: 13 additions & 0 deletions armi/physics/neutronics/tests/test_energyGroups.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
22 changes: 22 additions & 0 deletions armi/reactor/tests/test_components.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d3b5bd5

Please sign in to comment.