mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 22:26:08 -04:00
Merge remote-tracking branch 'upstream/develop' into oo_filters
This commit is contained in:
commit
320ee3a21b
37 changed files with 1527 additions and 467 deletions
|
|
@ -383,6 +383,9 @@
|
|||
"* `ScatterMatrixXS`\n",
|
||||
"* `NuScatterMatrixXS`\n",
|
||||
"* `Chi`\n",
|
||||
"* `ChiPrompt`\n",
|
||||
"* `InverseVelocity`\n",
|
||||
"* `PromptNuFissionXS`\n",
|
||||
"\n",
|
||||
"These classes provide us with an interface to generate the tally inputs as well as perform post-processing of OpenMC's tally data to compute the respective multi-group cross sections. In this case, let's create the multi-group total, absorption and scattering cross sections with our 2-group structure."
|
||||
]
|
||||
|
|
@ -1164,21 +1167,21 @@
|
|||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "Python 2",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
"name": "python2"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
"version": 2
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.2"
|
||||
"pygments_lexer": "ipython2",
|
||||
"version": "2.7.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -549,6 +549,9 @@
|
|||
"* `ScatterMatrixXS` (`\"scatter matrix\"`)\n",
|
||||
"* `NuScatterMatrixXS` (`\"nu-scatter matrix\"`)\n",
|
||||
"* `Chi` (`\"chi\"`)\n",
|
||||
"* `ChiPrompt` (`\"chi prompt\"`)\n",
|
||||
"* `InverseVelocity` (`\"inverse-velocity\"`)\n",
|
||||
"* `PromptNuFissionXS` (`\"prompt-nu-fission\"`)\n",
|
||||
"\n",
|
||||
"In this case, let's create the multi-group cross sections needed to run an OpenMOC simulation to verify the accuracy of our cross sections. In particular, we will define `\"transport\"`, `\"nu-fission\"`, `'\"fission\"`, `\"nu-scatter matrix\"` and `\"chi\"` cross sections for our `Library`.\n",
|
||||
"\n",
|
||||
|
|
@ -571,7 +574,7 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Now we must specify the type of domain over which we would like the `Library` to compute multi-group cross sections. The domain type corresponds to the type of tally filter to be used in the tallies created to compute multi-group cross sections. At the present time, the `Library` supports `\"material,\"` `\"cell,\"` and `\"universe\"` domain types. We will use a `\"cell\"` domain type here to compute cross sections in each of the cells in the fuel assembly geometry.\n",
|
||||
"Now we must specify the type of domain over which we would like the `Library` to compute multi-group cross sections. The domain type corresponds to the type of tally filter to be used in the tallies created to compute multi-group cross sections. At the present time, the `Library` supports `\"material\"`, `\"cell\"`, `\"universe\"`, and `\"mesh\"` domain types. We will use a `\"cell\"` domain type here to compute cross sections in each of the cells in the fuel assembly geometry.\n",
|
||||
"\n",
|
||||
"**Note:** By default, the `Library` class will instantiate `MGXS` objects for each and every domain (material, cell or universe) in the geometry of interest. However, one may specify a subset of these domains to the `Library.domains` property. In our case, we wish to compute multi-group cross sections in each and every cell since they will be needed in our downstream OpenMOC calculation on the identical combinatorial geometry mesh."
|
||||
]
|
||||
|
|
@ -1596,21 +1599,21 @@
|
|||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "Python 2",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
"name": "python2"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
"version": 2
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.2"
|
||||
"pygments_lexer": "ipython2",
|
||||
"version": "2.7.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
|
|
@ -519,9 +519,9 @@
|
|||
"cell_type": "markdown",
|
||||
"metadata": {},
|
||||
"source": [
|
||||
"Now we must specify the type of domain over which we would like the `Library` to compute multi-group cross sections. The domain type corresponds to the type of tally filter to be used in the tallies created to compute multi-group cross sections. At the present time, the `Library` supports \"material,\" \"cell,\" and \"universe\" domain types. In this simple example, we wish to compute multi-group cross sections only for each material andtherefore will use a \"material\" domain type.\n",
|
||||
"Now we must specify the type of domain over which we would like the `Library` to compute multi-group cross sections. The domain type corresponds to the type of tally filter to be used in the tallies created to compute multi-group cross sections. At the present time, the `Library` supports \"material\" \"cell\", \"universe\", and \"mesh\" domain types. In this simple example, we wish to compute multi-group cross sections only for each material and therefore will use a \"material\" domain type.\n",
|
||||
"\n",
|
||||
"**Note:** By default, the `Library` class will instantiate `MGXS` objects for each and every domain (material, cell or universe) in the geometry of interest. However, one may specify a subset of these domains to the `Library.domains` property."
|
||||
"**Note:** By default, the `Library` class will instantiate `MGXS` objects for each and every domain (material, cell, universe, or mesh) in the geometry of interest. However, one may specify a subset of these domains to the `Library.domains` property."
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
@ -1437,21 +1437,21 @@
|
|||
],
|
||||
"metadata": {
|
||||
"kernelspec": {
|
||||
"display_name": "Python 3",
|
||||
"display_name": "Python 2",
|
||||
"language": "python",
|
||||
"name": "python3"
|
||||
"name": "python2"
|
||||
},
|
||||
"language_info": {
|
||||
"codemirror_mode": {
|
||||
"name": "ipython",
|
||||
"version": 3
|
||||
"version": 2
|
||||
},
|
||||
"file_extension": ".py",
|
||||
"mimetype": "text/x-python",
|
||||
"name": "python",
|
||||
"nbconvert_exporter": "python",
|
||||
"pygments_lexer": "ipython3",
|
||||
"version": "3.5.2"
|
||||
"pygments_lexer": "ipython2",
|
||||
"version": "2.7.11"
|
||||
}
|
||||
},
|
||||
"nbformat": 4,
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -269,13 +269,16 @@ Multi-group Cross Sections
|
|||
openmc.mgxs.AbsorptionXS
|
||||
openmc.mgxs.CaptureXS
|
||||
openmc.mgxs.Chi
|
||||
openmc.mgxs.ChiPrompt
|
||||
openmc.mgxs.FissionXS
|
||||
openmc.mgxs.InverseVelocity
|
||||
openmc.mgxs.KappaFissionXS
|
||||
openmc.mgxs.MultiplicityMatrixXS
|
||||
openmc.mgxs.NuFissionXS
|
||||
openmc.mgxs.NuFissionMatrixXS
|
||||
openmc.mgxs.NuScatterXS
|
||||
openmc.mgxs.NuScatterMatrixXS
|
||||
openmc.mgxs.PromptNuFissionXS
|
||||
openmc.mgxs.ScatterXS
|
||||
openmc.mgxs.ScatterMatrixXS
|
||||
openmc.mgxs.TotalXS
|
||||
|
|
|
|||
|
|
@ -1764,6 +1764,10 @@ The ``<tally>`` element accepts the following sub-elements:
|
|||
| |fission. This score type is not used in the |
|
||||
| |multi-group :ref:`energy_mode`. |
|
||||
+----------------------+---------------------------------------------------+
|
||||
|prompt-nu-fission |Total production of prompt neutrons due to |
|
||||
| |fission. This score type is not used in the |
|
||||
| |multi-group :ref:`energy_mode`. |
|
||||
+----------------------+---------------------------------------------------+
|
||||
|nu-fission |Total production of neutrons due to fission. |
|
||||
+----------------------+---------------------------------------------------+
|
||||
|nu-scatter, |These scores are similar in functionality to their |
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ from openmc.plots import *
|
|||
from openmc.settings import *
|
||||
from openmc.surface import *
|
||||
from openmc.universe import *
|
||||
from openmc.mgxs_library import *
|
||||
from openmc.mesh import *
|
||||
from openmc.mgxs_library import *
|
||||
from openmc.filter import *
|
||||
from openmc.trigger import *
|
||||
from openmc.tallies import *
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ def check_less_than(name, value, maximum, equality=False):
|
|||
raise ValueError(msg)
|
||||
|
||||
def check_greater_than(name, value, minimum, equality=False):
|
||||
"""Ensure that an object's value is less than a given value.
|
||||
"""Ensure that an object's value is greater than a given value.
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
|
|
|||
|
|
@ -122,10 +122,11 @@ ATOMIC_SYMBOL = {1: 'H', 2: 'He', 3: 'Li', 4: 'Be', 5: 'B', 6: 'C', 7: 'N',
|
|||
114: 'Fl', 116: 'Lv'}
|
||||
ATOMIC_NUMBER = {value: key for key, value in ATOMIC_SYMBOL.items()}
|
||||
|
||||
REACTION_NAME = {1: '(n,total)', 2: '(n,elastic)', 4: '(n,level)', 5: '(n,misc)', 11: '(n,2nd)',
|
||||
16: '(n,2n)', 17: '(n,3n)', 18: '(n,fission)', 19: '(n,f)',
|
||||
20: '(n,nf)', 21: '(n,2nf)', 22: '(n,na)', 23: '(n,n3a)',
|
||||
24: '(n,2na)', 25: '(n,3na)', 28: '(n,np)', 29: '(n,n2a)',
|
||||
REACTION_NAME = {1: '(n,total)', 2: '(n,elastic)', 4: '(n,level)',
|
||||
5: '(n,misc)', 11: '(n,2nd)', 16: '(n,2n)', 17: '(n,3n)',
|
||||
18: '(n,fission)', 19: '(n,f)', 20: '(n,nf)', 21: '(n,2nf)',
|
||||
22: '(n,na)', 23: '(n,n3a)', 24: '(n,2na)', 25: '(n,3na)',
|
||||
27: '(n,absorption)', 28: '(n,np)', 29: '(n,n2a)',
|
||||
30: '(n,2n2a)', 32: '(n,nd)', 33: '(n,nt)', 34: '(n,nHe-3)',
|
||||
35: '(n,nd2a)', 36: '(n,nt2a)', 37: '(n,4n)', 38: '(n,3nf)',
|
||||
41: '(n,2np)', 42: '(n,3np)', 44: '(n,n2p)', 45: '(n,npa)',
|
||||
|
|
|
|||
|
|
@ -80,50 +80,46 @@ class Tabulated1D(object):
|
|||
# Get indices for interpolation
|
||||
idx = np.searchsorted(self.x, x, side='right') - 1
|
||||
|
||||
# Find lowest valid index
|
||||
i_low = np.searchsorted(idx, 0)
|
||||
|
||||
# Loop over interpolation regions
|
||||
for k in range(len(self.breakpoints)):
|
||||
# Determine which x values are within this interpolation range
|
||||
i_high = np.searchsorted(idx, self.breakpoints[k] - 1)
|
||||
# Get indices for the begining and ending of this region
|
||||
i_begin = self.breakpoints[k-1] - 1 if k > 0 else 0
|
||||
i_end = self.breakpoints[k] - 1
|
||||
|
||||
# Get x values and bounding (x,y) pairs
|
||||
xk = x[i_low:i_high]
|
||||
xi = self.x[idx[i_low:i_high]]
|
||||
xi1 = self.x[idx[i_low:i_high] + 1]
|
||||
yi = self.y[idx[i_low:i_high]]
|
||||
yi1 = self.y[idx[i_low:i_high] + 1]
|
||||
# Figure out which idx values lie within this region
|
||||
contained = (idx >= i_begin) & (idx < i_end)
|
||||
|
||||
xk = x[contained] # x values in this region
|
||||
xi = self.x[idx[contained]] # low edge of corresponding bins
|
||||
xi1 = self.x[idx[contained] + 1] # high edge of corresponding bins
|
||||
yi = self.y[idx[contained]]
|
||||
yi1 = self.y[idx[contained] + 1]
|
||||
|
||||
if self.interpolation[k] == 1:
|
||||
# Histogram
|
||||
y[i_low:i_high] = yi
|
||||
y[contined] = yi
|
||||
|
||||
elif self.interpolation[k] == 2:
|
||||
# Linear-linear
|
||||
y[i_low:i_high] = yi + (xk - xi)/(xi1 - xi)*(yi1 - yi)
|
||||
y[contained] = yi + (xk - xi)/(xi1 - xi)*(yi1 - yi)
|
||||
|
||||
elif self.interpolation[k] == 3:
|
||||
# Linear-log
|
||||
y[i_low:i_high] = yi + np.log(xk/xi)/np.log(xi1/xi)*(yi1 - yi)
|
||||
y[contained] = yi + np.log(xk/xi)/np.log(xi1/xi)*(yi1 - yi)
|
||||
|
||||
elif self.interpolation[k] == 4:
|
||||
# Log-linear
|
||||
y[i_low:i_high] = yi*np.exp((xk - xi)/(xi1 - xi)*np.log(yi1/yi))
|
||||
y[contained] = yi*np.exp((xk - xi)/(xi1 - xi)*np.log(yi1/yi))
|
||||
|
||||
elif self.interpolation[k] == 5:
|
||||
# Log-log
|
||||
y[i_low:i_high] = yi*np.exp(np.log(xk/xi)/np.log(xi1/xi)*np.log(yi1/yi))
|
||||
y[contained] = (yi*np.exp(np.log(xk/xi)/np.log(xi1/xi)
|
||||
*np.log(yi1/yi)))
|
||||
|
||||
i_low = i_high
|
||||
|
||||
# In some cases, the first/last point of x may be less than the first
|
||||
# value of self.x due only to precision, so we check if they're close
|
||||
# and set them equal if so. Otherwise, the interpolated value might be
|
||||
# out of range (and thus zero)
|
||||
if np.isclose(x[0], self.x[0], 1e-8):
|
||||
y[0] = self.y[0]
|
||||
if np.isclose(x[-1], self.x[-1], 1e-8):
|
||||
y[-1] = self.y[-1]
|
||||
# In some cases, x values might be outside the tabulated region due only
|
||||
# to precision, so we check if they're close and set them equal if so.
|
||||
y[np.isclose(x, self.x[0], atol=1e-14)] = self.y[0]
|
||||
y[np.isclose(x, self.x[-1], atol=1e-14)] = self.y[-1]
|
||||
|
||||
return y if iterable else y[0]
|
||||
|
||||
|
|
|
|||
|
|
@ -326,6 +326,17 @@ class IncidentNeutron(object):
|
|||
tgroup = group['total_nu']
|
||||
rx.derived_products.append(Product.from_hdf5(tgroup))
|
||||
|
||||
# Build summed reactions. Start from the highest MT number because high
|
||||
# MTs never depend on lower MTs.
|
||||
for mt_sum in sorted(SUM_RULES, reverse=True):
|
||||
if mt_sum not in data:
|
||||
xs_components = [data[mt].xs for mt in SUM_RULES[mt_sum]
|
||||
if mt in data]
|
||||
if len(xs_components) > 0:
|
||||
rxn = Reaction(mt_sum)
|
||||
rxn.xs = Sum(xs_components)
|
||||
data.summed_reactions[mt_sum] = rxn
|
||||
|
||||
# Read unresolved resonance probability tables
|
||||
if 'urr' in group:
|
||||
urr_group = group['urr']
|
||||
|
|
|
|||
|
|
@ -400,7 +400,7 @@ class Reaction(object):
|
|||
# Read cross section
|
||||
if 'xs' in group:
|
||||
xs = group['xs'].value
|
||||
rx.xs = Tabulated1D(energy, xs)
|
||||
rx.xs = Tabulated1D(energy[rx.threshold_idx:], xs)
|
||||
|
||||
# Determine number of products
|
||||
n_product = 0
|
||||
|
|
|
|||
|
|
@ -568,7 +568,7 @@ class Filter(object):
|
|||
# Initialize dictionary to build Pandas Multi-index column
|
||||
filter_dict = {}
|
||||
|
||||
# Append Mesh ID as outermost index of mult-index
|
||||
# Append Mesh ID as outermost index of multi-index
|
||||
mesh_key = 'mesh {0}'.format(self.mesh.id)
|
||||
|
||||
# Find mesh dimensions - use 3D indices for simplicity
|
||||
|
|
|
|||
|
|
@ -54,9 +54,9 @@ class Library(object):
|
|||
If true, computes cross sections for each nuclide in each domain
|
||||
mgxs_types : Iterable of str
|
||||
The types of cross sections in the library (e.g., ['total', 'scatter'])
|
||||
domain_type : {'material', 'cell', 'distribcell', 'universe'}
|
||||
domain_type : {'material', 'cell', 'distribcell', 'universe', 'mesh'}
|
||||
Domain type for spatial homogenization
|
||||
domains : Iterable of openmc.Material, openmc.Cell or openmc.Universe
|
||||
domains : Iterable of openmc.Material, openmc.Cell, openmc.Universe or openmc.Mesh
|
||||
The spatial domain(s) for which MGXS in the Library are computed
|
||||
correction : {'P0', None}
|
||||
Apply the P0 correction to scattering matrices if set to 'P0'
|
||||
|
|
@ -183,6 +183,8 @@ class Library(object):
|
|||
return self.openmc_geometry.get_all_material_cells()
|
||||
elif self.domain_type == 'universe':
|
||||
return self.openmc_geometry.get_all_universes()
|
||||
elif self.domain_type == 'mesh':
|
||||
raise ValueError('Unable to get domains for Mesh domain type')
|
||||
else:
|
||||
raise ValueError('Unable to get domains without a domain type')
|
||||
else:
|
||||
|
|
@ -273,6 +275,12 @@ class Library(object):
|
|||
elif self.domain_type == 'universe':
|
||||
cv.check_iterable_type('domain', domains, openmc.Universe)
|
||||
all_domains = self.openmc_geometry.get_all_universes()
|
||||
elif self.domain_type == 'mesh':
|
||||
cv.check_iterable_type('domain', domains, openmc.Mesh)
|
||||
|
||||
# The mesh and geometry are independent, so set all_domains
|
||||
# to the input domains
|
||||
all_domains = domains
|
||||
else:
|
||||
raise ValueError('Unable to set domains with domain '
|
||||
'type "{}"'.format(self.domain_type))
|
||||
|
|
@ -452,7 +460,7 @@ class Library(object):
|
|||
----------
|
||||
domain : Material or Cell or Universe or Integral
|
||||
The material, cell, or universe object of interest (or its ID)
|
||||
mgxs_type : {'total', 'transport', 'nu-transport', 'absorption', 'capture', 'fission', 'nu-fission', 'kappa-fission', 'scatter', 'nu-scatter', 'scatter matrix', 'nu-scatter matrix', 'multiplicity matrix', 'nu-fission matrix', chi'}
|
||||
mgxs_type : {'total', 'transport', 'nu-transport', 'absorption', 'capture', 'fission', 'nu-fission', 'kappa-fission', 'scatter', 'nu-scatter', 'scatter matrix', 'nu-scatter matrix', 'multiplicity matrix', 'nu-fission matrix', chi', 'chi-prompt', 'inverse-velocity', 'prompt-nu-fission'}
|
||||
The type of multi-group cross section object to return
|
||||
|
||||
Returns
|
||||
|
|
@ -474,6 +482,8 @@ class Library(object):
|
|||
cv.check_type('domain', domain, (openmc.Cell, Integral))
|
||||
elif self.domain_type == 'universe':
|
||||
cv.check_type('domain', domain, (openmc.Universe, Integral))
|
||||
elif self.domain_type == 'mesh':
|
||||
cv.check_type('domain', domain, (openmc.Mesh, Integral))
|
||||
|
||||
# Check that requested domain is included in library
|
||||
if isinstance(domain, Integral):
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1293,7 +1293,7 @@ class Tally(object):
|
|||
# Create list of 2- or 3-tuples tuples for mesh cell bins
|
||||
if self_filter.type == 'mesh':
|
||||
dimension = self_filter.mesh.dimension
|
||||
xyz = map(lambda x: np.arange(1, x+1), dimension)
|
||||
xyz = [range(1, x+1) for x in dimension]
|
||||
bins = list(itertools.product(*xyz))
|
||||
|
||||
# Create list of 2-tuples for energy boundary bins
|
||||
|
|
|
|||
|
|
@ -289,7 +289,7 @@ module constants
|
|||
EVENT_ABSORB = 2
|
||||
|
||||
! Tally score type
|
||||
integer, parameter :: N_SCORE_TYPES = 20
|
||||
integer, parameter :: N_SCORE_TYPES = 21
|
||||
integer, parameter :: &
|
||||
SCORE_FLUX = -1, & ! flux
|
||||
SCORE_TOTAL = -2, & ! total reaction rate
|
||||
|
|
@ -310,7 +310,8 @@ module constants
|
|||
SCORE_NU_SCATTER_YN = -17, & ! angular flux-weighted nu-scattering moment (0:N)
|
||||
SCORE_EVENTS = -18, & ! number of events
|
||||
SCORE_DELAYED_NU_FISSION = -19, & ! delayed neutron production rate
|
||||
SCORE_INVERSE_VELOCITY = -20 ! flux-weighted inverse velocity
|
||||
SCORE_PROMPT_NU_FISSION = -20, & ! prompt neutron production rate
|
||||
SCORE_INVERSE_VELOCITY = -21 ! flux-weighted inverse velocity
|
||||
|
||||
! Maximum scattering order supported
|
||||
integer, parameter :: MAX_ANG_ORDER = 10
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ contains
|
|||
string = "nu-fission"
|
||||
case (SCORE_DELAYED_NU_FISSION)
|
||||
string = "delayed-nu-fission"
|
||||
case (SCORE_PROMPT_NU_FISSION)
|
||||
string = "prompt-nu-fission"
|
||||
case (SCORE_KAPPA_FISSION)
|
||||
string = "kappa-fission"
|
||||
case (SCORE_CURRENT)
|
||||
|
|
|
|||
|
|
@ -3635,6 +3635,12 @@ contains
|
|||
! Set tally estimator to analog
|
||||
t % estimator = ESTIMATOR_ANALOG
|
||||
end if
|
||||
case ('prompt-nu-fission')
|
||||
t % score_bins(j) = SCORE_PROMPT_NU_FISSION
|
||||
if (t % find_filter(FILTER_ENERGYOUT) > 0) then
|
||||
! Set tally estimator to analog
|
||||
t % estimator = ESTIMATOR_ANALOG
|
||||
end if
|
||||
|
||||
! Disallow for MG mode since data not present
|
||||
if (.not. run_CE) then
|
||||
|
|
|
|||
|
|
@ -774,6 +774,7 @@ contains
|
|||
score_names(abs(SCORE_NU_SCATTER_PN)) = "Scattering Prod. Rate Moment"
|
||||
score_names(abs(SCORE_NU_SCATTER_YN)) = "Scattering Prod. Rate Moment"
|
||||
score_names(abs(SCORE_DELAYED_NU_FISSION)) = "Delayed-Nu-Fission Rate"
|
||||
score_names(abs(SCORE_PROMPT_NU_FISSION)) = "Prompt-Nu-Fission Rate"
|
||||
score_names(abs(SCORE_INVERSE_VELOCITY)) = "Flux-Weighted Inverse Velocity"
|
||||
|
||||
! Create filename for tally output
|
||||
|
|
|
|||
258
src/tally.F90
258
src/tally.F90
|
|
@ -400,7 +400,7 @@ contains
|
|||
! neutrons were emitted with different energies, multiple
|
||||
! outgoing energy bins may have been scored to. The following
|
||||
! logic treats this special case and results to multiple bins
|
||||
call score_fission_eout_ce(p, t, score_index)
|
||||
call score_fission_eout_ce(p, t, score_index, score_bin)
|
||||
cycle SCORE_LOOP
|
||||
end if
|
||||
end if
|
||||
|
|
@ -434,6 +434,67 @@ contains
|
|||
end if
|
||||
|
||||
|
||||
case (SCORE_PROMPT_NU_FISSION)
|
||||
if (t % estimator == ESTIMATOR_ANALOG) then
|
||||
if (survival_biasing .or. p % fission) then
|
||||
if (t % find_filter(FILTER_ENERGYOUT) > 0) then
|
||||
! Normally, we only need to make contributions to one scoring
|
||||
! bin. However, in the case of fission, since multiple fission
|
||||
! neutrons were emitted with different energies, multiple
|
||||
! outgoing energy bins may have been scored to. The following
|
||||
! logic treats this special case and results to multiple bins
|
||||
call score_fission_eout_ce(p, t, score_index, score_bin)
|
||||
cycle SCORE_LOOP
|
||||
end if
|
||||
end if
|
||||
if (survival_biasing) then
|
||||
! No fission events occur if survival biasing is on -- need to
|
||||
! calculate fraction of absorptions that would have resulted in
|
||||
! prompt-nu-fission
|
||||
if (micro_xs(p % event_nuclide) % absorption > ZERO) then
|
||||
score = p % absorb_wgt * micro_xs(p % event_nuclide) % fission &
|
||||
* nuclides(p % event_nuclide) % nu(E, EMISSION_PROMPT) &
|
||||
/ micro_xs(p % event_nuclide) % absorption
|
||||
else
|
||||
score = ZERO
|
||||
end if
|
||||
else
|
||||
! Skip any non-fission events
|
||||
if (.not. p % fission) cycle SCORE_LOOP
|
||||
! If there is no outgoing energy filter, than we only need to
|
||||
! score to one bin. For the score to be 'analog', we need to
|
||||
! score the number of particles that were banked in the fission
|
||||
! bank as prompt neutrons. Since this was weighted by 1/keff, we
|
||||
! multiply by keff to get the proper score.
|
||||
score = keff * p % wgt_bank * (ONE - sum(p % n_delayed_bank) &
|
||||
/ real(p % n_bank, 8))
|
||||
end if
|
||||
|
||||
else
|
||||
if (i_nuclide > 0) then
|
||||
score = micro_xs(i_nuclide) % fission * nuclides(i_nuclide) % &
|
||||
nu(E, EMISSION_PROMPT) * atom_density * flux
|
||||
else
|
||||
|
||||
score = ZERO
|
||||
|
||||
! Loop over all nuclides in the current material
|
||||
do l = 1, materials(p % material) % n_nuclides
|
||||
|
||||
! Get atom density
|
||||
atom_density_ = materials(p % material) % atom_density(l)
|
||||
|
||||
! Get index in nuclides array
|
||||
i_nuc = materials(p % material) % nuclide(l)
|
||||
|
||||
! Accumulate the contribution from each nuclide
|
||||
score = score + micro_xs(i_nuc) % fission * nuclides(i_nuc) % &
|
||||
nu(E, EMISSION_PROMPT) * atom_density_ * flux
|
||||
end do
|
||||
end if
|
||||
end if
|
||||
|
||||
|
||||
case (SCORE_DELAYED_NU_FISSION)
|
||||
|
||||
! make sure the correct energy is used
|
||||
|
|
@ -454,7 +515,7 @@ contains
|
|||
! neutrons were emitted with different energies, multiple
|
||||
! outgoing energy bins may have been scored to. The following
|
||||
! logic treats this special case and results to multiple bins
|
||||
call score_fission_delayed_eout(p, t, score_index)
|
||||
call score_fission_eout_ce(p, t, score_index, score_bin)
|
||||
cycle SCORE_LOOP
|
||||
end if
|
||||
end if
|
||||
|
|
@ -1607,12 +1668,18 @@ contains
|
|||
! neutrons produced with different energies.
|
||||
!===============================================================================
|
||||
|
||||
subroutine score_fission_eout_ce(p, t, i_score)
|
||||
type(Particle), intent(in) :: p
|
||||
subroutine score_fission_eout_ce(p, t, i_score, score_bin)
|
||||
|
||||
type(Particle), intent(in) :: p
|
||||
type(TallyObject), intent(inout) :: t
|
||||
integer, intent(in) :: i_score ! index for score
|
||||
integer, intent(in) :: i_score ! index for score
|
||||
integer, intent(in) :: score_bin
|
||||
|
||||
integer :: i ! index of outgoing energy filter
|
||||
integer :: j ! index of delayedgroup filter
|
||||
integer :: d ! delayed group
|
||||
integer :: g ! another delayed group
|
||||
integer :: d_bin ! delayed group bin index
|
||||
integer :: n ! number of energies on filter
|
||||
integer :: k ! loop index for bank sites
|
||||
integer :: bin_energyout ! original outgoing energy bin
|
||||
|
|
@ -1625,12 +1692,12 @@ contains
|
|||
i = t % find_filter(FILTER_ENERGYOUT)
|
||||
bin_energyout = matching_bins(i)
|
||||
|
||||
! Declare the filter type
|
||||
select type(filt => t % filters(i) % obj)
|
||||
! declare the energyout filter type
|
||||
select type(eo_filt => t % filters(i) % obj)
|
||||
type is (EnergyoutFilter)
|
||||
|
||||
! Get number of energies on filter
|
||||
n = size(filt % bins)
|
||||
n = size(eo_filt % bins)
|
||||
|
||||
! Since the creation of fission sites is weighted such that it is
|
||||
! expected to create n_particles sites, we need to multiply the
|
||||
|
|
@ -1639,6 +1706,10 @@ contains
|
|||
|
||||
! loop over number of particles banked
|
||||
do k = 1, p % n_bank
|
||||
|
||||
! get the delayed group
|
||||
g = fission_bank(n_bank - p % n_bank + k) % delayed_group
|
||||
|
||||
! determine score based on bank site weight and keff
|
||||
score = keff * fission_bank(n_bank - p % n_bank + k) % wgt
|
||||
|
||||
|
|
@ -1646,19 +1717,66 @@ contains
|
|||
E_out = fission_bank(n_bank - p % n_bank + k) % E
|
||||
|
||||
! check if outgoing energy is within specified range on filter
|
||||
if (E_out < filt % bins(1) .or. E_out > filt % bins(n)) cycle
|
||||
if (E_out < eo_filt % bins(1) .or. E_out > eo_filt % bins(n)) cycle
|
||||
|
||||
! change outgoing energy bin
|
||||
matching_bins(i) = binary_search(filt % bins, n, E_out)
|
||||
Matching_bins(i) = binary_search(eo_filt % bins, n, E_out)
|
||||
|
||||
! determine scoring index and weight for this filter combination
|
||||
i_filter = sum((matching_bins(1:size(t%filters)) - 1) * t % stride) + 1
|
||||
filter_weight = product(filter_weights(:size(t % filters)))
|
||||
! Case for tallying prompt neutrons
|
||||
if (score_bin == SCORE_NU_FISSION .or. &
|
||||
(score_bin == SCORE_PROMPT_NU_FISSION .and. g == 0)) then
|
||||
|
||||
! Add score to tally
|
||||
! determine scoring index and weight for this filter combination
|
||||
i_filter = sum((matching_bins(1:size(t%filters)) - 1) * t % stride) &
|
||||
+ 1
|
||||
filter_weight = product(filter_weights(:size(t % filters)))
|
||||
|
||||
! Add score to tally
|
||||
!$omp atomic
|
||||
t % results(i_score, i_filter) % value = &
|
||||
t % results(i_score, i_filter) % value + score * filter_weight
|
||||
t % results(i_score, i_filter) % value = &
|
||||
t % results(i_score, i_filter) % value + score * filter_weight
|
||||
|
||||
! Case for tallying delayed emissions
|
||||
else if (score_bin == SCORE_DELAYED_NU_FISSION .and. g /= 0) then
|
||||
|
||||
! Get the index of delayed group filter
|
||||
j = t % find_filter(FILTER_DELAYEDGROUP)
|
||||
|
||||
! if the delayed group filter is present, tally to corresponding
|
||||
! delayed group bin if it exists
|
||||
if (j > 0) then
|
||||
|
||||
! declare the delayed group filter type
|
||||
select type(dg_filt => t % filters(j) % obj)
|
||||
type is (DelayedGroupFilter)
|
||||
|
||||
! loop over delayed group bins until the corresponding bin is
|
||||
! found
|
||||
do d_bin = 1, dg_filt % n_bins
|
||||
d = dg_filt % groups(d_bin)
|
||||
|
||||
! check whether the delayed group of the particle is equal to
|
||||
! the delayed group of this bin
|
||||
if (d == g) then
|
||||
call score_fission_delayed_dg(t, d_bin, score, i_score)
|
||||
end if
|
||||
end do
|
||||
end select
|
||||
|
||||
! if the delayed group filter is not present, add score to tally
|
||||
else
|
||||
|
||||
! determine scoring index and weight for this filter combination
|
||||
i_filter = sum((matching_bins(1:size(t%filters)) - 1) * t % stride)&
|
||||
+ 1
|
||||
filter_weight = product(filter_weights(:size(t % filters)))
|
||||
|
||||
! Add score to tally
|
||||
!$omp atomic
|
||||
t % results(i_score, i_filter) % value = &
|
||||
t % results(i_score, i_filter) % value + score * filter_weight
|
||||
end if
|
||||
end if
|
||||
end do
|
||||
end select
|
||||
|
||||
|
|
@ -1751,114 +1869,6 @@ contains
|
|||
|
||||
end subroutine score_fission_eout_mg
|
||||
|
||||
!===============================================================================
|
||||
! SCORE_FISSION_DELAYED_EOUT handles a special case where we need to store
|
||||
! delayed neutron production rate with an outgoing energy filter (think of a
|
||||
! fission matrix). In this case, we may need to score to multiple bins if there
|
||||
! were multiple neutrons produced with different energies.
|
||||
!===============================================================================
|
||||
|
||||
subroutine score_fission_delayed_eout(p, t, i_score)
|
||||
|
||||
type(Particle), intent(in) :: p
|
||||
type(TallyObject), intent(inout) :: t
|
||||
integer, intent(in) :: i_score ! index for score
|
||||
|
||||
integer :: i ! index of outgoing energy filter
|
||||
integer :: j ! index of delayedgroup filter
|
||||
integer :: d ! delayed group
|
||||
integer :: g ! another delayed group
|
||||
integer :: d_bin ! delayed group bin index
|
||||
integer :: n ! number of energies on filter
|
||||
integer :: k ! loop index for bank sites
|
||||
integer :: bin_energyout ! original outgoing energy bin
|
||||
integer :: i_filter ! index for matching filter bin combination
|
||||
real(8) :: filter_weight ! combined weight of all filters
|
||||
real(8) :: score ! actual score
|
||||
real(8) :: E_out ! energy of fission bank site
|
||||
|
||||
! Save original outgoing energy bin
|
||||
i = t % find_filter(FILTER_ENERGYOUT)
|
||||
bin_energyout = matching_bins(i)
|
||||
|
||||
! Get the index of delayed group filter
|
||||
j = t % find_filter(FILTER_DELAYEDGROUP)
|
||||
|
||||
! Declare the energyout filter type
|
||||
select type(eo_filt => t % filters(i) % obj)
|
||||
type is (EnergyoutFilter)
|
||||
|
||||
! Get number of energies on filter
|
||||
n = size(eo_filt % bins)
|
||||
|
||||
! Since the creation of fission sites is weighted such that it is
|
||||
! expected to create n_particles sites, we need to multiply the
|
||||
! score by keff to get the true delayed-nu-fission rate.
|
||||
|
||||
! loop over number of particles banked
|
||||
do k = 1, p % n_bank
|
||||
|
||||
! get the delayed group
|
||||
g = fission_bank(n_bank - p % n_bank + k) % delayed_group
|
||||
|
||||
! check if the particle was born delayed
|
||||
if (g /= 0) then
|
||||
|
||||
! determine score based on bank site weight and keff
|
||||
score = keff * fission_bank(n_bank - p % n_bank + k) % wgt
|
||||
|
||||
! determine outgoing energy from fission bank
|
||||
E_out = fission_bank(n_bank - p % n_bank + k) % E
|
||||
|
||||
! check if outgoing energy is within specified range on filter
|
||||
if (E_out < eo_filt % bins(1) .or. E_out > eo_filt % bins(n)) cycle
|
||||
|
||||
! change outgoing energy bin
|
||||
matching_bins(i) = binary_search(eo_filt % bins, n, E_out)
|
||||
|
||||
! if the delayed group filter is present, tally to corresponding
|
||||
! delayed group bin if it exists
|
||||
if (j > 0) then
|
||||
|
||||
! Declare the delayed group filter type
|
||||
select type(dg_filt => t % filters(j) % obj)
|
||||
type is (DelayedGroupFilter)
|
||||
|
||||
! loop over delayed group bins until the corresponding bin is
|
||||
! found
|
||||
do d_bin = 1, dg_filt % n_bins
|
||||
d = dg_filt % groups(d_bin)
|
||||
|
||||
! check whether the delayed group of the particle is equal to
|
||||
! the delayed group of this bin
|
||||
if (d == g) then
|
||||
call score_fission_delayed_dg(t, d_bin, score, i_score)
|
||||
end if
|
||||
end do
|
||||
end select
|
||||
|
||||
! if the delayed group filter is not present, add score to tally
|
||||
else
|
||||
|
||||
! determine scoring index and weight for this filter combination
|
||||
i_filter = sum((matching_bins(1:size(t%filters)) - 1) * t % stride)&
|
||||
+ 1
|
||||
filter_weight = product(filter_weights(:size(t % filters)))
|
||||
|
||||
! Add score to tally
|
||||
!$omp atomic
|
||||
t % results(i_score, i_filter) % value = &
|
||||
t % results(i_score, i_filter) % value + score * filter_weight
|
||||
end if
|
||||
end if
|
||||
end do
|
||||
end select
|
||||
|
||||
! reset outgoing energy bin
|
||||
matching_bins(i) = bin_energyout
|
||||
|
||||
end subroutine score_fission_delayed_eout
|
||||
|
||||
!===============================================================================
|
||||
! SCORE_FISSION_DELAYED_DG helper function used to increment the tally when a
|
||||
! delayed group filter is present.
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
855919f7a333acff6423527b82656d6a472ea8416002fb475c2d21c676e2f75f5c040d209a3e9a3a6118cf944f2c1bfb8cf2318273b890861d790b1927791a35
|
||||
e2cdca7ea5b3532050af5b12fac26d7ef212d2696bb1b73cdd00929b2243c40d100ad02438c7b090555b49815d0de6c48cf1b4ebf437a48bc80c2d2b4bad292e
|
||||
|
|
@ -34,6 +34,12 @@
|
|||
0 10000 1 1 total 0.085835 0.005592
|
||||
material group out nuclide mean std. dev.
|
||||
0 10000 1 total 1.0 0.046071
|
||||
material group out nuclide mean std. dev.
|
||||
0 10000 1 total 1.0 0.051471
|
||||
material group in nuclide mean std. dev.
|
||||
0 10000 1 total 4.996730e-07 3.650635e-08
|
||||
material group in nuclide mean std. dev.
|
||||
0 10000 1 total 0.090004 0.006367
|
||||
material group in nuclide mean std. dev.
|
||||
0 10001 1 total 0.311594 0.013793
|
||||
material group in nuclide mean std. dev.
|
||||
|
|
@ -70,6 +76,12 @@
|
|||
0 10001 1 1 total 0.0 0.0
|
||||
material group out nuclide mean std. dev.
|
||||
0 10001 1 total 0.0 0.0
|
||||
material group out nuclide mean std. dev.
|
||||
0 10001 1 total 0.0 0.0
|
||||
material group in nuclide mean std. dev.
|
||||
0 10001 1 total 5.454760e-07 4.949800e-08
|
||||
material group in nuclide mean std. dev.
|
||||
0 10001 1 total 0.0 0.0
|
||||
material group in nuclide mean std. dev.
|
||||
0 10002 1 total 0.904999 0.043964
|
||||
material group in nuclide mean std. dev.
|
||||
|
|
@ -106,3 +118,9 @@
|
|||
0 10002 1 1 total 0.0 0.0
|
||||
material group out nuclide mean std. dev.
|
||||
0 10002 1 total 0.0 0.0
|
||||
material group out nuclide mean std. dev.
|
||||
0 10002 1 total 0.0 0.0
|
||||
material group in nuclide mean std. dev.
|
||||
0 10002 1 total 5.773006e-07 5.322132e-08
|
||||
material group in nuclide mean std. dev.
|
||||
0 10002 1 total 0.0 0.0
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
3a3b7f75b326c94a8e5c7efe3046b2fdb887e9f75ecf6eb27587f9450c77cf8fd6acc4198c15bffb4e7ceead6d7b4327c19536bbf9cc35dfaae3f4ce4c26cc1a
|
||||
2d948f3b12293294eaeca231a3df9d51195379e8bb38dd3e68d3bc512a7d08ed52a1109054ca381684ec127268710f6d6e9210ac8154c9b379608e996627624a
|
||||
|
|
@ -34,3 +34,9 @@
|
|||
0 (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13,... 1 1 total 0.0 0.0
|
||||
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 0.0 0.0
|
||||
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 0.0 0.0
|
||||
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.000001 6.946255e-07
|
||||
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.0 0.0
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
855919f7a333acff6423527b82656d6a472ea8416002fb475c2d21c676e2f75f5c040d209a3e9a3a6118cf944f2c1bfb8cf2318273b890861d790b1927791a35
|
||||
e2cdca7ea5b3532050af5b12fac26d7ef212d2696bb1b73cdd00929b2243c40d100ad02438c7b090555b49815d0de6c48cf1b4ebf437a48bc80c2d2b4bad292e
|
||||
|
|
@ -63,6 +63,15 @@ domain=10000 type=nu-fission matrix
|
|||
domain=10000 type=chi
|
||||
[ 1. 0.]
|
||||
[ 0.04607052 0. ]
|
||||
domain=10000 type=chi-prompt
|
||||
[ 1. 0.]
|
||||
[ 0.05147146 0. ]
|
||||
domain=10000 type=inverse-velocity
|
||||
[ 5.70932329e-08 2.85573950e-06]
|
||||
[ 4.68792969e-09 2.44216503e-07]
|
||||
domain=10000 type=prompt-nu-fission
|
||||
[ 0.01923922 0.46671903]
|
||||
[ 0.00130951 0.04141087]
|
||||
domain=10001 type=total
|
||||
[ 0.31373767 0.3008214 ]
|
||||
[ 0.0155819 0.02805245]
|
||||
|
|
@ -128,6 +137,15 @@ domain=10001 type=nu-fission matrix
|
|||
domain=10001 type=chi
|
||||
[ 0. 0.]
|
||||
[ 0. 0.]
|
||||
domain=10001 type=chi-prompt
|
||||
[ 0. 0.]
|
||||
[ 0. 0.]
|
||||
domain=10001 type=inverse-velocity
|
||||
[ 5.99598048e-08 2.98549021e-06]
|
||||
[ 4.55309296e-09 3.41701554e-07]
|
||||
domain=10001 type=prompt-nu-fission
|
||||
[ 0. 0.]
|
||||
[ 0. 0.]
|
||||
domain=10002 type=total
|
||||
[ 0.66457226 2.05238401]
|
||||
[ 0.03121475 0.22434291]
|
||||
|
|
@ -193,3 +211,12 @@ domain=10002 type=nu-fission matrix
|
|||
domain=10002 type=chi
|
||||
[ 0. 0.]
|
||||
[ 0. 0.]
|
||||
domain=10002 type=chi-prompt
|
||||
[ 0. 0.]
|
||||
[ 0. 0.]
|
||||
domain=10002 type=inverse-velocity
|
||||
[ 6.02207831e-08 3.04495537e-06]
|
||||
[ 3.78043696e-09 3.60007673e-07]
|
||||
domain=10002 type=prompt-nu-fission
|
||||
[ 0. 0.]
|
||||
[ 0. 0.]
|
||||
|
|
|
|||
1
tests/test_mgxs_library_mesh/inputs_true.dat
Normal file
1
tests/test_mgxs_library_mesh/inputs_true.dat
Normal file
|
|
@ -0,0 +1 @@
|
|||
a4cd030bea212e45fdb159e75a7fb3d1947e9bf3d0384ac5d37a72298d67dcfdd1b9eb5c6af8ac6e5983bd5b47de9c17a2ea472b467b7222a4909ee070bf1ca3
|
||||
132
tests/test_mgxs_library_mesh/results_true.dat
Normal file
132
tests/test_mgxs_library_mesh/results_true.dat
Normal file
|
|
@ -0,0 +1,132 @@
|
|||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 0.640786 0.044177
|
||||
1 1 2 1 1 total 0.660597 0.128423
|
||||
2 2 1 1 1 total 0.615276 0.104046
|
||||
3 2 2 1 1 total 0.646999 0.186709
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 0.36665 0.048814
|
||||
1 1 2 1 1 total 0.40784 0.096486
|
||||
2 2 1 1 1 total 0.36356 0.074111
|
||||
3 2 2 1 1 total 0.41456 0.160443
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 0.366650 0.048814
|
||||
1 1 2 1 1 total 0.407840 0.096486
|
||||
2 2 1 1 1 total 0.363560 0.074111
|
||||
3 2 2 1 1 total 0.414593 0.160436
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 0.025749 0.002863
|
||||
1 1 2 1 1 total 0.028400 0.005275
|
||||
2 2 1 1 1 total 0.022988 0.004099
|
||||
3 2 2 1 1 total 0.027589 0.010350
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 0.015861 0.002876
|
||||
1 1 2 1 1 total 0.017280 0.004371
|
||||
2 2 1 1 1 total 0.014403 0.003542
|
||||
3 2 2 1 1 total 0.018061 0.010110
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 0.009888 0.001077
|
||||
1 1 2 1 1 total 0.011121 0.002456
|
||||
2 2 1 1 1 total 0.008585 0.001552
|
||||
3 2 2 1 1 total 0.009527 0.003659
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 0.026065 0.002907
|
||||
1 1 2 1 1 total 0.029084 0.006430
|
||||
2 2 1 1 1 total 0.022596 0.004062
|
||||
3 2 2 1 1 total 0.025066 0.009687
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 1.938476 0.211550
|
||||
1 1 2 1 1 total 2.177360 0.480780
|
||||
2 2 1 1 1 total 1.682799 0.303764
|
||||
3 2 2 1 1 total 1.864890 0.715661
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 0.615037 0.041754
|
||||
1 1 2 1 1 total 0.632196 0.123878
|
||||
2 2 1 1 1 total 0.592288 0.100439
|
||||
3 2 2 1 1 total 0.619410 0.177190
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 0.584014 0.054315
|
||||
1 1 2 1 1 total 0.622514 0.111323
|
||||
2 2 1 1 1 total 0.587256 0.084833
|
||||
3 2 2 1 1 total 0.613792 0.168612
|
||||
mesh 1 group in group out nuclide moment mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 1 total P0 0.584014 0.054315
|
||||
1 1 1 1 1 1 total P1 0.243427 0.025488
|
||||
2 1 1 1 1 1 total P2 0.089236 0.007357
|
||||
3 1 1 1 1 1 total P3 0.008994 0.005768
|
||||
4 1 2 1 1 1 total P0 0.622514 0.111323
|
||||
5 1 2 1 1 1 total P1 0.239376 0.042594
|
||||
6 1 2 1 1 1 total P2 0.088386 0.017200
|
||||
7 1 2 1 1 1 total P3 -0.001243 0.005639
|
||||
8 2 1 1 1 1 total P0 0.587256 0.084833
|
||||
9 2 1 1 1 1 total P1 0.245120 0.041033
|
||||
10 2 1 1 1 1 total P2 0.086784 0.016255
|
||||
11 2 1 1 1 1 total P3 0.008660 0.004755
|
||||
12 2 2 1 1 1 total P0 0.612950 0.167940
|
||||
13 2 2 1 1 1 total P1 0.226176 0.061882
|
||||
14 2 2 1 1 1 total P2 0.086593 0.026126
|
||||
15 2 2 1 1 1 total P3 0.009672 0.011995
|
||||
mesh 1 group in group out nuclide moment mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 1 total P0 0.584014 0.054315
|
||||
1 1 1 1 1 1 total P1 0.243427 0.025488
|
||||
2 1 1 1 1 1 total P2 0.089236 0.007357
|
||||
3 1 1 1 1 1 total P3 0.008994 0.005768
|
||||
4 1 2 1 1 1 total P0 0.622514 0.111323
|
||||
5 1 2 1 1 1 total P1 0.239376 0.042594
|
||||
6 1 2 1 1 1 total P2 0.088386 0.017200
|
||||
7 1 2 1 1 1 total P3 -0.001243 0.005639
|
||||
8 2 1 1 1 1 total P0 0.587256 0.084833
|
||||
9 2 1 1 1 1 total P1 0.245120 0.041033
|
||||
10 2 1 1 1 1 total P2 0.086784 0.016255
|
||||
11 2 1 1 1 1 total P3 0.008660 0.004755
|
||||
12 2 2 1 1 1 total P0 0.613792 0.168612
|
||||
13 2 2 1 1 1 total P1 0.226142 0.061856
|
||||
14 2 2 1 1 1 total P2 0.086174 0.025979
|
||||
15 2 2 1 1 1 total P3 0.009721 0.012027
|
||||
mesh 1 group in group out nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 1 total 1.000000 0.088094
|
||||
1 1 2 1 1 1 total 1.000000 0.160891
|
||||
2 2 1 1 1 1 total 1.000000 0.126864
|
||||
3 2 2 1 1 1 total 1.001374 0.305883
|
||||
mesh 1 group in group out nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 1 total 0.027395 0.004680
|
||||
1 1 2 1 1 1 total 0.022914 0.006025
|
||||
2 2 1 1 1 1 total 0.019384 0.002846
|
||||
3 2 2 1 1 1 total 0.029629 0.006292
|
||||
mesh 1 group out nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 1.0 0.220956
|
||||
1 1 2 1 1 total 1.0 0.316565
|
||||
2 2 1 1 1 total 1.0 0.132140
|
||||
3 2 2 1 1 total 1.0 0.181577
|
||||
mesh 1 group out nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 1.0 0.222246
|
||||
1 1 2 1 1 total 1.0 0.316565
|
||||
2 2 1 1 1 total 1.0 0.132140
|
||||
3 2 2 1 1 total 1.0 0.181577
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 3.610522e-07 3.169931e-08
|
||||
1 1 2 1 1 total 3.942353e-07 8.459167e-08
|
||||
2 2 1 1 1 total 3.097784e-07 5.252025e-08
|
||||
3 2 2 1 1 total 3.799163e-07 1.806470e-07
|
||||
mesh 1 group in nuclide mean std. dev.
|
||||
x y z
|
||||
0 1 1 1 1 total 0.025735 0.002840
|
||||
1 1 2 1 1 total 0.028773 0.006349
|
||||
2 2 1 1 1 total 0.022306 0.004010
|
||||
3 2 2 1 1 total 0.024549 0.009379
|
||||
81
tests/test_mgxs_library_mesh/test_mgxs_library_mesh.py
Normal file
81
tests/test_mgxs_library_mesh/test_mgxs_library_mesh.py
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
import sys
|
||||
import glob
|
||||
import hashlib
|
||||
sys.path.insert(0, os.pardir)
|
||||
from testing_harness import PyAPITestHarness
|
||||
import openmc
|
||||
import openmc.mgxs
|
||||
|
||||
|
||||
class MGXSTestHarness(PyAPITestHarness):
|
||||
def _build_inputs(self):
|
||||
# Generate inputs using parent class routine
|
||||
super(MGXSTestHarness, self)._build_inputs()
|
||||
|
||||
# Initialize a one-group structure
|
||||
energy_groups = openmc.mgxs.EnergyGroups(group_edges=[0, 20.])
|
||||
|
||||
# Initialize MGXS Library for a few cross section types
|
||||
# for one material-filled cell in the geometry
|
||||
self.mgxs_lib = openmc.mgxs.Library(self._input_set.geometry)
|
||||
self.mgxs_lib.by_nuclide = False
|
||||
|
||||
# Test all MGXS types
|
||||
self.mgxs_lib.mgxs_types = openmc.mgxs.MGXS_TYPES
|
||||
self.mgxs_lib.energy_groups = energy_groups
|
||||
self.mgxs_lib.legendre_order = 3
|
||||
self.mgxs_lib.domain_type = 'mesh'
|
||||
|
||||
# Instantiate a tally mesh
|
||||
mesh = openmc.Mesh(mesh_id=1)
|
||||
mesh.type = 'regular'
|
||||
mesh.dimension = [2, 2]
|
||||
mesh.lower_left = [-100., -100.]
|
||||
mesh.width = [100., 100.]
|
||||
|
||||
self.mgxs_lib.domains = [mesh]
|
||||
self.mgxs_lib.build_library()
|
||||
|
||||
# Initialize a tallies file
|
||||
self._input_set.tallies = openmc.Tallies()
|
||||
self.mgxs_lib.add_to_tallies_file(self._input_set.tallies, merge=False)
|
||||
self._input_set.tallies.export_to_xml()
|
||||
|
||||
def _get_results(self, hash_output=False):
|
||||
"""Digest info in the statepoint and return as a string."""
|
||||
|
||||
# Read the statepoint file.
|
||||
statepoint = glob.glob(os.path.join(os.getcwd(), self._sp_name))[0]
|
||||
sp = openmc.StatePoint(statepoint)
|
||||
|
||||
# Load the MGXS library from the statepoint
|
||||
self.mgxs_lib.load_from_statepoint(sp)
|
||||
|
||||
# Build a string from Pandas Dataframe for each 1-group MGXS
|
||||
outstr = ''
|
||||
for domain in self.mgxs_lib.domains:
|
||||
for mgxs_type in self.mgxs_lib.mgxs_types:
|
||||
mgxs = self.mgxs_lib.get_mgxs(domain, mgxs_type)
|
||||
df = mgxs.get_pandas_dataframe()
|
||||
outstr += df.to_string() + '\n'
|
||||
|
||||
# Hash the results if necessary
|
||||
if hash_output:
|
||||
sha512 = hashlib.sha512()
|
||||
sha512.update(outstr.encode('utf-8'))
|
||||
outstr = sha512.hexdigest()
|
||||
|
||||
return outstr
|
||||
|
||||
def _cleanup(self):
|
||||
super(MGXSTestHarness, self)._cleanup()
|
||||
f = os.path.join(os.getcwd(), 'tallies.xml')
|
||||
if os.path.exists(f): os.remove(f)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
harness = MGXSTestHarness('statepoint.10.*', True)
|
||||
harness.main()
|
||||
|
|
@ -1 +1 @@
|
|||
855919f7a333acff6423527b82656d6a472ea8416002fb475c2d21c676e2f75f5c040d209a3e9a3a6118cf944f2c1bfb8cf2318273b890861d790b1927791a35
|
||||
e2cdca7ea5b3532050af5b12fac26d7ef212d2696bb1b73cdd00929b2243c40d100ad02438c7b090555b49815d0de6c48cf1b4ebf437a48bc80c2d2b4bad292e
|
||||
|
|
@ -75,6 +75,15 @@
|
|||
material group out nuclide mean std. dev.
|
||||
1 10000 1 total 1.0 0.046071
|
||||
0 10000 2 total 0.0 0.000000
|
||||
material group out nuclide mean std. dev.
|
||||
1 10000 1 total 1.0 0.051471
|
||||
0 10000 2 total 0.0 0.000000
|
||||
material group in nuclide mean std. dev.
|
||||
1 10000 1 total 5.709323e-08 4.687930e-09
|
||||
0 10000 2 total 2.855740e-06 2.442165e-07
|
||||
material group in nuclide mean std. dev.
|
||||
1 10000 1 total 0.019239 0.001310
|
||||
0 10000 2 total 0.466719 0.041411
|
||||
material group in nuclide mean std. dev.
|
||||
1 10001 1 total 0.313738 0.015582
|
||||
0 10001 2 total 0.300821 0.028052
|
||||
|
|
@ -152,6 +161,15 @@
|
|||
material group out nuclide mean std. dev.
|
||||
1 10001 1 total 0.0 0.0
|
||||
0 10001 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
|
||||
material group in nuclide mean std. dev.
|
||||
1 10001 1 total 5.995980e-08 4.553093e-09
|
||||
0 10001 2 total 2.985490e-06 3.417016e-07
|
||||
material group in nuclide mean std. dev.
|
||||
1 10001 1 total 0.0 0.0
|
||||
0 10001 2 total 0.0 0.0
|
||||
material group in nuclide mean std. dev.
|
||||
1 10002 1 total 0.664572 0.031215
|
||||
0 10002 2 total 2.052384 0.224343
|
||||
|
|
@ -229,3 +247,12 @@
|
|||
material group out nuclide mean std. dev.
|
||||
1 10002 1 total 0.0 0.0
|
||||
0 10002 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
|
||||
material group in nuclide mean std. dev.
|
||||
1 10002 1 total 6.022078e-08 3.780437e-09
|
||||
0 10002 2 total 3.044955e-06 3.600077e-07
|
||||
material group in nuclide mean std. dev.
|
||||
1 10002 1 total 0.0 0.0
|
||||
0 10002 2 total 0.0 0.0
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
739796983940a1bad601998cf9ea2f90453a994477c7f675c2fd404d1864fe04a7fbfb5a15c5fe7cf9bad016b78432ba0910baba6f9cc026143761e9f526b62a
|
||||
e4a5f03ab6167e96462c4ef537533fe33b98d7878ae00824c5619356bda8d548b3c71af01ba8c88d5a9b46dd1471d331e6f678a164af922200f2ee3642be6340
|
||||
|
|
@ -1 +1 @@
|
|||
d56c6bae6bf3cd8950d3f50f089458c1c6c807be780fc97570532c6af6eb7e3057968d3345bd3c363f01315271129ef7b2ca028b05767353e601dc37b035f8a7
|
||||
e494320a213b5704a2ac915a2ba504857be91961ceb6735b6ad05d81eb31c44c9584d5bd9d40baececf1dcb5b030e6ecec63cfbd20639baf69bcb596c5c46591
|
||||
|
|
@ -1 +1 @@
|
|||
2f6728effcafd8cdba60604f5c695a1fbaa591c0ee6bd907d7a942ee8df05386502aeae4027a4bf455ac1d072211c77010fe624f4a86ac538a53fc7159695eaa
|
||||
930af242a043f2676a000dbc5a2db6b148edcb31ed8c87dbaa35a8efb37a3be8cff30cdf4dc03f9c5c7eb4021f7e4c3327e64681cdd8fd8722c95c69db850227
|
||||
|
|
@ -1 +1 @@
|
|||
d890ab7b790d6672ce94ab4144c5f6b1a7ffae63cfe3bff5cdcf75a1458e3819650b547de9c137a223bc2725c7d7670b06636377f55b69078274a89ebc7c5851
|
||||
a51db2a4efc681805f85968e04411dc33beee0532c202f5179b9a82880ab60a75e53fa9141c81045ea1d2842372f2d8da900326f09382ea61dd80a3c9b43bba1
|
||||
|
|
@ -123,7 +123,8 @@ class TalliesTestHarness(PyAPITestHarness):
|
|||
t.filters = [cell_filter]
|
||||
t.scores = ['absorption', 'delayed-nu-fission', 'events', 'fission',
|
||||
'inverse-velocity', 'kappa-fission', '(n,2n)', '(n,n1)',
|
||||
'(n,gamma)', 'nu-fission', 'scatter', 'elastic', 'total']
|
||||
'(n,gamma)', 'nu-fission', 'scatter', 'elastic', 'total',
|
||||
'prompt-nu-fission']
|
||||
score_tallies[0].estimator = 'tracklength'
|
||||
score_tallies[1].estimator = 'analog'
|
||||
score_tallies[2].estimator = 'collision'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue