Updating the DAGMC universes test.

This commit is contained in:
Patrick Shriwise 2021-03-03 20:01:45 -06:00
parent b3ad45f9a8
commit 41e3179167
3 changed files with 117 additions and 1 deletions

View file

@ -0,0 +1,47 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell fill="9" id="13" region="9 -10 11 -12 13 -14" universe="10" />
<dagmc auto_ids="true" filename="dagmc.h5m" id="9" name="" />
<surface boundary="reflective" coeffs="-24.0" id="9" name="left" type="x-plane" />
<surface boundary="reflective" coeffs="24.0" id="10" name="right" type="x-plane" />
<surface boundary="reflective" coeffs="-24.0" id="11" name="front" type="y-plane" />
<surface boundary="reflective" coeffs="24.0" id="12" name="back" type="y-plane" />
<surface boundary="vacuum" coeffs="-20.0" id="13" name="bottom" type="z-plane" />
<surface boundary="vacuum" coeffs="20.0" id="14" name="top" type="z-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="13" name="no-void fuel">
<density units="g/cc" value="10.29769" />
<nuclide ao="0.93120485" name="U234" />
<nuclide ao="0.00055815" name="U235" />
<nuclide ao="0.022408" name="U238" />
<nuclide ao="0.045829" name="O16" />
</material>
<material id="14" name="clad">
<density units="g/cc" value="6.55" />
<nuclide ao="0.021827" name="Zr90" />
<nuclide ao="0.00476" name="Zr91" />
<nuclide ao="0.0072758" name="Zr92" />
<nuclide ao="0.0073734" name="Zr94" />
<nuclide ao="0.0011879" name="Zr96" />
</material>
<material id="15" name="water">
<density units="g/cc" value="0.740582" />
<nuclide ao="0.049457" name="H1" />
<nuclide ao="0.024672" name="O16" />
<nuclide ao="8.0042e-06" name="B10" />
<nuclide ao="3.2218e-05" name="B11" />
<sab name="c_H_in_H2O" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>100</particles>
<batches>10</batches>
<inactive>2</inactive>
<output>
<summary>false</summary>
</output>
</settings>

View file

@ -0,0 +1,2 @@
k-combined:
7.531408E-01 1.260163E-02

View file

@ -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()
harness = DAGMCUniverseTest('statepoint.10.h5')
harness.main()