mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 06:05:58 -04:00
Make number of burnable materials optional for TalliedFissionYieldHelper
Must be supplied prior to generating tallies. This makes the Operator's job a little easier when picking the fission yield mode.
This commit is contained in:
parent
f82dc83473
commit
ebf2f25ab1
2 changed files with 22 additions and 5 deletions
|
|
@ -480,13 +480,14 @@ class TalliedFissionYieldHelper(FissionYieldHelper):
|
||||||
chain_nuclides : iterable of openmc.deplete.Nuclide
|
chain_nuclides : iterable of openmc.deplete.Nuclide
|
||||||
Nuclides tracked in the depletion chain. Not necessary
|
Nuclides tracked in the depletion chain. Not necessary
|
||||||
that all have yield data.
|
that all have yield data.
|
||||||
n_bmats : int
|
n_bmats : int, optional
|
||||||
Number of burnable materials tracked in the problem.
|
Number of burnable materials tracked in the problem.
|
||||||
|
|
||||||
Attributes
|
Attributes
|
||||||
----------
|
----------
|
||||||
n_bmats : int
|
n_bmats : int
|
||||||
Number of burnable materials tracked in the problem
|
Number of burnable materials tracked in the problem.
|
||||||
|
Must be set prior to generating tallies
|
||||||
constant_yields : dict of str to :class:`openmc.deplete.FissionYield`
|
constant_yields : dict of str to :class:`openmc.deplete.FissionYield`
|
||||||
Fission yields for all nuclides that only have one set of
|
Fission yields for all nuclides that only have one set of
|
||||||
fission yield data. Can be accessed as ``{parent: {product: yield}}``
|
fission yield data. Can be accessed as ``{parent: {product: yield}}``
|
||||||
|
|
@ -494,13 +495,26 @@ class TalliedFissionYieldHelper(FissionYieldHelper):
|
||||||
|
|
||||||
_upper_energy = 20.0e6 # upper energy for tallies
|
_upper_energy = 20.0e6 # upper energy for tallies
|
||||||
|
|
||||||
def __init__(self, chain_nuclides, n_bmats):
|
def __init__(self, chain_nuclides, n_bmats=None):
|
||||||
super().__init__(chain_nuclides)
|
super().__init__(chain_nuclides)
|
||||||
self.n_bmats = n_bmats
|
self.n_bmats = n_bmats
|
||||||
self._local_indexes = None
|
self._local_indexes = None
|
||||||
self._fission_rate_tally = None
|
self._fission_rate_tally = None
|
||||||
self._tally_index = {}
|
self._tally_index = {}
|
||||||
|
|
||||||
|
@property
|
||||||
|
def n_bmats(self):
|
||||||
|
return self._n_bmats
|
||||||
|
|
||||||
|
@n_bmats.setter
|
||||||
|
def n_bmats(self, value):
|
||||||
|
if value is None:
|
||||||
|
self._n_bmats = None
|
||||||
|
return
|
||||||
|
check_type("n_bmats", value, Integral)
|
||||||
|
check_greater_than("n_bmats", value, 0)
|
||||||
|
sef._n_bmats = value
|
||||||
|
|
||||||
def generate_tallies(self, materials, mat_indexes):
|
def generate_tallies(self, materials, mat_indexes):
|
||||||
"""Construct the fission rate tally
|
"""Construct the fission rate tally
|
||||||
|
|
||||||
|
|
@ -512,6 +526,8 @@ class TalliedFissionYieldHelper(FissionYieldHelper):
|
||||||
Indexes for materials in ``materials`` tracked on this
|
Indexes for materials in ``materials`` tracked on this
|
||||||
process
|
process
|
||||||
"""
|
"""
|
||||||
|
if self._n_bmat is None:
|
||||||
|
raise AttributeError("Number of burnable materials is not set")
|
||||||
self._local_indexes = asarray(mat_indexes)
|
self._local_indexes = asarray(mat_indexes)
|
||||||
|
|
||||||
# Tally group-wise fission reaction rates
|
# Tally group-wise fission reaction rates
|
||||||
|
|
|
||||||
|
|
@ -238,7 +238,7 @@ class FissionYieldCutoffHelper(TalliedFissionYieldHelper):
|
||||||
chain_nuclides : iterable of openmc.deplete.Nuclide
|
chain_nuclides : iterable of openmc.deplete.Nuclide
|
||||||
Nuclides tracked in the depletion chain. Not necessary
|
Nuclides tracked in the depletion chain. Not necessary
|
||||||
that all have yield data.
|
that all have yield data.
|
||||||
n_bmats : int
|
n_bmats : int, optional
|
||||||
Number of burnable materials tracked in the problem
|
Number of burnable materials tracked in the problem
|
||||||
cutoff : float, optional
|
cutoff : float, optional
|
||||||
Cutoff energy in [eV] below which all fissions will be
|
Cutoff energy in [eV] below which all fissions will be
|
||||||
|
|
@ -254,7 +254,8 @@ class FissionYieldCutoffHelper(TalliedFissionYieldHelper):
|
||||||
Attributes
|
Attributes
|
||||||
----------
|
----------
|
||||||
n_bmats : int
|
n_bmats : int
|
||||||
Number of burnable materials tracked in the problem
|
Number of burnable materials tracked in the problem.
|
||||||
|
Must be set prior to generating tallies
|
||||||
thermal_yields : dict
|
thermal_yields : dict
|
||||||
Dictionary of the form ``{parent: {product: yield}}``
|
Dictionary of the form ``{parent: {product: yield}}``
|
||||||
with thermal yields
|
with thermal yields
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue