Canoe
Comprehensive Atmosphere N' Ocean Engine
ionization.cpp
Go to the documentation of this file.
1 
8 // C/C++
9 #include <cmath>
10 
11 // canoe
12 #include <constants.hpp>
13 
14 // snap
15 #include "thermodynamics.hpp"
16 
17 Real saha_ionization_electron_density(Real T, Real num, Real ion_ev) {
18  num *= 1.E-6; // m^{-3} -> cm^{-3}
19  Real erg2ev = 6.242E11;
20  Real kBoltz_ev = Constants::kBoltz_cgs * erg2ev;
21  // Real kBoltz_ev = 8.617E-5; // ev/K
22  Real hPlanck_ev = Constants::hPlanck_cgs * erg2ev; // ev.s
23  // Real hPlanck_ev = 4.136E-15; // ev.s
24  Real me_cgs = 9.11E-28; // g
25  Real kBT = kBoltz_ev * T; // ev
26  // Real kBT = T/300.*0.0256; // ev
27  Real hbar = hPlanck_ev / (2. * M_PI);
28  // Real hbarc = 1973E-8; // ev.cm
29  Real hbarc = hbar * Constants::cLight_cgs; // ev.cm
30  Real mc2 = 0.511E6; // ev
31  Real debroglie_thermal = sqrt(2. * M_PI * hbarc * hbarc / (mc2 * kBT)); // cm
32  Real coeff = 2. / pow(debroglie_thermal, 3) * exp(-ion_ev / kBT); // cm^{-3}
33  return 1.E6 * (-coeff + sqrt(coeff * coeff + 4. * coeff * num)) /
34  2.; // cm^{-3} -> m^{-3}
35 }
Real saha_ionization_electron_density(Real T, Real num, Real ion_ev)
Definition: ionization.cpp:17
double const hPlanck_cgs
Definition: constants.hpp:12
double const cLight_cgs
Definition: constants.hpp:14
double const kBoltz_cgs
Definition: constants.hpp:8