Update tally_arithmetic test

This commit is contained in:
Paul Romano 2019-08-19 09:34:01 -05:00
parent 7bc96c822c
commit e1d2a9d802
3 changed files with 140 additions and 489 deletions

View file

@ -1,338 +1,55 @@
<?xml version='1.0' encoding='utf-8'?>
<geometry>
<cell fill="200" id="1" region="-6 34 -35" universe="0" />
<cell fill="201" id="2" region="-6 35 -36" universe="0" />
<cell id="3" material="8" region="-7 31 -32" universe="0" />
<cell id="4" material="9" region="-5 32 -33" universe="0" />
<cell id="5" material="12" region="-5 33 -34" universe="0" />
<cell id="6" material="11" region="-5 36 -37" universe="0" />
<cell id="7" material="10" region="-5 37 -38" universe="0" />
<cell id="8" material="7" region="-7 38 -39" universe="0" />
<cell id="9" material="9" region="6 -7 32 -38" universe="0" />
<cell id="10" material="5" region="7 -8 31 -39" universe="0" />
<cell id="11" material="6" region="5 -6 32 -34" universe="0" />
<cell id="12" material="7" region="5 -6 36 -38" universe="0" />
<cell id="21" material="1" region="-1" universe="1" />
<cell id="22" material="2" region="1 -2" universe="1" />
<cell id="23" material="3" region="2" universe="1" />
<cell id="24" material="3" region="-3" universe="2" />
<cell id="25" material="2" region="3 -4" universe="2" />
<cell id="26" material="3" region="4" universe="2" />
<cell id="27" material="1" region="-1" universe="3" />
<cell id="28" material="2" region="1 -2" universe="3" />
<cell id="29" material="4" region="2" universe="3" />
<cell id="30" material="4" region="-3" universe="4" />
<cell id="31" material="2" region="3 -4" universe="4" />
<cell id="32" material="4" region="4" universe="4" />
<cell id="50" material="3" region="34 -35" universe="5" />
<cell fill="100" id="60" region="34 -35" universe="6" />
<cell id="70" material="4" region="35 -36" universe="7" />
<cell fill="101" id="80" region="35 -36" universe="8" />
<lattice id="100" name="Fuel assembly (lower half)">
<pitch>1.26 1.26</pitch>
<dimension>17 17</dimension>
<lower_left>-10.71 -10.71</lower_left>
<universes>
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
1 1 1 1 1 2 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7 7
7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 </universes>
</lattice>
<surface coeffs="0.0 0.0 0.41" id="1" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.475" id="2" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.56" id="3" type="z-cylinder" />
<surface coeffs="0.0 0.0 0.62" id="4" type="z-cylinder" />
<surface coeffs="0.0 0.0 187.6" id="5" type="z-cylinder" />
<surface coeffs="0.0 0.0 209.0" id="6" type="z-cylinder" />
<surface coeffs="0.0 0.0 229.0" id="7" type="z-cylinder" />
<surface boundary="vacuum" coeffs="0.0 0.0 249.0" id="8" type="z-cylinder" />
<surface boundary="vacuum" coeffs="-229.0" id="31" type="z-plane" />
<surface coeffs="-199.0" id="32" type="z-plane" />
<surface coeffs="-193.0" id="33" type="z-plane" />
<surface coeffs="-183.0" id="34" type="z-plane" />
<surface coeffs="0.0" id="35" type="z-plane" />
<surface coeffs="183.0" id="36" type="z-plane" />
<surface coeffs="203.0" id="37" type="z-plane" />
<surface coeffs="215.0" id="38" type="z-plane" />
<surface boundary="vacuum" coeffs="223.0" id="39" type="z-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 5.0" id="1" type="z-cylinder" />
<surface boundary="vacuum" coeffs="0.0 0.0 10.0" id="2" type="z-cylinder" />
</geometry>
<?xml version='1.0' encoding='utf-8'?>
<materials>
<material depletable="true" id="1" name="UOX fuel">
<density units="g/cm3" value="10.062" />
<nuclide ao="4.9476e-06" name="U234" />
<nuclide ao="0.00048218" name="U235" />
<nuclide ao="0.021504" name="U238" />
<nuclide ao="1.0801e-08" name="Xe135" />
<nuclide ao="0.045737" name="O16" />
<material depletable="true" id="1">
<density units="g/cm3" value="10.0" />
<nuclide ao="1.0" name="U234" />
<nuclide ao="4.0" name="U235" />
<nuclide ao="95.0" name="U238" />
</material>
<material id="2" name="Zircaloy">
<density units="g/cm3" value="5.77" />
<nuclide ao="0.5145" name="Zr90" />
<nuclide ao="0.1122" name="Zr91" />
<nuclide ao="0.1715" name="Zr92" />
<nuclide ao="0.1738" name="Zr94" />
<nuclide ao="0.028" name="Zr96" />
</material>
<material id="3" name="Cold borated water">
<density units="atom/b-cm" value="0.07416" />
<material id="2" name="light water">
<density units="g/cm3" value="1.0" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
<nuclide ao="0.000649" name="B10" />
<nuclide ao="0.002689" name="B11" />
<sab name="c_H_in_H2O" />
</material>
<material id="4" name="Hot borated water">
<density units="atom/b-cm" value="0.06614" />
<nuclide ao="2.0" name="H1" />
<nuclide ao="1.0" name="O16" />
<nuclide ao="0.000649" name="B10" />
<nuclide ao="0.002689" name="B11" />
<sab name="c_H_in_H2O" />
</material>
<material id="5" name="Reactor pressure vessel steel">
<density units="g/cm3" value="7.9" />
<nuclide name="Fe54" wo="0.05437098" />
<nuclide name="Fe56" wo="0.88500663" />
<nuclide name="Fe57" wo="0.0208008" />
<nuclide name="Fe58" wo="0.00282159" />
<nuclide name="Ni58" wo="0.0067198" />
<nuclide name="Ni60" wo="0.0026776" />
<nuclide name="Mn55" wo="0.01" />
<nuclide name="Cr52" wo="0.002092475" />
<nuclide name="C0" wo="0.0025" />
<nuclide name="Cu63" wo="0.0013696" />
</material>
<material id="6" name="Lower radial reflector">
<density units="g/cm3" value="4.32" />
<nuclide name="H1" wo="0.0095661" />
<nuclide name="O16" wo="0.0759107" />
<nuclide name="B10" wo="3.08409e-05" />
<nuclide name="B11" wo="0.000140499" />
<nuclide name="Fe54" wo="0.035620772088" />
<nuclide name="Fe56" wo="0.579805982228" />
<nuclide name="Fe57" wo="0.01362750048" />
<nuclide name="Fe58" wo="0.001848545204" />
<nuclide name="Ni58" wo="0.055298376566" />
<nuclide name="Mn55" wo="0.018287" />
<nuclide name="Cr52" wo="0.145407678031" />
<sab name="c_H_in_H2O" />
</material>
<material id="7" name="Upper radial reflector / Top plate region">
<density units="g/cm3" value="4.28" />
<nuclide name="H1" wo="0.0086117" />
<nuclide name="O16" wo="0.0683369" />
<nuclide name="B10" wo="2.77638e-05" />
<nuclide name="B11" wo="0.000126481" />
<nuclide name="Fe54" wo="0.035953677186" />
<nuclide name="Fe56" wo="0.585224740891" />
<nuclide name="Fe57" wo="0.01375486056" />
<nuclide name="Fe58" wo="0.001865821363" />
<nuclide name="Ni58" wo="0.055815129186" />
<nuclide name="Mn55" wo="0.0184579" />
<nuclide name="Cr52" wo="0.146766614995" />
<sab name="c_H_in_H2O" />
</material>
<material id="8" name="Bottom plate region">
<density units="g/cm3" value="7.184" />
<nuclide name="H1" wo="0.0011505" />
<nuclide name="O16" wo="0.0091296" />
<nuclide name="B10" wo="3.70915e-06" />
<nuclide name="B11" wo="1.68974e-05" />
<nuclide name="Fe54" wo="0.03855611055" />
<nuclide name="Fe56" wo="0.627585036425" />
<nuclide name="Fe57" wo="0.014750478" />
<nuclide name="Fe58" wo="0.002000875025" />
<nuclide name="Ni58" wo="0.059855207342" />
<nuclide name="Mn55" wo="0.019794" />
<nuclide name="Cr52" wo="0.157390026871" />
<sab name="c_H_in_H2O" />
</material>
<material id="9" name="Bottom nozzle region">
<density units="g/cm3" value="2.53" />
<nuclide name="H1" wo="0.0245014" />
<nuclide name="O16" wo="0.1944274" />
<nuclide name="B10" wo="7.89917e-05" />
<nuclide name="B11" wo="0.000359854" />
<nuclide name="Fe54" wo="0.030411411144" />
<nuclide name="Fe56" wo="0.495012237964" />
<nuclide name="Fe57" wo="0.01163454624" />
<nuclide name="Fe58" wo="0.001578204652" />
<nuclide name="Ni58" wo="0.047211231662" />
<nuclide name="Mn55" wo="0.0156126" />
<nuclide name="Cr52" wo="0.124142524198" />
<sab name="c_H_in_H2O" />
</material>
<material id="10" name="Top nozzle region">
<density units="g/cm3" value="1.746" />
<nuclide name="H1" wo="0.035887" />
<nuclide name="O16" wo="0.2847761" />
<nuclide name="B10" wo="0.000115699" />
<nuclide name="B11" wo="0.000527075" />
<nuclide name="Fe54" wo="0.02644016154" />
<nuclide name="Fe56" wo="0.43037146399" />
<nuclide name="Fe57" wo="0.0101152584" />
<nuclide name="Fe58" wo="0.00137211607" />
<nuclide name="Ni58" wo="0.04104621835" />
<nuclide name="Mn55" wo="0.0135739" />
<nuclide name="Cr52" wo="0.107931450781" />
<sab name="c_H_in_H2O" />
</material>
<material id="11" name="Top of fuel assemblies">
<density units="g/cm3" value="3.044" />
<nuclide name="H1" wo="0.0162913" />
<nuclide name="O16" wo="0.1292776" />
<nuclide name="B10" wo="5.25228e-05" />
<nuclide name="B11" wo="0.000239272" />
<nuclide name="Zr90" wo="0.43313403903" />
<nuclide name="Zr91" wo="0.09549277374" />
<nuclide name="Zr92" wo="0.14759527104" />
<nuclide name="Zr94" wo="0.15280552077" />
<nuclide name="Zr96" wo="0.02511169542" />
<sab name="c_H_in_H2O" />
</material>
<material id="12" name="Bottom of fuel assemblies">
<density units="g/cm3" value="1.762" />
<nuclide name="H1" wo="0.0292856" />
<nuclide name="O16" wo="0.2323919" />
<nuclide name="B10" wo="9.44159e-05" />
<nuclide name="B11" wo="0.00043012" />
<nuclide name="Zr90" wo="0.3741373658" />
<nuclide name="Zr91" wo="0.0824858164" />
<nuclide name="Zr92" wo="0.1274914944" />
<nuclide name="Zr94" wo="0.1319920622" />
<nuclide name="Zr96" wo="0.0216912612" />
<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>5</inactive>
<source strength="1.0">
<space type="box">
<parameters>-160 -160 -183 160 160 183</parameters>
</space>
</source>
<particles>1000</particles>
<batches>5</batches>
<inactive>0</inactive>
</settings>
<?xml version='1.0' encoding='utf-8'?>
<tallies>
<mesh id="1">
<dimension>2 2 2</dimension>
<lower_left>-160.0 -160.0 -183.0</lower_left>
<upper_right>160.0 160.0 183.0</upper_right>
<dimension>2 2</dimension>
<lower_left>-10.0 -10.0</lower_left>
<upper_right>10.0 10.0</upper_right>
</mesh>
<filter id="2" type="material">
<bins>1 3</bins>
<bins>1 2</bins>
</filter>
<filter id="1" type="energy">
<bins>0.0 2.53e-07 0.001 1.0 20.0</bins>
<bins>0.0 10.0 20000000.0</bins>
</filter>
<filter id="3" type="distribcell">
<bins>60</bins>
</filter>
<filter id="4" type="mesh">
<filter id="3" type="mesh">
<bins>1</bins>
</filter>
<tally id="1" name="tally 1">
<filters>2 1 3</filters>
<filters>2 1</filters>
<nuclides>U234 U235</nuclides>
<scores>nu-fission total</scores>
</tally>
<tally id="2" name="tally 2">
<filters>1 4</filters>
<filters>1 3</filters>
<nuclides>U238 U235</nuclides>
<scores>total fission</scores>
</tally>

View file

@ -1,139 +1,49 @@
[[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
...
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]][[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
...
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]][[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
...
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]
[[0. 0. 0. 0.]
[0. 0. 0. 0.]
[0. 0. 0. 0.]]][[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
...
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]][[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
...
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]
[[0. 0. 0.]
[0. 0. 0.]
[0. 0. 0.]]]
[2.87610e-07 1.60278e-13 2.54988e-04 1.42099e-10 2.33002e-07 1.83973e-07
2.06574e-04 1.63105e-04 7.77662e-03 4.33372e-09 4.02417e-03 2.24257e-09
6.30008e-03 4.97439e-03 3.26010e-03 2.57410e-03 2.52614e-07 1.57719e-13
2.23961e-04 1.39830e-10 2.43493e-07 1.93615e-07 2.15874e-04 1.71654e-04
6.83035e-03 4.26453e-09 3.53450e-03 2.20677e-09 6.58373e-03 5.23510e-03
3.40688e-03 2.70901e-03 2.72019e-07 1.63161e-13 2.41165e-04 1.44654e-10
2.44531e-07 1.94194e-07 2.16795e-04 1.72167e-04 7.35506e-03 4.41166e-09
3.80602e-03 2.28290e-09 6.61180e-03 5.25075e-03 3.42141e-03 2.71710e-03
2.41472e-07 1.50936e-13 2.14083e-04 1.33816e-10 2.24252e-07 1.77892e-07
1.98816e-04 1.57715e-04 6.52910e-03 4.08113e-09 3.37861e-03 2.11186e-09
6.06350e-03 4.80998e-03 3.13768e-03 2.48902e-03 2.48914e-03 4.48016e-05
1.13508e-02 2.04302e-04 1.19934e-04 2.60981e-05 5.46915e-04 1.19011e-04
2.77675e-02 4.99783e-04 4.93334e-02 8.87945e-04 1.33792e-03 2.91137e-04
2.37703e-03 5.17251e-04 2.49083e-03 4.43597e-05 1.13585e-02 2.02286e-04
1.21668e-04 2.66359e-05 5.54821e-04 1.21463e-04 2.77864e-02 4.94854e-04
4.93670e-02 8.79187e-04 1.35726e-03 2.97136e-04 2.41139e-03 5.27909e-04
2.28387e-03 4.25108e-05 1.04148e-02 1.93855e-04 1.16292e-04 2.67442e-05
5.30307e-04 1.21957e-04 2.54776e-02 4.74228e-04 4.52651e-02 8.42543e-04
1.29729e-03 2.98344e-04 2.30485e-03 5.30056e-04 2.25849e-03 4.37806e-05
1.02990e-02 1.99646e-04 1.16539e-04 2.71633e-05 5.31435e-04 1.23868e-04
2.51945e-02 4.88393e-04 4.47620e-02 8.67709e-04 1.30005e-03 3.03020e-04
2.30975e-03 5.38363e-04][2.87610e-07 1.60278e-13 2.54988e-04 1.42099e-10 2.33002e-07 1.83973e-07
2.06574e-04 1.63105e-04 7.77662e-03 4.33372e-09 4.02417e-03 2.24257e-09
6.30008e-03 4.97439e-03 3.26010e-03 2.57410e-03 2.52614e-07 1.57719e-13
2.23961e-04 1.39830e-10 2.43493e-07 1.93615e-07 2.15874e-04 1.71654e-04
6.83035e-03 4.26453e-09 3.53450e-03 2.20677e-09 6.58373e-03 5.23510e-03
3.40688e-03 2.70901e-03 2.72019e-07 1.63161e-13 2.41165e-04 1.44654e-10
2.44531e-07 1.94194e-07 2.16795e-04 1.72167e-04 7.35506e-03 4.41166e-09
3.80602e-03 2.28290e-09 6.61180e-03 5.25075e-03 3.42141e-03 2.71710e-03
2.41472e-07 1.50936e-13 2.14083e-04 1.33816e-10 2.24252e-07 1.77892e-07
1.98816e-04 1.57715e-04 6.52910e-03 4.08113e-09 3.37861e-03 2.11186e-09
6.06350e-03 4.80998e-03 3.13768e-03 2.48902e-03 2.48914e-03 4.48016e-05
1.13508e-02 2.04302e-04 1.19934e-04 2.60981e-05 5.46915e-04 1.19011e-04
2.77675e-02 4.99783e-04 4.93334e-02 8.87945e-04 1.33792e-03 2.91137e-04
2.37703e-03 5.17251e-04 2.49083e-03 4.43597e-05 1.13585e-02 2.02286e-04
1.21668e-04 2.66359e-05 5.54821e-04 1.21463e-04 2.77864e-02 4.94854e-04
4.93670e-02 8.79187e-04 1.35726e-03 2.97136e-04 2.41139e-03 5.27909e-04
2.28387e-03 4.25108e-05 1.04148e-02 1.93855e-04 1.16292e-04 2.67442e-05
5.30307e-04 1.21957e-04 2.54776e-02 4.74228e-04 4.52651e-02 8.42543e-04
1.29729e-03 2.98344e-04 2.30485e-03 5.30056e-04 2.25849e-03 4.37806e-05
1.02990e-02 1.99646e-04 1.16539e-04 2.71633e-05 5.31435e-04 1.23868e-04
2.51945e-02 4.88393e-04 4.47620e-02 8.67709e-04 1.30005e-03 3.03020e-04
2.30975e-03 5.38363e-04][0.0063 0.00497 0.00326 0.00257 0.00658 0.00524 0.00341 0.00271 0.00661
0.00525 0.00342 0.00272 0.00606 0.00481 0.00314 0.00249 0.00134 0.00029
0.00238 0.00052 0.00136 0.0003 0.00241 0.00053 0.0013 0.0003 0.0023
0.00053 0.0013 0.0003 0.00231 0.00054][0.00025 0.00021 0.00402 0.00326 0.00022 0.00022 0.00353 0.00341 0.00024
0.00022 0.00381 0.00342 0.00021 0.0002 0.00338 0.00314 0.01135 0.00055
0.04933 0.00238 0.01136 0.00055 0.04937 0.00241 0.01041 0.00053 0.04527
0.0023 0.0103 0.00053 0.04476 0.00231][0.00326 0.00341 0.00342 0.00314 0.00238 0.00241 0.0023 0.00231]

View file

@ -1,39 +1,61 @@
import hashlib
import numpy as np
import openmc
import pytest
from tests.testing_harness import PyAPITestHarness
@pytest.fixture
def model():
model = openmc.model.Model()
fuel = openmc.Material()
fuel.set_density('g/cm3', 10.0)
fuel.add_nuclide('U234', 1.0)
fuel.add_nuclide('U235', 4.0)
fuel.add_nuclide('U238', 95.0)
water = openmc.Material(name='light water')
water.add_nuclide('H1', 2.0)
water.add_nuclide('O16', 1.0)
water.set_density('g/cm3', 1.0)
water.add_s_alpha_beta('c_H_in_H2O')
model.materials.extend([fuel, water])
cyl1 = openmc.ZCylinder(r=5.0)
cyl2 = openmc.ZCylinder(r=10.0, boundary_type='vacuum')
cell1 = openmc.Cell(fill=fuel, region=-cyl1)
cell2 = openmc.Cell(fill=water, region=+cyl1 & -cyl2)
model.geometry = openmc.Geometry([cell1, cell2])
model.settings.batches = 5
model.settings.inactive = 0
model.settings.particles = 1000
mesh = openmc.RegularMesh()
mesh.dimension = (2, 2)
mesh.lower_left = (-10.0, -10.0)
mesh.upper_right = (10.0, 10.0)
energy_filter = openmc.EnergyFilter((0.0, 10.0, 20.0e6))
material_filter = openmc.MaterialFilter((fuel, water))
mesh_filter = openmc.MeshFilter(mesh)
tally = openmc.Tally(name='tally 1')
tally.filters = [material_filter, energy_filter]
tally.scores = ['nu-fission', 'total']
tally.nuclides = ['U234', 'U235']
model.tallies.append(tally)
tally = openmc.Tally(name='tally 2')
tally.filters = [energy_filter, mesh_filter]
tally.scores = ['total', 'fission']
tally.nuclides = ['U238', 'U235']
model.tallies.append(tally)
return model
class TallyArithmeticTestHarness(PyAPITestHarness):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
# Initialize Mesh
mesh = openmc.RegularMesh(mesh_id=1)
mesh.dimension = [2, 2, 2]
mesh.lower_left = [-160.0, -160.0, -183.0]
mesh.upper_right = [160.0, 160.0, 183.0]
# Initialize the filters
energy_filter = openmc.EnergyFilter((0.0, 0.253e-6, 1.0e-3, 1.0, 20.0))
material_filter = openmc.MaterialFilter((1, 3))
distrib_filter = openmc.DistribcellFilter(60)
mesh_filter = openmc.MeshFilter(mesh)
# Initialized the tallies
tally = openmc.Tally(name='tally 1')
tally.filters = [material_filter, energy_filter, distrib_filter]
tally.scores = ['nu-fission', 'total']
tally.nuclides = ['U234', 'U235']
self._model.tallies.append(tally)
tally = openmc.Tally(name='tally 2')
tally.filters = [energy_filter, mesh_filter]
tally.scores = ['total', 'fission']
tally.nuclides = ['U238', 'U235']
self._model.tallies.append(tally)
def _get_results(self, hash_output=False):
"""Digest info in the statepoint and return as a string."""
@ -45,27 +67,29 @@ class TallyArithmeticTestHarness(PyAPITestHarness):
tally_2 = sp.get_tally(name='tally 2')
# Perform all the tally arithmetic operations and output results
outstr = ''
tally_3 = tally_1 * tally_2
outstr += str(tally_3.mean)
output = []
with np.printoptions(precision=5, threshold=np.inf):
mean = (tally_1 * tally_2).mean
output.append(str(mean[np.nonzero(mean)]))
tally_3 = tally_1.hybrid_product(tally_2, '*', 'entrywise', 'tensor',
'tensor')
outstr += str(tally_3.mean)
mean = tally_1.hybrid_product(
tally_2, '*', 'entrywise', 'tensor', 'tensor').mean
output.append(str(mean[np.nonzero(mean)]))
tally_3 = tally_1.hybrid_product(tally_2, '*', 'entrywise', 'entrywise',
'tensor')
outstr += str(tally_3.mean)
mean = tally_1.hybrid_product(
tally_2, '*', 'entrywise', 'entrywise', 'tensor').mean
output.append(str(mean[np.nonzero(mean)]))
tally_3 = tally_1.hybrid_product(tally_2, '*', 'entrywise', 'tensor',
'entrywise')
outstr += str(tally_3.mean)
mean = tally_1.hybrid_product(
tally_2, '*', 'entrywise', 'tensor', 'entrywise').mean
output.append(str(mean[np.nonzero(mean)]))
tally_3 = tally_1.hybrid_product(tally_2, '*', 'entrywise', 'entrywise',
'entrywise')
outstr += str(tally_3.mean)
mean = tally_1.hybrid_product(
tally_2, '*', 'entrywise', 'entrywise', 'entrywise').mean
output.append(str(mean[np.nonzero(mean)]))
# Hash the results if necessary
outstr = ''.join(output)
if hash_output:
sha512 = hashlib.sha512()
sha512.update(outstr.encode('utf-8'))
@ -74,6 +98,6 @@ class TallyArithmeticTestHarness(PyAPITestHarness):
return outstr
def test_tally_arithmetic():
harness = TallyArithmeticTestHarness('statepoint.10.h5')
def test_tally_arithmetic(model):
harness = TallyArithmeticTestHarness('statepoint.5.h5', model)
harness.main()