Skip to content
Projects

opencr.core.rates

How the rate coefficient of a reaction is given.

A rate model describes the data, not how they are evaluated: the evaluation (Maxwellian or any electron energy distribution, on any backend) is in opencr.kinetics.rates. The rate of a reaction with reactants r_i is k prod n_i (a reactant that appears twice counts twice), so k is in s^-1 for one reactant, m^3/s for two and m^6/s for three.

depends_on names the temperature a model depends on: "electron" (T_e, or for a non-Maxwellian distribution the effective temperature 2/3 <eps>), "ion", "gas" or "none".

The masses (kg), energies and temperatures (eV) of a rate model take an astropy Quantity or a string such as "11604 K" as well as a number (see plasmacoll.units). The rate coefficients themselves (Arrhenius.a, Tabulated.values, Constant.value) are numbers in the SI unit of the reaction’s order, which the rate model does not know.

Attributes

NameDescription
TEMPERATURESNo description.

Classes

NameDescription
Arrheniusk = a T^b exp(-c / T) with T in eV and k in SI.
ConstantA rate coefficient independent of temperature, e.g. an Einstein A in s^-1.
CrossSectionRateA rate from a cross section averaged over a velocity distribution.
DetailedBalanceThe inverse of another reaction of the network, by detailed balance.
Functionk(T) from a Python function of the temperature in eV (array in, array out).
RateModelBase class of the rate models; kind names the model in files.
Tabulatedk(T) from a table, interpolated linearly in log k against log T.

TEMPERATURESattributemodule attribute#

TEMPERATURES = ('electron', 'ion', 'gas', 'none')

Arrheniusclassdataclass#

class Arrhenius(depends_on: str = 'electron', a: float = 0.0, b: float = 0.0, c: float = unit_field('eV', 0.0))

Bases: RateModel

k = a T^b exp(-c / T) with T in eV and k in SI.

Attributes

NameTypeDescription
afloatThe prefactor in the SI unit of the reaction’s order.
bfloatThe temperature exponent.
cfloatThe activation energy in eV.

Numerics

arrhenius

k=a Tb e−c/Tk = a\,T^b\,e^{-c/T}

Assumptions:

  • TT in eV, kk in the SI unit of the reaction’s order; cc is the threshold taken out before evaluation

aattributeclass attributeinstance attribute#

a: float = 0.0

battributeclass attributeinstance attribute#

b: float = 0.0

cattributeclass attributeinstance attribute#

c: float = unit_field('eV', 0.0)

kindattributeclass attribute#

kind: str = 'arrhenius'

to_dictmethod#

def to_dict() -> dict[str, Any]

Return the three parameters.

Inherited from opencr.core.rates.RateModel

depends_onattributeclass attributeinstance attribute#

depends_on: str = 'electron'

Constantclassdataclass#

class Constant(depends_on: str = 'none', value: float = 0.0)

Bases: RateModel

A rate coefficient independent of temperature, e.g. an Einstein A in s^-1.

Attributes

NameTypeDescription
valuefloatk in the SI unit of the reaction’s order.

Numerics

constant

k=const,e.g. k=g Aul for a line with escape factor gk = \mathrm{const}, \qquad \text{e.g. } k = g\,A_{ul} \text{ for a line with escape factor } g

Assumptions:

  • no temperature (depends_on is none): Einstein coefficients, wall losses, pumping

depends_onattributeclass attributeinstance attribute#

depends_on: str = 'none'

kindattributeclass attribute#

kind: str = 'constant'

valueattributeclass attributeinstance attribute#

value: float = 0.0

to_dictmethod#

def to_dict() -> dict[str, Any]

Return the value.

CrossSectionRateclassdataclass#

class CrossSectionRate(depends_on: str = 'electron', cross_section: CrossSection | None = None, mass: float = unit_field('kg', ELECTRON_MASS), incident_mass: float | None = unit_field('kg', None))

Bases: RateModel

A rate from a cross section averaged over a velocity distribution.

For electrons (depends_on="electron") the average is over the electron energy distribution of the conditions (Maxwellian by default); otherwise over a Maxwellian of relative velocities at the ion or gas temperature.

Attributes

NameTypeDescription
cross_sectionCrossSection | NoneThe cross section (m^2) against energy (eV).
massfloatThe reduced mass in kg of the colliding pair.
incident_massfloat | NoneFor a table against the incident particle’s energy with the target at rest (the lab frame), the incident mass in kg; the table is looked up at E incident_mass / mass. None for a table in the centre-of-mass frame. For electrons both agree.

Numerics

maxwellian

k(T)=8πμ (kT)−3/2∫Eth∞σ(E) E e−E/kT dEk(T) = \sqrt{\frac{8}{\pi\mu}}\,(kT)^{-3/2} \int_{E_{\mathrm{th}}}^\infty \sigma(E)\,E\,e^{-E/kT}\,dE

lab frame

Elab=E mincμE_{\mathrm{lab}} = E\,\frac{m_{\mathrm{inc}}}{\mu}

eedf

k=2eme∫0∞ε σ(ε) F0(ε) dεk = \sqrt{\frac{2e}{m_e}} \int_0^\infty \varepsilon\,\sigma(\varepsilon)\,F_0(\varepsilon)\,d\varepsilon

Assumptions:

  • σ\sigma a plasmacoll CrossSection: linear between the table points, held at the last value above, zero below the threshold
  • a Maxwellian of the reduced mass μ\mu at TeT_e, TiT_i or TgasT_{\mathrm{gas}} (depends_on); for electrons the conditions’ EEDF when it is not Maxwellian
  • a lab-frame table (target at rest) is read at ElabE_{\mathrm{lab}}; a centre-of-mass table at EE

References:

Built from:

  • opencr.kinetics.rates.MaxwellianIntegral
  • opencr.kinetics.eedf.EEDF

cross_sectionattributeclass attributeinstance attribute#

cross_section: CrossSection | None = None

incident_massattributeclass attributeinstance attribute#

incident_mass: float | None = unit_field('kg', None)

kindattributeclass attribute#

kind: str = 'cross_section'

massattributeclass attributeinstance attribute#

mass: float = unit_field('kg', ELECTRON_MASS)

tableproperty#

table: CrossSection

The cross section (never None after construction).

thresholdproperty#

threshold: float

The threshold of the cross section in eV (in its own frame).

to_dictmethod#

def to_dict() -> dict[str, Any]

Return the table, threshold and masses.

Inherited from opencr.core.rates.RateModel

depends_onattributeclass attributeinstance attribute#

depends_on: str = 'electron'

DetailedBalanceclassdataclass#

class DetailedBalance(depends_on: str = 'electron', forward: str = '')

Bases: RateModel

The inverse of another reaction of the network, by detailed balance.

De-excitation from excitation, three-body recombination from ionization, and any other inverse whose forward reaction has the products as reactants and an electron on both sides or one more on the forward product side. The evaluation (opencr.kinetics.rates) uses the state energies and weights: the Klein-Rosseland inverse cross section for an electron-impact excitation (valid for any energy distribution), and the Maxwellian relation (Boltzmann, Saha) otherwise.

Attributes

NameTypeDescription
forwardstrThe name of the forward reaction.

Numerics

inverse

kinv(T)=kfwd(T) gingout eΔE/T (Λ3)Δe,Λ3=(h22πmekT)3/2k_{\mathrm{inv}}(T) = k_{\mathrm{fwd}}(T)\,\frac{g_{\mathrm{in}}}{g_{\mathrm{out}}}\, e^{\Delta E/T}\,\big(\Lambda^3\big)^{\Delta e}, \qquad \Lambda^3 = \left(\frac{h^2}{2\pi m_e kT}\right)^{3/2}

klein rosseland

σul(ε)=glgu ε+ΔEε σlu(ε+ΔE)\sigma_{ul}(\varepsilon) = \frac{g_l}{g_u}\,\frac{\varepsilon + \Delta E}{\varepsilon}\,\sigma_{lu}(\varepsilon + \Delta E)

Assumptions:

  • gin,goutg_{\mathrm{in}}, g_{\mathrm{out}} the products of the weights of the forward reactants and products (ge=2g_e = 2), ΔE\Delta E the forward energy change from the state energies
  • the same number of heavy particles on both sides of the forward reaction and Δe≥0\Delta e \ge 0 extra electrons among its products: Boltzmann (Δe=0\Delta e = 0) or Saha (Δe=1\Delta e = 1)
  • with a non-Maxwellian EEDF an electron-impact excitation is inverted by its Klein-Rosseland cross section; a Saha inverse uses the Maxwellian forward rate at TeffT_{\mathrm{eff}}

References:

Built from:

  • opencr.kinetics.rates.RateEvaluator.coefficients
  • opencr.kinetics.rates.inverse_cross_section

forwardattributeclass attributeinstance attribute#

forward: str = ''

kindattributeclass attribute#

kind: str = 'detailed_balance'

to_dictmethod#

def to_dict() -> dict[str, Any]

Return the forward reaction’s name.

Inherited from opencr.core.rates.RateModel

depends_onattributeclass attributeinstance attribute#

depends_on: str = 'electron'

Functionclassdataclass#

class Function(depends_on: str = 'electron', function: Callable[[np.ndarray], np.ndarray] | None = None, label: str = '', threshold: float = unit_field('eV', 0.0), file_temperatures: tuple[float, ...] = unit_field('eV', default_factory=lambda : tuple(np.geomspace(0.01, 10000.0, 241).tolist())))

Bases: RateModel

k(T) from a Python function of the temperature in eV (array in, array out).

Written to files as a table on file_temperatures.

Attributes

NameTypeDescription
functionCallable[[np.ndarray], np.ndarray] | Nonek in SI as a function of T in eV.
labelstrWhat the function is, e.g. "Kramers radiative recombination".
thresholdfloatAs for Tabulated, used when the function is tabulated.
file_temperaturestuple[float, ...]The temperatures (eV) of the table written to files.

Numerics

function

k=f(T)k = f(T)

tabulation

Ti=10−2+6i/240 eV,i=0,…,240,then as TabulatedT_i = 10^{-2 + 6 i / 240}\ \mathrm{eV}, \quad i = 0, \dots, 240, \qquad \text{then as } \texttt{Tabulated}

Assumptions:

  • ff is host Python code; files and the JAX backend use its table
  • kk itself is returned, so the threshold scaling does not protect it: kk underflows to zero once Eth/T≳708E_{\mathrm{th}}/T \gtrsim 708, and so does an inverse of it

Built from:

  • opencr.core.rates.Tabulated

file_temperaturesattributeclass attributeinstance attribute#

file_temperatures: tuple[float, ...] = unit_field('eV', default_factory=lambda : tuple(np.geomspace(0.01, 10000.0, 241).tolist()))

functionattributeclass attributeinstance attribute#

function: Callable[[np.ndarray], np.ndarray] | None = None

kindattributeclass attribute#

kind: str = 'function'

labelattributeclass attributeinstance attribute#

label: str = ''

thresholdattributeclass attributeinstance attribute#

threshold: float = unit_field('eV', 0.0)

tabulatemethod#

def tabulate() -> Tabulated

Return the function as a Tabulated model on file_temperatures.

to_dictmethod#

def to_dict() -> dict[str, Any]

Return the function tabulated (see tabulate).

Inherited from opencr.core.rates.RateModel

depends_onattributeclass attributeinstance attribute#

depends_on: str = 'electron'

RateModelclassdataclass#

class RateModel(depends_on: str = 'electron')

Base class of the rate models; kind names the model in files.

depends_onattributeclass attributeinstance attribute#

depends_on: str = 'electron'

kindattributeclass attribute#

kind: str = ''

to_dictmethod#

def to_dict() -> dict[str, Any]

Return the model as plain data (see opencr.data.native).

Tabulatedclassdataclass#

class Tabulated(depends_on: str = 'electron', temperatures: tuple[float, ...] = unit_field('eV', ()), values: tuple[float, ...] = (), threshold: float = unit_field('eV', 0.0))

Bases: RateModel

k(T) from a table, interpolated linearly in log k against log T.

A threshold (eV) removes the Boltzmann factor before interpolating, log(k exp(threshold / T)), which keeps the interpolation accurate at temperatures far below a threshold. Outside the table this scaled quantity holds its end value, so k = k_end exp(threshold / T_end - threshold / T) there.

Attributes

NameTypeDescription
temperaturestuple[float, ...]The table temperatures in eV, increasing.
valuestuple[float, ...]k in SI at temperatures, non-negative.
thresholdfloatThe energy in eV of the Boltzmann factor to remove.

Numerics

interpolation

ln⁡ ⁣(k eEth/T) linear in ln⁡T between the table points\ln\!\big(k\, e^{E_{\mathrm{th}}/T}\big) \text{ linear in } \ln T \text{ between the table points}

extrapolation

k(T)=kend eEth/Tend−Eth/Toutside the table (ln⁡T clipped)k(T) = k_{\mathrm{end}}\, e^{E_{\mathrm{th}}/T_{\mathrm{end}} - E_{\mathrm{th}}/T} \quad \text{outside the table } (\ln T \text{ clipped})

Order of accuracy: 2.

Assumptions:

  • the order is in the table spacing in ln⁡T\ln T, for a smooth ln⁡(k eEth/T)\ln(k\,e^{E_{\mathrm{th}}/T})
  • outside the table the scaled quantity k eEth/Tk\,e^{E_{\mathrm{th}}/T} holds its end value, not kk itself

kindattributeclass attribute#

kind: str = 'tabulated'

temperaturesattributeclass attributeinstance attribute#

temperatures: tuple[float, ...] = unit_field('eV', ())

thresholdattributeclass attributeinstance attribute#

threshold: float = unit_field('eV', 0.0)

valuesattributeclass attributeinstance attribute#

values: tuple[float, ...] = ()

to_dictmethod#

def to_dict() -> dict[str, Any]

Return the table.

Inherited from opencr.core.rates.RateModel

depends_onattributeclass attributeinstance attribute#

depends_on: str = 'electron'