Skip to content

Commit

Permalink
update test for symmetry factor
Browse files Browse the repository at this point in the history
  • Loading branch information
bsculac committed Dec 11, 2024
1 parent b80e9ac commit e86145b
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions armi/physics/fuelCycle/tests/test_fuelHandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
from armi.settings import caseSettings
from armi.tests import TEST_ROOT, ArmiTestHelper, mockRunLogs
from armi.utils import directoryChangers
from armi.reactor.parameters import ParamLocation


class FuelHandlerTestHelper(ArmiTestHelper):
Expand Down Expand Up @@ -153,14 +154,32 @@ def interactBOC(self, cycle=None):


class TestFuelHandler(FuelHandlerTestHelper):
def test_getParamMax(self):
@patch("armi.reactor.assemblies.Assembly.getSymmetryFactor")
def test_getParamMax(self, mockGetSymmetry):

a = self.assembly
mockGetSymmetry.return_value = 1
expectedValue = 0.5
a.p["kInf"] = expectedValue
for b in a:
b.p["kInf"] = expectedValue

# symmetry factor == 1
res = fuelHandlers.FuelHandler._getParamMax(a, "kInf", True)
self.assertEqual(res, expectedValue)

res = fuelHandlers.FuelHandler._getParamMax(a, "kInf", False)
self.assertEqual(res, expectedValue)

# symmetry factor == 3
mockGetSymmetry.return_value = 3
a.p.paramDefs["kInf"].location = ParamLocation.VOLUME_INTEGRATED
a.getBlocks()[0].p.paramDefs["kInf"].location = ParamLocation.VOLUME_INTEGRATED
res = fuelHandlers.FuelHandler._getParamMax(a, "kInf", True)
self.assertEqual(res, 0.0)
self.assertAlmostEqual(res, expectedValue * 3)

res = fuelHandlers.FuelHandler._getParamMax(a, "kInf", False)
self.assertEqual(res, 0.0)
self.assertAlmostEqual(res, expectedValue * 3)

def test_interactBOC(self):
# set up mock interface
Expand Down

0 comments on commit e86145b

Please sign in to comment.