Source code for lir_achem.compute_collision_frequency

"""There are two main functions in this module, to compute the electron-ion collision frequency and the electron-neutral one"""

import numpy as np


[docs] def ei_collisionfreq(e_here, i_here): """Computes the collision frequency between the electrons and one ion species From Schunk & Nagy (1978) and Zawdie et al., 2017 We suppose that electrons, ions and neutrals have the same temperature :param e_here: Electron class instance :param i_here: Ion class instance :returns: v, collision frequency (s-1) """ if i_here.z < 0: # print("Negative ions - No collisions !") return 0 # Constants e = 1.602e-19 # Charge electron (C) kb = 1.381e-23 # Boltzmann constant gamma = np.exp(0.577) # Euler constant me = 9.109e-31 # Mass electron (kg) # ki^2, ke^2 (Equations 21 & 22 of Zawdie et al., 2017) ki_2 = (4 * np.pi * i_here.density * 1e6 * i_here.z**2 * e**2) / ( kb * e_here.temperature ) ke_2 = (4 * np.pi * e_here.densities * 1e6 * e**2) / (kb * e_here.temperature) # Coulomb logarithm (Equation 20) Coulomb_log = np.log( (4 * kb * e_here.temperature) / (gamma**2 * i_here.z * e**2 * np.sqrt(ke_2)) ) - (ke_2 + ki_2) / ki_2 * np.log(np.sqrt(ki_2 + ke_2) / np.sqrt(ke_2)) # Collision frequency (Equation 19) v = ( 4 * np.sqrt(2 * np.pi) / 3 * i_here.density * 1e6 * (i_here.z * e**2) ** 2 / np.sqrt(me) * Coulomb_log / (kb * e_here.temperature) ** (3 / 2) ) return v
[docs] def en_collisionfreq(e_here, n_here): """Computes electron-neutrals collision frequency From Schunk & Nagy (1978) and Zawdie et al. (2017) :param e_here: Electrons class instance :param n_here: Neutrals class instance :returns: v, collision frequency (s-1)""" # From Zawdie et al, 2017, Equations 23 to 28 # Electrons and neutrals are not defined at the same altitudes start = np.argmin(np.abs(e_here.altitudes[0] - n_here.altitudes)) stop = np.argmin(np.abs(e_here.altitudes[-1] - n_here.altitudes)) # N2 vN2 = ( 2.33e-11 * n_here.N2[start : stop + 1] * (1 - 1.21e-4 * e_here.temperature) * e_here.temperature ) # O2 vO2 = ( 1.82e-10 * n_here.O2[start : stop + 1] * (1 + 3.6e-2 * np.sqrt(e_here.temperature)) * np.sqrt(e_here.temperature) ) # O vO = ( 8.9e-11 * n_here.O[start : stop + 1] * (1 + 5.7e-4 * e_here.temperature) * np.sqrt(e_here.temperature) ) # He vHe = 4.6e-10 * n_here.He[start : stop + 1] * np.sqrt(e_here.temperature) # H vH = ( 4.5e-9 * n_here.H[start : stop + 1] * (1 - 1.35e-4 * e_here.temperature) * np.sqrt(e_here.temperature) ) v = vN2 + vO2 + vO + vHe + vH return v