Skip to content
Projects

opencr.core.reactions

Reactions between states.

A Reaction lists its reactant and product states (a state that appears twice counts twice), its kind, its rate model and the provenance of its data. Creating one checks the charge and element balance; photons are implicit products of the radiative kinds (RADIATIVE_KINDS).

Attributes

NameDescription
RADIATIVE_KINDSNo description.
REACTION_KINDSNo description.

Classes

NameDescription
ReactionOne reaction.

RADIATIVE_KINDSattributemodule attribute#

RADIATIVE_KINDS = ('spontaneous_emission', 'radiative_recombination')

REACTION_KINDSattributemodule attribute#

REACTION_KINDS = (
  'excitation',
  'deexcitation',
  'ionization',
  'three_body_recombination',
  'radiative_recombination',
  'dielectronic_recombination',
  'spontaneous_emission',
  'dissociation',
  'dissociative_excitation',
  'dissociative_ionization',
  'dissociative_recombination',
  'attachment',
  'dissociative_attachment',
  'detachment',
  'charge_exchange',
  'mutual_neutralization',
  'associative_detachment',
  'penning_ionization',
  'quenching',
  'vibrational_transfer',
  'proton_transfer',
  'wall_loss',
  'pumping',
  'other'
)

Reactionclassdataclass#

class Reaction(name: str, reactants: tuple[State, ...], products: tuple[State, ...], kind: str, rate: RateModel, provenance: Provenance | None = None, escape: float = 1.0)

One reaction.

Attributes

NameTypeDescription
namestrA unique name in its network, e.g. "exc:H(n=1)->H(n=2)".
reactantstuple[State, ...]The reactant states; the electron is ELECTRON_STATE.
productstuple[State, ...]The product states.
kindstrOne of REACTION_KINDS.
rateRateModelThe rate model.
provenanceProvenance | NoneThe origin of the rate data.
escapefloatFor a spontaneous emission, the default escape factor of the line (1 for an optically thin plasma); conditions may override it.

escapeattributeclass attributeinstance attribute#

escape: float = 1.0

kindattributeinstance attribute#

kind: str

nameattributeinstance attribute#

name: str

productsattributeinstance attribute#

products: tuple[State, ...]

provenanceattributeclass attributeinstance attribute#

provenance: Provenance | None = None

rateattributeinstance attribute#

rate: RateModel

reactantsattributeinstance attribute#

reactants: tuple[State, ...]

energy_changeproperty#

energy_change: float

The internal energy of the products minus the reactants’ in eV.

equationproperty#

equation: str

The reaction as text, e.g. "e + H(n=1) -> e + H(n=2)".

is_inverseproperty#

is_inverse: bool

Whether the rate is the detailed balance of another reaction.

netproperty#

net: dict[str, int]

The net change of each state per reaction (products minus reactants).

orderproperty#

order: int

The number of reactant particles.

photon_energyproperty#

photon_energy: float | None

For a spontaneous emission, the photon energy in eV; otherwise None.

product_countsproperty#

product_counts: dict[str, int]

How often each state is a product, by name.

reactant_countsproperty#

reactant_counts: dict[str, int]

How often each state is a reactant, by name.

inverse_ofmethod#

def inverse_of(forward: Reaction) -> bool

Return whether this reaction is forward run backwards.