mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
added test for particle restart
This commit is contained in:
parent
ac1397b3d1
commit
ceb5730030
4 changed files with 68 additions and 0 deletions
12
tests/test_particle_restart/geometry.xml
Normal file
12
tests/test_particle_restart/geometry.xml
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<!-- Nested Cylinders with Tracking Error -->
|
||||
<surface id="1" type="z-cylinder" coeffs="0.0 0.0 10.0" />
|
||||
<surface id="2" type="z-cylinder" coeffs="0.0 0.0 20.0" boundary="reflective" />
|
||||
<surface id="3" type="z-plane" coeffs="5.0" boundary="reflective" />
|
||||
<surface id="4" type="z-plane" coeffs="-5.0" boundary="reflective" />
|
||||
<cell id="1" material="1" surfaces="-1 3 -4" />
|
||||
<cell id="2" material="1" surfaces="1 -2"/>
|
||||
|
||||
</geometry>
|
||||
9
tests/test_particle_restart/materials.xml
Normal file
9
tests/test_particle_restart/materials.xml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<material id="1">
|
||||
<density value="4.5" units="g/cc" />
|
||||
<nuclide name="U-235" xs="70c" ao="1.0" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
16
tests/test_particle_restart/settings.xml
Normal file
16
tests/test_particle_restart/settings.xml
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<eigenvalue>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>1000</particles>
|
||||
</eigenvalue>
|
||||
|
||||
<source>
|
||||
<space type="box">
|
||||
<parameters>-20 -20 -5 20 20 5</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
31
tests/test_particle_restart/test_particle_restart.py
Normal file
31
tests/test_particle_restart/test_particle_restart.py
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
from subprocess import Popen, STDOUT, PIPE
|
||||
|
||||
pwd = os.path.dirname(__file__)
|
||||
|
||||
def setup():
|
||||
os.putenv('PWD', pwd)
|
||||
os.chdir(pwd)
|
||||
|
||||
def test_run():
|
||||
proc = Popen([pwd + '/../../src/openmc'], stderr=STDOUT, stdout=PIPE)
|
||||
returncode = proc.wait()
|
||||
print(proc.communicate()[0])
|
||||
assert returncode == 0
|
||||
|
||||
def test_run_restart():
|
||||
proc = Popen([pwd + '/../../src/openmc'], stderr=STDOUT, stdout=PIPE)
|
||||
returncode = proc.wait()
|
||||
print(proc.communicate()[0])
|
||||
assert returncode == 0
|
||||
|
||||
def test_created_restart():
|
||||
assert os.path.exists(pwd + '/particle_0.binary')
|
||||
|
||||
def teardown():
|
||||
output = [pwd + '/particle_0.binary']
|
||||
for f in output:
|
||||
if os.path.exists(f):
|
||||
os.remove(f)
|
||||
Loading…
Add table
Add a link
Reference in a new issue