mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-26 13:15:39 -04:00
removed DelayedGroups and addressed PR comments
This commit is contained in:
parent
ad9fe27d26
commit
cdca6f3e1a
17 changed files with 431 additions and 506 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,4 @@
|
|||
from openmc.mgxs.groups import EnergyGroups, DelayedGroups
|
||||
from openmc.mgxs.groups import EnergyGroups
|
||||
from openmc.mgxs.library import Library
|
||||
from openmc.mgxs.mgxs import *
|
||||
from openmc.mgxs.mdgxs import *
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from collections import Iterable
|
||||
from numbers import Real, Integral
|
||||
from numbers import Real
|
||||
import copy
|
||||
import sys
|
||||
|
||||
|
|
@ -11,10 +11,6 @@ import openmc.checkvalue as cv
|
|||
if sys.version_info[0] >= 3:
|
||||
basestring = str
|
||||
|
||||
# Maximum number of delayed groups
|
||||
# TODO: Get value from OpenMC
|
||||
MAX_DELAYED_GROUPS = 8
|
||||
|
||||
|
||||
class EnergyGroups(object):
|
||||
"""An energy groups structure used for multi-group cross-sections.
|
||||
|
|
@ -303,127 +299,3 @@ class EnergyGroups(object):
|
|||
# Assign merged edges to merged groups
|
||||
merged_groups.group_edges = list(merged_edges)
|
||||
return merged_groups
|
||||
|
||||
|
||||
class DelayedGroups(object):
|
||||
"""A delayed groups structure used for multi-delayed-group parameters.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
groups : Iterable of Int
|
||||
The delayed groups
|
||||
|
||||
Attributes
|
||||
----------
|
||||
groups : Iterable of Int
|
||||
The delayed groups
|
||||
num_groups : int
|
||||
The number of delayed groups
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, groups=None):
|
||||
self._groups = None
|
||||
|
||||
if groups is not None:
|
||||
self.groups = groups
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
existing = memo.get(id(self))
|
||||
|
||||
# If this is the first time we have tried to copy object, create copy
|
||||
if existing is None:
|
||||
clone = type(self).__new__(type(self))
|
||||
clone._groups = copy.deepcopy(self.groups, memo)
|
||||
|
||||
memo[id(self)] = clone
|
||||
|
||||
return clone
|
||||
|
||||
# If this object has been copied before, return the first copy made
|
||||
else:
|
||||
return existing
|
||||
|
||||
def __eq__(self, other):
|
||||
if not isinstance(other, DelayedGroups):
|
||||
return False
|
||||
elif self.num_groups != other.num_groups:
|
||||
return False
|
||||
elif np.allclose(self.groups, other.groups):
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def __ne__(self, other):
|
||||
return not self == other
|
||||
|
||||
def __hash__(self):
|
||||
return hash(tuple(self.groups))
|
||||
|
||||
@property
|
||||
def groups(self):
|
||||
return self._groups
|
||||
|
||||
@property
|
||||
def num_groups(self):
|
||||
return len(self.groups)
|
||||
|
||||
@groups.setter
|
||||
def groups(self, groups):
|
||||
cv.check_type('groups', groups, Iterable, Integral)
|
||||
cv.check_greater_than('number of delayed groups', len(groups), 0)
|
||||
|
||||
# Check that the groups are within [1, MAX_DELAYED_GROUPS]
|
||||
for group in groups:
|
||||
cv.check_greater_than('delayed group', group, 0)
|
||||
cv.check_less_than('delayed group', group, MAX_DELAYED_GROUPS,
|
||||
equality=True)
|
||||
|
||||
self._groups = np.asarray(groups, dtype=int)
|
||||
|
||||
def can_merge(self, other):
|
||||
"""Determine if delayed groups can be merged with another.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
other : openmc.mgxs.DelayedGroups
|
||||
DelayedGroups to compare with
|
||||
|
||||
Returns
|
||||
-------
|
||||
bool
|
||||
Whether the delayed groups can be merged
|
||||
|
||||
"""
|
||||
|
||||
return isinstance(other, DelayedGroups)
|
||||
|
||||
def merge(self, other):
|
||||
"""Merge this delayed groups with another.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
other : openmc.mgxs.DelayedGroups
|
||||
DelayedGroups to merge with
|
||||
|
||||
Returns
|
||||
-------
|
||||
merged_groups : openmc.mgxs.DelayedGroups
|
||||
DelayedGroups resulting from the merge
|
||||
|
||||
"""
|
||||
|
||||
if not self.can_merge(other):
|
||||
raise ValueError('Unable to merge delayed groups')
|
||||
|
||||
# Create deep copy to return as merged delayed groups
|
||||
merged_groups = copy.deepcopy(self)
|
||||
|
||||
# Merge unique filter bins
|
||||
groups = np.concatenate((self.groups, other.groups))
|
||||
groups = np.unique(groups)
|
||||
groups.sort()
|
||||
|
||||
# Assign groups to merged groups
|
||||
merged_groups.groups = list(groups)
|
||||
return merged_groups
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class Library(object):
|
|||
The highest legendre moment in the scattering matrices (default is 0)
|
||||
energy_groups : openmc.mgxs.EnergyGroups
|
||||
Energy group structure for energy condensation
|
||||
delayed_groups : openmc.mgxs.DelayedGroups
|
||||
delayed_groups : list of int
|
||||
Delayed groups to filter out the xs
|
||||
tally_trigger : openmc.Trigger
|
||||
An (optional) tally precision trigger given to each tally used to
|
||||
|
|
@ -224,7 +224,7 @@ class Library(object):
|
|||
if self.delayed_groups == None:
|
||||
return 0
|
||||
else:
|
||||
return self.delayed_groups.num_groups
|
||||
return len(self.delayed_groups)
|
||||
|
||||
@property
|
||||
def all_mgxs(self):
|
||||
|
|
@ -327,8 +327,16 @@ class Library(object):
|
|||
|
||||
@delayed_groups.setter
|
||||
def delayed_groups(self, delayed_groups):
|
||||
cv.check_type('delayed groups', delayed_groups,
|
||||
openmc.mgxs.DelayedGroups)
|
||||
|
||||
cv.check_type('delayed groups', delayed_groups, list, int)
|
||||
cv.check_greater_than('num delayed groups', len(delayed_groups), 0)
|
||||
|
||||
# Check that the groups are within [1, MAX_DELAYED_GROUPS]
|
||||
for group in delayed_groups:
|
||||
cv.check_greater_than('delayed group', group, 0)
|
||||
cv.check_less_than('delayed group', group,
|
||||
openmc.mgxs.MAX_DELAYED_GROUPS, equality=True)
|
||||
|
||||
self._delayed_groups = delayed_groups
|
||||
|
||||
@correction.setter
|
||||
|
|
|
|||
|
|
@ -10,17 +10,22 @@ import abc
|
|||
|
||||
import numpy as np
|
||||
|
||||
from mgxs import MGXS, MGXS_TYPES, DOMAIN_TYPES, _DOMAINS
|
||||
from openmc.mgxs import EnergyGroups, DelayedGroups
|
||||
from openmc import Mesh
|
||||
import openmc
|
||||
import openmc.checkvalue as cv
|
||||
from openmc.mgxs.groups import EnergyGroups
|
||||
from openmc.mgxs.mgxs import MGXS, MGXS_TYPES, DOMAIN_TYPES, _DOMAINS
|
||||
|
||||
|
||||
# Supported cross section types
|
||||
MDGXS_TYPES = ['delayed-nu-fission',
|
||||
'chi-delayed',
|
||||
'beta']
|
||||
|
||||
# Maximum number of delayed groups, from src/constants.F90
|
||||
MAX_DELAYED_GROUPS = 8
|
||||
|
||||
|
||||
class MDGXS(MGXS):
|
||||
"""An abstract multi-delayed-group cross section for some energy and delayed
|
||||
group structures within some spatial domain.
|
||||
|
|
@ -45,7 +50,7 @@ class MDGXS(MGXS):
|
|||
name : str, optional
|
||||
Name of the multi-group cross section. Used as a label to identify
|
||||
tallies in OpenMC 'tallies.xml' file.
|
||||
delayed_groups : openmc.mgxs.DelayedGroups
|
||||
delayed_groups : list of int
|
||||
Delayed groups to filter out the xs
|
||||
|
||||
Attributes
|
||||
|
|
@ -62,7 +67,7 @@ class MDGXS(MGXS):
|
|||
Domain type for spatial homogenization
|
||||
energy_groups : openmc.mgxs.EnergyGroups
|
||||
Energy group structure for energy condensation
|
||||
delayed_groups : openmc.mgxs.DelayedGroups
|
||||
delayed_groups : list of int
|
||||
Delayed groups to filter out the xs
|
||||
tally_trigger : openmc.Trigger
|
||||
An (optional) tally precision trigger given to each tally used to
|
||||
|
|
@ -118,6 +123,7 @@ class MDGXS(MGXS):
|
|||
delayed_groups=None, by_nuclide=False, name=''):
|
||||
super(MDGXS, self).__init__(domain, domain_type, energy_groups,
|
||||
by_nuclide, name)
|
||||
|
||||
self._delayed_groups = None
|
||||
|
||||
if delayed_groups is not None:
|
||||
|
|
@ -164,12 +170,20 @@ class MDGXS(MGXS):
|
|||
if self.delayed_groups == None:
|
||||
return 0
|
||||
else:
|
||||
return self.delayed_groups.num_groups
|
||||
return len(self.delayed_groups)
|
||||
|
||||
@delayed_groups.setter
|
||||
def delayed_groups(self, delayed_groups):
|
||||
cv.check_type('delayed groups', delayed_groups,
|
||||
openmc.mgxs.DelayedGroups)
|
||||
|
||||
cv.check_type('delayed groups', delayed_groups, list, int)
|
||||
cv.check_greater_than('num delayed groups', len(delayed_groups), 0)
|
||||
|
||||
# Check that the groups are within [1, MAX_DELAYED_GROUPS]
|
||||
for group in delayed_groups:
|
||||
cv.check_greater_than('delayed group', group, 0)
|
||||
cv.check_less_than('delayed group', group, MAX_DELAYED_GROUPS,
|
||||
equality=True)
|
||||
|
||||
self._delayed_groups = delayed_groups
|
||||
|
||||
@property
|
||||
|
|
@ -180,8 +194,7 @@ class MDGXS(MGXS):
|
|||
energy_filter = openmc.Filter('energy', group_edges)
|
||||
|
||||
if self.delayed_groups != None:
|
||||
delayed_groups = self.delayed_groups.groups
|
||||
delayed_filter = openmc.Filter('delayedgroup', delayed_groups)
|
||||
delayed_filter = openmc.Filter('delayedgroup', self.delayed_groups)
|
||||
return [[energy_filter], [delayed_filter, energy_filter]]
|
||||
else:
|
||||
return [[energy_filter], [energy_filter]]
|
||||
|
|
@ -213,7 +226,7 @@ class MDGXS(MGXS):
|
|||
name : str, optional
|
||||
Name of the multi-group cross section. Used as a label to identify
|
||||
tallies in OpenMC 'tallies.xml' file. Defaults to the empty string.
|
||||
delayed_groups : openmc.mgxs.DelayedGroups
|
||||
delayed_groups : list of int
|
||||
Delayed groups to filter out the xs
|
||||
|
||||
Returns
|
||||
|
|
@ -268,7 +281,7 @@ class MDGXS(MGXS):
|
|||
Defaults to 'increasing'.
|
||||
value : {'mean', 'std_dev', 'rel_err'}
|
||||
A string for the type of value to return. Defaults to 'mean'.
|
||||
delayed_groups : Iterable of Integral or 'all'
|
||||
delayed_groups : list of int or 'all'
|
||||
Delayed groups of interest. Defaults to 'all'.
|
||||
|
||||
Returns
|
||||
|
|
@ -316,7 +329,7 @@ class MDGXS(MGXS):
|
|||
|
||||
# Construct list of delayed group tuples for all requested groups
|
||||
if not isinstance(delayed_groups, basestring):
|
||||
cv.check_iterable_type('delayed_groups', delayed_groups, Integral)
|
||||
cv.check_type('delayed groups', delayed_groups, list, int)
|
||||
for delayed_group in delayed_groups:
|
||||
filters.append('delayedgroup')
|
||||
filter_bins.append((delayed_group,))
|
||||
|
|
@ -402,7 +415,7 @@ class MDGXS(MGXS):
|
|||
|
||||
cv.check_iterable_type('nuclides', nuclides, basestring)
|
||||
cv.check_iterable_type('energy_groups', groups, Integral)
|
||||
cv.check_iterable_type('delayed_groups', delayed_groups, Integral)
|
||||
cv.check_type('delayed groups', delayed_groups, list, int)
|
||||
|
||||
# Build lists of filters and filter bins to slice
|
||||
filters = []
|
||||
|
|
@ -447,7 +460,7 @@ class MDGXS(MGXS):
|
|||
|
||||
# Assign sliced delayed group structure to sliced MDGXS
|
||||
if delayed_groups:
|
||||
slice_xs.delayed_groups.groups = delayed_groups
|
||||
slice_xs.delayed_groups = delayed_groups
|
||||
|
||||
# Assign sliced nuclides to sliced MGXS
|
||||
if nuclides:
|
||||
|
|
@ -456,28 +469,6 @@ class MDGXS(MGXS):
|
|||
slice_xs.sparse = self.sparse
|
||||
return slice_xs
|
||||
|
||||
def can_merge(self, other):
|
||||
"""Determine if another MDGXS can be merged with this one
|
||||
|
||||
If results have been loaded from a statepoint, then MGXS are only
|
||||
mergeable along one and only one of enegy groups or nuclides.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
other : openmc.mgxs.MGXS
|
||||
MGXS to check for merging
|
||||
|
||||
"""
|
||||
|
||||
can_merge = super(MDGXS, self).can_merge(other)
|
||||
|
||||
# Compare delayed groups
|
||||
if not self.delayed_groups.can_merge(other.delayed_groups):
|
||||
can_merge = False
|
||||
|
||||
# If all conditionals pass then MDGXS are mergeable
|
||||
return can_merge
|
||||
|
||||
def merge(self, other):
|
||||
"""Merge another MDGXS with this one
|
||||
|
||||
|
|
@ -502,9 +493,8 @@ class MDGXS(MGXS):
|
|||
|
||||
# Merge delayed groups
|
||||
if self.delayed_groups != other.delayed_groups:
|
||||
merged_delayed_groups = self.delayed_groups.merge(
|
||||
other.delayed_groups)
|
||||
merged_mdgxs.delayed_groups = merged_delayed_groups
|
||||
merged_mdgxs.delayed_groups = list(set(self.delayed_groups +
|
||||
other.delayed_groups))
|
||||
|
||||
return merged_mdgxs
|
||||
|
||||
|
|
@ -586,7 +576,7 @@ class MDGXS(MGXS):
|
|||
# Add the cross section header
|
||||
string += '{0: <16}\n'.format(xs_header)
|
||||
|
||||
for delayed_group in self.delayed_groups.groups:
|
||||
for delayed_group in self.delayed_groups:
|
||||
|
||||
template = '{0: <12}Delayed Group {1}:\t'
|
||||
string += template.format('', delayed_group)
|
||||
|
|
@ -635,7 +625,7 @@ class MDGXS(MGXS):
|
|||
xs_type: {'macro', 'micro'}
|
||||
Store the macro or micro cross section in units of cm^-1 or barns.
|
||||
Defaults to 'macro'.
|
||||
delayed_groups : Iterable of Integral or 'all'
|
||||
delayed_groups : list of int or 'all'
|
||||
Delayed groups of interest. Defaults to 'all'.
|
||||
|
||||
"""
|
||||
|
|
@ -715,7 +705,7 @@ class MDGXS(MGXS):
|
|||
The geometric information in the Summary object is embedded into
|
||||
a Multi-index column with a geometric "path" to each distribcell
|
||||
instance.
|
||||
delayed_groups : Iterable of Integral or 'all'
|
||||
delayed_groups : list of int or 'all'
|
||||
Delayed groups of interest. Defaults to 'all'.
|
||||
|
||||
Returns
|
||||
|
|
@ -731,112 +721,11 @@ class MDGXS(MGXS):
|
|||
|
||||
"""
|
||||
|
||||
if not isinstance(groups, basestring):
|
||||
cv.check_iterable_type('groups', groups, Integral)
|
||||
if nuclides != 'all' and nuclides != 'sum':
|
||||
cv.check_iterable_type('nuclides', nuclides, basestring)
|
||||
if not isinstance(delayed_groups, basestring):
|
||||
cv.check_iterable_type('delayed groups', delayed_groups, Integral)
|
||||
cv.check_type('delayed groups', delayed_groups, list, int)
|
||||
|
||||
cv.check_value('xs_type', xs_type, ['macro', 'micro'])
|
||||
|
||||
num_delayed_groups = 1
|
||||
if self.delayed_groups != None:
|
||||
num_delayed_groups = self.delayed_groups.num_groups
|
||||
|
||||
# Get a Pandas DataFrame from the derived xs tally
|
||||
if self.by_nuclide and nuclides == 'sum':
|
||||
|
||||
# Use tally summation to sum across all nuclides
|
||||
query_nuclides = self.get_all_nuclides()
|
||||
xs_tally = self.xs_tally.summation(nuclides=query_nuclides)
|
||||
df = xs_tally.get_pandas_dataframe(
|
||||
distribcell_paths=distribcell_paths)
|
||||
|
||||
# Remove nuclide column since it is homogeneous and redundant
|
||||
if self.domain_type == 'mesh':
|
||||
df.drop('nuclide', axis=1, level=0, inplace=True)
|
||||
else:
|
||||
df.drop('nuclide', axis=1, inplace=True)
|
||||
|
||||
# If the user requested a specific set of nuclides
|
||||
elif self.by_nuclide and nuclides != 'all':
|
||||
xs_tally = self.xs_tally.get_slice(nuclides=nuclides)
|
||||
df = xs_tally.get_pandas_dataframe(
|
||||
distribcell_paths=distribcell_paths)
|
||||
|
||||
# If the user requested all nuclides, keep nuclide column in dataframe
|
||||
else:
|
||||
df = self.xs_tally.get_pandas_dataframe(
|
||||
distribcell_paths=distribcell_paths)
|
||||
|
||||
# Remove the score column since it is homogeneous and redundant
|
||||
if self.domain_type == 'mesh':
|
||||
df = df.drop('score', axis=1, level=0)
|
||||
else:
|
||||
df = df.drop('score', axis=1)
|
||||
|
||||
# Override energy groups bounds with indices
|
||||
all_groups = np.arange(self.num_groups, 0, -1, dtype=np.int)
|
||||
all_groups = np.repeat(all_groups, self.num_nuclides)
|
||||
if 'energy low [MeV]' in df and 'energyout low [MeV]' in df:
|
||||
df.rename(columns={'energy low [MeV]': 'group in'},
|
||||
inplace=True)
|
||||
in_groups = np.tile(all_groups, self.num_subdomains * num_delayed_groups)
|
||||
in_groups = np.repeat(in_groups, df.shape[0] / in_groups.size)
|
||||
df['group in'] = in_groups
|
||||
del df['energy high [MeV]']
|
||||
|
||||
df.rename(columns={'energyout low [MeV]': 'group out'},
|
||||
inplace=True)
|
||||
out_groups = np.repeat(all_groups, self.xs_tally.num_scores)
|
||||
out_groups = np.tile(out_groups, df.shape[0] / out_groups.size * num_delayed_groups)
|
||||
df['group out'] = out_groups
|
||||
del df['energyout high [MeV]']
|
||||
columns = ['group in', 'group out']
|
||||
|
||||
elif 'energyout low [MeV]' in df:
|
||||
df.rename(columns={'energyout low [MeV]': 'group out'},
|
||||
inplace=True)
|
||||
in_groups = np.tile(all_groups, self.num_subdomains * num_delayed_groups)
|
||||
df['group out'] = in_groups
|
||||
del df['energyout high [MeV]']
|
||||
columns = ['group out']
|
||||
|
||||
elif 'energy low [MeV]' in df:
|
||||
df.rename(columns={'energy low [MeV]': 'group in'}, inplace=True)
|
||||
in_groups = np.tile(all_groups, self.num_subdomains * num_delayed_groups)
|
||||
df['group in'] = in_groups
|
||||
del df['energy high [MeV]']
|
||||
columns = ['group in']
|
||||
|
||||
# Select out those groups the user requested
|
||||
if not isinstance(groups, basestring):
|
||||
if 'group in' in df:
|
||||
df = df[df['group in'].isin(groups)]
|
||||
if 'group out' in df:
|
||||
df = df[df['group out'].isin(groups)]
|
||||
|
||||
# If user requested micro cross sections, divide out the atom densities
|
||||
if xs_type == 'micro':
|
||||
if self.by_nuclide:
|
||||
densities = self.get_nuclide_densities(nuclides)
|
||||
else:
|
||||
densities = self.get_nuclide_densities('sum')
|
||||
densities = np.repeat(densities, len(self.rxn_rate_tally.scores))
|
||||
tile_factor = df.shape[0] / len(densities)
|
||||
df['mean'] /= np.tile(densities, tile_factor)
|
||||
df['std. dev.'] /= np.tile(densities, tile_factor)
|
||||
|
||||
# Sort the dataframe by domain type id (e.g., distribcell id) and
|
||||
# energy groups such that data is from fast to thermal
|
||||
if self.domain_type == 'mesh':
|
||||
mesh_str = 'mesh {0}'.format(self.domain.id)
|
||||
df.sort_values(by=[(mesh_str, 'x'), (mesh_str, 'y'), \
|
||||
(mesh_str, 'z')] + columns, inplace=True)
|
||||
else:
|
||||
df.sort_values(by=[self.domain_type] + columns, inplace=True)
|
||||
return df
|
||||
df = super(MDGXS, self).get_pandas_dataframe(groups, nuclides, xs_type,
|
||||
distribcell_paths)
|
||||
|
||||
# Select out those delayed groups the user requested
|
||||
if not isinstance(delayed_groups, basestring):
|
||||
|
|
@ -890,7 +779,7 @@ class ChiDelayed(MDGXS):
|
|||
name : str, optional
|
||||
Name of the multi-group cross section. Used as a label to identify
|
||||
tallies in OpenMC 'tallies.xml' file.
|
||||
delayed_groups : openmc.mgxs.DelayedGroups
|
||||
delayed_groups : list of int
|
||||
Delayed groups to filter out the xs
|
||||
|
||||
Attributes
|
||||
|
|
@ -907,7 +796,7 @@ class ChiDelayed(MDGXS):
|
|||
Domain type for spatial homogenization
|
||||
energy_groups : openmc.mgxs.EnergyGroups
|
||||
Energy group structure for energy condensation
|
||||
delayed_groups : openmc.mgxs.DelayedGroups
|
||||
delayed_groups : list of int
|
||||
Delayed groups to filter out the xs
|
||||
tally_trigger : openmc.Trigger
|
||||
An (optional) tally precision trigger given to each tally used to
|
||||
|
|
@ -974,8 +863,7 @@ class ChiDelayed(MDGXS):
|
|||
energyout = openmc.Filter('energyout', group_edges)
|
||||
energyin = openmc.Filter('energy', [group_edges[0], group_edges[-1]])
|
||||
if self.delayed_groups != None:
|
||||
delayed_groups = self.delayed_groups.groups
|
||||
delayed_filter = openmc.Filter('delayedgroup', delayed_groups)
|
||||
delayed_filter = openmc.Filter('delayedgroup', self.delayed_groups)
|
||||
return [[delayed_filter, energyin], [delayed_filter, energyout]]
|
||||
else:
|
||||
return [[energyin], [energyout]]
|
||||
|
|
@ -1120,9 +1008,8 @@ class ChiDelayed(MDGXS):
|
|||
|
||||
# Merge delayed groups
|
||||
if self.delayed_groups != other.delayed_groups:
|
||||
merged_delayed_groups = self.delayed_groups.merge\
|
||||
(other.delayed_groups)
|
||||
merged_mdgxs.delayed_groups = merged_delayed_groups
|
||||
merged_mdgxs.delayed_groups = list(set(self.delayed_groups +
|
||||
other.delayed_groups))
|
||||
|
||||
# Merge nuclides
|
||||
if self.nuclides != other.nuclides:
|
||||
|
|
@ -1157,7 +1044,7 @@ class ChiDelayed(MDGXS):
|
|||
----------
|
||||
groups : Iterable of Integral or 'all'
|
||||
Energy groups of interest. Defaults to 'all'.
|
||||
delayed_groups : Iterable of Integral or 'all'
|
||||
delayed_groups : list of int or 'all'
|
||||
Delayed groups of interest. Defaults to 'all'.
|
||||
subdomains : Iterable of Integral or 'all'
|
||||
Subdomain IDs of interest. Defaults to 'all'.
|
||||
|
|
@ -1222,7 +1109,7 @@ class ChiDelayed(MDGXS):
|
|||
|
||||
# Construct list of delayed group tuples for all requested groups
|
||||
if not isinstance(delayed_groups, basestring):
|
||||
cv.check_iterable_type('delayed_groups', delayed_groups, Integral)
|
||||
cv.check_type('delayed groups', delayed_groups, list, int)
|
||||
for delayed_group in delayed_groups:
|
||||
filters.append('delayedgroup')
|
||||
filter_bins.append((delayed_group,))
|
||||
|
|
@ -1344,7 +1231,7 @@ class DelayedNuFissionXS(MDGXS):
|
|||
name : str, optional
|
||||
Name of the multi-group cross section. Used as a label to identify
|
||||
tallies in OpenMC 'tallies.xml' file.
|
||||
delayed_groups : openmc.mgxs.DelayedGroups
|
||||
delayed_groups : list of int
|
||||
Delayed groups to filter out the xs
|
||||
|
||||
Attributes
|
||||
|
|
@ -1361,7 +1248,7 @@ class DelayedNuFissionXS(MDGXS):
|
|||
Domain type for spatial homogenization
|
||||
energy_groups : openmc.mgxs.EnergyGroups
|
||||
Energy group structure for energy condensation
|
||||
delayed_groups : openmc.mgxs.DelayedGroups
|
||||
delayed_groups : list of int
|
||||
Delayed groups to filter out the xs
|
||||
tally_trigger : openmc.Trigger
|
||||
An (optional) tally precision trigger given to each tally used to
|
||||
|
|
@ -1463,7 +1350,7 @@ class Beta(MDGXS):
|
|||
name : str, optional
|
||||
Name of the multi-group cross section. Used as a label to identify
|
||||
tallies in OpenMC 'tallies.xml' file.
|
||||
delayed_groups : openmc.mgxs.DelayedGroups
|
||||
delayed_groups : list of int
|
||||
Delayed groups to filter out the xs
|
||||
|
||||
Attributes
|
||||
|
|
@ -1480,7 +1367,7 @@ class Beta(MDGXS):
|
|||
Domain type for spatial homogenization
|
||||
energy_groups : openmc.mgxs.EnergyGroups
|
||||
Energy group structure for energy condensation
|
||||
delayed_groups : openmc.mgxs.DelayedGroups
|
||||
delayed_groups : list of int
|
||||
Delayed groups to filter out the xs
|
||||
tally_trigger : openmc.Trigger
|
||||
An (optional) tally precision trigger given to each tally used to
|
||||
|
|
|
|||
|
|
@ -1517,15 +1517,14 @@ class MGXS(object):
|
|||
if 'energy low [MeV]' in df and 'energyout low [MeV]' in df:
|
||||
df.rename(columns={'energy low [MeV]': 'group in'},
|
||||
inplace=True)
|
||||
in_groups = np.tile(all_groups, self.num_subdomains)
|
||||
in_groups = np.tile(all_groups, df.shape[0] / all_groups.size)
|
||||
in_groups = np.repeat(in_groups, df.shape[0] / in_groups.size)
|
||||
df['group in'] = in_groups
|
||||
del df['energy high [MeV]']
|
||||
|
||||
df.rename(columns={'energyout low [MeV]': 'group out'},
|
||||
inplace=True)
|
||||
out_groups = np.repeat(all_groups, self.xs_tally.num_scores)
|
||||
out_groups = np.tile(out_groups, df.shape[0] / out_groups.size)
|
||||
out_groups = np.tile(all_groups, df.shape[0] / all_groups.size)
|
||||
df['group out'] = out_groups
|
||||
del df['energyout high [MeV]']
|
||||
columns = ['group in', 'group out']
|
||||
|
|
@ -1533,14 +1532,14 @@ class MGXS(object):
|
|||
elif 'energyout low [MeV]' in df:
|
||||
df.rename(columns={'energyout low [MeV]': 'group out'},
|
||||
inplace=True)
|
||||
in_groups = np.tile(all_groups, self.num_subdomains)
|
||||
in_groups = np.tile(all_groups, df.shape[0] / all_groups.size)
|
||||
df['group out'] = in_groups
|
||||
del df['energyout high [MeV]']
|
||||
columns = ['group out']
|
||||
|
||||
elif 'energy low [MeV]' in df:
|
||||
df.rename(columns={'energy low [MeV]': 'group in'}, inplace=True)
|
||||
in_groups = np.tile(all_groups, self.num_subdomains)
|
||||
in_groups = np.tile(all_groups, df.shape[0] / all_groups.size)
|
||||
df['group in'] = in_groups
|
||||
del df['energy high [MeV]']
|
||||
columns = ['group in']
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ import openmc
|
|||
from openmc.source import Source
|
||||
from openmc.stats import Box
|
||||
|
||||
import numpy as np
|
||||
|
||||
class InputSet(object):
|
||||
def __init__(self):
|
||||
|
|
@ -673,6 +674,158 @@ class PinCellInputSet(object):
|
|||
self.plots.add_plot(plot)
|
||||
|
||||
|
||||
class AssemblyInputSet(object):
|
||||
def __init__(self):
|
||||
self.settings = openmc.Settings()
|
||||
self.materials = openmc.Materials()
|
||||
self.geometry = openmc.Geometry()
|
||||
self.tallies = None
|
||||
self.plots = None
|
||||
|
||||
def export(self):
|
||||
self.settings.export_to_xml()
|
||||
self.materials.export_to_xml()
|
||||
self.geometry.export_to_xml()
|
||||
if self.tallies is not None:
|
||||
self.tallies.export_to_xml()
|
||||
if self.plots is not None:
|
||||
self.plots.export_to_xml()
|
||||
|
||||
def build_default_materials_and_geometry(self):
|
||||
# Define materials.
|
||||
fuel = openmc.Material(name='Fuel')
|
||||
fuel.set_density('g/cm3', 10.29769)
|
||||
fuel.add_nuclide("U234", 4.4843e-6)
|
||||
fuel.add_nuclide("U235", 5.5815e-4)
|
||||
fuel.add_nuclide("U238", 2.2408e-2)
|
||||
fuel.add_nuclide("O16", 4.5829e-2)
|
||||
|
||||
clad = openmc.Material(name='Cladding')
|
||||
clad.set_density('g/cm3', 6.55)
|
||||
clad.add_nuclide("Zr90", 2.1827e-2)
|
||||
clad.add_nuclide("Zr91", 4.7600e-3)
|
||||
clad.add_nuclide("Zr92", 7.2758e-3)
|
||||
clad.add_nuclide("Zr94", 7.3734e-3)
|
||||
clad.add_nuclide("Zr96", 1.1879e-3)
|
||||
|
||||
hot_water = openmc.Material(name='Hot borated water')
|
||||
hot_water.set_density('g/cm3', 0.740582)
|
||||
hot_water.add_nuclide("H1", 4.9457e-2)
|
||||
hot_water.add_nuclide("O16", 2.4672e-2)
|
||||
hot_water.add_nuclide("B10", 8.0042e-6)
|
||||
hot_water.add_nuclide("B11", 3.2218e-5)
|
||||
hot_water.add_s_alpha_beta('c_H_in_H2O', '71t')
|
||||
|
||||
# Define the materials file.
|
||||
self.materials.default_xs = '71c'
|
||||
self.materials += (fuel, clad, hot_water)
|
||||
|
||||
# Instantiate ZCylinder surfaces
|
||||
fuel_or = openmc.ZCylinder(x0=0, y0=0, R=0.39218, name='Fuel OR')
|
||||
clad_or = openmc.ZCylinder(x0=0, y0=0, R=0.45720, name='Clad OR')
|
||||
|
||||
# Create boundary planes to surround the geometry
|
||||
min_x = openmc.XPlane(x0=-10.71, boundary_type='reflective')
|
||||
max_x = openmc.XPlane(x0=+10.71, boundary_type='reflective')
|
||||
min_y = openmc.YPlane(y0=-10.71, boundary_type='reflective')
|
||||
max_y = openmc.YPlane(y0=+10.71, boundary_type='reflective')
|
||||
|
||||
# Create a Universe to encapsulate a fuel pin
|
||||
fuel_pin_universe = openmc.Universe(name='Fuel Pin')
|
||||
|
||||
# Create fuel Cell
|
||||
fuel_cell = openmc.Cell(name='fuel')
|
||||
fuel_cell.fill = fuel
|
||||
fuel_cell.region = -fuel_or
|
||||
fuel_pin_universe.add_cell(fuel_cell)
|
||||
|
||||
# Create a clad Cell
|
||||
clad_cell = openmc.Cell(name='clad')
|
||||
clad_cell.fill = clad
|
||||
clad_cell.region = +fuel_or & -clad_or
|
||||
fuel_pin_universe.add_cell(clad_cell)
|
||||
|
||||
# Create a moderator Cell
|
||||
hot_water_cell = openmc.Cell(name='hot water')
|
||||
hot_water_cell.fill = hot_water
|
||||
hot_water_cell.region = +clad_or
|
||||
fuel_pin_universe.add_cell(hot_water_cell)
|
||||
|
||||
# Create a Universe to encapsulate a control rod guide tube
|
||||
guide_tube_universe = openmc.Universe(name='Guide Tube')
|
||||
|
||||
# Create guide tube inner Cell
|
||||
gt_inner_cell = openmc.Cell(name='guide tube inner water')
|
||||
gt_inner_cell.fill = hot_water
|
||||
gt_inner_cell.region = -fuel_or
|
||||
guide_tube_universe.add_cell(gt_inner_cell)
|
||||
|
||||
# Create a clad Cell
|
||||
gt_clad_cell = openmc.Cell(name='guide tube clad')
|
||||
gt_clad_cell.fill = clad
|
||||
gt_clad_cell.region = +fuel_or & -clad_or
|
||||
guide_tube_universe.add_cell(gt_clad_cell)
|
||||
|
||||
# Create a guide tube outer Cell
|
||||
gt_outer_cell = openmc.Cell(name='guide tube outer water')
|
||||
gt_outer_cell.fill = hot_water
|
||||
gt_outer_cell.region = +clad_or
|
||||
guide_tube_universe.add_cell(gt_outer_cell)
|
||||
|
||||
# Create fuel assembly Lattice
|
||||
assembly = openmc.RectLattice(name='Fuel Assembly')
|
||||
assembly.pitch = (1.26, 1.26)
|
||||
assembly.lower_left = [-1.26 * 17. / 2.0] * 2
|
||||
|
||||
# Create array indices for guide tube locations in lattice
|
||||
template_x = np.array([5, 8, 11, 3, 13, 2, 5, 8, 11, 14, 2, 5, 8,
|
||||
11, 14, 2, 5, 8, 11, 14, 3, 13, 5, 8, 11])
|
||||
template_y = np.array([2, 2, 2, 3, 3, 5, 5, 5, 5, 5, 8, 8, 8, 8,
|
||||
8, 11, 11, 11, 11, 11, 13, 13, 14, 14, 14])
|
||||
|
||||
# Initialize an empty 17x17 array of the lattice universes
|
||||
universes = np.empty((17, 17), dtype=openmc.Universe)
|
||||
|
||||
# Fill the array with the fuel pin and guide tube universes
|
||||
universes[:,:] = fuel_pin_universe
|
||||
universes[template_x, template_y] = guide_tube_universe
|
||||
|
||||
# Store the array of universes in the lattice
|
||||
assembly.universes = universes
|
||||
|
||||
# Create root Cell
|
||||
root_cell = openmc.Cell(name='root cell')
|
||||
root_cell.fill = assembly
|
||||
|
||||
# Add boundary planes
|
||||
root_cell.region = +min_x & -max_x & +min_y & -max_y
|
||||
|
||||
# Create root Universe
|
||||
root_universe = openmc.Universe(universe_id=0, name='root universe')
|
||||
root_universe.add_cell(root_cell)
|
||||
|
||||
# Instantiate a Geometry, register the root Universe, and export to XML
|
||||
self.geometry.root_universe = root_universe
|
||||
|
||||
def build_default_settings(self):
|
||||
self.settings.batches = 10
|
||||
self.settings.inactive = 5
|
||||
self.settings.particles = 100
|
||||
self.settings.source = Source(space=Box([-10.71, -10.71, -1],
|
||||
[10.71, 10.71, 1],
|
||||
only_fissionable=True))
|
||||
|
||||
def build_defualt_plots(self):
|
||||
plot = openmc.Plot()
|
||||
plot.filename = 'mat'
|
||||
plot.origin = (0.0, 0.0, 0)
|
||||
plot.width = (21.42, 21.42)
|
||||
plot.pixels = (300, 300)
|
||||
plot.color = 'mat'
|
||||
|
||||
self.plots.add_plot(plot)
|
||||
|
||||
|
||||
class MGInputSet(InputSet):
|
||||
def build_default_materials_and_geometry(self):
|
||||
# Define materials needed for 1D/1G slab problem
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
20.])
|
||||
|
||||
# Initialize a six-delayed-group structure
|
||||
delayed_groups = openmc.mgxs.DelayedGroups(range(1,7))
|
||||
delayed_groups = range(1,7)
|
||||
|
||||
# Initialize MGXS Library for a few cross section types
|
||||
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
5e4bd179eeb955f61e01dc2a486e3fefd2cef7859390f12a817cd5412359766d7bfe0bf3f8553e8d28af0844ee04a4ebaad6510ec6157ee836d631a2a2b3baec
|
||||
9ce3d6987d67e92b0924916bb54288429d2bd6dfd12a69f86c5dbefb407f7eb72adb0e44d558c09e9a39610ffeb651aee4aedc629cf3a28a181d62ca4cfbcd5a
|
||||
|
|
@ -1,63 +1,63 @@
|
|||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 0.453624 0.02261
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 0.400852 0.024589
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 0.400852 0.024589
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 0.064903 0.004684
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 0.028048 0.004982
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 0.036855 0.002749
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 0.090649 0.006763
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 7.137955 0.532092
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 0.388721 0.018415
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 0.389304 0.023619
|
||||
avg(distribcell) group in group out nuclide moment mean std. dev.
|
||||
0 (0,) 1 1 total P0 0.389304 0.023619
|
||||
1 (0,) 1 1 total P1 0.046224 0.005672
|
||||
2 (0,) 1 1 total P2 0.017984 0.002178
|
||||
3 (0,) 1 1 total P3 0.006628 0.001620
|
||||
avg(distribcell) group in group out nuclide moment mean std. dev.
|
||||
0 (0,) 1 1 total P0 0.389304 0.023619
|
||||
1 (0,) 1 1 total P1 0.046224 0.005672
|
||||
2 (0,) 1 1 total P2 0.017984 0.002178
|
||||
3 (0,) 1 1 total P3 0.006628 0.001620
|
||||
avg(distribcell) group in group out nuclide mean std. dev.
|
||||
0 (0,) 1 1 total 1.0 0.066327
|
||||
avg(distribcell) group in group out nuclide mean std. dev.
|
||||
0 (0,) 1 1 total 0.085835 0.004328
|
||||
avg(distribcell) group out nuclide mean std. dev.
|
||||
0 (0,) 1 total 1.0 0.046071
|
||||
avg(distribcell) group out nuclide mean std. dev.
|
||||
0 (0,) 1 total 1.0 0.051471
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 4.996730e-07 3.741595e-08
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0,) 1 total 0.090004 0.006717
|
||||
avg(distribcell) delayedgroup group in nuclide mean std. dev.
|
||||
0 (0,) 1 1 total 0.000021 0.000002
|
||||
1 (0,) 2 1 total 0.000110 0.000008
|
||||
2 (0,) 3 1 total 0.000107 0.000008
|
||||
3 (0,) 4 1 total 0.000249 0.000018
|
||||
4 (0,) 5 1 total 0.000112 0.000008
|
||||
5 (0,) 6 1 total 0.000046 0.000003
|
||||
avg(distribcell) delayedgroup group out nuclide mean std. dev.
|
||||
0 (0,) 1 1 total 0.0 0.000000
|
||||
1 (0,) 2 1 total 1.0 0.869128
|
||||
2 (0,) 3 1 total 1.0 1.414214
|
||||
3 (0,) 4 1 total 1.0 0.360359
|
||||
4 (0,) 5 1 total 0.0 0.000000
|
||||
5 (0,) 6 1 total 0.0 0.000000
|
||||
avg(distribcell) delayedgroup group in nuclide mean std. dev.
|
||||
0 (0,) 1 1 total 0.000227 0.000022
|
||||
1 (0,) 2 1 total 0.001214 0.000115
|
||||
2 (0,) 3 1 total 0.001184 0.000111
|
||||
3 (0,) 4 1 total 0.002752 0.000257
|
||||
4 (0,) 5 1 total 0.001231 0.000113
|
||||
5 (0,) 6 1 total 0.000512 0.000047
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.457353 0.010474
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.405649 0.015784
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.405641 0.015787
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.066556 0.00251
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.028979 0.002712
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.037577 0.001487
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.092377 0.003628
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 7.276707 0.287579
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.390797 0.008717
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.387332 0.014241
|
||||
avg(distribcell) group in group out nuclide moment mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P0 0.387009 0.014230
|
||||
1 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P1 0.047179 0.004923
|
||||
2 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P2 0.015713 0.003654
|
||||
3 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P3 0.005378 0.003137
|
||||
avg(distribcell) group in group out nuclide moment mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P0 0.387332 0.014241
|
||||
1 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P1 0.047187 0.004933
|
||||
2 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P2 0.015727 0.003654
|
||||
3 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total P3 0.005387 0.003141
|
||||
avg(distribcell) group in group out nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total 1.000834 0.037242
|
||||
avg(distribcell) group in group out nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total 0.094516 0.0059
|
||||
avg(distribcell) group out nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 1.0 0.080455
|
||||
avg(distribcell) group out nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 1.0 0.080541
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 5.139437e-07 2.133314e-08
|
||||
avg(distribcell) group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 total 0.091725 0.003604
|
||||
avg(distribcell) delayedgroup group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total 0.000021 8.253907e-07
|
||||
1 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 2 1 total 0.000112 4.284000e-06
|
||||
2 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 3 1 total 0.000109 4.105197e-06
|
||||
3 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 4 1 total 0.000252 9.271420e-06
|
||||
4 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 5 1 total 0.000112 3.888625e-06
|
||||
5 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 6 1 total 0.000047 1.625563e-06
|
||||
avg(distribcell) delayedgroup group out nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total 0.0 0.000000
|
||||
1 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 2 1 total 1.0 1.414214
|
||||
2 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 3 1 total 1.0 1.414214
|
||||
3 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 4 1 total 0.0 0.000000
|
||||
4 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 5 1 total 0.0 0.000000
|
||||
5 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 6 1 total 1.0 1.414214
|
||||
avg(distribcell) delayedgroup group in nuclide mean std. dev.
|
||||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total 0.000227 0.000012
|
||||
1 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 2 1 total 0.001209 0.000061
|
||||
2 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 3 1 total 0.001177 0.000059
|
||||
3 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 4 1 total 0.002727 0.000135
|
||||
4 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 5 1 total 0.001210 0.000058
|
||||
5 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 6 1 total 0.000504 0.000024
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import glob
|
|||
import hashlib
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import PyAPITestHarness
|
||||
from input_set import PinCellInputSet
|
||||
from input_set import AssemblyInputSet
|
||||
import openmc
|
||||
import openmc.mgxs
|
||||
|
||||
|
|
@ -14,7 +14,7 @@ import openmc.mgxs
|
|||
class MGXSTestHarness(PyAPITestHarness):
|
||||
def _build_inputs(self):
|
||||
# Set the input set to use the pincell model
|
||||
self._input_set = PinCellInputSet()
|
||||
self._input_set = AssemblyInputSet()
|
||||
|
||||
# Generate inputs using parent class routine
|
||||
super(MGXSTestHarness, self)._build_inputs()
|
||||
|
|
@ -23,7 +23,7 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 20.])
|
||||
|
||||
# Initialize a six-delayed-group structure
|
||||
delayed_groups = openmc.mgxs.DelayedGroups(range(1,7))
|
||||
delayed_groups = range(1,7)
|
||||
|
||||
# Initialize MGXS Library for a few cross section types
|
||||
# for one material-filled cell in the geometry
|
||||
|
|
@ -38,7 +38,7 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
self.mgxs_lib.legendre_order = 3
|
||||
self.mgxs_lib.domain_type = 'distribcell'
|
||||
cells = self.mgxs_lib.openmc_geometry.get_all_material_cells()
|
||||
self.mgxs_lib.domains = [c for c in cells if c.name == 'cell 1']
|
||||
self.mgxs_lib.domains = [c for c in cells if c.name == 'fuel']
|
||||
self.mgxs_lib.build_library()
|
||||
|
||||
# Initialize a tallies file
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
20.])
|
||||
|
||||
# Initialize a six-delayed-group structure
|
||||
delayed_groups = openmc.mgxs.DelayedGroups(range(1,7))
|
||||
delayed_groups = range(1,7)
|
||||
|
||||
# Initialize MGXS Library for a few cross section types
|
||||
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry)
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 20.])
|
||||
|
||||
# Initialize a six-delayed-group structure
|
||||
delayed_groups = openmc.mgxs.DelayedGroups(range(1,7))
|
||||
delayed_groups = range(1,7)
|
||||
|
||||
# Initialize MGXS Library for a few cross section types
|
||||
# for one material-filled cell in the geometry
|
||||
|
|
|
|||
|
|
@ -29,49 +29,49 @@
|
|||
1 10000 1 total 0.385188 0.026946
|
||||
0 10000 2 total 0.412389 0.015425
|
||||
material group in group out nuclide moment mean std. dev.
|
||||
12 10000 1 1 total P0 0.384199 0.027001
|
||||
13 10000 1 1 total P1 0.051870 0.006983
|
||||
14 10000 1 1 total P2 0.020069 0.002846
|
||||
1 10000 1 1 total P0 0.016482 0.004502
|
||||
3 10000 1 1 total P1 -0.010499 0.010438
|
||||
5 10000 1 1 total P2 -0.000768 0.000768
|
||||
7 10000 1 1 total P3 -0.000171 0.000172
|
||||
9 10000 1 1 total P0 -0.000207 0.000149
|
||||
11 10000 1 1 total P1 0.000234 0.000128
|
||||
13 10000 1 1 total P2 0.051870 0.006983
|
||||
15 10000 1 1 total P3 0.009478 0.002234
|
||||
8 10000 1 2 total P0 0.000989 0.000482
|
||||
9 10000 1 2 total P1 -0.000207 0.000149
|
||||
10 10000 1 2 total P2 -0.000103 0.000184
|
||||
11 10000 1 2 total P3 0.000234 0.000128
|
||||
4 10000 2 1 total P0 0.000925 0.000925
|
||||
5 10000 2 1 total P1 -0.000768 0.000768
|
||||
6 10000 2 1 total P2 0.000494 0.000494
|
||||
7 10000 2 1 total P3 -0.000171 0.000172
|
||||
0 10000 2 2 total P0 0.411465 0.015245
|
||||
1 10000 2 2 total P1 0.016482 0.004502
|
||||
2 10000 2 2 total P2 0.006371 0.010551
|
||||
3 10000 2 2 total P3 -0.010499 0.010438
|
||||
2 10000 2 2 total P1 0.006371 0.010551
|
||||
4 10000 2 2 total P2 0.000925 0.000925
|
||||
6 10000 2 2 total P3 0.000494 0.000494
|
||||
8 10000 2 2 total P0 0.000989 0.000482
|
||||
10 10000 2 2 total P1 -0.000103 0.000184
|
||||
12 10000 2 2 total P2 0.384199 0.027001
|
||||
14 10000 2 2 total P3 0.020069 0.002846
|
||||
material group in group out nuclide moment mean std. dev.
|
||||
12 10000 1 1 total P0 0.384199 0.027001
|
||||
13 10000 1 1 total P1 0.051870 0.006983
|
||||
14 10000 1 1 total P2 0.020069 0.002846
|
||||
1 10000 1 1 total P0 0.016482 0.004502
|
||||
3 10000 1 1 total P1 -0.010499 0.010438
|
||||
5 10000 1 1 total P2 -0.000768 0.000768
|
||||
7 10000 1 1 total P3 -0.000171 0.000172
|
||||
9 10000 1 1 total P0 -0.000207 0.000149
|
||||
11 10000 1 1 total P1 0.000234 0.000128
|
||||
13 10000 1 1 total P2 0.051870 0.006983
|
||||
15 10000 1 1 total P3 0.009478 0.002234
|
||||
8 10000 1 2 total P0 0.000989 0.000482
|
||||
9 10000 1 2 total P1 -0.000207 0.000149
|
||||
10 10000 1 2 total P2 -0.000103 0.000184
|
||||
11 10000 1 2 total P3 0.000234 0.000128
|
||||
4 10000 2 1 total P0 0.000925 0.000925
|
||||
5 10000 2 1 total P1 -0.000768 0.000768
|
||||
6 10000 2 1 total P2 0.000494 0.000494
|
||||
7 10000 2 1 total P3 -0.000171 0.000172
|
||||
0 10000 2 2 total P0 0.411465 0.015245
|
||||
1 10000 2 2 total P1 0.016482 0.004502
|
||||
2 10000 2 2 total P2 0.006371 0.010551
|
||||
3 10000 2 2 total P3 -0.010499 0.010438
|
||||
2 10000 2 2 total P1 0.006371 0.010551
|
||||
4 10000 2 2 total P2 0.000925 0.000925
|
||||
6 10000 2 2 total P3 0.000494 0.000494
|
||||
8 10000 2 2 total P0 0.000989 0.000482
|
||||
10 10000 2 2 total P1 -0.000103 0.000184
|
||||
12 10000 2 2 total P2 0.384199 0.027001
|
||||
14 10000 2 2 total P3 0.020069 0.002846
|
||||
material group in group out nuclide mean std. dev.
|
||||
1 10000 1 1 total 1.0 1.414214
|
||||
3 10000 1 1 total 1.0 0.078516
|
||||
2 10000 1 2 total 1.0 0.687184
|
||||
1 10000 2 1 total 1.0 1.414214
|
||||
0 10000 2 2 total 1.0 0.041130
|
||||
2 10000 2 2 total 1.0 0.687184
|
||||
material group in group out nuclide mean std. dev.
|
||||
1 10000 1 1 total 0.454366 0.027426
|
||||
3 10000 1 1 total 0.020142 0.003149
|
||||
2 10000 1 2 total 0.000000 0.000000
|
||||
1 10000 2 1 total 0.454366 0.027426
|
||||
0 10000 2 2 total 0.000000 0.000000
|
||||
2 10000 2 2 total 0.000000 0.000000
|
||||
material group out nuclide mean std. dev.
|
||||
1 10000 1 total 1.0 0.046071
|
||||
0 10000 2 total 0.0 0.000000
|
||||
|
|
@ -154,49 +154,49 @@
|
|||
1 10001 1 total 0.310121 0.033788
|
||||
0 10001 2 total 0.296264 0.043792
|
||||
material group in group out nuclide moment mean std. dev.
|
||||
12 10001 1 1 total P0 0.310121 0.033788
|
||||
13 10001 1 1 total P1 0.038230 0.008484
|
||||
14 10001 1 1 total P2 0.020745 0.004696
|
||||
1 10001 1 1 total P0 -0.011214 0.016180
|
||||
3 10001 1 1 total P1 -0.003270 0.007329
|
||||
5 10001 1 1 total P2 0.000000 0.000000
|
||||
7 10001 1 1 total P3 0.000000 0.000000
|
||||
9 10001 1 1 total P0 0.000000 0.000000
|
||||
11 10001 1 1 total P1 0.000000 0.000000
|
||||
13 10001 1 1 total P2 0.038230 0.008484
|
||||
15 10001 1 1 total P3 0.007964 0.003732
|
||||
8 10001 1 2 total P0 0.000000 0.000000
|
||||
9 10001 1 2 total P1 0.000000 0.000000
|
||||
10 10001 1 2 total P2 0.000000 0.000000
|
||||
11 10001 1 2 total P3 0.000000 0.000000
|
||||
4 10001 2 1 total P0 0.000000 0.000000
|
||||
5 10001 2 1 total P1 0.000000 0.000000
|
||||
6 10001 2 1 total P2 0.000000 0.000000
|
||||
7 10001 2 1 total P3 0.000000 0.000000
|
||||
0 10001 2 2 total P0 0.296264 0.043792
|
||||
1 10001 2 2 total P1 -0.011214 0.016180
|
||||
2 10001 2 2 total P2 0.008837 0.011504
|
||||
3 10001 2 2 total P3 -0.003270 0.007329
|
||||
2 10001 2 2 total P1 0.008837 0.011504
|
||||
4 10001 2 2 total P2 0.000000 0.000000
|
||||
6 10001 2 2 total P3 0.000000 0.000000
|
||||
8 10001 2 2 total P0 0.000000 0.000000
|
||||
10 10001 2 2 total P1 0.000000 0.000000
|
||||
12 10001 2 2 total P2 0.310121 0.033788
|
||||
14 10001 2 2 total P3 0.020745 0.004696
|
||||
material group in group out nuclide moment mean std. dev.
|
||||
12 10001 1 1 total P0 0.310121 0.033788
|
||||
13 10001 1 1 total P1 0.038230 0.008484
|
||||
14 10001 1 1 total P2 0.020745 0.004696
|
||||
1 10001 1 1 total P0 -0.011214 0.016180
|
||||
3 10001 1 1 total P1 -0.003270 0.007329
|
||||
5 10001 1 1 total P2 0.000000 0.000000
|
||||
7 10001 1 1 total P3 0.000000 0.000000
|
||||
9 10001 1 1 total P0 0.000000 0.000000
|
||||
11 10001 1 1 total P1 0.000000 0.000000
|
||||
13 10001 1 1 total P2 0.038230 0.008484
|
||||
15 10001 1 1 total P3 0.007964 0.003732
|
||||
8 10001 1 2 total P0 0.000000 0.000000
|
||||
9 10001 1 2 total P1 0.000000 0.000000
|
||||
10 10001 1 2 total P2 0.000000 0.000000
|
||||
11 10001 1 2 total P3 0.000000 0.000000
|
||||
4 10001 2 1 total P0 0.000000 0.000000
|
||||
5 10001 2 1 total P1 0.000000 0.000000
|
||||
6 10001 2 1 total P2 0.000000 0.000000
|
||||
7 10001 2 1 total P3 0.000000 0.000000
|
||||
0 10001 2 2 total P0 0.296264 0.043792
|
||||
1 10001 2 2 total P1 -0.011214 0.016180
|
||||
2 10001 2 2 total P2 0.008837 0.011504
|
||||
3 10001 2 2 total P3 -0.003270 0.007329
|
||||
2 10001 2 2 total P1 0.008837 0.011504
|
||||
4 10001 2 2 total P2 0.000000 0.000000
|
||||
6 10001 2 2 total P3 0.000000 0.000000
|
||||
8 10001 2 2 total P0 0.000000 0.000000
|
||||
10 10001 2 2 total P1 0.000000 0.000000
|
||||
12 10001 2 2 total P2 0.310121 0.033788
|
||||
14 10001 2 2 total P3 0.020745 0.004696
|
||||
material group in group out nuclide mean std. dev.
|
||||
1 10001 1 1 total 0.0 0.000000
|
||||
3 10001 1 1 total 1.0 0.108779
|
||||
2 10001 1 2 total 0.0 0.000000
|
||||
1 10001 2 1 total 0.0 0.000000
|
||||
0 10001 2 2 total 1.0 0.142427
|
||||
2 10001 2 2 total 0.0 0.000000
|
||||
material group in group out nuclide mean std. dev.
|
||||
1 10001 1 1 total 0.0 0.0
|
||||
3 10001 1 1 total 0.0 0.0
|
||||
2 10001 1 2 total 0.0 0.0
|
||||
1 10001 2 1 total 0.0 0.0
|
||||
0 10001 2 2 total 0.0 0.0
|
||||
2 10001 2 2 total 0.0 0.0
|
||||
material group out nuclide mean std. dev.
|
||||
1 10001 1 total 0.0 0.0
|
||||
0 10001 2 total 0.0 0.0
|
||||
|
|
@ -279,49 +279,49 @@
|
|||
1 10002 1 total 0.671269 0.026186
|
||||
0 10002 2 total 2.035388 0.258060
|
||||
material group in group out nuclide moment mean std. dev.
|
||||
12 10002 1 1 total P0 0.639901 0.024709
|
||||
13 10002 1 1 total P1 0.381167 0.016243
|
||||
14 10002 1 1 total P2 0.152392 0.008156
|
||||
1 10002 1 1 total P0 0.509941 0.051236
|
||||
3 10002 1 1 total P1 0.024988 0.008312
|
||||
5 10002 1 1 total P2 0.000400 0.000401
|
||||
7 10002 1 1 total P3 0.000214 0.000215
|
||||
9 10002 1 1 total P0 0.008758 0.000926
|
||||
11 10002 1 1 total P1 -0.003785 0.000817
|
||||
13 10002 1 1 total P2 0.381167 0.016243
|
||||
15 10002 1 1 total P3 0.009148 0.003889
|
||||
8 10002 1 2 total P0 0.031368 0.001728
|
||||
9 10002 1 2 total P1 0.008758 0.000926
|
||||
10 10002 1 2 total P2 -0.002568 0.001014
|
||||
11 10002 1 2 total P3 -0.003785 0.000817
|
||||
4 10002 2 1 total P0 0.000443 0.000445
|
||||
5 10002 2 1 total P1 0.000400 0.000401
|
||||
6 10002 2 1 total P2 0.000320 0.000321
|
||||
7 10002 2 1 total P3 0.000214 0.000215
|
||||
0 10002 2 2 total P0 2.034945 0.257800
|
||||
1 10002 2 2 total P1 0.509941 0.051236
|
||||
2 10002 2 2 total P2 0.111175 0.013020
|
||||
3 10002 2 2 total P3 0.024988 0.008312
|
||||
2 10002 2 2 total P1 0.111175 0.013020
|
||||
4 10002 2 2 total P2 0.000443 0.000445
|
||||
6 10002 2 2 total P3 0.000320 0.000321
|
||||
8 10002 2 2 total P0 0.031368 0.001728
|
||||
10 10002 2 2 total P1 -0.002568 0.001014
|
||||
12 10002 2 2 total P2 0.639901 0.024709
|
||||
14 10002 2 2 total P3 0.152392 0.008156
|
||||
material group in group out nuclide moment mean std. dev.
|
||||
12 10002 1 1 total P0 0.639901 0.024709
|
||||
13 10002 1 1 total P1 0.381167 0.016243
|
||||
14 10002 1 1 total P2 0.152392 0.008156
|
||||
1 10002 1 1 total P0 0.509941 0.051236
|
||||
3 10002 1 1 total P1 0.024988 0.008312
|
||||
5 10002 1 1 total P2 0.000400 0.000401
|
||||
7 10002 1 1 total P3 0.000214 0.000215
|
||||
9 10002 1 1 total P0 0.008758 0.000926
|
||||
11 10002 1 1 total P1 -0.003785 0.000817
|
||||
13 10002 1 1 total P2 0.381167 0.016243
|
||||
15 10002 1 1 total P3 0.009148 0.003889
|
||||
8 10002 1 2 total P0 0.031368 0.001728
|
||||
9 10002 1 2 total P1 0.008758 0.000926
|
||||
10 10002 1 2 total P2 -0.002568 0.001014
|
||||
11 10002 1 2 total P3 -0.003785 0.000817
|
||||
4 10002 2 1 total P0 0.000443 0.000445
|
||||
5 10002 2 1 total P1 0.000400 0.000401
|
||||
6 10002 2 1 total P2 0.000320 0.000321
|
||||
7 10002 2 1 total P3 0.000214 0.000215
|
||||
0 10002 2 2 total P0 2.034945 0.257800
|
||||
1 10002 2 2 total P1 0.509941 0.051236
|
||||
2 10002 2 2 total P2 0.111175 0.013020
|
||||
3 10002 2 2 total P3 0.024988 0.008312
|
||||
2 10002 2 2 total P1 0.111175 0.013020
|
||||
4 10002 2 2 total P2 0.000443 0.000445
|
||||
6 10002 2 2 total P3 0.000320 0.000321
|
||||
8 10002 2 2 total P0 0.031368 0.001728
|
||||
10 10002 2 2 total P1 -0.002568 0.001014
|
||||
12 10002 2 2 total P2 0.639901 0.024709
|
||||
14 10002 2 2 total P3 0.152392 0.008156
|
||||
material group in group out nuclide mean std. dev.
|
||||
1 10002 1 1 total 1.0 1.414214
|
||||
3 10002 1 1 total 1.0 0.038609
|
||||
2 10002 1 2 total 1.0 0.067667
|
||||
1 10002 2 1 total 1.0 1.414214
|
||||
0 10002 2 2 total 1.0 0.135929
|
||||
2 10002 2 2 total 1.0 0.067667
|
||||
material group in group out nuclide mean std. dev.
|
||||
1 10002 1 1 total 0.0 0.0
|
||||
3 10002 1 1 total 0.0 0.0
|
||||
2 10002 1 2 total 0.0 0.0
|
||||
1 10002 2 1 total 0.0 0.0
|
||||
0 10002 2 2 total 0.0 0.0
|
||||
2 10002 2 2 total 0.0 0.0
|
||||
material group out nuclide mean std. dev.
|
||||
1 10002 1 total 0.0 0.0
|
||||
0 10002 2 total 0.0 0.0
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ class MGXSTestHarness(PyAPITestHarness):
|
|||
20.])
|
||||
|
||||
# Initialize a six-delayed-group structure
|
||||
delayed_groups = openmc.mgxs.DelayedGroups(range(1,7))
|
||||
delayed_groups = range(1,7)
|
||||
|
||||
# Initialize MGXS Library for a few cross section types
|
||||
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry)
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
e494320a213b5704a2ac915a2ba504857be91961ceb6735b6ad05d81eb31c44c9584d5bd9d40baececf1dcb5b030e6ecec63cfbd20639baf69bcb596c5c46591
|
||||
cb61db73f66b40ed1a59a59e6f4fd52678e9dc41c7bb8ad327989233c3b8d78a71d84c3cb8ad9bc8b1585b319e1f1d66a8667e7cad2ead4cc574f415f8f7a35d
|
||||
Loading…
Add table
Add a link
Reference in a new issue