Skip to content
Projects

Overview

OpenCR is a zero-dimensional collisional-radiative (CR) model of a low-temperature plasma: the populations of explicit states (atomic levels, ions, molecular levels) coupled by elementary reactions with traceable data. From them come the quasi-static populations of the excited states for given driver densities, the effective ionization, recombination and photon emissivity coefficients, closed steady states, the time evolution and the line emission. The electron temperature or energy distribution, the electron density (or quasi-neutrality), the heavy-particle temperatures and the escape factors are inputs: no energy equation and no transport are solved.

Each equation on these pages is declared on the code that implements it, as a method card, and checked by the tests: 23 closed forms against SymPy rules, four discretisations against their order of convergence. The pages of the section list the cards module by module; this one shows how they fit together, for the predefined atomic hydrogen model (hydrogen/atomic/basic).

  1. Population equations. Reaction rr proceeds at wr=krneare∏jnjarjw_r = k_r n_e^{a_{re}} \prod_j n_j^{a_{rj}} (mass action), and every state changes by dni/dt=∑rνirwrdn_i/dt = \sum_r \nu_{ir} w_r. The electron is never a state: nen_e is given or quasi-neutral. The Jacobian is analytic and sparse; the conserved quantities are the elements.
  2. Rate models say how each krk_r is given: a cross section, Arrhenius, a table, a constant (Einstein AA), a Python function, or the detailed-balance inverse of another reaction.
  3. Rate coefficients. A piecewise-linear cross section is averaged over a Maxwellian in closed form, segment by segment, with the threshold taken out so that the inverses never overflow. De-excitation and three-body recombination follow by Boltzmann and Saha, or by the Klein-Rosseland cross section for any electron energy distribution:

coefficients

functionsource

Return k_r in SI for every reaction at conditions.

scaled
ln⁡k=ln⁡ ⁣(k eEth/T)−EthT,k=0 if ln⁡k<ln⁡(2.2×10−308),ln⁡k≤700\ln k = \ln\!\big(k\, e^{E_{\mathrm{th}}/T}\big) - \frac{E_{\mathrm{th}}}{T}, \qquad k = 0 \ \text{if}\ \ln k < \ln(2.2\times10^{-308}), \qquad \ln k \le 700
inverse
ln⁡kinv=ln⁡ ⁣(kfwd eEth/T)+ln⁡gingout+ΔE−EthT+32 Δe [ln⁡h22πmee−ln⁡T]\ln k_{\mathrm{inv}} = \ln\!\big(k_{\mathrm{fwd}}\, e^{E_{\mathrm{th}}/T}\big) + \ln\frac{g_{\mathrm{in}}}{g_{\mathrm{out}}} + \frac{\Delta E - E_{\mathrm{th}}}{T} + \tfrac32\, \Delta e\, \Big[\ln\frac{h^2}{2\pi m_e e} - \ln T\Big]
boltzmann
kul=klu glgu eΔE/Tk_{ul} = k_{lu}\,\frac{g_l}{g_u}\, e^{\Delta E/T}
saha
k3b=kion g0ge g+ Λ3 eI/T,Λ3=(h22πmekT)3/2k_{3b} = k_{\mathrm{ion}}\,\frac{g_0}{g_e\, g_+}\,\Lambda^3\, e^{I/T}, \qquad \Lambda^3 = \left(\frac{h^2}{2\pi m_e kT}\right)^{3/2}
escape
kr←gr krfor every spontaneous emissionk_r \leftarrow g_r\, k_r \quad \text{for every spontaneous emission}
Assumes
  • depends_on picks the temperature: TeT_e (TeffT_{\mathrm{eff}} for a non-Maxwellian EEDF), TiT_i (the gas temperature when not given), TgasT_{\mathrm{gas}}, or none
  • with a non-Maxwellian EEDF only the electron cross sections (and their Klein-Rosseland inverses) are integrated over it (plasmacoll.eedf_rate_coefficient)
  • the escape factor grg_r is Conditions.escape by name, else the reaction's own escape
References
Built from
  1. Quasi-static reduction. With the drivers (H(n=1) and H+^+) prescribed, the excited states follow them instantly; eliminating them gives the population coefficients and the effective (CR) rate coefficients SCRS_{\mathrm{CR}} and αCR\alpha_{\mathrm{CR}}:

quasi_static

functionsource

Return the quasi-static reduction with the drivers conditions.densities.

matrix
Mij=∑r: j is the quasi-static reactant of rνir kr neare∏p∈P, p≠jnparpM_{ij} = \sum_{r:\ j \text{ is the quasi-static reactant of } r} \nu_{ir}\, k_r\, n_e^{a_{re}} \prod_{p \in P,\, p \ne j} n_p^{a_{rp}}
reduction
dnQdt=MQQnQ+MQPnP=0⇒nQ=C nP,C=−MQQ−1MQP\frac{d\mathbf n_Q}{dt} = M_{QQ}\mathbf n_Q + M_{QP}\mathbf n_P = 0 \quad\Rightarrow\quad \mathbf n_Q = C\,\mathbf n_P, \qquad C = -M_{QQ}^{-1} M_{QP}
effective
dnPdt=MeffnP,Meff=MPP+MPQC\frac{d\mathbf n_P}{dt} = M^{\mathrm{eff}} \mathbf n_P, \qquad M^{\mathrm{eff}} = M_{PP} + M_{PQ} C
solve
MQQ=LU,X0=U−1L−1MQP,X=X0+U−1L−1(MQP−MQQX0)M_{QQ} = LU, \qquad X_0 = U^{-1}L^{-1} M_{QP}, \qquad X = X_0 + U^{-1}L^{-1}\left(M_{QP} - M_{QQ} X_0\right)
Assumes
  • drivers PP: the states with a density in the conditions; QQ the rest
  • every reaction linear in its one quasi-static reactant (two are refused); a reaction among drivers only goes on the column of its first heavy reactant
  • a given nen_e (a quasi-neutral one is refused)
  • sparse LU (splu) with one step of iterative refinement; a zero diagonal of MQQM_{QQ} (a state without losses) or a singular factorisation raises SingularSystemError
References
Built from
  1. Steady states solve R(n)=0R(\mathbf n) = 0: a sparse LU solve for a linear system, one row per conserved element replaced by its total for a closed one, Brent’s method in ln⁡ne\ln n_e for quasi-neutrality, and pseudo-transient continuation for the rest, judged by the relative residual. Time integration uses SciPy’s stiff integrators with the analytic Jacobian.
  2. Radiation trapping. An optically thick line is reabsorbed: its AA is multiplied by an escape factor of the line-centre optical depth of a Doppler-broadened line, iterated with the populations to self-consistency.
  3. Emission: the lines, their photon emissivity coefficients per driver, Doppler and instrumental widths, the electron cooling coefficient.

The atomic hydrogen model puts the hydrogen data together: levels resolved in nn, the Janev-Reiter-Samm and Johnson cross sections (from plasmacoll), Vriens-Smeets rates above n=24n = 24, Johnson’s Einstein coefficients and the radiative recombination fits. Around the model: the sensitivities to the rate data and the propagation of their uncertainties, the effective-rate tables other codes interpolate, and the batched and JAX reductions of many conditions at once.

SI units, except energies and temperatures (kTkT) in eV; densities in m−3^{-3}, a rate coefficient of a reaction with kk reactants in m3(k−1)^{3(k-1)}/s, wavelengths in nm in vacuum (in air above 200 nm on request). The constants are CODATA 2018 through scipy.constants, and IH=13.598434599702I_H = 13.598434599702 eV from the NIST ASD. The hydrogen cross sections keep the report’s 13.6 eV thresholds while the states use IHI_H: the 0.01% difference enters the detailed-balance exponents.

  • No energy equation, no EEDF calculation, no transport beyond explicit wall-loss and pumping reactions: zero-dimensional.
  • Atomic hydrogen: ll sub-states statistically populated (overestimates 2s at low density); no levels above nmax⁡n_{\max}, no continuum lowering; electron collisions only (no proton or atom impact, no ll-mixing); no two-photon decay of 2s, fine structure or Lamb shift; Kramers recombination without Gaunt factor for n≥3n \ge 3; Vriens-Smeets rates Maxwellian only.
  • Radiation: optically thin unless escape factors are given or computed; trapping is an escape-factor approximation over a user length, without stimulated emission, redistribution or continuum opacity; spectra are Gaussian lines only.
  • Detailed balance for inverses with different numbers of heavy particles (dissociation, attachment), or Saha inverses of non-electron rates.
  • The reduction, the batched and the JAX paths need one heavy reactant per reaction and a given nen_e.

Besides the checks of the cards, the tests compare a closed steady state without radiation with Saha-Boltzmann to 10−810^{-8}, the Maxwellian closed form with plasmacoll’s quadrature to 0.2%, the corona limit, the two-level reduction and the Jacobian with finite differences, the Einstein coefficients with NIST and the radiative recombination with Osterbrock and Ferland, and SCRS_{\mathrm{CR}} and αCR\alpha_{\mathrm{CR}} with OPEN-ADAS when its files are available; see the verification guide.