Skip to content

Commit

Permalink
Merge 8cc32c1 into b1658e4
Browse files Browse the repository at this point in the history
  • Loading branch information
sombrereau committed Dec 5, 2022
2 parents b1658e4 + 8cc32c1 commit c162609
Show file tree
Hide file tree
Showing 3 changed files with 2,066 additions and 0 deletions.
43 changes: 43 additions & 0 deletions armi/reactor/tests/test_rz_reactors.py
Expand Up @@ -45,5 +45,48 @@ 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 Sphere of UZr with a diameter of 30cm
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)

diameter_cm = 30
height_cm = diameter_cm

ref_reactor_volume = math.pi / 4.0 * diameter_cm ** 2 * height_cm / 8
ref_fuel_volume = 4.0 / 3.0 * math.pi * (diameter_cm / 2) ** 3 / 8

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

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


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

0 comments on commit c162609

Please sign in to comment.