openmc.deplete.ReactionRates

class openmc.deplete.ReactionRates[source]

Reaction rates resulting from a transport operator call

This class is a subclass of numpy.ndarray with a few custom attributes that make it easy to determine what index corresponds to a given material, nuclide, and reaction rate.

Parameters:
  • local_mats (list of str) – Material IDs
  • nuclides (list of str) – Depletable nuclides
  • reactions (list of str) – Transmutation reactions being tracked
  • from_results (boolean) – If the reaction rates are loaded from results, indexing dictionaries need to be kept the same.
Variables:
  • index_mat (OrderedDict of str to int) – A dictionary mapping material ID as string to index.
  • index_nuc (OrderedDict of str to int) – A dictionary mapping nuclide name as string to index.
  • index_rx (OrderedDict of str to int) – A dictionary mapping reaction name as string to index.
  • n_mat (int) – Number of materials.
  • n_nuc (int) – Number of nucs.
  • n_react (int) – Number of reactions.
get(mat, nuc, rx)[source]

Get reaction rate by material/nuclide/reaction

Parameters:
  • mat (str) – Material ID as a string
  • nuc (str) – Nuclide name
  • rx (str) – Name of the reaction
Returns:

Reaction rate corresponding to given material, nuclide, and reaction

Return type:

float

set(mat, nuc, rx, value)[source]

Set reaction rate by material/nuclide/reaction

Parameters:
  • mat (str) – Material ID as a string
  • nuc (str) – Nuclide name
  • rx (str) – Name of the reaction
  • value (float) – Corresponding reaction rate to set