Skip to content
Projects

opencr.constants

Physical constants (CODATA 2018, through scipy.constants) and unit helpers.

OpenCR’s units follow the max-models convention: SI everywhere, except temperatures, given as kT in eV, and particle and level energies in eV. Densities are in m^-3, rate coefficients of an order-k reaction in m^(3(k-1))/s (s^-1 for spontaneous emission, m^3/s for electron impact, m^6/s for three-body recombination), wavelengths in nm (in vacuum unless a function says otherwise).

Attributes

NameDescription
ATOMIC_MASSNo description.
BOHR_RADIUSNo description.
ELECTRON_MASSNo description.
ELEMENTARY_CHARGENo description.
HYDROGEN_IONIZATION_ENERGYNo description.
PLANCKNo description.
PROTON_MASSNo description.
SPEED_OF_LIGHTNo description.
VACUUM_PERMITTIVITYNo description.

Functions

NameDescription
air_wavelengthReturn the wavelength in standard air of a vacuum wavelength (both in nm).
photon_wavelengthReturn the vacuum wavelength in nm of a photon of energy eV.
thermal_de_broglie_cubedReturn (h^2 / (2 pi m_e kT))^(3/2) in m^3, kT in eV.

ATOMIC_MASSattributemodule attribute#

ATOMIC_MASS = _c.atomic_mass

BOHR_RADIUSattributemodule attribute#

BOHR_RADIUS = _c.physical_constants['Bohr radius'][0]

ELECTRON_MASSattributemodule attribute#

ELECTRON_MASS = _c.m_e

ELEMENTARY_CHARGEattributemodule attribute#

ELEMENTARY_CHARGE = _c.e

HYDROGEN_IONIZATION_ENERGYattributemodule attribute#

HYDROGEN_IONIZATION_ENERGY = 13.598434599702

PLANCKattributemodule attribute#

PLANCK = _c.h

PROTON_MASSattributemodule attribute#

PROTON_MASS = _c.m_p

SPEED_OF_LIGHTattributemodule attribute#

SPEED_OF_LIGHT = _c.c

VACUUM_PERMITTIVITYattributemodule attribute#

VACUUM_PERMITTIVITY = _c.epsilon_0

air_wavelengthfunction#

def air_wavelength(vacuum_wavelength: float | np.ndarray) -> np.ndarray

Return the wavelength in standard air of a vacuum wavelength (both in nm).

The refractive index of Edlén (1966) as revised by Birch and Downs (1994), the IAU standard used by NIST, applied above 200 nm; shorter wavelengths are returned unchanged (there is no air conversion in the vacuum UV).

Numerics

edlen

λair=λn,n−1=8.34254×10−5+2.406147×10−2130−σ2+1.5998×10−438.9−σ2,σ=103λ [nm] μm−1\lambda_{\mathrm{air}} = \frac{\lambda}{n}, \qquad n - 1 = 8.34254\times10^{-5} + \frac{2.406147\times10^{-2}}{130 - \sigma^2} + \frac{1.5998\times10^{-4}}{38.9 - \sigma^2}, \qquad \sigma = \frac{10^3}{\lambda\,[\mathrm{nm}]}\ \mu\mathrm{m}^{-1}

Assumptions:

  • standard air, the IAU standard used by NIST; above 200 nm only (shorter wavelengths are returned unchanged)

References:

photon_wavelengthfunction#

def photon_wavelength(energy: float | np.ndarray) -> np.ndarray

Return the vacuum wavelength in nm of a photon of energy eV.

Numerics

wavelength

λ [nm]=hcE=1239.84…E [eV]\lambda\,[\mathrm{nm}] = \frac{hc}{E} = \frac{1239.84\ldots}{E\,[\mathrm{eV}]}

Assumptions:

  • in vacuum

References:

thermal_de_broglie_cubedfunction#

def thermal_de_broglie_cubed(temperature: float | np.ndarray) -> np.ndarray

Return (h^2 / (2 pi m_e kT))^(3/2) in m^3, kT in eV.

The electron’s thermal de Broglie volume, the factor of the Saha equation n_e n_+ / n_0 = (g_e g_+ / g_0) exp(-I / kT) / lambda^3.

Numerics

volume

Λ3=(h22πmekT)3/2\Lambda^3 = \left(\frac{h^2}{2\pi m_e kT}\right)^{3/2}

saha

nen+n0=geg+g0 e−I/kTΛ3\frac{n_e n_+}{n_0} = \frac{g_e g_+}{g_0}\,\frac{e^{-I/kT}}{\Lambda^3}

Assumptions:

  • kTkT in eV, Λ3\Lambda^3 in m3^3