Skip to content

Commit

Permalink
Add unit test for component flux calc.
Browse files Browse the repository at this point in the history
  • Loading branch information
mgjarrett committed Jan 31, 2025
1 parent 04846e7 commit 1f10f53
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions armi/reactor/tests/test_blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -1201,6 +1201,20 @@ def test_adjustDensity(self):

self.assertAlmostEqual(mass2 - mass1, massDiff)

@patch.object(blocks.HexBlock, "getSymmetryFactor")
def test_getMgFlux(self, mock_sf):
mock_sf.return_value = 3
self.block.p.mgFlux = np.array([1, 1, 1, 1, 1])
self.block.p.mgFluxGamma = np.array([2, 2, 2, 2])
fuel = self.block.getComponent(Flags.FUEL)
blockVol = self.block.getVolume()
fuelVol = fuel.getVolume()
volFrac = fuelVol / blockVol / self.block.getSymmetryFactor()
neutronFlux = fuel.getIntegratedMgFlux()
gammaFlux = fuel.getIntegratedMgFlux(gamma=True)
np.testing.assert_almost_equal(neutronFlux, np.ones(5) * volFrac)
np.testing.assert_almost_equal(gammaFlux, np.ones(4) * volFrac * 2.0)

@patch.object(blocks.HexBlock, "getSymmetryFactor")
def test_completeInitialLoading(self, mock_sf):
"""Ensure that some BOL block and component params are populated properly.
Expand Down

0 comments on commit 1f10f53

Please sign in to comment.