diff --git a/docs/source/pythonapi/data.rst b/docs/source/pythonapi/data.rst index c7c65e14a..2ee08c7f5 100644 --- a/docs/source/pythonapi/data.rst +++ b/docs/source/pythonapi/data.rst @@ -63,6 +63,7 @@ Core Functions atomic_weight combine_distributions decay_constant + decay_photon_source dose_coefficients gnd_name half_life diff --git a/openmc/data/decay.py b/openmc/data/decay.py index c372b72e4..eafa84f66 100644 --- a/openmc/data/decay.py +++ b/openmc/data/decay.py @@ -579,13 +579,15 @@ class Decay(EqualityMixin): _DECAY_PHOTON_SOURCE = {} -def decay_photon_source(nuclide): +def decay_photon_source(nuclide: str) -> Univariate: """Get photon source from the decay of a nuclide This function relies on data stored in a depletion chain. Before calling it for the first time, you need to ensure that a depletion chain has been specified in openmc.config['chain_file']. + .. versionadded:: 0.14.0 + Parameters ---------- nuclide : str diff --git a/openmc/deplete/stepresult.py b/openmc/deplete/stepresult.py index 41086baf3..e462f1754 100644 --- a/openmc/deplete/stepresult.py +++ b/openmc/deplete/stepresult.py @@ -202,6 +202,8 @@ class StepResult: def get_material(self, mat_id): """Return material object for given depleted composition + .. versionadded:: 0.14.0 + Parameters ---------- mat_id : str diff --git a/openmc/material.py b/openmc/material.py index b5c9d70f9..53bf676d5 100644 --- a/openmc/material.py +++ b/openmc/material.py @@ -18,6 +18,7 @@ import openmc.checkvalue as cv from ._xml import clean_indentation, reorder_attributes from .mixin import IDManagerMixin from openmc.checkvalue import PathLike +from openmc.stats import Univariate # Units for density supported by OpenMC @@ -34,10 +35,10 @@ class Material(IDManagerMixin): To create a material, one should create an instance of this class, add nuclides or elements with :meth:`Material.add_nuclide` or :meth:`Material.add_element`, respectively, and set the total material - density with :meth:`Material.set_density()`. Alternatively, you can - use :meth:`Material.add_components()` to pass a dictionary - containing all the component information. The material can then be - assigned to a cell using the :attr:`Cell.fill` attribute. + density with :meth:`Material.set_density()`. Alternatively, you can use + :meth:`Material.add_components()` to pass a dictionary containing all the + component information. The material can then be assigned to a cell using the + :attr:`Cell.fill` attribute. Parameters ---------- @@ -91,6 +92,13 @@ class Material(IDManagerMixin): fissionable_mass : float Mass of fissionable nuclides in the material in [g]. Requires that the :attr:`volume` attribute is set. + decay_photon_source : openmc.stats.Univariate + Energy distribution of photons emitted from decay of unstable nuclides + within the material. The integral of this distribution is the total + intensity of the photon source. + + .. versionadded:: 0.14.0 + """ next_id = 1 @@ -256,7 +264,7 @@ class Material(IDManagerMixin): return density*self.volume @property - def decay_photon_source(self): + def decay_photon_source(self) -> Univariate: atoms = self.get_nuclide_atoms() dists = [] probs = [] @@ -832,7 +840,7 @@ class Material(IDManagerMixin): for nuclide in self._nuclides: if nuclide.name not in matching_nuclides: matching_nuclides.append(nuclide.name) - + return matching_nuclides def get_nuclide_densities(self):