Merge remote-tracking branch 'upstream/develop' into diff_tally6

This commit is contained in:
Sterling Harper 2016-10-10 22:38:11 -04:00
commit 24b96ba354
45 changed files with 2156 additions and 1428 deletions

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

@ -338,7 +338,7 @@
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAPoAAAD6AgMAAAD1grKuAAAABGdBTUEAALGPC/xhBQAAACBjSFJN\nAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAADFBMVEX///9yEhLpgJFNv8Tq\nQYT7AAAAAWJLR0QAiAUdSAAAAAd0SU1FB+AJAwQmKDRX/78AAALKSURBVGje7dpLcqQwDAbgHHE2\nYeEj+D4cwQucBUfo+3CEXoSp8OhuhF70T4qpKXmdr21LogK2Pj7A8QmNP+HDhw8fPnz48Kf6VH9G\n+66vy+je8k19jnf8C5dXIPv86ms56lPdjvaYbyodx3ze+XLE76cXFiD4zPji99z0/AJ4n1lfvJ6f\nnl0A6x+578efMSg1wPr172/jPO5yFXM+Ef78gdblM+WPHyguP//t1/g6pA0wfln+ho/fwgYYn19C\n/xwDvwHGc9OvC+hs37DTrwuwfWanXxdQTC9Mvyygs3wjTL8uwPJpn/tNDbSGz7T0SBEWw4vLXzbQ\n6b6RoveIoO6TvPxlA63qs7z8ZQPF9F+SH22vbX8OQKf5Rtv+EgDNJ3X58wZaxWd1+fMGiuFvir8b\nvjp8J/tGy/6jAmRvhW8fwL3vVT+o3grfPoB7r/IpALI3tz8FoJN84/NV873hB8UnM3xzANtf8nb4\ndwmg3grfFEDJO8JPE0i9Ff4pAYL3pI8mkHor/HMCeO9JH00g9SafEsh7T/ppARBvp48UwJnelT5S\nACd7O31TAlnvKx9SQCd7B58KgPO+8iMFuPWe9E8F8BveWX7bAjzX9y4//Jve+fhsH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TvPxlA63qs7z8ZQPF9F+SH22vbX8OQKf5Rtv+EgDNJ3X58wZaxWd1+fMGiuFvir8b\nvjp8J/tGy/6jAmRvhW8fwL3vVT+o3grfPoB7r/IpALI3tz8FoJN84/NV873hB8UnM3xzANtf8nb4\ndwmg3grfFEDJO8JPE0i9Ff4pAYL3pI8mkHor/HMCeO9JH00g9SafEsh7T/ppARBvp48UwJnelT5S\nACd7O31TAlnvKx9SQCd7B58KgPO+8iMFuPWe9E8F8BveWX7bAjzX9y4//Jve+fhsH6Ctv7n8PTzj\nvY/v9gEOHz58+PBX+6v/f/wPvnd54f3j6venE/yl769Xv7+j3x/o98/V32/o9+fl389Xnx+g5x/o\n+Qt6/oOeP6HnX+j5G3z+h54/ouefV5/foufP6Pk3ev4On/+j9w/o/Qd6/4Le/6D3T/D9V67Y/ZsV\nQBq+s+8f0ftP+P41axXguP9NWgDuu/Cdfv+N3r/D9/9TAID+A7T/Ae2/gPs/0P4TtP8F7r9J3AIO\n9P+g/Udw/9Oygbf7r9D+L7j/DO1/Q/vv4P4/tP8Q7n9E+y/h/k+0/xTuf4X7b+H+X7T/+BPuf3aM\n8OHDhw8fPnz4w/4vzcvgeY10sY0AAAAldEVYdGRhdGU6Y3JlYXRlADIwMTYtMDktMjlUMjM6NTg6\nNTItMDQ6MDBn7ClZAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDE2LTA5LTI5VDIzOjU4OjUyLTA0OjAw\nFrGR5QAAAABJRU5ErkJggg==\n",
"text/plain": [
"<IPython.core.display.Image object>"
]
@ -386,18 +386,18 @@
"# Create Tallies to compute microscopic multi-group cross-sections\n",
"\n",
"# Instantiate energy filter for multi-group cross-section Tallies\n",
"energy_filter = openmc.Filter(type='energy', bins=[0., 0.625e-6, 20.])\n",
"energy_filter = openmc.EnergyFilter([0., 0.625e-6, 20.])\n",
"\n",
"# Instantiate flux Tally in moderator and fuel\n",
"tally = openmc.Tally(name='flux')\n",
"tally.filters = [openmc.Filter(type='cell', bins=[fuel_cell.id, moderator_cell.id])]\n",
"tally.filters = [openmc.CellFilter([fuel_cell.id, moderator_cell.id])]\n",
"tally.filters.append(energy_filter)\n",
"tally.scores = ['flux']\n",
"tallies_file.append(tally)\n",
"\n",
"# Instantiate reaction rate Tally in fuel\n",
"tally = openmc.Tally(name='fuel rxn rates')\n",
"tally.filters = [openmc.Filter(type='cell', bins=[fuel_cell.id])]\n",
"tally.filters = [openmc.CellFilter([fuel_cell.id])]\n",
"tally.filters.append(energy_filter)\n",
"tally.scores = ['nu-fission', 'scatter']\n",
"tally.nuclides = [u238, u235]\n",
@ -405,7 +405,7 @@
"\n",
"# Instantiate reaction rate Tally in moderator\n",
"tally = openmc.Tally(name='moderator rxn rates')\n",
"tally.filters = [openmc.Filter(type='cell', bins=[moderator_cell.id])]\n",
"tally.filters = [openmc.CellFilter([moderator_cell.id])]\n",
"tally.filters.append(energy_filter)\n",
"tally.scores = ['absorption', 'total']\n",
"tally.nuclides = [o16, h1]\n",
@ -417,8 +417,7 @@
"mesh.dimension = [1, 1, 1]\n",
"mesh.lower_left = [-0.63, -0.63, -100.]\n",
"mesh.width = [1.26, 1.26, 200.]\n",
"mesh_filter = openmc.Filter(type='mesh', bins=[mesh.id])\n",
"mesh_filter.mesh = mesh\n",
"mesh_filter = openmc.MeshFilter(mesh)\n",
"\n",
"# Instantiate thermal, fast, and total leakage tallies\n",
"leak = openmc.Tally(name='leakage')\n",
@ -427,12 +426,12 @@
"tallies_file.append(leak)\n",
"\n",
"thermal_leak = openmc.Tally(name='thermal leakage')\n",
"thermal_leak.filters = [mesh_filter, openmc.Filter(type='energy', bins=[0., 0.625e-6])]\n",
"thermal_leak.filters = [mesh_filter, openmc.EnergyFilter([0., 0.625e-6])]\n",
"thermal_leak.scores = ['current']\n",
"tallies_file.append(thermal_leak)\n",
"\n",
"fast_leak = openmc.Tally(name='fast leakage')\n",
"fast_leak.filters = [mesh_filter, openmc.Filter(type='energy', bins=[0.625e-6, 20.])]\n",
"fast_leak.filters = [mesh_filter, openmc.EnergyFilter([0.625e-6, 20.])]\n",
"fast_leak.scores = ['current']\n",
"tallies_file.append(fast_leak)"
]
@ -464,7 +463,7 @@
"# Resonance Escape Probability tallies\n",
"therm_abs_rate = openmc.Tally(name='therm. abs. rate')\n",
"therm_abs_rate.scores = ['absorption']\n",
"therm_abs_rate.filters = [openmc.Filter(type='energy', bins=[0., 0.625e-6])]\n",
"therm_abs_rate.filters = [openmc.EnergyFilter([0., 0.625e-6])]\n",
"tallies_file.append(therm_abs_rate)"
]
},
@ -479,8 +478,8 @@
"# Thermal Flux Utilization tallies\n",
"fuel_therm_abs_rate = openmc.Tally(name='fuel therm. abs. rate')\n",
"fuel_therm_abs_rate.scores = ['absorption']\n",
"fuel_therm_abs_rate.filters = [openmc.Filter(type='energy', bins=[0., 0.625e-6]),\n",
" openmc.Filter(type='cell', bins=[fuel_cell.id])]\n",
"fuel_therm_abs_rate.filters = [openmc.EnergyFilter([0., 0.625e-6]),\n",
" openmc.CellFilter([fuel_cell.id])]\n",
"tallies_file.append(fuel_therm_abs_rate)"
]
},
@ -495,7 +494,7 @@
"# Fast Fission Factor tallies\n",
"therm_fiss_rate = openmc.Tally(name='therm. fiss. rate')\n",
"therm_fiss_rate.scores = ['nu-fission']\n",
"therm_fiss_rate.filters = [openmc.Filter(type='energy', bins=[0., 0.625e-6])]\n",
"therm_fiss_rate.filters = [openmc.EnergyFilter([0., 0.625e-6])]\n",
"tallies_file.append(therm_fiss_rate)"
]
},
@ -508,11 +507,11 @@
"outputs": [],
"source": [
"# Instantiate energy filter to illustrate Tally slicing\n",
"fine_energy_filter = openmc.Filter(type='energy', bins=np.logspace(np.log10(1e-8), np.log10(20), 10))\n",
"fine_energy_filter = openmc.EnergyFilter(np.logspace(np.log10(1e-8), np.log10(20), 10))\n",
"\n",
"# Instantiate flux Tally in moderator and fuel\n",
"tally = openmc.Tally(name='need-to-slice')\n",
"tally.filters = [openmc.Filter(type='cell', bins=[fuel_cell.id, moderator_cell.id])]\n",
"tally.filters = [openmc.CellFilter(bins=[fuel_cell.id, moderator_cell.id])]\n",
"tally.filters.append(fine_energy_filter)\n",
"tally.scores = ['nu-fission', 'scatter']\n",
"tally.nuclides = [h1, u238]\n",
@ -550,7 +549,6 @@
"name": "stdout",
"output_type": "stream",
"text": [
"rm: cannot remove 'statepoint.*': No such file or directory\n",
"\n",
" %%%%%%%%%%%%%%%\n",
" %%%%%%%%%%%%%%%%%%%%%%%%\n",
@ -580,9 +578,9 @@
" Copyright | 2011-2016 Massachusetts Institute of Technology\n",
" License | http://openmc.readthedocs.io/en/latest/license.html\n",
" Version | 0.8.0\n",
" Git SHA1 | 623b705a399f16c8e5063732bc6e6a357611542d\n",
" Date/Time | 2016-09-03 04:38:41\n",
" OpenMP Threads | 4\n",
" Git SHA1 | b02fa21928a37a2254bec13c9802ff8173b6aefd\n",
" Date/Time | 2016-09-29 23:59:21\n",
" MPI Processes | 1\n",
"\n",
" ===========================================================================\n",
" ========================> INITIALIZATION <=========================\n",
@ -592,12 +590,12 @@
" Reading geometry XML file...\n",
" Reading cross sections XML file...\n",
" Reading materials XML file...\n",
" Reading U235 from /opt/xsdata/nndc_new/U235.h5\n",
" Reading U238 from /opt/xsdata/nndc_new/U238.h5\n",
" Reading O16 from /opt/xsdata/nndc_new/O16.h5\n",
" Reading H1 from /opt/xsdata/nndc_new/H1.h5\n",
" Reading B10 from /opt/xsdata/nndc_new/B10.h5\n",
" Reading Zr90 from /opt/xsdata/nndc_new/Zr90.h5\n",
" Reading U235 from /home/smharper/openmc/data/nndc_hdf5/U235.h5\n",
" Reading U238 from /home/smharper/openmc/data/nndc_hdf5/U238.h5\n",
" Reading O16 from /home/smharper/openmc/data/nndc_hdf5/O16.h5\n",
" Reading H1 from /home/smharper/openmc/data/nndc_hdf5/H1.h5\n",
" Reading B10 from /home/smharper/openmc/data/nndc_hdf5/B10.h5\n",
" Reading Zr90 from /home/smharper/openmc/data/nndc_hdf5/Zr90.h5\n",
" Maximum neutron transport energy: 20.0000 MeV for U235\n",
" Reading tallies XML file...\n",
" Building neighboring cells lists for each surface...\n",
@ -638,20 +636,20 @@
"\n",
" =======================> TIMING STATISTICS <=======================\n",
"\n",
" Total time for initialization = 3.8900E-01 seconds\n",
" Reading cross sections = 2.7000E-01 seconds\n",
" Total time in simulation = 4.6960E+00 seconds\n",
" Time in transport only = 4.6760E+00 seconds\n",
" Time in inactive batches = 6.6400E-01 seconds\n",
" Time in active batches = 4.0320E+00 seconds\n",
" Total time for initialization = 2.9900E-01 seconds\n",
" Reading cross sections = 1.8000E-01 seconds\n",
" Total time in simulation = 1.6156E+01 seconds\n",
" Time in transport only = 1.6145E+01 seconds\n",
" Time in inactive batches = 2.3940E+00 seconds\n",
" Time in active batches = 1.3762E+01 seconds\n",
" Time synchronizing fission bank = 1.0000E-03 seconds\n",
" Sampling source sites = 1.0000E-03 seconds\n",
" SEND/RECV source sites = 0.0000E+00 seconds\n",
" Time accumulating tallies = 0.0000E+00 seconds\n",
" Total time for finalization = 1.0000E-03 seconds\n",
" Total time elapsed = 5.0960E+00 seconds\n",
" Calculation Rate (inactive) = 18825.3 neutrons/second\n",
" Calculation Rate (active) = 9300.60 neutrons/second\n",
" Total time elapsed = 1.6476E+01 seconds\n",
" Calculation Rate (inactive) = 5221.39 neutrons/second\n",
" Calculation Rate (active) = 2724.89 neutrons/second\n",
"\n",
" ============================> RESULTS <============================\n",
"\n",
@ -768,8 +766,8 @@
"\n",
"# Get the leakage tally\n",
"leak = sp.get_tally(name='leakage')\n",
"leak = leak.summation(filter_type='surface', remove_filter=True)\n",
"leak = leak.summation(filter_type='mesh', remove_filter=True)\n",
"leak = leak.summation(filter_type=openmc.SurfaceFilter, remove_filter=True)\n",
"leak = leak.summation(filter_type=openmc.MeshFilter, remove_filter=True)\n",
"\n",
"# Compute k-infinity using tally arithmetic\n",
"keff = fiss_rate / (abs_rate + leak)\n",
@ -839,8 +837,8 @@
"# Compute resonance escape probability using tally arithmetic\n",
"therm_abs_rate = sp.get_tally(name='therm. abs. rate')\n",
"thermal_leak = sp.get_tally(name='thermal leakage')\n",
"thermal_leak = thermal_leak.summation(filter_type='surface', remove_filter=True)\n",
"thermal_leak = thermal_leak.summation(filter_type='mesh', remove_filter=True)\n",
"thermal_leak = thermal_leak.summation(filter_type=openmc.SurfaceFilter, remove_filter=True)\n",
"thermal_leak = thermal_leak.summation(filter_type=openmc.MeshFilter, remove_filter=True)\n",
"res_esc = (therm_abs_rate + thermal_leak) / (abs_rate + thermal_leak)\n",
"res_esc.get_pandas_dataframe()"
]
@ -1248,7 +1246,7 @@
"source": [
"# Compute microscopic multi-group cross-sections\n",
"flux = sp.get_tally(name='flux')\n",
"flux = flux.get_slice(filters=['cell'], filter_bins=[(fuel_cell.id,)])\n",
"flux = flux.get_slice(filters=[openmc.CellFilter], filter_bins=[(fuel_cell.id,)])\n",
"fuel_rxn_rates = sp.get_tally(name='fuel rxn rates')\n",
"mod_rxn_rates = sp.get_tally(name='moderator rxn rates')"
]
@ -1475,7 +1473,7 @@
],
"source": [
"# Show how to use Tally.get_values(...) with a CrossFilter and CrossScore\n",
"fast_scatter_xs = fuel_xs.get_values(filters=['energy'], \n",
"fast_scatter_xs = fuel_xs.get_values(filters=[openmc.EnergyFilter], \n",
" filter_bins=[((0.625e-6, 20.),)], \n",
" scores=['(scatter / flux)'])\n",
"print(fast_scatter_xs)"
@ -1734,9 +1732,18 @@
"# \"Slice\" the H-1 scatter data in the moderator Cell into a new derived Tally\n",
"need_to_slice = sp.get_tally(name='need-to-slice')\n",
"slice_test = need_to_slice.get_slice(scores=['scatter'], nuclides=['H1'],\n",
" filters=['cell'], filter_bins=[(moderator_cell.id,)])\n",
" filters=[openmc.CellFilter], filter_bins=[(moderator_cell.id,)])\n",
"slice_test.get_pandas_dataframe()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {

View file

@ -133,7 +133,19 @@ Constructing Tallies
:nosignatures:
:template: myclass.rst
openmc.Filter
openmc.UniverseFilter
openmc.MaterialFilter
openmc.CellFilter
openmc.CellbornFilter
openmc.SurfaceFilter
openmc.MeshFilter
openmc.EnergyFilter
openmc.EnergyoutFilter
openmc.MuFilter
openmc.PolarFilter
openmc.AzimuthalFilter
openmc.DistribcellFilter
openmc.DelayedGroupFilter
openmc.Mesh
openmc.Trigger
openmc.Tally

View file

@ -292,8 +292,8 @@ OpenMC can use it for on-the-fly Doppler-broadening of resolved resonance range
cross sections. If this element is absent from the settings.xml file, the
:envvar:`OPENMC_MULTIPOLE_LIBRARY` environment variable will be used.
.. note:: The :ref:`temperature_method` must also be set to "multipole" for
windowed multipole functionality.
.. note:: The <temperature_multipole> element must also be set to "true" for
windowed multipole functionality.
``<max_order>`` Element
---------------------------
@ -725,19 +725,29 @@ a material default temperature.
``<temperature_method>`` Element
--------------------------------
The ``<temperature_method>`` element has an accepted value of "nearest",
"interpolation", or "multipole". A value of "nearest" indicates that for each
The ``<temperature_method>`` element has an accepted value of "nearest" or
"interpolation". A value of "nearest" indicates that for each
cell, the nearest temperature at which cross sections are given is to be
applied, within a given tolerance (see :ref:`temperature_tolerance`). A value of
"interpolation" indicates that cross sections are to be linear-linear
interpolated between temperatures at which nuclear data are present (see
:ref:`temperature_treatment`). A value of "multipole" indicates that the
windowed multipole method should be used to evaluate temperature-dependent cross
sections in the resolved resonance range (a :ref:`windowed multipole library
<multipole_library>` must also be available).
:ref:`temperature_treatment`).
*Default*: "nearest"
.. _temperature_multipole:
``<temperature_multipole>`` Element
-----------------------------------
The ``<temperature_multipole>`` element toggles the windowed multipole
capability on or off. If this element is set to "True" and the relevant data is
available, OpenMC will use the windowed multipole method to evaluate and Doppler
broaden cross sections in the resolved resonance range. This override other
methods like "nearest" and "interpolation" in the resolved resonance range.
*Default*: False
.. _temperature_tolerance:
``<temperature_tolerance>`` Element
@ -850,17 +860,6 @@ problem. It has the following attributes/sub-elements:
*Default*: None
``<use_windowed_multipole>`` Element
------------------------------------
The ``<use_windowed_multipole>`` element toggles the windowed multipole
capability on or off. If this element is set to "True" and the relevant data is
available, OpenMC will use the windowed multipole method to evaluate and Doppler
broaden cross sections in the resolved resonance range.
*Default*: False
``<verbosity>`` Element
-----------------------