Canoe
Comprehensive Atmosphere N' Ocean Engine
mwr_absorber_ph3.cpp
Go to the documentation of this file.
1 // canoe
2 #include <air_parcel.hpp>
3 #include <configure.hpp>
4 
5 // climath
7 
8 // opacity
10 #include "mwr_absorbers.hpp"
11 
12 namespace GiantPlanets {
13 
14 Real MwrAbsorberPH3::GetAttenuation(Real wave1, Real wave2,
15  AirParcel const& var) const {
16  Real P = var.w[IPR] / 1.E5; // pa -> bar
17  Real T = var.w[IDN];
18  Real xdry = 1.;
19  for (int i = 1; i <= NVAPOR; ++i) xdry -= var.w[i];
20 
21  Real XHe = GetPar<Real>("xHe") * xdry;
22  Real XPH3 = var.w[GetSpeciesIndex(0)];
23  Real XH2 = xdry - XHe;
24 
25  Real abs;
26 
27  if (model_name_ == "Radtran") {
28  abs = absorption_coefficient_PH3_radtran(wave1, P, T, XH2, XHe, XPH3);
29  } else { // Hoffman
30  abs = absorption_coefficient_PH3_Hoffman(wave1, P, T, XH2, XHe, XPH3);
31  }
32 
33  return 100. * abs; // 1/cm -> 1/m
34 }
35 
36 } // namespace GiantPlanets
double absorption_coefficient_PH3_Hoffman(double freq, double P, double T, double XH2, double XHe, double XPH3)
double absorption_coefficient_PH3_radtran(double freq, double P, double T, double XH2, double XHe, double XPH3)
std::string model_name_
absorption model model
Definition: absorber.hpp:64
Real *const w
Definition: air_parcel.hpp:36
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.