Cantera  2.1.2
WaterProps.cpp
Go to the documentation of this file.
1 /**
2  * @file WaterProps.cpp
3  */
4 /*
5  * Copyright (2006) Sandia Corporation. Under the terms of
6  * Contract DE-AC04-94AL85000 with Sandia Corporation, the
7  * U.S. Government retains certain rights in this software.
8  */
9 
11 #include "cantera/base/ctml.h"
15 
16 namespace Cantera
17 {
19  m_waterIAPWS(0),
20  m_own_sub(false)
21 {
22  // object owns its own water evaluator
24  m_own_sub = true;
25 }
26 
28  m_waterIAPWS(0),
29  m_own_sub(false)
30 {
31  if (wptr) {
32  // object in slave mode; it doesn't own its own water evaluator.
33  m_waterIAPWS = wptr->getWater();
34  m_own_sub = false;
35  } else {
37  m_own_sub = true;
38  }
39 }
40 
42  m_waterIAPWS(0),
43  m_own_sub(false)
44 {
45  if (waterIAPWS) {
46  m_waterIAPWS = waterIAPWS;
47  m_own_sub = false;
48  } else {
50  m_own_sub = true;
51  }
52 }
53 
55  m_waterIAPWS(0),
56  m_own_sub(false)
57 {
58  *this = b;
59 }
60 
62 {
63  if (m_own_sub) {
64  delete m_waterIAPWS;
65  }
66 }
67 
69 {
70  if (&b == this) {
71  return *this;
72  }
73 
74  if (m_own_sub) {
75  if (m_waterIAPWS) {
76  delete m_waterIAPWS;
77  m_waterIAPWS = 0;
78  }
79  }
80  if (b.m_own_sub) {
82  m_own_sub = true;
83  } else {
85  m_own_sub = false;
86  }
87 
88  return *this;
89 }
90 
91 doublereal WaterProps::density_T(doublereal T, doublereal P, int ifunc)
92 {
93  doublereal Tc = T - 273.15;
94  const doublereal U1 = 288.9414;
95  const doublereal U2 = 508929.2;
96  const doublereal U3 = 68.12963;
97  const doublereal U4 = -3.9863;
98 
99  doublereal tmp1 = Tc + U1;
100  doublereal tmp4 = Tc + U4;
101  doublereal t4t4 = tmp4 * tmp4;
102  doublereal tmp3 = Tc + U3;
103  doublereal rho = 1000. * (1.0 - tmp1*t4t4/(U2 * tmp3));
104 
105  /*
106  * Impose an ideal gas lower bound on rho. We need this
107  * to ensure positivity of rho, even though it is
108  * grossly unrepresentative.
109  */
110  doublereal rhomin = P / (GasConstant * T);
111  if (rho < rhomin) {
112  rho = rhomin;
113  if (ifunc == 1) {
114  return - rhomin / T;
115  } else if (ifunc == 3) {
116  return rhomin / P;
117  } else if (ifunc == 2) {
118  return 2.0 * rhomin / (T * T);
119  }
120  }
121 
122  if (ifunc == 1) {
123  doublereal drhodT = 1000./U2 * (
124  - tmp4 * tmp4 / (tmp3)
125  - tmp1 * 2 * tmp4 / (tmp3)
126  + tmp1 * t4t4 / (tmp3*tmp3)
127  );
128  return drhodT;
129  } else if (ifunc == 3) {
130  return 0.0;
131  } else if (ifunc == 2) {
132  doublereal t3t3 = tmp3 * tmp3;
133  doublereal d2rhodT2 = 1000./U2 *
134  ((-4.0*tmp4-2.0*tmp1)/tmp3 +
135  (2.0*t4t4 + 4.0*tmp1*tmp4)/t3t3
136  - 2.0*tmp1 * t4t4/(t3t3*tmp3));
137  return d2rhodT2;
138  }
139 
140  return rho;
141 }
142 
143 doublereal WaterProps::relEpsilon(doublereal T, doublereal P_pascal,
144  int ifunc)
145 {
146  const doublereal U1 = 3.4279E2;
147  const doublereal U2 = -5.0866E-3;
148  const doublereal U3 = 9.4690E-7;
149  const doublereal U4 = -2.0525;
150  const doublereal U5 = 3.1159E3;
151  const doublereal U6 = -1.8289E2;
152  const doublereal U7 = -8.0325E3;
153  const doublereal U8 = 4.2142E6;
154  const doublereal U9 = 2.1417;
155  doublereal T2 = T * T;
156 
157  doublereal eps1000 = U1 * exp(U2 * T + U3 * T2);
158  doublereal C = U4 + U5/(U6 + T);
159  doublereal B = U7 + U8/T + U9 * T;
160 
161  doublereal Pbar = P_pascal * 1.0E-5;
162  doublereal tmpBpar = B + Pbar;
163  doublereal tmpB1000 = B + 1000.0;
164  doublereal ltmp = log(tmpBpar/tmpB1000);
165  doublereal epsRel = eps1000 + C * ltmp;
166 
167  if (ifunc == 1 || ifunc == 2) {
168  doublereal tmpC = U6 + T;
169  doublereal dCdT = - U5/(tmpC * tmpC);
170 
171  doublereal dBdT = - U8/(T * T) + U9;
172 
173  doublereal deps1000dT = eps1000 * (U2 + 2.0 * U3 * T);
174 
175  doublereal dltmpdT = (dBdT/tmpBpar - dBdT/tmpB1000);
176  if (ifunc == 1) {
177  return deps1000dT + dCdT * ltmp + C * dltmpdT;
178  }
179  doublereal T3 = T2 * T;
180  doublereal d2CdT2 = - 2.0 * dCdT / tmpC;
181  doublereal d2BdT2 = 2.0 * U8 / (T3);
182 
183  doublereal d2ltmpdT2 = (d2BdT2*(1.0/tmpBpar - 1.0/tmpB1000) +
184  dBdT*dBdT*(1.0/(tmpB1000*tmpB1000) - 1.0/(tmpBpar*tmpBpar)));
185 
186  doublereal d2eps1000dT2 = (deps1000dT * (U2 + 2.0 * U3 * T) + eps1000 * (2.0 * U3));
187 
188  if (ifunc == 2) {
189  doublereal d2epsReldT2 = (d2eps1000dT2 + d2CdT2 * ltmp + 2.0 * dCdT * dltmpdT
190  + C * d2ltmpdT2);
191  return d2epsReldT2;
192  }
193  }
194  if (ifunc == 3) {
195  doublereal dltmpdP = 1.0E-5 / tmpBpar;
196  return C * dltmpdP;
197  }
198 
199  return epsRel;
200 }
201 
202 
203 doublereal WaterProps::ADebye(doublereal T, doublereal P_input, int ifunc)
204 {
205  doublereal psat = satPressure(T);
206  doublereal P;
207  if (psat > P_input) {
208  //printf("ADebye WARNING: p_input < psat: %g %g\n",
209  // P_input, psat);
210  P = psat;
211  } else {
212  P = P_input;
213  }
214  doublereal epsRelWater = relEpsilon(T, P, 0);
215  //printf("releps calc = %g, compare to 78.38\n", epsRelWater);
216  //doublereal B_Debye = 3.28640E9;
217 
218  doublereal epsilon = epsilon_0 * epsRelWater;
219  doublereal dw = density_IAPWS(T, P);
220  doublereal tmp = sqrt(2.0 * Avogadro * dw / 1000.);
221  doublereal tmp2 = ElectronCharge * ElectronCharge * Avogadro /
222  (epsilon * GasConstant * T);
223  doublereal tmp3 = tmp2 * sqrt(tmp2);
224  doublereal A_Debye = tmp * tmp3 / (8.0 * Pi);
225 
226 
227  /*
228  * dAdT = - 3/2 Ad/T + 1/2 Ad/dw d(dw)/dT - 3/2 Ad/eps d(eps)/dT
229  *
230  * dAdT = - 3/2 Ad/T - 1/2 Ad/Vw d(Vw)/dT - 3/2 Ad/eps d(eps)/dT
231  */
232  if (ifunc == 1 || ifunc == 2) {
233  doublereal dAdT = - 1.5 * A_Debye / T;
234 
235  doublereal depsRelWaterdT = relEpsilon(T, P, 1);
236  dAdT -= A_Debye * (1.5 * depsRelWaterdT / epsRelWater);
237 
238  //int methodD = 1;
239  //doublereal ddwdT = density_T_new(T, P, 1);
240  // doublereal contrib1 = A_Debye * (0.5 * ddwdT / dw);
241 
242  /*
243  * calculate d(lnV)/dT _constantP, i.e., the cte
244  */
245  doublereal cte = coeffThermalExp_IAPWS(T, P);
246  doublereal contrib2 = - A_Debye * (0.5 * cte);
247 
248  //dAdT += A_Debye * (0.5 * ddwdT / dw);
249  dAdT += contrib2;
250 
251 #ifdef DEBUG_HKM
252  //printf("dAdT = %g, contrib1 = %g, contrib2 = %g\n",
253  // dAdT, contrib1, contrib2);
254 #endif
255 
256  if (ifunc == 1) {
257  return dAdT;
258  }
259 
260  if (ifunc == 2) {
261  /*
262  * Get the second derivative of the dielectric constant wrt T
263  * -> we will take each of the terms in dAdT and differentiate
264  * it again.
265  */
266  doublereal d2AdT2 = 1.5 / T * (A_Debye/T - dAdT);
267 
268  doublereal d2epsRelWaterdT2 = relEpsilon(T, P, 2);
269 
270  //doublereal dT = -0.01;
271  //doublereal TT = T + dT;
272  //doublereal depsRelWaterdTdel = relEpsilon(TT, P, 1);
273  //doublereal d2alt = (depsRelWaterdTdel- depsRelWaterdT ) / dT;
274  //printf("diff %g %g\n",d2epsRelWaterdT2, d2alt);
275  // HKM -> checks out, i.e., they are the same.
276 
277  d2AdT2 += 1.5 * (- dAdT * depsRelWaterdT / epsRelWater
278  - A_Debye / epsRelWater *
279  (d2epsRelWaterdT2 - depsRelWaterdT * depsRelWaterdT / epsRelWater));
280 
281  doublereal deltaT = -0.1;
282  doublereal Tdel = T + deltaT;
283  doublereal cte_del = coeffThermalExp_IAPWS(Tdel, P);
284  doublereal dctedT = (cte_del - cte) / Tdel;
285 
286 
287  //doublereal d2dwdT2 = density_T_new(T, P, 2);
288 
289  doublereal contrib3 = 0.5 * (-(dAdT * cte) -(A_Debye * dctedT));
290  d2AdT2 += contrib3;
291 
292  return d2AdT2;
293  }
294  }
295  /*
296  * A_Debye = (1/(8 Pi)) sqrt(2 Na dw / 1000)
297  * (e e/(epsilon R T))^3/2
298  *
299  * dAdP = + 1/2 Ad/dw d(dw)/dP - 3/2 Ad/eps d(eps)/dP
300  *
301  * dAdP = - 1/2 Ad/Vw d(Vw)/dP - 3/2 Ad/eps d(eps)/dP
302  *
303  * dAdP = + 1/2 Ad * kappa - 3/2 Ad/eps d(eps)/dP
304  *
305  * where kappa = - 1/Vw d(Vw)/dP_T (isothermal compressibility)
306  */
307  if (ifunc == 3) {
308 
309  doublereal dAdP = 0.0;
310 
311  doublereal depsRelWaterdP = relEpsilon(T, P, 3);
312  dAdP -= A_Debye * (1.5 * depsRelWaterdP / epsRelWater);
313 
314  doublereal kappa = isothermalCompressibility_IAPWS(T,P);
315 
316  //doublereal ddwdP = density_T_new(T, P, 3);
317  dAdP += A_Debye * (0.5 * kappa);
318 
319  return dAdP;
320  }
321 
322  return A_Debye;
323 }
324 
325 doublereal WaterProps::satPressure(doublereal T)
326 {
327  return m_waterIAPWS->psat(T);
328 }
329 
330 doublereal WaterProps::density_IAPWS(doublereal temp, doublereal press)
331 {
332  return m_waterIAPWS->density(temp, press, WATER_LIQUID);
333 }
334 
335 doublereal WaterProps::density_IAPWS() const
336 {
337  return m_waterIAPWS->density();
338 }
339 
340 doublereal WaterProps::coeffThermalExp_IAPWS(doublereal temp, doublereal press)
341 {
342  doublereal dens = m_waterIAPWS->density(temp, press, WATER_LIQUID);
343  if (dens < 0.0) {
344  throw CanteraError("WaterProps::coeffThermalExp_IAPWS",
345  "Unable to solve for density at T = " + fp2str(temp) + " and P = " + fp2str(press));
346  }
347  return m_waterIAPWS->coeffThermExp();
348 }
349 
350 doublereal WaterProps::isothermalCompressibility_IAPWS(doublereal temp, doublereal press)
351 {
352  doublereal dens = m_waterIAPWS->density(temp, press, WATER_LIQUID);
353  if (dens < 0.0) {
354  throw CanteraError("WaterProps::isothermalCompressibility_IAPWS",
355  "Unable to solve for density at T = " + fp2str(temp) + " and P = " + fp2str(press));
356  }
358 }
359 
360 // Parameters for the viscosityWater() function
361 
362 // \cond
363 const doublereal H[4] = {1.,
364  0.978197,
365  0.579829,
366  -0.202354
367  };
368 
369 const doublereal Hij[6][7] = {
370  { 0.5132047, 0.2151778, -0.2818107, 0.1778064, -0.04176610, 0., 0.},
371  { 0.3205656, 0.7317883, -1.070786 , 0.4605040, 0., -0.01578386, 0.},
372  { 0., 1.241044 , -1.263184 , 0.2340379, 0., 0., 0.},
373  { 0., 1.476783 , 0., -0.4924179, 0.1600435, 0., -0.003629481},
374  {-0.7782567, 0.0 , 0., 0. , 0., 0., 0.},
375  { 0.1885447, 0.0 , 0., 0. , 0., 0., 0.},
376 };
377 const doublereal TStar = 647.27; // Kelvin
378 const doublereal rhoStar = 317.763; // kg / m3
379 const doublereal presStar = 22.115E6; // Pa
380 const doublereal muStar = 55.071E-6; //Pa s
381 // \endcond
382 
383 doublereal WaterProps::viscosityWater() const
384 {
385  doublereal temp = m_waterIAPWS->temperature();
386  doublereal dens = m_waterIAPWS->density();
387 
388  //WaterPropsIAPWS *waterP = new WaterPropsIAPWS();
389  //m_waterIAPWS->setState_TR(temp, dens);
390  //doublereal pressure = m_waterIAPWS->pressure();
391  //printf("pressure = %g\n", pressure);
392  //dens = 18.02 * pressure / (GasConstant * temp);
393  //printf ("mod dens = %g\n", dens);
394 
395  doublereal rhobar = dens/rhoStar;
396  doublereal tbar = temp / TStar;
397  // doublereal pbar = pressure / presStar;
398 
399  doublereal tbar2 = tbar * tbar;
400  doublereal tbar3 = tbar2 * tbar;
401 
402  doublereal mu0bar = std::sqrt(tbar) / (H[0] + H[1]/tbar + H[2]/tbar2 + H[3]/tbar3);
403 
404  //printf("mu0bar = %g\n", mu0bar);
405  //printf("mu0 = %g\n", mu0bar * muStar);
406 
407  doublereal tfac1 = 1.0 / tbar - 1.0;
408  doublereal tfac2 = tfac1 * tfac1;
409  doublereal tfac3 = tfac2 * tfac1;
410  doublereal tfac4 = tfac3 * tfac1;
411  doublereal tfac5 = tfac4 * tfac1;
412 
413  doublereal rfac1 = rhobar - 1.0;
414  doublereal rfac2 = rfac1 * rfac1;
415  doublereal rfac3 = rfac2 * rfac1;
416  doublereal rfac4 = rfac3 * rfac1;
417  doublereal rfac5 = rfac4 * rfac1;
418  doublereal rfac6 = rfac5 * rfac1;
419 
420  doublereal sum = (Hij[0][0] + Hij[1][0]*tfac1 + Hij[4][0]*tfac4 + Hij[5][0]*tfac5 +
421  Hij[0][1]*rfac1 + Hij[1][1]*tfac1*rfac1 + Hij[2][1]*tfac2*rfac1 + Hij[3][1]*tfac3*rfac1 +
422  Hij[0][2]*rfac2 + Hij[1][2]*tfac1*rfac2 + Hij[2][2]*tfac2*rfac2 +
423  Hij[0][3]*rfac3 + Hij[1][3]*tfac1*rfac3 + Hij[2][3]*tfac2*rfac3 + Hij[3][3]*tfac3*rfac3 +
424  Hij[0][4]*rfac4 + Hij[3][4]*tfac3*rfac4 +
425  Hij[1][5]*tfac1*rfac5 + Hij[3][6]*tfac3*rfac6
426  );
427  doublereal mu1bar = std::exp(rhobar * sum);
428 
429  // Apply the near-critical point corrections if necessary
430  doublereal mu2bar = 1.0;
431  if ((tbar >= 0.9970) && tbar <= 1.0082) {
432  if ((rhobar >= 0.755) && (rhobar <= 1.290)) {
433  doublereal drhodp = 1.0 / m_waterIAPWS->dpdrho();
434  drhodp *= presStar / rhoStar;
435  doublereal xsi = rhobar * drhodp;
436  if (xsi >= 21.93) {
437  mu2bar = 0.922 * std::pow(xsi, 0.0263);
438  }
439  }
440  }
441 
442  doublereal mubar = mu0bar * mu1bar * mu2bar;
443 
444  return mubar * muStar;
445 }
446 
448 {
449  static const doublereal Tstar = 647.27;
450  static const doublereal rhostar = 317.763;
451  static const doublereal lambdastar = 0.4945;
452  static const doublereal presstar = 22.115E6;
453  static const doublereal L[4] = {
454  1.0000,
455  6.978267,
456  2.599096,
457  -0.998254
458  };
459  static const doublereal Lji[6][5] = {
460  { 1.3293046, 1.7018363, 5.2246158, 8.7127675, -1.8525999},
461  {-0.40452437, -2.2156845, -10.124111, -9.5000611, 0.93404690},
462  { 0.24409490, 1.6511057, 4.9874687, 4.3786606, 0.0},
463  { 0.018660751, -0.76736002, -0.27297694, -0.91783782, 0.0},
464  {-0.12961068, 0.37283344, -0.43083393, 0.0, 0.0},
465  { 0.044809953, -0.11203160, 0.13333849, 0.0, 0.0},
466  };
467 
468  doublereal temp = m_waterIAPWS->temperature();
469  doublereal dens = m_waterIAPWS->density();
470 
471  doublereal rhobar = dens/rhostar;
472  doublereal tbar = temp / Tstar;
473  doublereal tbar2 = tbar * tbar;
474  doublereal tbar3 = tbar2 * tbar;
475  doublereal lambda0bar = sqrt(tbar) / (L[0] + L[1]/tbar + L[2]/tbar2 + L[3]/tbar3);
476 
477  //doublereal lambdagas = lambda0bar * lambdastar * 1.0E3;
478 
479  doublereal tfac1 = 1.0 / tbar - 1.0;
480  doublereal tfac2 = tfac1 * tfac1;
481  doublereal tfac3 = tfac2 * tfac1;
482  doublereal tfac4 = tfac3 * tfac1;
483 
484  doublereal rfac1 = rhobar - 1.0;
485  doublereal rfac2 = rfac1 * rfac1;
486  doublereal rfac3 = rfac2 * rfac1;
487  doublereal rfac4 = rfac3 * rfac1;
488  doublereal rfac5 = rfac4 * rfac1;
489 
490  doublereal sum = (Lji[0][0] + Lji[0][1]*tfac1 + Lji[0][2]*tfac2 + Lji[0][3]*tfac3 + Lji[0][4]*tfac4 +
491  Lji[1][0]*rfac1 + Lji[1][1]*tfac1*rfac1 + Lji[1][2]*tfac2*rfac1 + Lji[1][3]*tfac3*rfac1 + Lji[1][4]*tfac4*rfac1 +
492  Lji[2][0]*rfac2 + Lji[2][1]*tfac1*rfac2 + Lji[2][2]*tfac2*rfac2 + Lji[2][3]*tfac3*rfac2 +
493  Lji[3][0]*rfac3 + Lji[3][1]*tfac1*rfac3 + Lji[3][2]*tfac2*rfac3 + Lji[3][3]*tfac3*rfac3 +
494  Lji[4][0]*rfac4 + Lji[4][1]*tfac1*rfac4 + Lji[4][2]*tfac2*rfac4 +
495  Lji[5][0]*rfac5 + Lji[5][1]*tfac1*rfac5 + Lji[5][2]*tfac2*rfac5
496  );
497  doublereal lambda1bar = exp(rhobar * sum);
498 
499  doublereal mu0bar = std::sqrt(tbar) / (H[0] + H[1]/tbar + H[2]/tbar2 + H[3]/tbar3);
500 
501  doublereal tfac5 = tfac4 * tfac1;
502  doublereal rfac6 = rfac5 * rfac1;
503 
504  sum = (Hij[0][0] + Hij[1][0]*tfac1 + Hij[4][0]*tfac4 + Hij[5][0]*tfac5 +
505  Hij[0][1]*rfac1 + Hij[1][1]*tfac1*rfac1 + Hij[2][1]*tfac2*rfac1 + Hij[3][1]*tfac3*rfac1 +
506  Hij[0][2]*rfac2 + Hij[1][2]*tfac1*rfac2 + Hij[2][2]*tfac2*rfac2 +
507  Hij[0][3]*rfac3 + Hij[1][3]*tfac1*rfac3 + Hij[2][3]*tfac2*rfac3 + Hij[3][3]*tfac3*rfac3 +
508  Hij[0][4]*rfac4 + Hij[3][4]*tfac3*rfac4 +
509  Hij[1][5]*tfac1*rfac5 + Hij[3][6]*tfac3*rfac6
510  );
511  doublereal mu1bar = std::exp(rhobar * sum);
512 
513  doublereal t2r2 = tbar * tbar / (rhobar * rhobar);
514  doublereal drhodp = 1.0 / m_waterIAPWS->dpdrho();
515  drhodp *= presStar / rhoStar;
516  doublereal xsi = rhobar * drhodp;
517  doublereal xsipow = std::pow(xsi, 0.4678);
518  doublereal rho1 = rhobar - 1.;
519  doublereal rho2 = rho1 * rho1;
520  doublereal rho4 = rho2 * rho2;
521  doublereal temp2 = (tbar - 1.0) * (tbar - 1.0);
522 
523  /*
524  * beta = M / (rho * Rgas) (d (pressure) / dT) at constant rho
525  *
526  * Note for ideal gases this is equal to one.
527  *
528  * beta = delta (phi0_d() + phiR_d())
529  * - tau delta (phi0_dt() + phiR_dt())
530  */
531  doublereal beta = m_waterIAPWS->coeffPresExp();
532 
533  doublereal dpdT_const_rho = beta * GasConstant * dens / 18.015268;
534  dpdT_const_rho *= Tstar / presstar;
535 
536  doublereal lambda2bar = 0.0013848 / (mu0bar * mu1bar) * t2r2 * dpdT_const_rho * dpdT_const_rho *
537  xsipow * sqrt(rhobar) * exp(-18.66*temp2 - rho4);
538 
539  return (lambda0bar * lambda1bar + lambda2bar) * lambdastar;
540 }
541 
542 }
doublereal isothermalCompressibility() const
Returns the coefficient of isothermal compressibility for the state of the object.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
doublereal viscosityWater() const
Returns the viscosity of water at the current conditions (kg/m/s)
Definition: WaterProps.cpp:383
doublereal density(doublereal temperature, doublereal pressure, int phase=-1, doublereal rhoguess=-1.0)
Calculates the density given the temperature and the pressure, and a guess at the density...
Class for calculating the equation of state of water.
doublereal density_IAPWS() const
Returns the density of water.
Definition: WaterProps.cpp:335
Implementation of a pressure dependent standard state virtual function for a Pure Water Phase (see Sp...
Header for a class used to house several approximation routines for properties of water...
doublereal coeffThermExp() const
Returns the coefficient of thermal expansion.
const doublereal Pi
Pi.
Definition: ct_defs.h:51
doublereal satPressure(doublereal T)
Returns the saturation pressure given the temperature.
Definition: WaterProps.cpp:325
doublereal dpdrho() const
Returns the value of dp / drho at constant T for the state of the object.
WaterProps & operator=(const WaterProps &b)
Assignment operator.
Definition: WaterProps.cpp:68
doublereal isothermalCompressibility_IAPWS(doublereal T, doublereal P)
Returns the isothermal compressibility of water.
Definition: WaterProps.cpp:350
The WaterProps class is used to house several approximation routines for properties of water...
Definition: WaterProps.h:96
virtual ~WaterProps()
destructor
Definition: WaterProps.cpp:61
WaterPropsIAPWS * getWater()
Get a pointer to a changeable WaterPropsIAPWS object.
Definition: PDSS_Water.h:218
std::string fp2str(const double x, const std::string &fmt)
Convert a double into a c++ string.
Definition: stringUtils.cpp:29
Class for the liquid water pressure dependent standard state.
Definition: PDSS_Water.h:54
WaterPropsIAPWS * m_waterIAPWS
Pointer to the WaterPropsIAPWS object.
Definition: WaterProps.h:290
doublereal thermalConductivityWater() const
Returns the thermal conductivity of water at the current conditions (W/m/K)
Definition: WaterProps.cpp:447
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:68
WaterProps()
Default constructor.
Definition: WaterProps.cpp:18
const doublereal Avogadro
Avogadro's Number [number/kmol].
Definition: ct_defs.h:63
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Definition: ct_defs.h:66
Contains declarations for string manipulation functions within Cantera.
const doublereal epsilon_0
Permittivity of free space in F/m.
Definition: ct_defs.h:108
doublereal ADebye(doublereal T, doublereal P, int ifunc)
ADebye calculates the value of A_Debye as a function of temperature and pressure according to relatio...
Definition: WaterProps.cpp:203
doublereal coeffThermalExp_IAPWS(doublereal T, doublereal P)
returns the coefficient of thermal expansion
Definition: WaterProps.cpp:340
doublereal relEpsilon(doublereal T, doublereal P_pascal, int ifunc=0)
Bradley-Pitzer equation for the dielectric constant of water as a function of temperature and pressur...
Definition: WaterProps.cpp:143
static doublereal density_T(doublereal T, doublereal P, int ifunc)
Simple calculation of water density at atmospheric pressure.
Definition: WaterProps.cpp:91
bool m_own_sub
true if we own the WaterPropsIAPWS object
Definition: WaterProps.h:293
doublereal temperature() const
Returns the temperature (Kelvin)
doublereal psat(doublereal temperature, int waterState=WATER_LIQUID)
This function returns the saturation pressure given the temperature as an input parameter, and sets the internal state to the saturated conditions.
doublereal coeffPresExp() const
Returns the isochoric pressure derivative wrt temperature.
Headers for a class for calculating the equation of state of water from the IAPWS 1995 Formulation ba...