Skip to content
Projects

opencr.analysis.quantities

Scalar quantities of a steady state, named by strings.

The surrogates (opencr.ml), the sensitivities and the inverse modelling (opencr.inference) all ask a Result for named scalars:

========================================== =============================================== name quantity ========================================== =============================================== population:<state> the density of a state (m^-3) effective_rate:<source>><target> an effective rate coefficient (m^3/s), quasi-static emissivity:<reaction> the photon emissivity of a line (photons m^-3 s^-1) electron_cooling:<driver> the electron energy loss per electron and per particle of a driver (eV m^3/s), quasi-static ratio:<quantity>/<quantity> the ratio of two of the above ========================================== ===============================================

For example "effective_rate:H(n=1)>H+" is the CR ionization coefficient of atomic hydrogen and "ratio:emissivity:A:3-2/emissivity:A:4-2" the Balmer alpha to beta ratio.

Attributes

NameDescription
KINDSNo description.

Functions

NameDescription
check_quantityRaise ValueError (or KeyError) if name is not a quantity of model.
electron_coolingReturn the electron energy loss due to driver per electron and particle (eV m^3/s).
quantitiesReturn the quantities names of a steady state as an array.
quantityReturn the quantity name of a steady state (see the module docstring).

KINDSattributemodule attribute#

KINDS = ('population', 'effective_rate', 'emissivity', 'electron_cooling', 'ratio')

check_quantityfunction#

def check_quantity(model: Any, name: str) -> None

Raise ValueError (or KeyError) if name is not a quantity of model.

electron_coolingfunction#

def electron_cooling(result: Any, driver: str) -> float

Return the electron energy loss due to driver per electron and particle (eV m^3/s).

The sum over the electron-impact reactions (an electron among the reactants, not radiative) of k n_e^(a-1) c_X Delta E, where c_X is the quasi-static population of the reaction’s heavy reactant per particle of driver (1 for the driver itself, 0 for the other drivers) and Delta E the energy the heavy particles gain: the excitation and ionization energies, negative for de-excitation and three-body recombination. Radiative recombination (the electron’s kinetic energy) is not counted.

Numerics

cooling

Ld=∑rkr neare−1 cXr,d ΔEr[eV m3/s]L_d = \sum_r k_r\, n_e^{a_{re} - 1}\, c_{X_r, d}\, \Delta E_r \quad [\mathrm{eV\,m^3/s}]

Assumptions:

  • over the electron-impact, non-radiative reactions with one heavy reactant XrX_r
  • cX,dc_{X,d} the quasi-static population of XX per particle of driver dd (1 for dd itself, 0 for the other drivers)
  • ΔEr\Delta E_r the internal energy the heavy particles gain: negative for de-excitation and three-body recombination; radiative recombination is not counted

Built from:

  • opencr.kinetics.effective.quasi_static

quantitiesfunction#

def quantities(result: Any, names: Sequence[str]) -> np.ndarray

Return the quantities names of a steady state as an array.

quantityfunction#

def quantity(result: Any, name: str) -> float

Return the quantity name of a steady state (see the module docstring).