mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-27 05:35:49 -04:00
Update void test (allowing fixed source tests to work with PyAPITestHarness too)
This commit is contained in:
parent
961c5a025b
commit
fa11bacde7
7 changed files with 277 additions and 126 deletions
|
|
@ -1,40 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<geometry>
|
||||
|
||||
<!-- pu-met-fast-019 -->
|
||||
|
||||
<surface id="1" type="sphere" coeffs="0. 0. 0. 1.4" />
|
||||
<surface id="3" type="sphere" coeffs="0. 0. 0. 5.35" />
|
||||
<surface id="4" type="sphere" coeffs="0. 0. 1.05 5.35" />
|
||||
<surface id="5" type="z-cylinder" coeffs="0. 0. 5.50" />
|
||||
<surface id="6" type="z-cylinder" coeffs="0. 0. 1.1" />
|
||||
<surface id="7" type="sphere" coeffs="0. 0. 0. 11." />
|
||||
<surface id="8" type="sphere" coeffs="0. 0. 1.05 11." />
|
||||
<surface id="9" type="sphere" coeffs="0. 0. 0. 11.15" />
|
||||
<surface id="10" type="z-plane" coeffs="0." />
|
||||
<surface id="11" type="z-plane" coeffs="1." />
|
||||
<surface id="12" type="z-plane" coeffs="1.20" />
|
||||
<surface id="13" type="z-cylinder" coeffs="0. 0. 9.7" />
|
||||
<surface id="14" type="z-cylinder" coeffs="0. 0. 2.5" />
|
||||
<surface id="15" type="z-cylinder" coeffs="0. 0. 14." boundary="vacuum" />
|
||||
<surface id="16" type="z-plane" coeffs="-0.15" />
|
||||
<surface id="17" type="z-plane" coeffs="-14.15" boundary="vacuum" />
|
||||
<surface id="18" type="z-plane" coeffs="14." boundary="vacuum" />
|
||||
|
||||
<cell id="1" material="void" region="-1" /> <!-- cavity -->
|
||||
<cell id="2" material="1" region=" 1 -3" /> <!-- Pu Core -->
|
||||
<cell id="3" material="void" region=" 3 -4 12" />
|
||||
<cell id="4" material="void" region=" 3 -5 11 -12" />
|
||||
<cell id="5" material="2" region=" 3 -7 -16" /> <!-- Bottom Reflector -->
|
||||
<cell id="6" material="2" region=" 4 6 -8 12" /> <!-- top reflector -->
|
||||
<cell id="7" material="void" region=" 3 10 -11 -15" />
|
||||
<cell id="8" material="3" region=" 5 11 -12 -15" /> <!-- diaphragm -->
|
||||
<cell id="9" material="void" region=" 7 -10 13 -15 17" />
|
||||
<cell id="10" material="void" region=" 8 12 -15 -18" />
|
||||
<cell id="11" material="4" region=" 7 -9 -13 -10" /> <!-- copper cup -->
|
||||
<cell id="12" material="3" region=" 9 -10 -14 17" /> <!-- shaft -->
|
||||
<cell id="13" material="void" region=" 9 -10 -13 14 17" />
|
||||
<cell id="14" material="void" region=" 3 -7 -10 16" />
|
||||
<cell id="15" material="void" region=" 4 -6 -8 12" /> <!-- polar hole in Top Reflector -->
|
||||
|
||||
</geometry>
|
||||
132
tests/regression_tests/void/inputs_true.dat
Normal file
132
tests/regression_tests/void/inputs_true.dat
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<geometry>
|
||||
<cell id="1" material="1" region="-1" universe="1" />
|
||||
<cell id="2" material="void" region="1 -2" universe="1" />
|
||||
<cell id="3" material="1" region="2 -3" universe="1" />
|
||||
<cell id="4" material="void" region="3 -4" universe="1" />
|
||||
<cell id="5" material="1" region="4 -5" universe="1" />
|
||||
<cell id="6" material="void" region="5 -6" universe="1" />
|
||||
<cell id="7" material="1" region="6 -7" universe="1" />
|
||||
<cell id="8" material="void" region="7 -8" universe="1" />
|
||||
<cell id="9" material="1" region="8 -9" universe="1" />
|
||||
<cell id="10" material="void" region="9 -10" universe="1" />
|
||||
<cell id="11" material="1" region="10 -11" universe="1" />
|
||||
<cell id="12" material="void" region="11 -12" universe="1" />
|
||||
<cell id="13" material="1" region="12 -13" universe="1" />
|
||||
<cell id="14" material="void" region="13 -14" universe="1" />
|
||||
<cell id="15" material="1" region="14 -15" universe="1" />
|
||||
<cell id="16" material="void" region="15 -16" universe="1" />
|
||||
<cell id="17" material="1" region="16 -17" universe="1" />
|
||||
<cell id="18" material="void" region="17 -18" universe="1" />
|
||||
<cell id="19" material="1" region="18 -19" universe="1" />
|
||||
<cell id="20" material="void" region="19 -20" universe="1" />
|
||||
<cell id="21" material="1" region="20 -21" universe="1" />
|
||||
<cell id="22" material="void" region="21 -22" universe="1" />
|
||||
<cell id="23" material="1" region="22 -23" universe="1" />
|
||||
<cell id="24" material="void" region="23 -24" universe="1" />
|
||||
<cell id="25" material="1" region="24 -25" universe="1" />
|
||||
<cell id="26" material="void" region="25 -26" universe="1" />
|
||||
<cell id="27" material="1" region="26 -27" universe="1" />
|
||||
<cell id="28" material="void" region="27 -28" universe="1" />
|
||||
<cell id="29" material="1" region="28 -29" universe="1" />
|
||||
<cell id="30" material="void" region="29 -30" universe="1" />
|
||||
<cell id="31" material="1" region="30 -31" universe="1" />
|
||||
<cell id="32" material="void" region="31 -32" universe="1" />
|
||||
<cell id="33" material="1" region="32 -33" universe="1" />
|
||||
<cell id="34" material="void" region="33 -34" universe="1" />
|
||||
<cell id="35" material="1" region="34 -35" universe="1" />
|
||||
<cell id="36" material="void" region="35 -36" universe="1" />
|
||||
<cell id="37" material="1" region="36 -37" universe="1" />
|
||||
<cell id="38" material="void" region="37 -38" universe="1" />
|
||||
<cell id="39" material="1" region="38 -39" universe="1" />
|
||||
<cell id="40" material="void" region="39 -40" universe="1" />
|
||||
<cell id="41" material="1" region="40 -41" universe="1" />
|
||||
<cell id="42" material="void" region="41 -42" universe="1" />
|
||||
<cell id="43" material="1" region="42 -43" universe="1" />
|
||||
<cell id="44" material="void" region="43 -44" universe="1" />
|
||||
<cell id="45" material="1" region="44 -45" universe="1" />
|
||||
<cell id="46" material="void" region="45 -46" universe="1" />
|
||||
<cell id="47" material="1" region="46 -47" universe="1" />
|
||||
<cell id="48" material="void" region="47 -48" universe="1" />
|
||||
<cell id="49" material="1" region="48 -49" universe="1" />
|
||||
<cell id="50" material="void" region="49 -50" universe="1" />
|
||||
<cell id="51" material="1" region="50" universe="1" />
|
||||
<surface coeffs="0.0 0.0 0.0 1.0" id="1" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 3.020408163265306" id="2" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 5.040816326530612" id="3" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 7.061224489795918" id="4" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 9.081632653061224" id="5" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 11.102040816326529" id="6" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 13.122448979591836" id="7" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 15.142857142857142" id="8" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 17.163265306122447" id="9" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 19.183673469387752" id="10" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 21.204081632653057" id="11" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 23.224489795918366" id="12" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 25.24489795918367" id="13" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 27.265306122448976" id="14" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 29.285714285714285" id="15" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 31.30612244897959" id="16" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 33.326530612244895" id="17" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 35.3469387755102" id="18" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 37.367346938775505" id="19" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 39.38775510204081" id="20" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 41.408163265306115" id="21" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 43.42857142857142" id="22" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 45.44897959183673" id="23" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 47.469387755102034" id="24" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 49.48979591836734" id="25" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 51.51020408163265" id="26" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 53.53061224489795" id="27" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 55.55102040816326" id="28" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 57.57142857142857" id="29" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 59.59183673469387" id="30" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 61.61224489795918" id="31" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 63.63265306122448" id="32" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 65.65306122448979" id="33" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 67.67346938775509" id="34" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 69.6938775510204" id="35" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 71.71428571428571" id="36" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 73.73469387755101" id="37" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 75.75510204081633" id="38" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 77.77551020408163" id="39" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 79.79591836734693" id="40" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 81.81632653061223" id="41" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 83.83673469387755" id="42" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 85.85714285714285" id="43" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 87.87755102040815" id="44" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 89.89795918367346" id="45" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 91.91836734693877" id="46" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 93.93877551020407" id="47" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 95.95918367346938" id="48" type="sphere" />
|
||||
<surface coeffs="0.0 0.0 0.0 97.97959183673468" id="49" type="sphere" />
|
||||
<surface boundary="vacuum" coeffs="0.0 0.0 0.0 100.0" id="50" type="sphere" />
|
||||
</geometry>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<materials>
|
||||
<material id="1">
|
||||
<density units="g/cm3" value="7.14" />
|
||||
<nuclide ao="1.0" name="Zn64" />
|
||||
</material>
|
||||
</materials>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<settings>
|
||||
<run_mode>fixed source</run_mode>
|
||||
<particles>1000</particles>
|
||||
<batches>3</batches>
|
||||
<source strength="1.0">
|
||||
<space type="point">
|
||||
<parameters>0.0 0.0 0.0</parameters>
|
||||
</space>
|
||||
</source>
|
||||
</settings>
|
||||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<tallies>
|
||||
<filter id="1" type="cell">
|
||||
<bins>1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51</bins>
|
||||
</filter>
|
||||
<tally id="1">
|
||||
<filters>1</filters>
|
||||
<scores>total</scores>
|
||||
</tally>
|
||||
</tallies>
|
||||
|
|
@ -1,61 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<materials>
|
||||
|
||||
<!-- pu-met-fast-019 -->
|
||||
|
||||
<!-- Plutonium -->
|
||||
<material id="1">
|
||||
<density value="15.4757" units="g/cm3" />
|
||||
<nuclide name="Pu239" ao="3.3930e-02" />
|
||||
<nuclide name="Pu240" ao="3.5043e-03" />
|
||||
<nuclide name="Pu241" ao="3.9189e-04" />
|
||||
<nuclide name="Ga69" ao="1.3287e-03" />
|
||||
<nuclide name="Ga71" ao="8.8181e-04" />
|
||||
<nuclide name="Ni58" ao="9.6649e-04" />
|
||||
<nuclide name="Ni60" ao="3.7229e-04" />
|
||||
<nuclide name="Ni61" ao="1.6183e-05" />
|
||||
<nuclide name="Ni62" ao="5.1599e-05" />
|
||||
<nuclide name="Ni64" ao="1.3141e-05" />
|
||||
<nuclide name="C0" ao="3.0246e-03" />
|
||||
<!-- <nuclide name="W180" ao="8.8920e-08" /> -->
|
||||
<nuclide name="W182" ao="1.9725e-05" />
|
||||
<nuclide name="W183" ao="1.0604e-05" />
|
||||
<nuclide name="W184" ao="2.2704e-05" />
|
||||
<nuclide name="W186" ao="2.1067e-05" />
|
||||
<nuclide name="Fe54" ao="1.9011e-05" />
|
||||
<nuclide name="Fe56" ao="2.9843e-04" />
|
||||
<nuclide name="Fe57" ao="6.8920e-06" />
|
||||
<nuclide name="Fe58" ao="9.1720e-07" />
|
||||
</material>
|
||||
|
||||
<!-- Reflector -->
|
||||
<material id="2">
|
||||
<density value="1.8169" units="g/cm3" />
|
||||
<nuclide name="Be9" ao="1.2081e-01" />
|
||||
<nuclide name="O16" ao="8.2033e-05" />
|
||||
<nuclide name="O17" ao="3.1184e-08" />
|
||||
<nuclide name="C0" ao="1.0020e-04" />
|
||||
<nuclide name="Fe54" ao="2.9774e-06" />
|
||||
<nuclide name="Fe56" ao="4.6739e-05" />
|
||||
<nuclide name="Fe57" ao="1.0794e-06" />
|
||||
<nuclide name="Fe58" ao="1.4365e-07" />
|
||||
<sab name="c_Be" />
|
||||
</material>
|
||||
|
||||
<!-- Steel Diaphragm and Steel Shaft -->
|
||||
<material id="3">
|
||||
<density value="7.5278" units="g/cm3" />
|
||||
<nuclide name="Fe54" ao="4.7446e-03" />
|
||||
<nuclide name="Fe56" ao="7.4480e-02" />
|
||||
<nuclide name="Fe57" ao="1.7201e-03" />
|
||||
<nuclide name="Fe58" ao="2.2891e-04" />
|
||||
</material>
|
||||
|
||||
<!-- Copper Cup -->
|
||||
<material id="4">
|
||||
<density value="8.6913" units="g/cm3" />
|
||||
<nuclide name="Cu63" ao="5.6972e-02" />
|
||||
<nuclide name="Cu65" ao="2.5393e-02" />
|
||||
</material>
|
||||
|
||||
</materials>
|
||||
|
|
@ -1,2 +1,103 @@
|
|||
k-combined:
|
||||
9.612556E-01 1.990135E-02
|
||||
tally 1:
|
||||
8.636087E-01
|
||||
2.486134E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
2.848447E+00
|
||||
2.704761E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
3.944691E+00
|
||||
5.195294E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
4.822264E+00
|
||||
7.764351E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
5.295627E+00
|
||||
9.359046E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
5.331702E+00
|
||||
9.480054E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
5.598029E+00
|
||||
1.044833E+01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
5.803138E+00
|
||||
1.124136E+01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
5.768440E+00
|
||||
1.110547E+01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
5.554687E+00
|
||||
1.029492E+01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
5.503880E+00
|
||||
1.011832E+01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
5.059080E+00
|
||||
8.564408E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
4.718153E+00
|
||||
7.431929E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
4.575826E+00
|
||||
6.980348E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
4.283929E+00
|
||||
6.120164E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
3.997971E+00
|
||||
5.330979E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
3.735927E+00
|
||||
4.653022E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
3.302545E+00
|
||||
3.645387E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
3.082630E+00
|
||||
3.203343E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
2.775434E+00
|
||||
2.569844E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
2.518170E+00
|
||||
2.134420E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
2.233921E+00
|
||||
1.666795E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
1.829991E+00
|
||||
1.118883E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
1.420528E+00
|
||||
6.755061E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
9.856494E-01
|
||||
3.253539E-01
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
0.000000E+00
|
||||
|
|
|
|||
|
|
@ -1,16 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
<settings>
|
||||
|
||||
<run_mode>eigenvalue</run_mode>
|
||||
<batches>10</batches>
|
||||
<inactive>5</inactive>
|
||||
<particles>100</particles>
|
||||
|
||||
<source>
|
||||
<space>
|
||||
<type>point</type>
|
||||
<parameters>0.0 0.0 0.0</parameters>
|
||||
</space>
|
||||
</source>
|
||||
|
||||
</settings>
|
||||
|
|
@ -1,6 +1,39 @@
|
|||
from tests.testing_harness import TestHarness
|
||||
import numpy as np
|
||||
import openmc
|
||||
import pytest
|
||||
|
||||
from tests.testing_harness import PyAPITestHarness
|
||||
|
||||
@pytest.fixture
|
||||
def model():
|
||||
model = openmc.model.Model()
|
||||
|
||||
zn = openmc.Material()
|
||||
zn.set_density('g/cm3', 7.14)
|
||||
zn.add_nuclide('Zn64', 1.0)
|
||||
model.materials.append(zn)
|
||||
|
||||
radii = np.linspace(1.0, 100.0)
|
||||
surfs = [openmc.Sphere(r=r) for r in radii]
|
||||
surfs[-1].boundary_type = 'vacuum'
|
||||
cells = [openmc.Cell(fill=(zn if i % 2 == 0 else None), region=region)
|
||||
for i, region in enumerate(openmc.model.subdivide(surfs))]
|
||||
model.geometry = openmc.Geometry(cells)
|
||||
|
||||
model.settings.run_mode = 'fixed source'
|
||||
model.settings.batches = 3
|
||||
model.settings.particles = 1000
|
||||
model.settings.source = openmc.Source(space=openmc.stats.Point())
|
||||
|
||||
cell_filter = openmc.CellFilter(cells)
|
||||
tally = openmc.Tally()
|
||||
tally.filters = [cell_filter]
|
||||
tally.scores = ['total']
|
||||
model.tallies.append(tally)
|
||||
|
||||
return model
|
||||
|
||||
|
||||
def test_void():
|
||||
harness = TestHarness('statepoint.10.h5')
|
||||
def test_void(model):
|
||||
harness = PyAPITestHarness('statepoint.3.h5', model)
|
||||
harness.main()
|
||||
|
|
|
|||
|
|
@ -72,10 +72,12 @@ class TestHarness(object):
|
|||
# Read the statepoint file.
|
||||
statepoint = glob.glob(self._sp_name)[0]
|
||||
with openmc.StatePoint(statepoint) as sp:
|
||||
# Write out k-combined.
|
||||
outstr = 'k-combined:\n'
|
||||
form = '{0:12.6E} {1:12.6E}\n'
|
||||
outstr += form.format(sp.k_combined.n, sp.k_combined.s)
|
||||
outstr = ''
|
||||
if sp.run_mode == 'eigenvalue':
|
||||
# Write out k-combined.
|
||||
outstr += 'k-combined:\n'
|
||||
form = '{0:12.6E} {1:12.6E}\n'
|
||||
outstr += form.format(sp.k_combined.n, sp.k_combined.s)
|
||||
|
||||
# Write out tally data.
|
||||
for i, tally_ind in enumerate(sp.tallies):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue