Skip to content

Commit

Permalink
Adding modern RZ theta unittest for ARMI (#1009)
Browse files Browse the repository at this point in the history
  • Loading branch information
sombrereau committed Dec 15, 2022
1 parent ce71855 commit 0c6d0ae
Show file tree
Hide file tree
Showing 3 changed files with 799 additions and 0 deletions.
42 changes: 42 additions & 0 deletions armi/reactor/tests/test_rz_reactors.py
Expand Up @@ -45,5 +45,47 @@ def test_findAllMeshPoints(self):
self.assertLess(i[-1], 2 * math.pi)


class Test_RZT_Reactor_modern(unittest.TestCase):
def test_loadRZT_reactor(self):
"""
The Godiva benchmark model is a HEU sphere with a radius of 8.74 cm
This unit tests loading and verifies the reactor is loaded correctly by
comparing volumes against expected volumes for full core (including
void boundary conditions) and just the fuel
"""
cs = settings.Settings(
fName=os.path.join(TEST_ROOT, "Godiva.armi.unittest.yaml")
)
r = reactors.loadFromCs(cs)

godivaRadius = 8.7407
reactorRadius = 9
reactorHeight = 17.5

refReactorVolume = math.pi * reactorRadius ** 2 * reactorHeight / 8
refFuelVolume = 4.0 / 3.0 * math.pi * (godivaRadius) ** 3 / 8

reactorVolumes = []
fuelVolumes = []
for b in r.core.getBlocks():
reactorVolumes.append(b.getVolume())
for c in b:
if "Godiva" in c.name:
fuelVolumes.append(c.getVolume())
"""
verify the total reactor volume is as expected
"""
tolerance = 1e-3
error = math.fabs((refReactorVolume - sum(reactorVolumes)) / refReactorVolume)
self.assertLess(error, tolerance)

"""
verify the total fuel volume is as expected
"""
error = math.fabs((refFuelVolume - sum(fuelVolumes)) / refFuelVolume)
self.assertLess(error, tolerance)


if __name__ == "__main__":
unittest.main()

0 comments on commit 0c6d0ae

Please sign in to comment.