openmc.stats.DecaySpectrum
- class openmc.stats.DecaySpectrum(nuclides: dict[str, float], volume: float)[source]
Energy distribution from decay photon spectra of a mixture of nuclides.
This distribution stores nuclide names, their atom densities, and the volume of the region. When written to XML and read by the C++ solver, the nuclide names are resolved against the depletion chain to obtain the decay photon energy spectra and decay constants. The resulting distribution is a mixture of per-nuclide photon spectra weighted by absolute activity. The volume is necessary so that the C++ solver can compute the total photon emission rate in [photons/s], which is used as the source strength.
Added in version 0.15.4.
- Parameters:
- Variables:
- clip(tolerance: float = 1e-09, inplace: bool = False)[source]
Remove nuclides with negligible contribution to photon emission.
Nuclides that are stable or have no photon source in the depletion chain are removed unconditionally. The remaining nuclides are ranked by their photon emission rate (proportional to
atom_density * decay_constant * photon_yield) and the least important are discarded until the cumulative discarded fraction of the total emission rate exceeds tolerance.Requires
openmc.config['chain_file']to be set.- Parameters:
- Returns:
Distribution with negligible nuclides removed.
- Return type:
- evaluate(x)[source]
Evaluate the probability density at a given value.
Delegates to the combined distribution built from chain data. Raises
NotImplementedErrorif the combined distribution is aMixture(which does not supportevaluate()).
- classmethod from_xml_element(elem: Element)[source]
Generate decay photon distribution from an XML element
- Parameters:
elem (lxml.etree._Element) – XML element
- Returns:
Decay photon distribution generated from XML element
- Return type:
- integral()[source]
Return integral of the distribution
Returns the total photon emission rate in [photons/s] by delegating to
to_distribution(). Returns0.0when no chain data is available (e.g.,openmc.config['chain_file']is not set).- Returns:
Total photon emission rate in [photons/s], or
0.0if chain data is unavailable.- Return type:
- mean()[source]
Return the mean of the distribution.
Delegates to the combined distribution built from chain data.
- Returns:
Mean photon energy in [eV].
- Return type:
- property support
Return the support of the probability distribution.
- to_distribution()[source]
Convert to a concrete distribution using decay chain data.
Builds a combined photon energy distribution by looking up each nuclide in the depletion chain via
openmc.data.decay_photon_energy()and weighting by absolute atom count (density * 1e24 * volume). The result is cached on the object; the cache is invalidated automatically whennuclidesorvolumeare reassigned.Requires
openmc.config['chain_file']to be set.- Returns:
Combined photon energy distribution, or
Noneif no nuclide innuclideshas a photon source in the chain.- Return type:
openmc.stats.Univariate or None