Addressing comments from @paulromano.

This commit is contained in:
Patrick Shriwise 2020-05-13 17:05:31 -05:00
parent 8265907c3f
commit 64f6d5ce1f
3 changed files with 44 additions and 45 deletions

View file

@ -1,39 +1,20 @@
<?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" />
<cell id="1" material="1" region="-1" universe="1" />
<cell id="2" material="2" region="1 -2" universe="1" />
<surface coeffs="0.0 0.0 1.5" id="1" type="z-cylinder" />
<surface boundary="reflective" coeffs="0.0 0.0 3.0" id="2" type="z-cylinder" />
</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 depletable="true" id="1" name="fuel">
<density units="g/cc" value="11" />
<nuclide ao="1.0" name="U235" />
</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 id="2" name="water">
<density units="g/cc" value="1.0" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
@ -42,9 +23,4 @@
<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,9 +1,7 @@
k-combined:
1.108161E+00 3.345885E-02
1.857752E+00 2.922425E-02
tally 1:
1.178481E+02
1.548363E+03
4.198718E+01
1.962188E+02
2.252008E+02
5.647830E+03
5.337194E+01
3.209877E+02
1.621671E+02
2.939588E+03

View file

@ -35,15 +35,16 @@ def cpp_driver(request):
os.environ['CXX'] = 'mpicxx'
try:
print("Building driver")
# Run cmake/make to build the shared libary
subprocess.run(['cmake', os.path.pardir], check=True)
subprocess.run(['make'], check=True)
os.chdir(os.path.pardir)
yield "./build/cpp_driver"
finally:
# Remove local build directory when test is complete
os.chdir(os.path.pardir)
shutil.rmtree('build')
@ -65,10 +66,34 @@ class ExternalDriverTestHarness(PyAPITestHarness):
def test_cpp_driver(cpp_driver):
model = openmc.examples.pwr_pin_cell()
model = openmc.model.Model()
# materials
u235 = openmc.Material(name="fuel")
u235.add_nuclide('U235', 1.0, 'ao')
u235.set_density('g/cc', 11)
water = openmc.Material(name="water")
water.add_nuclide('H1', 2.0, 'ao')
water.add_nuclide('O16', 1.0, 'ao')
water.set_density('g/cc', 1.0)
mats = openmc.Materials([u235, water])
model.materials = mats
# geometry
fuel_or = openmc.ZCylinder(r=1.5)
coolant_or = openmc.ZCylinder(r=3.0, boundary_type='reflective')
fuel = openmc.Cell(fill=u235, region=-fuel_or)
coolant = openmc.Cell(fill=water, region=+fuel_or & -coolant_or)
model.geometry = openmc.Geometry([fuel, coolant])
model.settings.particles = 100
model.settings.batches = 10
model.settings.inactive = 1
harness = ExternalDriverTestHarness(cpp_driver, 'statepoint.10.h5', model)
harness._build_inputs()
harness.main()