mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Adding another dagmc using the python interface.
This commit is contained in:
parent
008c8f80d4
commit
90a25609bf
5 changed files with 236 additions and 0 deletions
0
tests/regression_tests/dagmc_py/__init__.py
Normal file
0
tests/regression_tests/dagmc_py/__init__.py
Normal file
1
tests/regression_tests/dagmc_py/dagmc.h5m
Symbolic link
1
tests/regression_tests/dagmc_py/dagmc.h5m
Symbolic link
|
|
@ -0,0 +1 @@
|
|||
../dagmc/dagmc.h5m
|
||||
184
tests/regression_tests/dagmc_py/inputs_true.dat
Normal file
184
tests/regression_tests/dagmc_py/inputs_true.dat
Normal file
|
|
@ -0,0 +1,184 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<geometry>
|
||||
<cell fill="200" id="1" region="-6 34 -35" universe="0" />
|
||||
<cell fill="201" id="2" region="-6 35 -36" universe="0" />
|
||||
<cell id="3" material="8" region="-7 31 -32" universe="0" />
|
||||
<cell id="4" material="9" region="-5 32 -33" universe="0" />
|
||||
<cell id="5" material="12" region="-5 33 -34" universe="0" />
|
||||
<cell id="6" material="11" region="-5 36 -37" universe="0" />
|
||||
<cell id="7" material="10" region="-5 37 -38" universe="0" />
|
||||
<cell id="8" material="7" region="-7 38 -39" universe="0" />
|
||||
<cell id="9" material="9" region="6 -7 32 -38" universe="0" />
|
||||
<cell id="10" material="5" region="7 -8 31 -39" universe="0" />
|
||||
<cell id="11" material="6" region="5 -6 32 -34" universe="0" />
|
||||
<cell id="12" material="7" region="5 -6 36 -38" universe="0" />
|
||||
<cell id="21" material="1" region="-1" universe="1" />
|
||||
<cell id="22" material="2" region="1 -2" universe="1" />
|
||||
<cell id="23" material="3" region="2" universe="1" />
|
||||
<cell id="24" material="3" region="-3" universe="2" />
|
||||
<cell id="25" material="2" region="3 -4" universe="2" />
|
||||
<cell id="26" material="3" region="4" universe="2" />
|
||||
<cell id="27" material="1" region="-1" universe="3" />
|
||||
<cell id="28" material="2" region="1 -2" universe="3" />
|
||||
<cell id="29" material="4" region="2" universe="3" />
|
||||
<cell id="30" material="4" region="-3" universe="4" />
|
||||
<cell id="31" material="2" region="3 -4" universe="4" />
|
||||
<cell id="32" material="4" region="4" universe="4" />
|
||||
<cell id="50" material="3" region="34 -35" universe="5" />
|
||||
<cell fill="100" id="60" region="34 -35" universe="6" />
|
||||
<cell id="70" material="4" region="35 -36" universe="7" />
|
||||
<cell fill="101" id="80" region="35 -36" universe="8" />
|
||||
<lattice id="100" name="Fuel assembly (lower half)">
|
||||
<pitch>1.26 1.26</pitch>
|
||||
<dimension>17 17</dimension>
|
||||
<lower_left>-10.71 -10.71</lower_left>
|
||||
<universes>
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1
|
||||
1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 2 1 1 2 1 1 2 1 1 2 1 1 2 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 2 1 1 1 1 1 1 1 1 1 2 1 1 1
|
||||
1 1 1 1 1 2 1 1 2 1 1 2 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
|
||||
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 </universes>
|
||||
</lattice>
|
||||
<lattice id="101" name="Fuel assembly (upper half)">
|
||||
<pitch>1.26 1.26</pitch>
|
||||
<dimension>17 17</dimension>
|
||||
<lower_left>-10.71 -10.71</lower_left>
|
||||
<universes>
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3
|
||||
3 3 3 4 3 3 3 3 3 3 3 3 3 4 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 4 3 3 4 3 3 4 3 3 4 3 3 4 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 4 3 3 3 3 3 3 3 3 3 4 3 3 3
|
||||
3 3 3 3 3 4 3 3 4 3 3 4 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3
|
||||
3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 </universes>
|
||||
</lattice>
|
||||
<lattice id="200" name="Core lattice (lower half)">
|
||||
<pitch>21.42 21.42</pitch>
|
||||
<dimension>21 21</dimension>
|
||||
<lower_left>-224.91 -224.91</lower_left>
|
||||
<universes>
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5 5
|
||||
5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5
|
||||
5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5
|
||||
5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 6 6 6 6 6 6 6 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5
|
||||
5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 </universes>
|
||||
</lattice>
|
||||
<lattice id="201" name="Core lattice (lower half)">
|
||||
<pitch>21.42 21.42</pitch>
|
||||
<dimension>21 21</dimension>
|
||||
<lower_left>-224.91 -224.91</lower_left>
|
||||
<universes>
|
||||
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 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.475" id="2" type="z-cylinder" />
|
||||
<surface coeffs="0.0 0.0 0.56" id="3" type="z-cylinder" />
|
||||
<surface coeffs="0.0 0.0 0.62" id="4" type="z-cylinder" />
|
||||
<surface coeffs="0.0 0.0 187.6" id="5" type="z-cylinder" />
|
||||
<surface coeffs="0.0 0.0 209.0" id="6" type="z-cylinder" />
|
||||
<surface coeffs="0.0 0.0 229.0" id="7" type="z-cylinder" />
|
||||
<surface boundary="vacuum" coeffs="0.0 0.0 249.0" id="8" type="z-cylinder" />
|
||||
<surface boundary="vacuum" coeffs="-229.0" id="31" type="z-plane" />
|
||||
<surface coeffs="-199.0" id="32" type="z-plane" />
|
||||
<surface coeffs="-193.0" id="33" type="z-plane" />
|
||||
<surface coeffs="-183.0" id="34" type="z-plane" />
|
||||
<surface coeffs="0.0" id="35" type="z-plane" />
|
||||
<surface coeffs="183.0" id="36" type="z-plane" />
|
||||
<surface coeffs="203.0" id="37" type="z-plane" />
|
||||
<surface coeffs="215.0" id="38" type="z-plane" />
|
||||
<surface boundary="vacuum" coeffs="223.0" id="39" type="z-plane" />
|
||||
</geometry>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<materials>
|
||||
<material depletable="true" id="40">
|
||||
<density units="g/cc" value="11" />
|
||||
<nuclide ao="1.0" name="U235" />
|
||||
</material>
|
||||
<material id="41">
|
||||
<density units="g/cc" value="1.0" />
|
||||
<nuclide ao="2.0" name="H1" />
|
||||
<nuclide ao="1.0" name="O16" />
|
||||
<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>5</batches>
|
||||
<inactive>0</inactive>
|
||||
<source strength="1.0">
|
||||
<space type="box">
|
||||
<parameters>-4 -4 -4 4 4 4</parameters>
|
||||
</space>
|
||||
</source>
|
||||
<dagmc>true</dagmc>
|
||||
</settings>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<tallies>
|
||||
<filter id="1" type="cell">
|
||||
<bins>1</bins>
|
||||
</filter>
|
||||
<tally id="1">
|
||||
<filters>1</filters>
|
||||
<scores>total</scores>
|
||||
</tally>
|
||||
</tallies>
|
||||
1
tests/regression_tests/dagmc_py/results_true.dat
Normal file
1
tests/regression_tests/dagmc_py/results_true.dat
Normal file
|
|
@ -0,0 +1 @@
|
|||
d229fdde717cef748e965199a6ff797d3e3f552f34cc6187008025c330a9bedd676e2a6ff2288bdbf04c852a528fd862d2c959d1d5ca44d7b18890fcd58fa5de
|
||||
50
tests/regression_tests/dagmc_py/test.py
Normal file
50
tests/regression_tests/dagmc_py/test.py
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
import openmc
|
||||
import openmc.capi
|
||||
from openmc.stats import Box
|
||||
|
||||
import pytest
|
||||
from tests.testing_harness import HashedPyAPITestHarness
|
||||
|
||||
pytestmark = pytest.mark.skipif(
|
||||
not openmc.capi.dagmc_enabled,
|
||||
reason="DAGMC CAD geometry is not enabled.")
|
||||
|
||||
def test_dagmc():
|
||||
harness = HashedPyAPITestHarness('statepoint.5.h5')
|
||||
model = harness._model
|
||||
|
||||
# settings
|
||||
model.settings.batches = 5
|
||||
model.settings.inactive = 0
|
||||
model.settings.particles = 100
|
||||
|
||||
source = openmc.Source(space=Box([-4, -4, -4],
|
||||
[ 4, 4, 4]))
|
||||
model.settings.source = source
|
||||
|
||||
model.settings.dagmc = True
|
||||
|
||||
# tally
|
||||
tally = openmc.Tally()
|
||||
tally.scores = ['total']
|
||||
tally.filters = [openmc.CellFilter(1)]
|
||||
model.tallies = [tally]
|
||||
|
||||
# materials
|
||||
u235 = openmc.Material()
|
||||
u235.add_nuclide('U235', 1.0, 'ao')
|
||||
u235.set_density('g/cc', 11)
|
||||
u235.id = 40
|
||||
|
||||
water = openmc.Material()
|
||||
water.add_nuclide('H1', 2.0, 'ao')
|
||||
water.add_nuclide('O16', 1.0, 'ao')
|
||||
water.add_s_alpha_beta('c_H_in_H2O')
|
||||
water.set_density('g/cc', 1.0)
|
||||
water.id = 41
|
||||
print(water)
|
||||
|
||||
mats = openmc.Materials([u235, water])
|
||||
model.materials = mats
|
||||
|
||||
harness.main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue