Skip to content

Commit

Permalink
added modern RZ theta unittest for ARMI
Browse files Browse the repository at this point in the history
  • Loading branch information
sombrereau committed Dec 5, 2022
1 parent b1658e4 commit dc4f67c
Show file tree
Hide file tree
Showing 4 changed files with 2,101 additions and 0 deletions.
38 changes: 38 additions & 0 deletions armi/reactor/tests/test_rz_reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,44 @@ def test_findAllMeshPoints(self):
i, _, _ = self.r.core.findAllMeshPoints()
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.criticality.yaml"))
r = reactors.loadFromCs(cs)

diameter_cm = 30
height_cm = diameter_cm

ref_reactor_volume = math.pi/4. * diameter_cm**2 * height_cm / 8
ref_fuel_volume = 4./3. * 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()
Loading

0 comments on commit dc4f67c

Please sign in to comment.