diff --git a/openmc/deplete/operator.py b/openmc/deplete/operator.py index 8eb033783f..2572150012 100644 --- a/openmc/deplete/operator.py +++ b/openmc/deplete/operator.py @@ -113,6 +113,12 @@ class Operator(TransportOperator): ``fission_yield_mode``. Will be passed directly on to the helper. Passing a value of None will use the defaults for the associated helper. + reduce_chain : bool or int, optional + If ``True`` or an integer, create a reduced depletion chain by + following transmuation paths for isotopes in burnable materials. + A value of ``True`` implies to follow all paths to completion, + while a non-negative integer indicates the depth. See + :meth:`openmc.deplete.Chain.reduce` Attributes ---------- @@ -158,7 +164,8 @@ class Operator(TransportOperator): def __init__(self, geometry, settings, chain_file=None, prev_results=None, diff_burnable_mats=False, energy_mode="fission-q", fission_q=None, dilute_initial=1.0e3, - fission_yield_mode="constant", fission_yield_opts=None): + fission_yield_mode="constant", fission_yield_opts=None, + reduce_chain=False): if fission_yield_mode not in self._fission_helpers: raise KeyError( "fission_yield_mode must be one of {}, not {}".format( @@ -179,6 +186,17 @@ class Operator(TransportOperator): self.geometry = geometry self.diff_burnable_mats = diff_burnable_mats + # Reduce the chain before we create more materials + if reduce_chain is not False: + all_isotopes = set() + for material in geometry.get_all_materials().values(): + if not material.depletable: + continue + for name, _dens_percent, _dens_type in material.nuclides: + all_isotopes.add(name) + level = None if reduce_chain is True else reduce_chain + self.chain = self.chain.reduce(all_isotopes, level) + # Differentiate burnable materials with multiple instances if self.diff_burnable_mats: self._differentiate_burnable_mats()