Athena++/Atmosphere
Planetary Atmosphere Simulator
water_vapors.hpp
Go to the documentation of this file.
1 #ifndef WATER_VAPORS_HPP_
2 #define WATER_VAPORS_HPP_
3 
4 #include <cmath>
5 
6 inline double svph2o(double t, double p, double beta, double gamma) {
7  return p*exp((1. - 1./t)*beta - gamma*log(t));
8 }
9 
10 inline double sat_vapor_p_H2O_UMich(double T) {
11  double x =
12  -2445.5646/T +
13  8.2312*log10(T) -
14  0.01677006*T +
15  1.20514e-05*T*T -
16  6.757169;
17  return pow(10.0,x)*1.E5/760.;
18 }
19 
20 // (273, 373)
21 inline double sat_vapor_p_H2O_Antoine(double T) {
22  double result;
23 
24  if (T < 303.)
25  result = pow(10., 5.40221 - (1838.675 / (T - 31.737)));
26  else if (T < 333.)
27  result = pow(10., 5.20389 - (1733.926 / (T - 39.485)));
28  else if (T < 363.)
29  result = pow(10., 5.0768 - (1659.793 / (T - 45.854)));
30  else
31  result = pow(10., 5.08354 - (1663.125 / (T - 45.622)));
32 
33  return 1.E5 * result;
34 }
35 
36 // (100, 373.16)
37 inline double sat_vapor_p_H2O_Hubner(double T) {
38  double A, B ,C, D;
39  A = 4.07023;
40  B = -2484.98;
41  C = 3.56654;
42  D = -0.00320981;
43  double x = A + B/T + C*log10(T) + D*T; // best fit in [100K; 273.16K]
44  return pow(10.0, x);
45 }
46 
47 // (0, 273.16)
48 inline double sat_vapor_p_H2O_Fray(double T) {
49  double a[7], x, pt, Tt, tr;
50  pt = 6.11657e-03;
51  Tt = 273.16;
52  tr = T/Tt;
53  x = 0.;
54  a[0] = 20.9969665107897;
55  a[1] = 3.72437478271362;
56  a[2] = -13.9205483215524;
57  a[3] = 29.6988765013566;
58  a[4] = -40.1972392635944;
59  a[5] = 29.7880481050215;
60  a[6] = -9.13050963547721;
61 
62  for(int i = 0; i < 7; i++)
63  x = x + a[i]*pow(tr, i);
64  return 1.E5 * pt * exp(1.5*log(tr) + (1 - 1/tr)*x);
65 }
66 
67 inline double sat_vapor_p_H2O_BriggsS(double T) {
68  double a[6], x;
69  if ( T < 273.16 ) {
70  a[1] = -5631.1206;
71  a[2] = -8.363602;
72  a[3] = 8.2312;
73  a[4] = -3.861449e-02;
74  a[5] = 2.77494e-05;
75  } else {
76  a[1] = -2313.0338;
77  a[2] = -164.03307;
78  a[3] = 38.053682;
79  a[4] = -1.3844344e-01;
80  a[5] = 7.4465367e-05;
81  }
82  x = a[1]/T + a[2] + a[3]*log(T) + a[4]*T + a[5]*pow(T, 2);
83  return exp(x) / 10.;
84 }
85 
86 inline double sat_vapor_p_H2O_Bolton(double T) {
87  double result;
88  result = 612.2 * exp(17.67 * (T - 273.15) / (T - 29.65));
89  return result;
90 }
91 
92 inline double sat_vapor_p_H2O_Smithsonian(double T) {
93  double result;
94  result = 100. * exp(23.33086 - 6111.72784 / T + 0.15215 * log(T));
95  return result;
96 }
97 
98 inline double sat_vapor_p_H2O_Ideal(double T) {
99  double betal = 24.88,
100  gammal = 5.06,
101  betas = 22.98,
102  gammas = 0.52,
103  tr = 273.16,
104  pr = 611.7;
105  return T > tr ? svph2o(T/tr, pr, betal, gammal):svph2o(T/tr, pr, betas, gammas);
106 }
107 
108 #endif
#define A(i, j)
Definition: band_back_sub.c:13
#define B(iq)
Definition: cdisort.h:249
double sat_vapor_p_H2O_Fray(double T)
double sat_vapor_p_H2O_UMich(double T)
double sat_vapor_p_H2O_Antoine(double T)
double sat_vapor_p_H2O_Smithsonian(double T)
double svph2o(double t, double p, double beta, double gamma)
Definition: water_vapors.hpp:6
double sat_vapor_p_H2O_Hubner(double T)
double sat_vapor_p_H2O_BriggsS(double T)
double sat_vapor_p_H2O_Ideal(double T)
double sat_vapor_p_H2O_Bolton(double T)