From aa86aa5262690e9a3e5b3ac08bac799ad642209f Mon Sep 17 00:00:00 2001 From: Andrew Johnson Date: Wed, 14 Aug 2019 18:02:27 -0500 Subject: [PATCH] Improve documentation for FissionYieldHelpers Add a separate section in the documentation describing the helpers. Reword purpose of mat_indexes in generate_tallies --- docs/source/pythonapi/deplete.rst | 19 ++++++++++++++----- openmc/deplete/abc.py | 14 ++++++++++---- openmc/deplete/helpers.py | 19 +++++++++++++------ openmc/deplete/nuclide.py | 2 +- openmc/deplete/operator.py | 15 ++++++--------- 5 files changed, 44 insertions(+), 25 deletions(-) diff --git a/docs/source/pythonapi/deplete.rst b/docs/source/pythonapi/deplete.rst index 5699f3f2a..5b26eb38a 100644 --- a/docs/source/pythonapi/deplete.rst +++ b/docs/source/pythonapi/deplete.rst @@ -77,16 +77,25 @@ data, such as number densities and reaction rates for each material. :template: myclass.rst AtomNumber - AveragedFissionYieldHelper - ChainFissionHelper - ConstantFissionYieldHelper - DirectReactionRateHelper - FissionYieldCutoffHelper OperatorResult ReactionRates Results ResultsList +The following classes are used to help the :class:`openmc.deplete.Operator` +compute quantities like effective fission yields, reaction rates, and +total system energy. + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: myclass.rst + + helpers.AveragedFissionYieldHelper + helpers.ChainFissionHelper + helpers.ConstantFissionYieldHelper + helpers.DirectReactionRateHelper + helpers.FissionYieldCutoffHelper The following classes are abstract classes that can be used to extend the :mod:`openmc.deplete` capabilities: diff --git a/openmc/deplete/abc.py b/openmc/deplete/abc.py index d1dc2cdc4..fd5278d89 100644 --- a/openmc/deplete/abc.py +++ b/openmc/deplete/abc.py @@ -443,8 +443,11 @@ class FissionYieldHelper(ABC): materials : iterable of C-API materials Materials to be used in :class:`openmc.capi.MaterialFilter` mat_indexes : iterable of int - Indexes for materials in ``materials`` tracked on this - process + Indices of tallied materials that will have their fission + yields computed by this helper. Necessary as the + :class:`openmc.deplete.Operator` that uses this helper + may only burn a subset of all materials when running + in parallel mode. """ def update_nuclides_from_operator(self, nuclides): @@ -526,8 +529,11 @@ class TalliedFissionYieldHelper(FissionYieldHelper): materials : iterable of :class:`openmc.capi.Material` Materials to be used in :class:`openmc.capi.MaterialFilter` mat_indexes : iterable of int - Indexes for materials in ``materials`` tracked on this - process + Indices of tallied materials that will have their fission + yields computed by this helper. Necessary as the + :class:`openmc.deplete.Operator` that uses this helper + may only burn a subset of all materials when running + in parallel mode. """ self._local_indexes = asarray(mat_indexes) diff --git a/openmc/deplete/helpers.py b/openmc/deplete/helpers.py index 19e51628d..8dc9035b3 100644 --- a/openmc/deplete/helpers.py +++ b/openmc/deplete/helpers.py @@ -376,8 +376,11 @@ class FissionYieldCutoffHelper(TalliedFissionYieldHelper): materials : iterable of :class:`openmc.capi.Material` Materials to be used in :class:`openmc.capi.MaterialFilter` mat_indexes : iterable of int - Indexes for materials in ``materials`` tracked on this - process + Indices of tallied materials that will have their fission + yields computed by this helper. Necessary as the + :class:`openmc.deplete.Operator` that uses this helper + may only burn a subset of all materials when running + in parallel mode. """ super().generate_tallies(materials, mat_indexes) energy_filter = EnergyFilter() @@ -465,8 +468,9 @@ class AveragedFissionYieldHelper(TalliedFissionYieldHelper): Conversely, if the average energy is above the highest energy with yield data, that set of fission yields is used. For the case where the average energy is between two sets - of yields, a geometric mean of the yield distributions is - used. + of yields, the effective fission yield computed by + linearly interpolating between yields provided at the + nearest energies above and below the average. Parameters ---------- @@ -502,8 +506,11 @@ class AveragedFissionYieldHelper(TalliedFissionYieldHelper): materials : iterable of :class:`openmc.capi.Material` Materials to be used in :class:`openmc.capi.MaterialFilter` mat_indexes : iterable of int - Indexes for materials in ``materials`` tracked on this - process + Indices of tallied materials that will have their fission + yields computed by this helper. Necessary as the + :class:`openmc.deplete.Operator` that uses this helper + may only burn a subset of all materials when running + in parallel mode. """ super().generate_tallies(materials, mat_indexes) fission_tally = self._fission_rate_tally diff --git a/openmc/deplete/nuclide.py b/openmc/deplete/nuclide.py index 649b6700f..d2b0acc16 100644 --- a/openmc/deplete/nuclide.py +++ b/openmc/deplete/nuclide.py @@ -236,7 +236,7 @@ class Nuclide(object): class FissionYieldDistribution(Mapping): - """Class for storing energy-dependent fission yields for a single nuclide + """Energy-dependent fission product yields for a single nuclide Can be used as a dictionary mapping energies and products to fission yields:: diff --git a/openmc/deplete/operator.py b/openmc/deplete/operator.py index b7df9b8fc..5b9d2fca6 100644 --- a/openmc/deplete/operator.py +++ b/openmc/deplete/operator.py @@ -86,19 +86,16 @@ class Operator(TransportOperator): in initial condition to ensure they exist in the decay chain. Only done for nuclides with reaction rates. Defaults to 1.0e3. - fission_yield_mode : str, {"constant", "cutoff"} + fission_yield_mode : ("constant", "cutoff", "average") Key indicating what fission product yield scheme to use. The - key determines what fission energy helper is used:: + key determines what fission energy helper is used: - * "constant": :class:`openmc.deplete.ConstantFissionYieldHelper` - * "cutoff": :class:`openmc.deplete.FissionYieldCutoffHelper` - * "average": :class:`openmc.deplete.AveragedFissionYieldHelper` + * "constant": :class:`~openmc.deplete.helpers.ConstantFissionYieldHelper` + * "cutoff": :class:`~openmc.deplete.helpers.FissionYieldCutoffHelper` + * "average": :class:`~openmc.deplete.helpers.AveragedFissionYieldHelper` The documentation on these classes describe their methodology - and differences. ``"constant"`` will treat fission yields as - constant with respect to energy, while ``"cutoff"`` will - compute effective yields based on the number of fission events - above and below a cutoff. Default: ``"constant"`` + and differences. Default: ``"constant"`` fission_yield_opts : dict of str to option, optional Optional arguments to pass to the helper determined by ``fission_yield_mode``. Will be passed directly on to the