Skip to content

Commit

Permalink
black
Browse files Browse the repository at this point in the history
  • Loading branch information
sombrereau committed Dec 5, 2022
1 parent dc4f67c commit db16c95
Showing 1 changed file with 18 additions and 13 deletions.
31 changes: 18 additions & 13 deletions armi/reactor/tests/test_rz_reactors.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,44 +44,49 @@ def test_findAllMeshPoints(self):
i, _, _ = self.r.core.findAllMeshPoints()
self.assertLess(i[-1], 2 * math.pi)

class Test_RZT_Reactor_modern(unittest.TestCase):

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"))
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

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 = []
fuel_volumes = []
for b in r.core.getBlocks():
reactor_volumes.append(b.getVolume())
for c in b:
if 'Godiva' in c.name:
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)
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)
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 db16c95

Please sign in to comment.