Canoe
Comprehensive Atmosphere N' Ocean Engine
mwr_absorber_electron.cpp
Go to the documentation of this file.
1 // canoe
2 #include <air_parcel.hpp>
3 #include <configure.hpp>
4 
5 // opacity
7 #include "mwr_absorbers.hpp"
8 
9 namespace GiantPlanets {
10 
11 Real MwrAbsorberElectron::GetAttenuation(Real wave1, Real wave2,
12  AirParcel const& qfrac) const {
13  Real P = qfrac.w[IPR] / 1.E5; // pa -> bar
14  Real T = qfrac.w[IDN];
15 
16  Real abs;
17  Real wave = (wave1 + wave2) / 2.;
18 
19  AirParcel var(qfrac);
20  var.ToMoleConcentration();
21 
22  if (model_name_ == "Reference") {
23  abs = attenuation_freefree_Reference(wave, P, T);
24  } else if (model_name_ == "ChengLi") {
25  abs = attenuation_freefree_Chengli(wave, P, T);
26  } else { // AppletonHartree
27  abs = attenuation_appleton_hartree_nomag(wave, P, T,
28  var.w[GetSpeciesIndex(0)]);
29  }
30 
31  return 100. * abs; // 1/cm -> 1/m
32 }
33 
34 } // namespace GiantPlanets
double attenuation_freefree_Reference(double freq_GHz, double P_bar, double T)
double attenuation_freefree_Chengli(double freq_GHz, double P_bar, double T)
double attenuation_appleton_hartree_nomag(double freq_GHz, double P_bar, double T, double ne)
std::string model_name_
absorption model model
Definition: absorber.hpp:64
Real *const w
Definition: air_parcel.hpp:36
AirParcel & ToMoleConcentration()
Definition: air_parcel.cpp:122
Real GetAttenuation(Real wave1, Real wave2, AirParcel const &var) const
Get attenuation coefficient [1/m].
int GetSpeciesIndex(int n) const
This file contains declaration of Absorber.