Add fission photon production test

This commit is contained in:
Paul Romano 2020-01-08 17:15:32 -06:00
parent a9070f7ec1
commit cf788db82f
4 changed files with 174 additions and 0 deletions

View file

@ -0,0 +1,49 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell id="1" material="1" region="-1" universe="1" />
<surface boundary="reflective" coeffs="0.0 0.0 0.0 100.0" id="1" type="sphere" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="1">
<density units="g/cm3" value="10.0" />
<nuclide ao="1.0" name="U235" />
</material>
</materials>
<?xml version='1.0' encoding='utf-8'?>
<settings>
<run_mode>eigenvalue</run_mode>
<particles>1000</particles>
<batches>5</batches>
<inactive>2</inactive>
<source strength="1.0">
<space type="point">
<parameters>0 0 0</parameters>
</space>
</source>
<photon_transport>true</photon_transport>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<filter id="1" type="particle">
<bins>neutron photon</bins>
</filter>
<tally id="1">
<filters>1</filters>
<nuclides>U235 total</nuclides>
<scores>fission heating heating-local</scores>
<estimator>tracklength</estimator>
</tally>
<tally id="2">
<filters>1</filters>
<nuclides>U235 total</nuclides>
<scores>fission heating heating-local</scores>
<estimator>collision</estimator>
</tally>
<tally id="3">
<filters>1</filters>
<nuclides>U235 total</nuclides>
<scores>fission heating heating-local</scores>
<estimator>analog</estimator>
</tally>
</tallies>

View file

@ -0,0 +1,77 @@
k-combined:
2.223956E+00 2.598313E-03
tally 1:
2.600054E+00
2.253433E+00
4.390171E+08
6.424554E+16
0.000000E+00
0.000000E+00
2.600054E+00
2.253433E+00
4.390171E+08
6.424554E+16
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.491697E+07
2.070245E+14
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.491697E+07
2.070245E+14
0.000000E+00
0.000000E+00
tally 2:
2.602512E+00
2.258176E+00
4.394176E+08
6.437709E+16
0.000000E+00
0.000000E+00
2.602512E+00
2.258176E+00
4.394176E+08
6.437709E+16
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.508579E+07
2.098299E+14
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.508579E+07
2.098299E+14
0.000000E+00
0.000000E+00
tally 3:
2.663535E+00
2.364845E+00
4.394176E+08
6.437709E+16
0.000000E+00
0.000000E+00
2.663535E+00
2.364845E+00
4.394176E+08
6.437709E+16
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.495967E+07
2.077339E+14
0.000000E+00
0.000000E+00
0.000000E+00
0.000000E+00
2.504536E+07
2.091625E+14
0.000000E+00
0.000000E+00

View file

@ -0,0 +1,48 @@
import openmc
import pytest
from tests.testing_harness import PyAPITestHarness
@pytest.fixture
def model():
model = openmc.model.Model()
mat = openmc.Material()
mat.set_density('g/cm3', 10.0)
mat.add_nuclide('U235', 1.0)
model.materials.append(mat)
sph = openmc.Sphere(r=100.0, boundary_type='reflective')
cell = openmc.Cell(fill=mat, region=-sph)
model.geometry = openmc.Geometry([cell])
model.settings.particles = 1000
model.settings.batches = 5
model.settings.inactive = 2
model.settings.photon_transport = True
model.settings.source = openmc.Source(space=openmc.stats.Point((0, 0, 0)))
particle_filter = openmc.ParticleFilter(['neutron', 'photon'])
tally_tracklength = openmc.Tally()
tally_tracklength.filters = [particle_filter]
tally_tracklength.scores = ['fission', 'heating', 'heating-local']
tally_tracklength.nuclides = ['U235', 'total']
tally_tracklength.estimator = 'tracklength'
tally_collision = openmc.Tally()
tally_collision.filters = [particle_filter]
tally_collision.scores = ['fission', 'heating', 'heating-local']
tally_collision.nuclides = ['U235', 'total']
tally_collision.estimator = 'collision'
tally_analog = openmc.Tally()
tally_analog.filters = [particle_filter]
tally_analog.scores = ['fission', 'heating', 'heating-local']
tally_analog.nuclides = ['U235', 'total']
tally_analog.estimator = 'analog'
model.tallies.extend([tally_tracklength, tally_collision, tally_analog])
return model
def test_photon_production(model):
harness = PyAPITestHarness('statepoint.5.h5', model)
harness.main()