10 static const double Tmn=273.16;
11 static const double Tmx=1600.0;
12 static const double M=18.016;
13 static const double Tc=647.286;
14 static const double Pc=22.089e6;
15 static const double Roc=317.0;
16 static const double To=273.16;
17 static const double R=461.51;
18 static const double E=4.8E-3;
19 static const double Ta=1000.0;
20 static const double tauc=1.544912;
21 static const double Tp=338.15;
22 static const double aww=0.01;
23 static const double Roa1=634.0;
24 static const double Roaj=1000.0;
25 static const double u0=2375470.875;
26 static const double s0=6697.356635;
28 static const double A[10][7]= {{
29 2.9492937E-2,-5.1985860E-3,
30 6.8335354E-3,-1.5641040E-4,
31 -6.3972405E-3, -3.9661401E-3, -6.9048554E-4
34 -1.3213917E-4,7.7779182E-6, -2.6149751E-5,-7.2546108E-7,
35 2.6409282E-5, 1.5453061E-5,2.7407416E-6
38 2.7464632E-7,-3.3301902E-8,6.5326396E-8,-9.2734289E-9,
39 -4.7740374E-8,-2.9142470E-8,-5.1028070E-9
42 -3.6093828E-10, -1.6254622E-11, -2.6181978E-11, 4.3125840E-12,
43 5.6323130E-11, 2.9568796E-11,3.9636085E-12
45 {3.4218431E-13, -1.7731074E-13,0,0,0,0,0},
46 {-2.4450042E-16, 1.2748742E-16,0,0,0,0,0},
47 {1.5518535E-19, 1.3746153E-19,0,0,0,0,0},
48 {5.9728487E-24,1.5597836E-22, 0,0,0,0,0},
50 -4.1030848E-1, 3.3731180E-1, -1.3746678E-1, 6.7874983E-3,
51 1.3687317E-1, 7.984797E-2, 1.3041253E-2
54 -4.1605860E-4, -2.0988866E-4,-7.3396848E-4,1.0401717E-5,
55 6.4581880E-4, 3.9917570E-4, 7.1531353E-5
59 static const double F[]= {-7.4192420, 2.9721E-1,-1.155286E-1,8.685635E-3,
60 1.0940980E-3, -4.39993E-3, 2.5206580E-3, -5.2186840E-4
63 static const double D[]= {3.6711257,-2.8512396E1,2.2265240E2,-8.8243852E2,
64 2.0002765E3,-2.6122557E3,1.8297674E3,-5.3350520E2
67 static const double G[]= {4.6E4,1.011249E3,8.3893E-1,-2.19989E-4,2.466619E-7,
71 static const double taua[] = {1.544912, 2.5, 2.5, 2.5, 2.5, 2.5, 2.5};
73 inline double water::C(
int i)
76 return (i == 0 ? R*T : R*T*(tau - tauc)*pow(tau - taua[i],i-1));
79 inline double water::Cprime(
int i)
82 return (i == 0 ? R : (i == 1 ? -R*tauc :
83 -R*pow(tau - taua[i],i-2)*(tauc*(tau - taua[i])
84 + (i-1)*tau*(tau - tauc))));
87 inline double water::I(
int j)
89 double factor, sum, rho_aj;
90 rho_aj = (j == 0 ? Roa1 : Roaj);
92 factor = Rho - rho_aj;
93 for (
int i=7; i>0; i--) {
98 sum += (exp(-E*Rho)*(A[8][j] + A[9][j]*Rho));
102 inline double water::H(
int j)
104 double factor, sum, rho_aj;
105 rho_aj = (j == 0 ? Roa1 : Roaj);
107 factor = Rho - rho_aj;
108 for (
int i=6; i>0; i--) {
109 sum += (A[i][j] + Rho*(i+1)*A[i+1][j]);
112 sum += (A[0][j] + Rho*A[1][j]);
113 sum += (exp(-E*Rho)*((1.0 - Rho*E)*A[8][j]
114 + Rho*(2.0 - Rho*E)*A[9][j]));
115 sum += A[7][j]*pow(factor,7);
123 for (i=0; i<7; i++) {
124 sum += (C(i) - T*Cprime(i))*I(i);
126 for (i=1; i<6; i++) {
127 sum += G[i]*(pow(T,i) - pow(To,i))/
double(i);
129 sum += G[0]*log(T/To) + u0;
130 return sum + m_energy_offset;
137 for (i=2; i<6; i++) {
138 sum += G[i]*(pow(T,i-1) - pow(To,i-1))/
double(i-1);
140 sum += G[1]*log(T/To);
141 sum -= G[0]*(1.0/T - 1.0/To);
142 sum += s0 - R*log(Rho);
143 for (i=0; i<7; i++) {
144 sum -= Cprime(i)*I(i);
146 return sum + m_entropy_offset;
152 for (
int i=0; i<7; i++) {
161 if ((T < Tmn) || (T > Tc)) {
164 for (
int i=1; i<=8; i++) {
165 sum += F[i-1]*pow(aww*(T-Tp),
double(i-1));
187 double water::ldens()
191 if ((T < Tmn) || (T >= Tc)) {
194 for (i=0; i<8; i++) {
195 sum+=D[i]*pow(1.0 - T/Tc,
double(i+1)/3.0);
197 double density = Roc*(1+sum);
201 double water::Tcrit()
205 double water::Pcrit()
209 double water::Vcrit()
223 return (
char*) m_name.c_str();
225 char* water::formula()
227 return (
char*) m_formula.c_str();
229 double water::MolWt()