From 5978d78e1caceb5b0bd30f5fb126353935e34ae0 Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Wed, 31 Mar 2021 18:07:08 -0500 Subject: [PATCH] Creating a more complicated test --- tests/regression_tests/rotation/test.py | 44 +++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/tests/regression_tests/rotation/test.py b/tests/regression_tests/rotation/test.py index 31c3d8d655..4a4526342e 100644 --- a/tests/regression_tests/rotation/test.py +++ b/tests/regression_tests/rotation/test.py @@ -1,6 +1,46 @@ from tests.testing_harness import TestHarness -def test_rotation(): - harness = TestHarness('statepoint.10.h5') +@pytest.fixture +def model(): + model = openmc.model.Model() + + fuel = openmc.Material() + fuel.set_density('g/cc', 10.0) + fuel.add_nuclide('U235', 1.0) + + h1 = openmc.Material() + h1.set_density('g/cc', 0.1) + h1.add_nuclide('H1', 0.1) + + inner_sphere = openmc.Sphere(x0=1.0, r=5.0) + + fuel_cell = openmc.Cell(fill=fuel, region=-inner_sphere) + hydrogen_cell = openmc.Cell(fill=h1, region=+inner_sphere) + univ = openmc.Universe(cells=[fuel_cell, hydrogen_cell]) + + + box = openmc.rectangular_prism(15., 15., 'z', boundary_type='vacuum') + lower_z = openmc.ZPlane(-7.5, boundary_type='vacuum') + upper_z = openmc.ZPlane(22.5, boundary_type='vacuum') + middle_z = openmc.ZPlane(7.5) + + lower_cell = openmc.Cell(fill=univ, region=box & +lower_z & -middle_z) + lower_cell.rotation = (10, 20, 30) + upper_cell = openmc.Cell(fill=univ, region=box & +middle_z & -upper_z) + upper_cell.translation = (0, 0, 15) + + model.geometry = openmc.Geometry(root=[lower_cell, upper_cell]) + + model.settings.particles = 10000 + model.settings.inactive = 5 + model.settings.batches = 10 + source_box = openmc.stats.Box((-4., -4., -4.), (4., 4., 4.)) + model.settings.source = openmc.Source(space=source_box) + + return model + + +def test_rotation(model): + harness = PyAPITestHarness('statepoint.10.h5', model) harness.main()