mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Improved docs for Tally.get_slice(...) and fixed bug with redundant energy filter bins in sliced tallies
This commit is contained in:
parent
263266f4f8
commit
9d7dbdb7d7
3 changed files with 87 additions and 964 deletions
File diff suppressed because one or more lines are too long
|
|
@ -1452,7 +1452,6 @@
|
|||
],
|
||||
"source": [
|
||||
"# Generate tracks for OpenMOC\n",
|
||||
"openmoc_geometry.initializeFlatSourceRegions()\n",
|
||||
"track_generator = openmoc.TrackGenerator(openmoc_geometry, num_azim=32, spacing=0.1)\n",
|
||||
"track_generator.generateTracks()\n",
|
||||
"\n",
|
||||
|
|
@ -1638,7 +1637,7 @@
|
|||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython2",
|
||||
"version": "2.7.10"
|
||||
"version": "2.7.6"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -1003,16 +1003,17 @@ class Tally(object):
|
|||
A list of filter type strings
|
||||
(e.g., ['mesh', 'energy']; default is [])
|
||||
filter_bins : list of Iterables
|
||||
A list of the filter bins corresponding to the filter_types
|
||||
parameter (e.g., [(1,), (0., 0.625e-6)]; default is []). Each bin
|
||||
in the list is the integer ID for 'material', 'surface', 'cell',
|
||||
'cellborn', and 'universe' Filters. Each bin is an integer for the
|
||||
cell instance ID for 'distribcell' Filters. Each bin is a 2-tuple of
|
||||
floats for 'energy' and 'energyout' filters corresponding to the
|
||||
energy boundaries of the bin of interest. The bin is a (x,y,z)
|
||||
3-tuple for 'mesh' filters corresponding to the mesh cell of
|
||||
interest. The order of the bins in the list must correspond to the
|
||||
filter_types parameter.
|
||||
A list of tuples of filter bins corresponding to the filter_types
|
||||
parameter (e.g., [(1,), ((0., 0.625e-6),)]; default is []). Each
|
||||
tuple contains bins for the corresponding filter type in the filters
|
||||
parameter. Each bins is the integer ID for 'material', 'surface',
|
||||
'cell', 'cellborn', and 'universe' Filters. Each bin is an integer
|
||||
for the cell instance ID for 'distribcell' Filters. Each bin is a
|
||||
2-tuple of floats for 'energy' and 'energyout' filters corresponding
|
||||
to the energy boundaries of the bin of interest. The bin is an
|
||||
(x,y,z) 3-tuple for 'mesh' filters corresponding to the mesh cell
|
||||
of interest. The order of the bins in the list must correspond to
|
||||
the filter_types parameter.
|
||||
|
||||
Returns
|
||||
-------
|
||||
|
|
@ -1174,16 +1175,17 @@ class Tally(object):
|
|||
A list of filter type strings
|
||||
(e.g., ['mesh', 'energy']; default is [])
|
||||
filter_bins : list of Iterables
|
||||
A list of the filter bins corresponding to the filter_types
|
||||
parameter (e.g., [(1,), (0., 0.625e-6)]; default is []). Each bin
|
||||
in the list is the integer ID for 'material', 'surface', 'cell',
|
||||
'cellborn', and 'universe' Filters. Each bin is an integer for the
|
||||
cell instance ID for 'distribcell' Filters. Each bin is a 2-tuple of
|
||||
floats for 'energy' and 'energyout' filters corresponding to the
|
||||
energy boundaries of the bin of interest. The bin is a (x,y,z)
|
||||
3-tuple for 'mesh' filters corresponding to the mesh cell of
|
||||
interest. The order of the bins in the list must correspond to the
|
||||
filter_types parameter.
|
||||
A list of tuples of filter bins corresponding to the filter_types
|
||||
parameter (e.g., [(1,), ((0., 0.625e-6),)]; default is []). Each
|
||||
tuple contains bins for the corresponding filter type in the filters
|
||||
parameter. Each bins is the integer ID for 'material', 'surface',
|
||||
'cell', 'cellborn', and 'universe' Filters. Each bin is an integer
|
||||
for the cell instance ID for 'distribcell' Filters. Each bin is a
|
||||
2-tuple of floats for 'energy' and 'energyout' filters corresponding
|
||||
to the energy boundaries of the bin of interest. The bin is an
|
||||
(x,y,z) 3-tuple for 'mesh' filters corresponding to the mesh cell
|
||||
of interest. The order of the bins in the list must correspond to
|
||||
the filter_types parameter.
|
||||
nuclides : list of str
|
||||
A list of nuclide name strings
|
||||
(e.g., ['U-235', 'U-238']; default is [])
|
||||
|
|
@ -2641,16 +2643,17 @@ class Tally(object):
|
|||
A list of filter type strings
|
||||
(e.g., ['mesh', 'energy']; default is [])
|
||||
filter_bins : list of Iterables
|
||||
A list of the filter bins corresponding to the filter_types
|
||||
parameter (e.g., [(1,), (0., 0.625e-6)]; default is []). Each bin
|
||||
in the list is the integer ID for 'material', 'surface', 'cell',
|
||||
'cellborn', and 'universe' Filters. Each bin is an integer for the
|
||||
cell instance ID for 'distribcell' Filters. Each bin is a 2-tuple of
|
||||
floats for 'energy' and 'energyout' filters corresponding to the
|
||||
energy boundaries of the bin of interest. The bin is a (x,y,z)
|
||||
3-tuple for 'mesh' filters corresponding to the mesh cell of
|
||||
interest. The order of the bins in the list must correspond to the
|
||||
filter_types parameter.
|
||||
A list of tuples of filter bins corresponding to the filter_types
|
||||
parameter (e.g., [(1,), ((0., 0.625e-6),)]; default is []). Each
|
||||
tuple contains bins to slice for the corresponding filter type in
|
||||
the filters parameter. Each bins is the integer ID for 'material',
|
||||
'surface', 'cell', 'cellborn', and 'universe' Filters. Each bin is
|
||||
an integer for the cell instance ID for 'distribcell' Filters. Each
|
||||
bin is a 2-tuple of floats for 'energy' and 'energyout' filters
|
||||
corresponding to the energy boundaries of the bin of interest. The
|
||||
bin is an (x,y,z) 3-tuple for 'mesh' filters corresponding to the
|
||||
mesh cell of interest. The order of the bins in the list must
|
||||
correspond to the filter_types parameter.
|
||||
nuclides : list of str
|
||||
A list of nuclide name strings
|
||||
(e.g., ['U-235', 'U-238']; default is [])
|
||||
|
|
@ -2736,6 +2739,7 @@ class Tally(object):
|
|||
for filter_bin in filter_bins[i]:
|
||||
bin_index = find_filter.get_bin_index(filter_bin)
|
||||
if filter_type in ['energy', 'energyout']:
|
||||
bin_indices.extend([bin_index])
|
||||
bin_indices.extend([bin_index, bin_index+1])
|
||||
num_bins += 1
|
||||
elif filter_type == 'distribcell':
|
||||
|
|
@ -2745,7 +2749,7 @@ class Tally(object):
|
|||
bin_indices.append(bin_index)
|
||||
num_bins += 1
|
||||
|
||||
find_filter.bins = find_filter.bins[bin_indices]
|
||||
find_filter.bins = set(find_filter.bins[bin_indices])
|
||||
find_filter.num_bins = num_bins
|
||||
|
||||
# Update the new tally's filter strides
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue