Merge pull request #1854 from pshriwise/statepoint_close

Add close method to `openmc.StatePoint` and update docs/examples for best practices
This commit is contained in:
Paul Romano 2021-06-30 08:42:54 +07:00 committed by GitHub
commit 423971637e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 2756 additions and 2574 deletions

View file

@ -45,6 +45,23 @@ with the :envvar:`OPENMC_CROSS_SECTIONS` environment variable. It is recommended
to add a line in your ``.profile`` or ``.bash_profile`` setting the
:envvar:`OPENMC_CROSS_SECTIONS` environment variable.
RuntimeError: Failed to open HDF5 file with mode 'w': summary.h5
****************************************************************
This often occurs when working with the Python API and executing multiple OpenMC
runs in a script. If an :class:`openmc.StatePoint` is open in the Python interpreter,
the file handle of the statepoint file as well as the linked `summary.h5` file will
be unavailable for writing, causing this error to appear. To avoid this situation,
it is recommended that data be extracted from statepoint files in a context manager:
.. code-block:: python
with openmc.StatePoint('statepoint.10.h5') as sp:
k_eff = sp.k_combined
or that the :meth:`StatePoint.close` method is called before executing a subsequent
OpenMC run.
Geometry Debugging
******************

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -243,7 +243,7 @@
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AgMAAAD1grKuAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEVyEhLpgJFNv8T///98iBL0AAAAAWJLR0QDEQxM8gAAAAd0SU1FB+MHEhEzAhO1TdMAAAKlSURBVGje7ZrBscIwDETxwSWkn5TAgXCgBPqhBA6kyj/fDhCIJa2zZAwz0pmHpZWdSazd7Tw8P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0wNi0yNlQyMDo0NjoyMiswMDowMIjWIT4AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjEtMDYtMjZUMjA6NDY6MjIrMDA6MDD5i5mCAAAAAElFTkSuQmCC\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
@ -421,11 +421,11 @@
"name": "stderr",
"output_type": "stream",
"text": [
"/home/romano/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=6.\n",
"/home/shriwise/opt/openmc/openmc/openmc/mixin.py:68: IDWarning: Another Filter instance already exists with id=6.\n",
" warn(msg, IDWarning)\n",
"/home/romano/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=3.\n",
"/home/shriwise/opt/openmc/openmc/openmc/mixin.py:68: IDWarning: Another Filter instance already exists with id=3.\n",
" warn(msg, IDWarning)\n",
"/home/romano/openmc/openmc/mixin.py:71: IDWarning: Another Filter instance already exists with id=2.\n",
"/home/shriwise/opt/openmc/openmc/openmc/mixin.py:68: IDWarning: Another Filter instance already exists with id=2.\n",
" warn(msg, IDWarning)\n"
]
}
@ -478,78 +478,82 @@
" %%%%%%%%%%%\n",
"\n",
" | The OpenMC Monte Carlo Code\n",
" Copyright | 2011-2019 MIT and OpenMC contributors\n",
" License | http://openmc.readthedocs.io/en/latest/license.html\n",
" Version | 0.11.0-dev\n",
" Git SHA1 | 61c911cffdae2406f9f4bc667a9a6954748bb70c\n",
" Date/Time | 2019-07-18 22:51:02\n",
" OpenMP Threads | 4\n",
" Copyright | 2011-2021 MIT and OpenMC contributors\n",
" License | https://docs.openmc.org/en/latest/license.html\n",
" Version | 0.13.0-dev\n",
" Git SHA1 | 3dd81a1316ac3b5a0633e4b7a290f3bc97a066d9\n",
" Date/Time | 2021-06-26 15:46:22\n",
" OpenMP Threads | 2\n",
"\n",
" Reading settings XML file...\n",
" Reading cross sections XML file...\n",
" Reading materials XML file...\n",
" Reading geometry XML file...\n",
" Reading U235 from /opt/data/hdf5/nndc_hdf5_v15/U235.h5\n",
" Reading U238 from /opt/data/hdf5/nndc_hdf5_v15/U238.h5\n",
" Reading O16 from /opt/data/hdf5/nndc_hdf5_v15/O16.h5\n",
" Reading H1 from /opt/data/hdf5/nndc_hdf5_v15/H1.h5\n",
" Reading B10 from /opt/data/hdf5/nndc_hdf5_v15/B10.h5\n",
" Reading Zr90 from /opt/data/hdf5/nndc_hdf5_v15/Zr90.h5\n",
" Maximum neutron transport energy: 20000000.000000 eV for U235\n",
" Reading U235 from /home/shriwise/opt/openmc/xs/nndc_hdf5/U235.h5\n",
" Reading U238 from /home/shriwise/opt/openmc/xs/nndc_hdf5/U238.h5\n",
" Reading O16 from /home/shriwise/opt/openmc/xs/nndc_hdf5/O16.h5\n",
" Reading H1 from /home/shriwise/opt/openmc/xs/nndc_hdf5/H1.h5\n",
" Reading B10 from /home/shriwise/opt/openmc/xs/nndc_hdf5/B10.h5\n",
" Reading Zr90 from /home/shriwise/opt/openmc/xs/nndc_hdf5/Zr90.h5\n",
" Minimum neutron data temperature: 294.0 K\n",
" Maximum neutron data temperature: 294.0 K\n",
" Reading tallies XML file...\n",
" Preparing distributed cell instances...\n",
" Writing summary.h5 file...\n",
" Maximum neutron transport energy: 20000000.0 eV for U235\n",
" Initializing source particles...\n",
"\n",
" ====================> K EIGENVALUE SIMULATION <====================\n",
"\n",
" Bat./Gen. k Average k\n",
" ========= ======== ====================\n",
" 1/1 0.96168\n",
" 2/1 0.96651\n",
" 3/1 1.00678\n",
" 4/1 0.98773\n",
" 5/1 1.01883\n",
" 6/1 1.02959\n",
" 7/1 0.99859 1.01409 +/- 0.01550\n",
" 8/1 1.03441 1.02086 +/- 0.01123\n",
" 9/1 1.06097 1.03089 +/- 0.01279\n",
" 10/1 1.06132 1.03698 +/- 0.01163\n",
" 11/1 1.04687 1.03863 +/- 0.00964\n",
" 12/1 1.02982 1.03737 +/- 0.00824\n",
" 13/1 1.03520 1.03710 +/- 0.00714\n",
" 14/1 0.99508 1.03243 +/- 0.00784\n",
" 15/1 1.03987 1.03317 +/- 0.00705\n",
" 16/1 1.02743 1.03265 +/- 0.00640\n",
" 17/1 1.02975 1.03241 +/- 0.00585\n",
" 18/1 0.99671 1.02966 +/- 0.00604\n",
" 19/1 1.02040 1.02900 +/- 0.00563\n",
" 20/1 1.02024 1.02842 +/- 0.00527\n",
" 1/1 0.99327\n",
" 2/1 1.05535\n",
" 3/1 1.02165\n",
" 4/1 1.02898\n",
" 5/1 1.02521\n",
" 6/1 1.04782\n",
" 7/1 1.07014 1.05898 +/- 0.01116\n",
" 8/1 1.07724 1.06507 +/- 0.00886\n",
" 9/1 1.06268 1.06447 +/- 0.00630\n",
" 10/1 0.99628 1.05083 +/- 0.01448\n",
" 11/1 1.07257 1.05446 +/- 0.01237\n",
" 12/1 1.01603 1.04897 +/- 0.01181\n",
" 13/1 1.01047 1.04415 +/- 0.01130\n",
" 14/1 1.03639 1.04329 +/- 0.01000\n",
" 15/1 1.00699 1.03966 +/- 0.00966\n",
" 16/1 0.99098 1.03524 +/- 0.00979\n",
" 17/1 1.03990 1.03562 +/- 0.00895\n",
" 18/1 1.02076 1.03448 +/- 0.00831\n",
" 19/1 0.99685 1.03179 +/- 0.00815\n",
" 20/1 1.04833 1.03290 +/- 0.00767\n",
" Creating state point statepoint.20.h5...\n",
"\n",
" =======================> TIMING STATISTICS <=======================\n",
"\n",
" Total time for initialization = 3.4427e-01 seconds\n",
" Reading cross sections = 3.1628e-01 seconds\n",
" Total time in simulation = 3.7319e+00 seconds\n",
" Time in transport only = 3.6302e+00 seconds\n",
" Time in inactive batches = 4.9601e-01 seconds\n",
" Time in active batches = 3.2359e+00 seconds\n",
" Time synchronizing fission bank = 2.8100e-03 seconds\n",
" Sampling source sites = 2.4682e-03 seconds\n",
" SEND/RECV source sites = 3.2484e-04 seconds\n",
" Time accumulating tallies = 4.4538e-05 seconds\n",
" Total time for finalization = 9.3656e-04 seconds\n",
" Total time elapsed = 4.0859e+00 seconds\n",
" Calculation Rate (inactive) = 25201.2 particles/second\n",
" Calculation Rate (active) = 11588.7 particles/second\n",
" Total time for initialization = 2.5195e-01 seconds\n",
" Reading cross sections = 2.3830e-01 seconds\n",
" Total time in simulation = 3.6172e+00 seconds\n",
" Time in transport only = 3.6041e+00 seconds\n",
" Time in inactive batches = 4.5282e-01 seconds\n",
" Time in active batches = 3.1644e+00 seconds\n",
" Time synchronizing fission bank = 2.4821e-03 seconds\n",
" Sampling source sites = 2.0826e-03 seconds\n",
" SEND/RECV source sites = 3.8781e-04 seconds\n",
" Time accumulating tallies = 2.8497e-04 seconds\n",
" Time writing statepoints = 8.5742e-03 seconds\n",
" Total time for finalization = 3.1545e-04 seconds\n",
" Total time elapsed = 3.8763e+00 seconds\n",
" Calculation Rate (inactive) = 27604.9 particles/second\n",
" Calculation Rate (active) = 11850.8 particles/second\n",
"\n",
" ============================> RESULTS <============================\n",
"\n",
" k-effective (Collision) = 1.02889 +/- 0.00492\n",
" k-effective (Track-length) = 1.02842 +/- 0.00527\n",
" k-effective (Absorption) = 1.02637 +/- 0.00349\n",
" Combined k-effective = 1.02700 +/- 0.00291\n",
" Leakage Fraction = 0.01717 +/- 0.00107\n",
" k-effective (Collision) = 1.03497 +/- 0.00681\n",
" k-effective (Track-length) = 1.03290 +/- 0.00767\n",
" k-effective (Absorption) = 1.02663 +/- 0.00590\n",
" Combined k-effective = 1.03085 +/- 0.00535\n",
" Leakage Fraction = 0.01728 +/- 0.00077\n",
"\n"
]
}
@ -631,8 +635,8 @@
" <th>0</th>\n",
" <td>total</td>\n",
" <td>(nu-fission / (absorption + current))</td>\n",
" <td>1.023002</td>\n",
" <td>0.006647</td>\n",
" <td>1.025847</td>\n",
" <td>0.009998</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -640,7 +644,7 @@
],
"text/plain": [
" nuclide score mean std. dev.\n",
"0 total (nu-fission / (absorption + current)) 1.02e+00 6.65e-03"
"0 total (nu-fission / (absorption + current)) 1.03e+00 1.00e-02"
]
},
"execution_count": 21,
@ -712,8 +716,8 @@
" <td>0.625</td>\n",
" <td>total</td>\n",
" <td>((absorption + current) / (absorption + current))</td>\n",
" <td>0.694368</td>\n",
" <td>0.004606</td>\n",
" <td>0.695924</td>\n",
" <td>0.007275</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -724,7 +728,7 @@
"0 0.00e+00 6.25e-01 total \n",
"\n",
" score mean std. dev. \n",
"0 ((absorption + current) / (absorption + current)) 6.94e-01 4.61e-03 "
"0 ((absorption + current) / (absorption + current)) 6.96e-01 7.27e-03 "
]
},
"execution_count": 22,
@ -790,8 +794,8 @@
" <td>0.625</td>\n",
" <td>total</td>\n",
" <td>(nu-fission / nu-fission)</td>\n",
" <td>1.203099</td>\n",
" <td>0.009615</td>\n",
" <td>1.203449</td>\n",
" <td>0.01381</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -802,7 +806,7 @@
"0 0.00e+00 6.25e-01 total (nu-fission / nu-fission) \n",
"\n",
" mean std. dev. \n",
"0 1.20e+00 9.61e-03 "
"0 1.20e+00 1.38e-02 "
]
},
"execution_count": 23,
@ -869,8 +873,8 @@
" <td>1</td>\n",
" <td>total</td>\n",
" <td>(absorption / absorption)</td>\n",
" <td>0.749423</td>\n",
" <td>0.006089</td>\n",
" <td>0.74975</td>\n",
" <td>0.009032</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -881,7 +885,7 @@
"0 0.00e+00 6.25e-01 1 total (absorption / absorption) \n",
"\n",
" mean std. dev. \n",
"0 7.49e-01 6.09e-03 "
"0 7.50e-01 9.03e-03 "
]
},
"execution_count": 24,
@ -946,8 +950,8 @@
" <td>1</td>\n",
" <td>total</td>\n",
" <td>(nu-fission / absorption)</td>\n",
" <td>1.663727</td>\n",
" <td>0.014403</td>\n",
" <td>1.663575</td>\n",
" <td>0.020557</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -958,7 +962,7 @@
"0 0.00e+00 6.25e-01 1 total (nu-fission / absorption) \n",
"\n",
" mean std. dev. \n",
"0 1.66e+00 1.44e-02 "
"0 1.66e+00 2.06e-02 "
]
},
"execution_count": 25,
@ -1020,8 +1024,8 @@
" <td>0.625</td>\n",
" <td>total</td>\n",
" <td>((absorption + current) / (absorption + current))</td>\n",
" <td>0.984668</td>\n",
" <td>0.005509</td>\n",
" <td>0.984639</td>\n",
" <td>0.00883</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -1032,7 +1036,7 @@
"0 0.00e+00 6.25e-01 total \n",
"\n",
" score mean std. dev. \n",
"0 ((absorption + current) / (absorption + current)) 9.85e-01 5.51e-03 "
"0 ((absorption + current) / (absorption + current)) 9.85e-01 8.83e-03 "
]
},
"execution_count": 26,
@ -1093,8 +1097,8 @@
" <td>0.625</td>\n",
" <td>total</td>\n",
" <td>(absorption / (absorption + current))</td>\n",
" <td>0.997439</td>\n",
" <td>0.007548</td>\n",
" <td>0.997372</td>\n",
" <td>0.011707</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -1105,7 +1109,7 @@
"0 0.00e+00 6.25e-01 total \n",
"\n",
" score mean std. dev. \n",
"0 (absorption / (absorption + current)) 9.97e-01 7.55e-03 "
"0 (absorption / (absorption + current)) 9.97e-01 1.17e-02 "
]
},
"execution_count": 27,
@ -1168,8 +1172,8 @@
" <td>1</td>\n",
" <td>total</td>\n",
" <td>(((((((absorption + current) / (absorption + c...</td>\n",
" <td>1.023002</td>\n",
" <td>0.018791</td>\n",
" <td>1.025847</td>\n",
" <td>0.028224</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -1180,7 +1184,7 @@
"0 0.00e+00 6.25e-01 1 total \n",
"\n",
" score mean std. dev. \n",
"0 (((((((absorption + current) / (absorption + c... 1.02e+00 1.88e-02 "
"0 (((((((absorption + current) / (absorption + c... 1.03e+00 2.82e-02 "
]
},
"execution_count": 28,
@ -1260,8 +1264,8 @@
" <td>6.250000e-01</td>\n",
" <td>(U238 / total)</td>\n",
" <td>(nu-fission / flux)</td>\n",
" <td>6.659486e-07</td>\n",
" <td>5.627975e-09</td>\n",
" <td>6.670761e-07</td>\n",
" <td>7.788171e-09</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
@ -1270,8 +1274,8 @@
" <td>6.250000e-01</td>\n",
" <td>(U238 / total)</td>\n",
" <td>(scatter / flux)</td>\n",
" <td>2.099901e-01</td>\n",
" <td>1.748379e-03</td>\n",
" <td>2.099931e-01</td>\n",
" <td>2.336727e-03</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
@ -1280,8 +1284,8 @@
" <td>6.250000e-01</td>\n",
" <td>(U235 / total)</td>\n",
" <td>(nu-fission / flux)</td>\n",
" <td>3.566329e-01</td>\n",
" <td>3.030782e-03</td>\n",
" <td>3.571972e-01</td>\n",
" <td>4.203420e-03</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
@ -1290,8 +1294,8 @@
" <td>6.250000e-01</td>\n",
" <td>(U235 / total)</td>\n",
" <td>(scatter / flux)</td>\n",
" <td>5.555466e-03</td>\n",
" <td>4.635318e-05</td>\n",
" <td>5.555637e-03</td>\n",
" <td>6.200519e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
@ -1300,8 +1304,8 @@
" <td>2.000000e+07</td>\n",
" <td>(U238 / total)</td>\n",
" <td>(nu-fission / flux)</td>\n",
" <td>7.251304e-03</td>\n",
" <td>5.161998e-05</td>\n",
" <td>7.269233e-03</td>\n",
" <td>6.814579e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
@ -1310,8 +1314,8 @@
" <td>2.000000e+07</td>\n",
" <td>(U238 / total)</td>\n",
" <td>(scatter / flux)</td>\n",
" <td>2.272661e-01</td>\n",
" <td>9.576939e-04</td>\n",
" <td>2.276519e-01</td>\n",
" <td>7.674381e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
@ -1320,8 +1324,8 @@
" <td>2.000000e+07</td>\n",
" <td>(U235 / total)</td>\n",
" <td>(nu-fission / flux)</td>\n",
" <td>7.920169e-03</td>\n",
" <td>5.751231e-05</td>\n",
" <td>8.069479e-03</td>\n",
" <td>5.324215e-05</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
@ -1330,8 +1334,8 @@
" <td>2.000000e+07</td>\n",
" <td>(U235 / total)</td>\n",
" <td>(scatter / flux)</td>\n",
" <td>3.358280e-03</td>\n",
" <td>1.341281e-05</td>\n",
" <td>3.363165e-03</td>\n",
" <td>1.147434e-05</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -1349,14 +1353,14 @@
"7 1 6.25e-01 2.00e+07 (U235 / total) \n",
"\n",
" score mean std. dev. \n",
"0 (nu-fission / flux) 6.66e-07 5.63e-09 \n",
"1 (scatter / flux) 2.10e-01 1.75e-03 \n",
"2 (nu-fission / flux) 3.57e-01 3.03e-03 \n",
"3 (scatter / flux) 5.56e-03 4.64e-05 \n",
"4 (nu-fission / flux) 7.25e-03 5.16e-05 \n",
"5 (scatter / flux) 2.27e-01 9.58e-04 \n",
"6 (nu-fission / flux) 7.92e-03 5.75e-05 \n",
"7 (scatter / flux) 3.36e-03 1.34e-05 "
"0 (nu-fission / flux) 6.67e-07 7.79e-09 \n",
"1 (scatter / flux) 2.10e-01 2.34e-03 \n",
"2 (nu-fission / flux) 3.57e-01 4.20e-03 \n",
"3 (scatter / flux) 5.56e-03 6.20e-05 \n",
"4 (nu-fission / flux) 7.27e-03 6.81e-05 \n",
"5 (scatter / flux) 2.28e-01 7.67e-04 \n",
"6 (nu-fission / flux) 8.07e-03 5.32e-05 \n",
"7 (scatter / flux) 3.36e-03 1.15e-05 "
]
},
"execution_count": 30,
@ -1385,11 +1389,11 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[[[6.65948580e-07]\n",
" [3.56632881e-01]]\n",
"[[[6.67076123e-07]\n",
" [3.57197248e-01]]\n",
"\n",
" [[7.25130446e-03]\n",
" [7.92016892e-03]]]\n"
" [[7.26923324e-03]\n",
" [8.06947893e-03]]]\n"
]
}
],
@ -1415,9 +1419,9 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[[[0.00555547]]\n",
"[[[0.00555564]]\n",
"\n",
" [[0.00335828]]]\n"
" [[0.00336316]]]\n"
]
}
],
@ -1437,8 +1441,8 @@
"name": "stdout",
"output_type": "stream",
"text": [
"[[[0.22726611]\n",
" [0.00335828]]]\n"
"[[[0.22765194]\n",
" [0.00336316]]]\n"
]
}
],
@ -1501,7 +1505,7 @@
" <td>U238</td>\n",
" <td>nu-fission</td>\n",
" <td>0.000002</td>\n",
" <td>9.679304e-09</td>\n",
" <td>1.382881e-08</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
@ -1510,8 +1514,8 @@
" <td>6.250000e-01</td>\n",
" <td>U235</td>\n",
" <td>nu-fission</td>\n",
" <td>0.854805</td>\n",
" <td>5.239673e-03</td>\n",
" <td>0.858278</td>\n",
" <td>7.512185e-03</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
@ -1520,8 +1524,8 @@
" <td>2.000000e+07</td>\n",
" <td>U238</td>\n",
" <td>nu-fission</td>\n",
" <td>0.082978</td>\n",
" <td>5.346135e-04</td>\n",
" <td>0.082753</td>\n",
" <td>7.469156e-04</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
@ -1530,8 +1534,8 @@
" <td>2.000000e+07</td>\n",
" <td>U235</td>\n",
" <td>nu-fission</td>\n",
" <td>0.090632</td>\n",
" <td>5.981942e-04</td>\n",
" <td>0.091863</td>\n",
" <td>5.596607e-04</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -1540,15 +1544,15 @@
"text/plain": [
" cell energy low [eV] energy high [eV] nuclide score mean \\\n",
"0 1 0.00e+00 6.25e-01 U238 nu-fission 1.60e-06 \n",
"1 1 0.00e+00 6.25e-01 U235 nu-fission 8.55e-01 \n",
"2 1 6.25e-01 2.00e+07 U238 nu-fission 8.30e-02 \n",
"3 1 6.25e-01 2.00e+07 U235 nu-fission 9.06e-02 \n",
"1 1 0.00e+00 6.25e-01 U235 nu-fission 8.58e-01 \n",
"2 1 6.25e-01 2.00e+07 U238 nu-fission 8.28e-02 \n",
"3 1 6.25e-01 2.00e+07 U235 nu-fission 9.19e-02 \n",
"\n",
" std. dev. \n",
"0 9.68e-09 \n",
"1 5.24e-03 \n",
"2 5.35e-04 \n",
"3 5.98e-04 "
"0 1.38e-08 \n",
"1 7.51e-03 \n",
"2 7.47e-04 \n",
"3 5.60e-04 "
]
},
"execution_count": 34,
@ -1605,8 +1609,8 @@
" <td>1.080060e-01</td>\n",
" <td>H1</td>\n",
" <td>scatter</td>\n",
" <td>4.541188</td>\n",
" <td>0.025230</td>\n",
" <td>4.542677</td>\n",
" <td>0.037555</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
@ -1615,8 +1619,8 @@
" <td>1.166529e+00</td>\n",
" <td>H1</td>\n",
" <td>scatter</td>\n",
" <td>2.001332</td>\n",
" <td>0.006754</td>\n",
" <td>2.019002</td>\n",
" <td>0.011992</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
@ -1625,8 +1629,8 @@
" <td>1.259921e+01</td>\n",
" <td>H1</td>\n",
" <td>scatter</td>\n",
" <td>1.639292</td>\n",
" <td>0.011374</td>\n",
" <td>1.622688</td>\n",
" <td>0.011889</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
@ -1635,8 +1639,8 @@
" <td>1.360790e+02</td>\n",
" <td>H1</td>\n",
" <td>scatter</td>\n",
" <td>1.821633</td>\n",
" <td>0.009590</td>\n",
" <td>1.834317</td>\n",
" <td>0.012322</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
@ -1645,8 +1649,8 @@
" <td>1.469734e+03</td>\n",
" <td>H1</td>\n",
" <td>scatter</td>\n",
" <td>2.032395</td>\n",
" <td>0.009953</td>\n",
" <td>2.040064</td>\n",
" <td>0.012967</td>\n",
" </tr>\n",
" <tr>\n",
" <th>5</th>\n",
@ -1655,8 +1659,8 @@
" <td>1.587401e+04</td>\n",
" <td>H1</td>\n",
" <td>scatter</td>\n",
" <td>2.120745</td>\n",
" <td>0.011090</td>\n",
" <td>2.107758</td>\n",
" <td>0.012781</td>\n",
" </tr>\n",
" <tr>\n",
" <th>6</th>\n",
@ -1665,8 +1669,8 @@
" <td>1.714488e+05</td>\n",
" <td>H1</td>\n",
" <td>scatter</td>\n",
" <td>2.181709</td>\n",
" <td>0.013602</td>\n",
" <td>2.175480</td>\n",
" <td>0.014165</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7</th>\n",
@ -1675,8 +1679,8 @@
" <td>1.851749e+06</td>\n",
" <td>H1</td>\n",
" <td>scatter</td>\n",
" <td>2.013644</td>\n",
" <td>0.009219</td>\n",
" <td>1.983382</td>\n",
" <td>0.012931</td>\n",
" </tr>\n",
" <tr>\n",
" <th>8</th>\n",
@ -1685,8 +1689,8 @@
" <td>2.000000e+07</td>\n",
" <td>H1</td>\n",
" <td>scatter</td>\n",
" <td>0.372640</td>\n",
" <td>0.002903</td>\n",
" <td>0.372359</td>\n",
" <td>0.003689</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
@ -1695,25 +1699,25 @@
"text/plain": [
" cell energy low [eV] energy high [eV] nuclide score mean \\\n",
"0 3 1.00e-02 1.08e-01 H1 scatter 4.54e+00 \n",
"1 3 1.08e-01 1.17e+00 H1 scatter 2.00e+00 \n",
"2 3 1.17e+00 1.26e+01 H1 scatter 1.64e+00 \n",
"3 3 1.26e+01 1.36e+02 H1 scatter 1.82e+00 \n",
"4 3 1.36e+02 1.47e+03 H1 scatter 2.03e+00 \n",
"5 3 1.47e+03 1.59e+04 H1 scatter 2.12e+00 \n",
"1 3 1.08e-01 1.17e+00 H1 scatter 2.02e+00 \n",
"2 3 1.17e+00 1.26e+01 H1 scatter 1.62e+00 \n",
"3 3 1.26e+01 1.36e+02 H1 scatter 1.83e+00 \n",
"4 3 1.36e+02 1.47e+03 H1 scatter 2.04e+00 \n",
"5 3 1.47e+03 1.59e+04 H1 scatter 2.11e+00 \n",
"6 3 1.59e+04 1.71e+05 H1 scatter 2.18e+00 \n",
"7 3 1.71e+05 1.85e+06 H1 scatter 2.01e+00 \n",
"8 3 1.85e+06 2.00e+07 H1 scatter 3.73e-01 \n",
"7 3 1.71e+05 1.85e+06 H1 scatter 1.98e+00 \n",
"8 3 1.85e+06 2.00e+07 H1 scatter 3.72e-01 \n",
"\n",
" std. dev. \n",
"0 2.52e-02 \n",
"1 6.75e-03 \n",
"2 1.14e-02 \n",
"3 9.59e-03 \n",
"4 9.95e-03 \n",
"5 1.11e-02 \n",
"6 1.36e-02 \n",
"7 9.22e-03 \n",
"8 2.90e-03 "
"0 3.76e-02 \n",
"1 1.20e-02 \n",
"2 1.19e-02 \n",
"3 1.23e-02 \n",
"4 1.30e-02 \n",
"5 1.28e-02 \n",
"6 1.42e-02 \n",
"7 1.29e-02 \n",
"8 3.69e-03 "
]
},
"execution_count": 35,
@ -1728,6 +1732,16 @@
" filters=[openmc.CellFilter], filter_bins=[(moderator_cell.id,)])\n",
"slice_test.get_pandas_dataframe()"
]
},
{
"cell_type": "code",
"execution_count": 36,
"metadata": {},
"outputs": [],
"source": [
"# Close the statepoint file as a matter of best practice\n",
"sp.close()"
]
}
],
"metadata": {
@ -1746,7 +1760,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.3"
"version": "3.7.3"
}
},
"nbformat": 4,

View file

@ -153,9 +153,7 @@ class StatePoint:
return self
def __exit__(self, *exc):
self._f.close()
if self._summary is not None:
self._summary._f.close()
self.close()
@property
def cmfd_on(self):
@ -490,6 +488,14 @@ class StatePoint:
for tally_id in self.tallies:
self.tallies[tally_id].sparse = self.sparse
def close(self):
"""Close the statepoint HDF5 file and the corresponding
summary HDF5 file if present.
"""
self._f.close()
if self._summary is not None:
self._summary._f.close()
def add_volume_information(self, volume_calc):
"""Add volume information to the geometry within the file