Athena++/Atmosphere
Planetary Atmosphere Simulator
ammonia_vapors.hpp
Go to the documentation of this file.
1 #ifndef AMMONIA_VAPORS_HPP
2 #define AMMONIA_VAPORS_HPP
3 
4 #include <cmath>
5 
6 inline double svpnh3(double t, double p, double beta, double gamma) {
7  return p*exp((1. - 1./t)*beta - gamma*log(t));
8 }
9 
10 
11 inline double sat_vapor_p_NH3_UMich(double T) {
12  double x = -1790.00/T - 1.81630*log10(T) + 14.97593;
13  return pow(10.0,x)*1.E5/760.;
14 }
15 
16 // (164, 371.5)
17 inline double sat_vapor_p_NH3_Antoine(double T) {
18  double result;
19  if (T < 239.6)
20  result = pow(10., 3.18757 - (506.713/(T - 80.78)));
21  else
22  result = pow(10., 4.86886 - (1113.928/(T - 10.409)));
23  return 1.E5*result;
24 }
25 
26 // (130, 200)
27 inline double sat_vapor_p_NH3_Hubner(double T) {
28  double A = 24.3037,
29  B = -1766.28,
30  C = -5.64472,
31  D = 0.00740241;
32 
33  double x = A + B/T + C*log10(T) + D*T;
34  return pow(10.0, x);
35 }
36 
37 inline double sat_vapor_p_NH3_BriggsS(double T) {
38  double a[6], x;
39  if ( T < 195 ) {
40  a[1] = -4122.;
41  a[2] = 41.67871;
42  a[3] = -1.81630;
43  a[4] = 0.;
44  a[5] = 0.;
45  }
46  else {
47  a[1] = -4409.3512;
48  a[2] = 76.864252;
49  a[3] = -8.4598340;
50  a[4] = 5.51029e-03;
51  a[5] = 6.80463e-06;
52  }
53  x = a[1]/T + a[2] + a[3]*log(T) + a[4]*T + a[5]*pow(T, 2);
54  return exp(x)/10.;
55 }
56 
57 // (15, 195.4)
58 inline double sat_vapor_p_NH3_Fray(double T) {
59  double a[7], x = 0;
60  a[0] = 1.596e+01;
61  a[1] = -3.537e+03;
62  a[2] = -3.310e+04;
63  a[3] = 1.742e+06;
64  a[4] = -2.995e+07;
65  a[5] = 0.;
66  a[6] = 0.;
67 
68  for(int i = 1; i < 7; i++)
69  x = x + a[i]/pow(T, i); // best fit in [15K; 195.41K]
70 
71  return 1.E5*exp(x + a[0]);
72 }
73 
74 inline double sat_vapor_p_NH3_Ideal(double T) {
75  double betal = 20.08,
76  gammal = 5.62,
77  betas = 20.64,
78  gammas = 1.43,
79  tr = 195.4,
80  pr = 6060.;
81 
82  return T > tr ? svpnh3(T/tr, pr, betal, gammal):svpnh3(T/tr, pr, betas, gammas);
83 }
84 
85 #endif
double sat_vapor_p_NH3_Ideal(double T)
double sat_vapor_p_NH3_Hubner(double T)
double sat_vapor_p_NH3_Fray(double T)
double svpnh3(double t, double p, double beta, double gamma)
double sat_vapor_p_NH3_BriggsS(double T)
double sat_vapor_p_NH3_UMich(double T)
double sat_vapor_p_NH3_Antoine(double T)
#define A(i, j)
Definition: band_back_sub.c:13
#define B(iq)
Definition: cdisort.h:249