Canoe
Comprehensive Atmosphere N' Ocean Engine
hydrogen_sulfide_vapors.hpp
Go to the documentation of this file.
1 #ifndef SRC_SNAP_THERMODYNAMICS_VAPORS_HYDROGEN_SULFIDE_VAPORS_HPP_
2 #define SRC_SNAP_THERMODYNAMICS_VAPORS_HYDROGEN_SULFIDE_VAPORS_HPP_
3 
4 // C/C++
5 #include <cmath>
6 
7 inline double Pcgs_from_torr(double P) { return (1013250.0 / 760.0) * P; }
8 
9 inline double sat_vapor_p_H2S_solid_UMich(double T) {
10  // Vapor of H2S over H2S liquid, T > 188 K, over H2S ice for T < 188 K
11  double x;
12  double log10T = log10(T);
13  if (T > 212.75)
14  x = 7.7547 - 976.0 / T - 0.12058 * log10T;
15  else if (T > 188.0)
16  x = 15.4859 - 1264.3574 / T - 2.86206 * log10T;
17  else
18  x = 57.19 - 2461.84 / T - 18.443 * log10T;
19 
20  return Pcgs_from_torr(pow(10.0, x)) * 0.1;
21 }
22 
23 // best fit in [138.8K; 349.5K] (webbook.nist.gov)
24 inline double sat_vapor_p_H2S_Antoine(double T) {
25  double result;
26  if (T < 212.8)
27  result = pow(10., 4.43681 - (829.439 / (T - 25.412)));
28  else
29  result = pow(10., 4.52887 - (958.587 / (T - 0.539)));
30 
31  return 1.E5 * result;
32 }
33 
34 // best fit in [120K; 190K]
35 inline double sat_vapor_p_H2S_solid_Hubner(double T) {
36  double A, B, C, D;
37  double log10T = log10(T);
38  A = 6.96156;
39  B = -903.815;
40  C = 0.258812;
41  D = 0.00873804;
42 
43  double x = A + B / T + C * log10(T) + D * T;
44  return 1.E5 * pow(10.0, x);
45 }
46 
47 // best fit in [110K; 187.57K]
48 inline double sat_vapor_p_H2S_solid_Fray(double T) {
49  double a[7], x;
50  x = 0.;
51  if (T > 127) {
52  a[0] = 8.933;
53  a[1] = -7.260e+02;
54  a[2] = -3.504e+05;
55  a[3] = 2.724e+07;
56  a[4] = -8.582e+08;
57  a[5] = 0.;
58  a[6] = 0.;
59  } else {
60  a[0] = 1.298e+01;
61  a[1] = -2.707e+03;
62  a[2] = 0.;
63  a[3] = 0.;
64  a[4] = 0.;
65  a[5] = 0.;
66  a[6] = 0.;
67  }
68 
69  for (int i = 1; i < 7; i++) {
70  x = x + a[i] / pow(T, i);
71  }
72  return 1.E5 * exp(x + a[0]);
73 }
74 
75 #endif // SRC_SNAP_THERMODYNAMICS_VAPORS_HYDROGEN_SULFIDE_VAPORS_HPP_
#define A(i, j)
Definition: band_back_sub.c:18
double Pcgs_from_torr(double P)
double sat_vapor_p_H2S_solid_Hubner(double T)
double sat_vapor_p_H2S_solid_Fray(double T)
double sat_vapor_p_H2S_Antoine(double T)
double sat_vapor_p_H2S_solid_UMich(double T)