Remove unused arguments on NormalizationHelper classes

This commit is contained in:
Paul Romano 2020-07-13 16:28:22 -05:00
parent bf8405f6cc
commit cdf58828af
3 changed files with 6 additions and 18 deletions

View file

@ -335,7 +335,7 @@ class NormalizationHelper(ABC):
self._energy = 0.0
@abstractmethod
def prepare(self, chain_nucs, rate_index, materials):
def prepare(self, chain_nucs, rate_index):
"""Perform work needed to obtain energy produced
This method is called prior to the transport simulations
@ -348,13 +348,9 @@ class NormalizationHelper(ABC):
rate_index : dict of str to int
Mapping from nuclide name to index in the
`fission_rates` for :meth:`update`.
materials : list of str
All materials tracked on the operator helped by this
object. Should correspond to
:attr:`openmc.deplete.Operator.burnable_materials`
"""
def update(self, fission_rates, mat_index):
def update(self, fission_rates):
"""Update the energy produced
Parameters
@ -363,9 +359,6 @@ class NormalizationHelper(ABC):
fission reaction rate for each isotope in the specified
material. Should be ordered corresponding to initial
``rate_index`` used in :meth:`prepare`
mat_index : int
Index for the specific material in the list of all burnable
materials.
"""
@property

View file

@ -113,7 +113,7 @@ class ChainFissionHelper(NormalizationHelper):
super().__init__()
self._fission_q_vector = None
def prepare(self, chain_nucs, rate_index, _materials):
def prepare(self, chain_nucs, rate_index):
"""Populate the fission Q value vector from a chain.
Parameters
@ -125,8 +125,6 @@ class ChainFissionHelper(NormalizationHelper):
Dictionary mapping names of nuclides, e.g. ``"U235"``,
to a corresponding index in the desired fission Q
vector.
_materials : list of str
Unused. Materials to be tracked for this helper.
"""
if (self._fission_q_vector is not None
and self._fission_q_vector.shape == (len(rate_index),)):
@ -143,7 +141,7 @@ class ChainFissionHelper(NormalizationHelper):
self._fission_q_vector = fission_qs
def update(self, fission_rates, _mat_index):
def update(self, fission_rates):
"""Update energy produced with fission rates in a material
Parameters
@ -152,9 +150,6 @@ class ChainFissionHelper(NormalizationHelper):
fission reaction rate for each isotope in the specified
material. Should be ordered corresponding to initial
``rate_index`` used in :meth:`prepare`
_mat_index : int
index for the material requested. Unused, as identical
isotopes in all materials have the same Q value.
"""
self._energy += dot(fission_rates, self._fission_q_vector)

View file

@ -492,7 +492,7 @@ class Operator(TransportOperator):
for i in self.burnable_mats]
self._rate_helper.generate_tallies(materials, self.chain.reactions)
self._normalization_helper.prepare(
self.chain.nuclides, self.reaction_rates.index_nuc, materials)
self.chain.nuclides, self.reaction_rates.index_nuc)
# Tell fission yield helper what materials this process is
# responsible for
self._yield_helper.generate_tallies(
@ -672,7 +672,7 @@ class Operator(TransportOperator):
fission_yields.append(self._yield_helper.weighted_yields(i))
# Accumulate energy from fission
self._normalization_helper.update(tally_rates[:, fission_ind], mat_index)
self._normalization_helper.update(tally_rates[:, fission_ind])
# Divide by total number and store
rates[i] = self._rate_helper.divide_by_adens(number)