openmc.deplete.FissionYield

class openmc.deplete.FissionYield(products, yields)[source]

Mapping for fission yields of a parent at a specific energy

Separated to support nested dictionary-like behavior for FissionYieldDistribution, and allowing math operations on a single vector of yields. Can in turn be used like a dictionary to fetch fission yields. Supports multiplication of a scalar to scale the fission yields and addition of another set of yields.

Does not support resizing / inserting new products that do not exist.

Parameters
  • products (tuple of str) – Sorted products for this specific distribution

  • yields (numpy.ndarray) – Fission product yields for each product in products

Variables
  • products (tuple of str) – Products for this specific distribution

  • yields (numpy.ndarray) – Fission product yields for each product in products

Examples

>>> import numpy
>>> fy_vector = FissionYield(
...     ("I129", "Sm149", "Xe135"),
...     numpy.array((0.001, 0.0003, 0.002)))
>>> fy_vector["Xe135"]
0.002
>>> new = FissionYield(fy_vector.products, fy_vector.yields.copy())
>>> fy_vector *= 2
>>> fy_vector["Xe135"]
0.004
>>> new["Xe135"]
0.002
>>> (new + fy_vector)["Sm149"]
0.0009
>>> dict(new) == {"Xe135": 0.002, "I129": 0.001, "Sm149": 0.0003}
True
items()[source]

Return pairs of product, yield