Simplifying tests a bit. Updating results.

This commit is contained in:
Patrick Shriwise 2020-05-12 08:40:23 -05:00
parent a50c4c15e9
commit 2007ba847e
4 changed files with 23 additions and 133 deletions

View file

@ -1,50 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="1" material="1" name="Fuel" region="-1" universe="0" />
<cell id="2" material="2" name="Cladding" region="1 -2" universe="0" />
<cell id="3" material="3" name="Water" region="2 3 -4 5 -6" universe="0" />
<surface coeffs="0 0 0.39218" id="1" name="Fuel OR" type="z-cylinder" />
<surface coeffs="0 0 0.4572" id="2" name="Clad OR" type="z-cylinder" />
<surface boundary="reflective" coeffs="-0.63" id="3" name="left" type="x-plane" />
<surface boundary="reflective" coeffs="0.63" id="4" name="right" type="x-plane" />
<surface boundary="reflective" coeffs="-0.63" id="5" name="bottom" type="y-plane" />
<surface boundary="reflective" coeffs="0.63" id="6" name="top" type="y-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="1" name="UO2 (2.4%)">
<density units="g/cm3" value="10.29769" />
<nuclide ao="4.4843e-06" name="U234" />
<nuclide ao="0.00055815" name="U235" />
<nuclide ao="0.022408" name="U238" />
<nuclide ao="0.045829" name="O16" />
</material>
<material id="2" name="Zircaloy">
<density units="g/cm3" 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="3" name="Hot borated water">
<density units="g/cm3" 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>1</inactive>
<source strength="1.0">
<space type="fission">
<parameters>-0.63 -0.63 -1 0.63 0.63 1</parameters>
</space>
</source>
</settings>

View file

@ -1,60 +0,0 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="4" material="4" name="Fuel" region="-7" universe="0" />
<cell id="5" material="5" name="Cladding" region="7 -8" universe="0" />
<cell id="6" material="6" name="Water" region="8 9 -10 11 -12" universe="0" />
<surface coeffs="0 0 0.39218" id="7" name="Fuel OR" type="z-cylinder" />
<surface coeffs="0 0 0.4572" id="8" name="Clad OR" type="z-cylinder" />
<surface boundary="reflective" coeffs="-0.63" id="9" name="left" type="x-plane" />
<surface boundary="reflective" coeffs="0.63" id="10" name="right" type="x-plane" />
<surface boundary="reflective" coeffs="-0.63" id="11" name="bottom" type="y-plane" />
<surface boundary="reflective" coeffs="0.63" id="12" name="top" type="y-plane" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="4" name="UO2 (2.4%)">
<density units="g/cm3" value="10.29769" />
<nuclide ao="4.4843e-06" name="U234" />
<nuclide ao="0.00055815" name="U235" />
<nuclide ao="0.022408" name="U238" />
<nuclide ao="0.045829" name="O16" />
</material>
<material id="5" name="Zircaloy">
<density units="g/cm3" 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="6" name="Hot borated water">
<density units="g/cm3" 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>1</inactive>
<source strength="1.0">
<space type="fission">
<parameters>-0.63 -0.63 -1 0.63 0.63 1</parameters>
</space>
</source>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<filter id="2" type="cell">
<bins>4 5 6</bins>
</filter>
<tally id="2">
<filters>2</filters>
<scores>flux</scores>
</tally>
</tallies>

View file

@ -1,9 +1,9 @@
k-combined:
1.141180E+00 4.513757E-02
1.108161E+00 3.345885E-02
tally 1:
1.220313E+02
1.659250E+03
4.421703E+01
2.178300E+02
2.356492E+02
6.182509E+03
1.178481E+02
1.548363E+03
4.198718E+01
1.962188E+02
2.252008E+02
5.647830E+03

View file

@ -7,11 +7,11 @@ import textwrap
import openmc
import pytest
from tests.regression_tests import config
from tests.testing_harness import PyAPITestHarness
@pytest.fixture
def driver(request):
def cpp_driver(request):
"""Compile the external source"""
# Get build directory and write CMakeLists.txt file
@ -40,16 +40,6 @@ def driver(request):
# Remove local build directory when test is complete
shutil.rmtree('build')
@pytest.fixture
def model():
model = openmc.examples.pwr_pin_cell()
model.settings.particles = 100
model.settings.batches = 10
model.settings.inactive = 1
return model
class ExternalDriverTestHarness(PyAPITestHarness):
def __init__(self, executable, statepoint_name, model=None):
@ -57,10 +47,20 @@ class ExternalDriverTestHarness(PyAPITestHarness):
self.executable = executable
def _run_openmc(self):
print("Running openmc")
openmc.run(openmc_exec=self.executable)
if config['mpi']:
mpi_args = [config['mpiexec'], '-n', config['mpi_np']]
openmc.run(openmc_exec=self.executable,
mpi_args=mpi_args,
event_based=config['event'])
else:
openmc.run(openmc_exec=self.executable,
event_based=config['event'])
def test_cpp_driver(cpp_driver):
model = openmc.examples.pwr_pin_cell()
model.settings.particles = 100
model.settings.batches = 10
model.settings.inactive = 1
def test_cpp_driver(driver, model):
harness = ExternalDriverTestHarness(driver, 'statepoint.10.h5', model)
harness = ExternalDriverTestHarness(cpp_driver, 'statepoint.10.h5', model)
harness.main()