diff --git a/tests/regression_tests/dagmc/universes/inputs_true.dat b/tests/regression_tests/dagmc/universes/inputs_true.dat new file mode 100644 index 0000000000..f8acb45ccc --- /dev/null +++ b/tests/regression_tests/dagmc/universes/inputs_true.dat @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + eigenvalue + 100 + 10 + 2 + + false + + diff --git a/tests/regression_tests/dagmc/universes/results_true.dat b/tests/regression_tests/dagmc/universes/results_true.dat new file mode 100644 index 0000000000..203d35efeb --- /dev/null +++ b/tests/regression_tests/dagmc/universes/results_true.dat @@ -0,0 +1,2 @@ +k-combined: +7.531408E-01 1.260163E-02 diff --git a/tests/regression_tests/dagmc/universes/test.py b/tests/regression_tests/dagmc/universes/test.py index 0ed2025462..0144a0c3a8 100644 --- a/tests/regression_tests/dagmc/universes/test.py +++ b/tests/regression_tests/dagmc/universes/test.py @@ -1,4 +1,71 @@ import openmc +import openmc.lib + +import pytest +from tests.testing_harness import PyAPITestHarness + +pytestmark = pytest.mark.skipif( + not openmc.lib._dagmc_enabled(), + reason="DAGMC CAD geometry is not enabled.") + + +class DAGMCUniverseTest(PyAPITestHarness): + + def _build_inputs(self): + model = openmc.model.Model() + + ### MATERIALS ### + fuel = openmc.Material(name='no-void fuel') + fuel.set_density('g/cc', 10.29769) + fuel.add_nuclide('U234', 0.93120485) + fuel.add_nuclide('U235', 0.00055815) + fuel.add_nuclide('U238', 0.022408) + fuel.add_nuclide('O16', 0.045829) + + cladding = openmc.Material(name='clad') + cladding.set_density('g/cc', 6.55) + cladding.add_nuclide('Zr90', 0.021827) + cladding.add_nuclide('Zr91', 0.00476) + cladding.add_nuclide('Zr92', 0.0072758) + cladding.add_nuclide('Zr94', 0.0073734) + cladding.add_nuclide('Zr96', 0.0011879) + + water = openmc.Material(name='water') + water.set_density('g/cc', 0.740582) + water.add_nuclide('H1', 0.049457) + water.add_nuclide('O16', 0.024672) + water.add_nuclide('B10', 8.0042e-06) + water.add_nuclide('B11', 3.2218e-05) + water.add_s_alpha_beta('c_H_in_H2O') + + model.materials = openmc.Materials([fuel, cladding, water]) + + ### GEOMETRY ### + # create the DAGMC universe + pincell_univ = openmc.DAGMCUniverse(filename='dagmc.h5m', auto_ids=True) + + left = openmc.XPlane(x0=-24.0, name='left', boundary_type='reflective') + right = openmc.XPlane(x0=24.0, name='right', boundary_type='reflective') + front = openmc.YPlane(y0=-24.0, name='front', boundary_type='reflective') + back = openmc.YPlane(y0=24.0, name='back', boundary_type='reflective') + bottom = openmc.ZPlane(z0=-20.0, name='bottom', boundary_type='vacuum') + top = openmc.ZPlane(z0=20.0, name='top', boundary_type='vacuum') + + box = +left & -right & +front & -back & +bottom & -top + + bounding_cell = openmc.Cell(fill=pincell_univ, region=box) + + model.geometry = openmc.Geometry(root=[bounding_cell]) + + # settings + model.settings.particles = 100 + model.settings.batches = 10 + model.settings.inactive = 2 + model.settings.output = {'summary' : False} + + model.export_to_xml() + def test_dagmc_universes(): - openmc.run() \ No newline at end of file + harness = DAGMCUniverseTest('statepoint.10.h5') + harness.main() \ No newline at end of file