11 inline double SQUARE(
double x) {
return x * x; }
12 inline double CUBE(
double x) {
return x * x * x; }
20 double const fine_struct = 1.0 / 137.036;
21 double const mc2 = 0.511e6;
22 double const kT = (T / 300) * .0256;
23 double const hbarc = 1973
e-8;
24 double sigma_T = 6.65e-25;
27 4.13566733e-15 * freq * 1e9;
29 double debroglie_thermal = sqrt(2.0 * M_PI *
SQUARE(hbarc) / (mc2 * kT));
30 double E_ionization = 5.986;
31 double n_Al = 1.6e-6 * (P * 1e5) / (kT * 1.609e-19) * 1
e-6;
34 sqrt(2 * n_Al / pow(debroglie_thermal, 3) * exp(-E_ionization / kT));
37 double alpha_ff = kludge * sqrt(32 *
CUBE(M_PI) / 3.0) *
38 (
SQUARE(Z) * fine_struct) * sqrt(mc2 / kT) *
39 (ni *
CUBE(hbarc / hbar_omega)) * ni * sigma_T *
40 (1.0 - exp(-hbar_omega / kT));
46 double ion_opacity_scale = 1.0;
47 double ion_opacity_cutoff = 1600.;
50 if (T < ion_opacity_cutoff)
53 alpha_ff = ion_opacity_scale *
54 exp(-20.957 + 9.51112E-3 * (1200. + T - ion_opacity_cutoff));
62 double T,
double ne) {
64 double freq = freq_GHz * 1.E9;
65 double P = P_bar * 1E6;
66 double e_cgs = 4.8E-10;
67 double me_cgs = 9.11E-28;
70 double colli_radius = 1.2E-8;
72 double omega = 2. * M_PI * freq;
74 double omega_pe = sqrt(4. * M_PI * ne * e_cgs * e_cgs / me_cgs);
76 double nu_e = 5. / 3. * (M_PI * colli_radius * colli_radius * num) *
78 double X = omega_pe * omega_pe / (omega * omega);
79 double Z = nu_e / omega;
80 double n2real = 1. -
X / (1. + Z * Z);
81 double n2imag =
X * Z / (1. + Z * Z);
82 double Qg = n2real / n2imag;
83 double alpha = 2. * M_PI / lambda / Qg;
double attenuation_freefree_Reference(double freq, double P, double T)
double attenuation_freefree_Chengli(double freq, double P, double T)
double attenuation_appleton_hartree_nomag(double freq_GHz, double P_bar, double T, double ne)