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