Cantera  2.5.1
PDSS_HKFT.cpp
Go to the documentation of this file.
1 /**
2  * @file PDSS_HKFT.cpp
3  * Definitions for the class PDSS_HKFT (pressure dependent standard state)
4  * which handles calculations for a single species in a phase using the
5  * HKFT standard state
6  * (see \ref pdssthermo and class \link Cantera::PDSS_HKFT PDSS_HKFT\endlink).
7  */
8 
9 // This file is part of Cantera. See License.txt in the top-level directory or
10 // at https://cantera.org/license.txt for license and copyright information.
11 
12 #include "cantera/base/ctml.h"
17 
18 using namespace std;
19 
20 namespace Cantera
21 {
22 // Set the default to error exit if there is an input file inconsistency
23 int PDSS_HKFT::s_InputInconsistencyErrorExit = 1;
24 
25 PDSS_HKFT::PDSS_HKFT()
26  : m_waterSS(0)
27  , m_densWaterSS(-1.0)
28  , m_deltaG_formation_tr_pr(NAN)
29  , m_deltaH_formation_tr_pr(NAN)
30  , m_Mu0_tr_pr(0.0)
31  , m_Entrop_tr_pr(NAN)
32  , m_a1(0.0)
33  , m_a2(0.0)
34  , m_a3(0.0)
35  , m_a4(0.0)
36  , m_c1(0.0)
37  , m_c2(0.0)
38  , m_omega_pr_tr(0.0)
39  , m_Y_pr_tr(0.0)
40  , m_Z_pr_tr(0.0)
41  , m_presR_bar(0.0)
42  , m_domega_jdT_prtr(0.0)
43  , m_charge_j(0.0)
44 {
45  m_pres = OneAtm;
46  m_presR_bar = OneAtm * 1.0E-5;
47  m_presR_bar = 1.0;
48 }
49 
50 doublereal PDSS_HKFT::enthalpy_mole() const
51 {
52  // Ok we may change this evaluation method in the future.
53  doublereal h = gibbs_mole() + m_temp * entropy_mole();
54  return h;
55 }
56 
57 doublereal PDSS_HKFT::enthalpy_mole2() const
58 {
59  double enthTRPR = m_Mu0_tr_pr + 298.15 * m_Entrop_tr_pr * toSI("cal/gmol");
60  return deltaH() + enthTRPR;
61 }
62 
63 doublereal PDSS_HKFT::intEnergy_mole() const
64 {
65  return enthalpy_RT() - molarVolume() * m_pres;
66 }
67 
68 doublereal PDSS_HKFT::entropy_mole() const
69 {
70  return m_Entrop_tr_pr * toSI("cal/gmol") + deltaS();
71 }
72 
73 doublereal PDSS_HKFT::gibbs_mole() const
74 {
75  return m_Mu0_tr_pr + deltaG();
76 }
77 
78 doublereal PDSS_HKFT::cp_mole() const
79 {
80  doublereal pbar = m_pres * 1.0E-5;
81  doublereal c1term = m_c1;
82  doublereal c2term = m_c2 / (m_temp - 228.) / (m_temp - 228.);
83  doublereal a3term = -m_a3 / (m_temp - 228.) / (m_temp - 228.) / (m_temp - 228.) * 2.0 * m_temp * (pbar - m_presR_bar);
84  doublereal a4term = -m_a4 / (m_temp - 228.) / (m_temp - 228.) / (m_temp - 228.) * 2.0 * m_temp
85  * log((2600. + pbar)/(2600. + m_presR_bar));
86 
87  doublereal omega_j;
88  doublereal domega_jdT;
89  doublereal d2omega_jdT2;
90  if (m_charge_j == 0.0) {
91  omega_j = m_omega_pr_tr;
92  domega_jdT = 0.0;
93  d2omega_jdT2 = 0.0;
94  } else {
95  doublereal nu = 166027;
96  doublereal r_e_j_pr_tr = m_charge_j * m_charge_j / (m_omega_pr_tr/nu + m_charge_j/3.082);
97  doublereal gval = gstar(m_temp, m_pres, 0);
98  doublereal dgvaldT = gstar(m_temp, m_pres, 1);
99  doublereal d2gvaldT2 = gstar(m_temp, m_pres, 2);
100 
101  doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval;
102  doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT;
103  doublereal d2r_e_jdT2 = fabs(m_charge_j) * d2gvaldT2;
104  doublereal r_e_j2 = r_e_j * r_e_j;
105 
106  doublereal charge2 = m_charge_j * m_charge_j;
107  doublereal r_e_H = 3.082 + gval;
108  doublereal r_e_H2 = r_e_H * r_e_H;
109  omega_j = nu * (charge2 / r_e_j - m_charge_j / r_e_H);
110  domega_jdT = nu * (-(charge2 / r_e_j2 * dr_e_jdT)
111  +(m_charge_j / r_e_H2 * dgvaldT));
112  d2omega_jdT2 = nu * (2.0*charge2*dr_e_jdT*dr_e_jdT/(r_e_j2*r_e_j) - charge2*d2r_e_jdT2/r_e_j2
113  -2.0*m_charge_j*dgvaldT*dgvaldT/(r_e_H2*r_e_H) + m_charge_j*d2gvaldT2 /r_e_H2);
114  }
115 
116  doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0);
117  doublereal drelepsilondT = m_waterProps->relEpsilon(m_temp, m_pres, 1);
118  doublereal Y = drelepsilondT / (relepsilon * relepsilon);
119  doublereal d2relepsilondT2 = m_waterProps->relEpsilon(m_temp, m_pres, 2);
120 
121  doublereal X = d2relepsilondT2 / (relepsilon* relepsilon) - 2.0 * relepsilon * Y * Y;
122  doublereal Z = -1.0 / relepsilon;
123 
124  doublereal yterm = 2.0 * m_temp * Y * domega_jdT;
125  doublereal xterm = omega_j * m_temp * X;
126  doublereal otterm = m_temp * d2omega_jdT2 * (Z + 1.0);
127  doublereal rterm = - m_domega_jdT_prtr * (m_Z_pr_tr + 1.0);
128 
129  doublereal Cp_calgmol = c1term + c2term + a3term + a4term + yterm + xterm + otterm + rterm;
130 
131  // Convert to Joules / kmol
132  doublereal Cp = Cp_calgmol * toSI("cal/gmol");
133 
134  return Cp;
135 }
136 
137 doublereal PDSS_HKFT::molarVolume() const
138 {
139  // Initially do all calculations in (cal/gmol/Pa)
140 
141  doublereal a1term = m_a1 * 1.0E-5;
142  doublereal a2term = m_a2 / (2600.E5 + m_pres);
143  doublereal a3term = m_a3 * 1.0E-5/ (m_temp - 228.);
144  doublereal a4term = m_a4 / (m_temp - 228.) / (2600.E5 + m_pres);
145 
146  doublereal omega_j;
147  doublereal domega_jdP;
148  if (m_charge_j == 0.0) {
149  omega_j = m_omega_pr_tr;
150  domega_jdP = 0.0;
151  } else {
152  doublereal nu = 166027.;
153  doublereal charge2 = m_charge_j * m_charge_j;
154  doublereal r_e_j_pr_tr = charge2 / (m_omega_pr_tr/nu + m_charge_j/3.082);
155 
156  doublereal gval = gstar(m_temp, m_pres, 0);
157  doublereal dgvaldP = gstar(m_temp, m_pres, 3);
158 
159  doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval;
160  doublereal r_e_H = 3.082 + gval;
161 
162  omega_j = nu * (charge2 / r_e_j - m_charge_j / r_e_H);
163  doublereal dr_e_jdP = fabs(m_charge_j) * dgvaldP;
164  domega_jdP = - nu * (charge2 / (r_e_j * r_e_j) * dr_e_jdP)
165  + nu * m_charge_j / (r_e_H * r_e_H) * dgvaldP;
166  }
167 
168  doublereal drelepsilondP = m_waterProps->relEpsilon(m_temp, m_pres, 3);
169  doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0);
170  doublereal Q = drelepsilondP / (relepsilon * relepsilon);
171  doublereal Z = -1.0 / relepsilon;
172  doublereal wterm = - domega_jdP * (Z + 1.0);
173  doublereal qterm = - omega_j * Q;
174  doublereal molVol_calgmolPascal = a1term + a2term + a3term + a4term + wterm + qterm;
175 
176  // Convert to m**3 / kmol from (cal/gmol/Pa)
177  return molVol_calgmolPascal * toSI("cal/gmol");
178 }
179 
180 doublereal PDSS_HKFT::density() const
181 {
182  return m_mw / molarVolume();
183 }
184 
185 doublereal PDSS_HKFT::gibbs_RT_ref() const
186 {
187  doublereal m_psave = m_pres;
189  doublereal ee = gibbs_RT();
190  m_pres = m_psave;
191  return ee;
192 }
193 
194 doublereal PDSS_HKFT::enthalpy_RT_ref() const
195 {
196  doublereal m_psave = m_pres;
198  doublereal hh = enthalpy_RT();
199  m_pres = m_psave;
200  return hh;
201 }
202 
203 doublereal PDSS_HKFT::entropy_R_ref() const
204 {
205  doublereal m_psave = m_pres;
207  doublereal ee = entropy_R();
208  m_pres = m_psave;
209  return ee;
210 }
211 
212 doublereal PDSS_HKFT::cp_R_ref() const
213 {
214  doublereal m_psave = m_pres;
216  doublereal ee = cp_R();
217  m_pres = m_psave;
218  return ee;
219 }
220 
221 doublereal PDSS_HKFT::molarVolume_ref() const
222 {
223  doublereal m_psave = m_pres;
225  doublereal ee = molarVolume();
226  m_pres = m_psave;
227  return ee;
228 }
229 
230 void PDSS_HKFT::setState_TP(doublereal temp, doublereal pres)
231 {
232  setTemperature(temp);
233  setPressure(pres);
234 }
235 
237 {
239  if (m_input.hasKey("h0")) {
240  m_deltaH_formation_tr_pr = m_input.convert("h0", "cal/gmol");
241  }
242  if (m_input.hasKey("g0")) {
243  m_deltaG_formation_tr_pr = m_input.convert("g0", "cal/gmol");
244  }
245  if (m_input.hasKey("s0")) {
246  m_Entrop_tr_pr = m_input.convert("s0", "cal/gmol/K");
247  }
248  auto& units = m_input.units();
249  if (m_input.hasKey("a")) {
250  auto& a = m_input["a"].asVector<AnyValue>(4);
251  m_a1 = units.convert(a[0], "cal/gmol/bar");
252  m_a2 = units.convert(a[1], "cal/gmol");
253  m_a3 = units.convert(a[2], "cal*K/gmol/bar");
254  m_a4 = units.convert(a[3], "cal*K/gmol");
255  }
256  if (m_input.hasKey("c")) {
257  auto& c = m_input["c"].asVector<AnyValue>(2);
258  m_c1 = units.convert(c[0], "cal/gmol/K");
259  m_c2 = units.convert(c[1], "cal*K/gmol");
260  }
261  if (m_input.hasKey("omega")) {
262  m_omega_pr_tr = m_input.convert("omega", "cal/gmol");
263  }
264 
265  // Ok, if we are missing one, then we construct its value from the other two.
266  // This code has been internally verified.
268  if (std::isnan(m_deltaH_formation_tr_pr)) {
270  doublereal Hcalc = m_Mu0_tr_pr + 298.15 * (m_Entrop_tr_pr * toSI("cal/gmol"));
271  m_deltaH_formation_tr_pr = Hcalc / toSI("cal/gmol");
272  } else if (std::isnan(m_deltaG_formation_tr_pr)) {
273  doublereal DHjmol = m_deltaH_formation_tr_pr * toSI("cal/gmol");
274  m_Mu0_tr_pr = DHjmol - 298.15 * (m_Entrop_tr_pr * toSI("cal/gmol"));
275  m_deltaG_formation_tr_pr = m_Mu0_tr_pr / toSI("cal/gmol");
276  double tmp = m_Mu0_tr_pr;
278  double totalSum = m_Mu0_tr_pr - tmp;
279  m_Mu0_tr_pr = tmp;
280  m_deltaG_formation_tr_pr = (m_Mu0_tr_pr - totalSum)/ toSI("cal/gmol");
281  } else if (std::isnan(m_Entrop_tr_pr)) {
283  doublereal DHjmol = m_deltaH_formation_tr_pr * toSI("cal/gmol");
284  m_Entrop_tr_pr = (DHjmol - m_Mu0_tr_pr) / (298.15 * toSI("cal/gmol"));
285  }
286 
287  m_waterSS = &dynamic_cast<PDSS_Water&>(*m_tp->providePDSS(0));
288 
289  // Section to initialize m_Z_pr_tr and m_Y_pr_tr
290  m_temp = 273.15 + 25.;
291  m_pres = OneAtm;
292  doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0);
295  m_Z_pr_tr = -1.0 / relepsilon;
296  doublereal drelepsilondT = m_waterProps->relEpsilon(m_temp, m_pres, 1);
297  m_Y_pr_tr = drelepsilondT / (relepsilon * relepsilon);
298  m_waterProps.reset(new WaterProps(m_waterSS));
299  m_presR_bar = OneAtm / 1.0E5;
300  m_presR_bar = 1.0;
302 
303  // Ok, we have mu. Let's check it against the input value
304  // of DH_F to see that we have some internal consistency
305  doublereal Hcalc = m_Mu0_tr_pr + 298.15 * (m_Entrop_tr_pr * toSI("cal/gmol"));
306  doublereal DHjmol = m_deltaH_formation_tr_pr * toSI("cal/gmol");
307 
308  // If the discrepancy is greater than 100 cal gmol-1, print
309  // an error and exit.
310  if (fabs(Hcalc -DHjmol) > 100.* toSI("cal/gmol")) {
311  std::string sname = m_tp->speciesName(m_spindex);
313  throw CanteraError("PDSS_HKFT::initThermo", "For {}, DHjmol is"
314  " not consistent with G and S: {} vs {} cal gmol-1",
315  sname, Hcalc/toSI("cal/gmol"), m_deltaH_formation_tr_pr);
316  } else {
317  warn_user("PDSS_HKFT::initThermo",
318  "DHjmol for {} is not consistent with G and S: calculated {} "
319  "vs input {} cal gmol-1; continuing with consistent DHjmol = {}",
320  sname, Hcalc/toSI("cal/gmol"), m_deltaH_formation_tr_pr,
321  Hcalc/toSI("cal/gmol"));
322  m_deltaH_formation_tr_pr = Hcalc / toSI("cal/gmol");
323  }
324  }
325  doublereal nu = 166027;
326  doublereal r_e_j_pr_tr;
327  if (m_charge_j != 0.0) {
328  r_e_j_pr_tr = m_charge_j * m_charge_j / (m_omega_pr_tr/nu + m_charge_j/3.082);
329  } else {
330  r_e_j_pr_tr = 0.0;
331  }
332 
333  if (m_charge_j == 0.0) {
334  m_domega_jdT_prtr = 0.0;
335  } else {
336  doublereal gval = gstar(m_temp, m_pres, 0);
337  doublereal dgvaldT = gstar(m_temp, m_pres, 1);
338  doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval;
339  doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT;
340  m_domega_jdT_prtr = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT)
341  + nu * m_charge_j / (3.082 + gval) / (3.082 + gval) * dgvaldT;
342  }
343 }
344 
345 void PDSS_HKFT::setDeltaH0(double dh0) {
346  m_deltaH_formation_tr_pr = dh0 / toSI("cal/gmol");
347 }
348 
349 void PDSS_HKFT::setDeltaG0(double dg0) {
350  m_deltaG_formation_tr_pr = dg0 / toSI("cal/gmol");
351 }
352 
353 void PDSS_HKFT::setS0(double s0) {
354  m_Entrop_tr_pr = s0 / toSI("cal/gmol/K");
355 }
356 
357 void PDSS_HKFT::set_a(double* a) {
358  m_a1 = a[0] / toSI("cal/gmol/bar");
359  m_a2 = a[1] / toSI("cal/gmol");
360  m_a3 = a[2] / toSI("cal-K/gmol/bar");
361  m_a4 = a[3] / toSI("cal-K/gmol");
362 }
363 
364 void PDSS_HKFT::set_c(double* c) {
365  m_c1 = c[0] / toSI("cal/gmol/K");
366  m_c2 = c[1] / toSI("cal-K/gmol");
367 }
368 
369 void PDSS_HKFT::setOmega(double omega) {
370  m_omega_pr_tr = omega / toSI("cal/gmol");
371 }
372 
374 {
375  PDSS::setParametersFromXML(speciesNode);
376  int hasDGO = 0;
377  int hasSO = 0;
378  int hasDHO = 0;
379 
380  const XML_Node* tn = speciesNode.findByName("thermo");
381  if (!tn) {
382  throw CanteraError("PDSS_HKFT::setParametersFromXML",
383  "no thermo Node for species '{}'", speciesNode.name());
384  }
385  if (!caseInsensitiveEquals(tn->attrib("model"), "hkft")) {
386  throw CanteraError("PDSS_HKFT::setParametersFromXML",
387  "thermo model for species '{}' isn't 'hkft'",
388  speciesNode.name());
389  }
390  const XML_Node* hh = tn->findByName("HKFT");
391  if (!hh) {
392  throw CanteraError("PDSS_HKFT::setParametersFromXML",
393  "no Thermo::HKFT Node for species '{}'", speciesNode.name());
394  }
395 
396  // go get the attributes
397  m_p0 = OneAtm;
398  std::string p0string = hh->attrib("Pref");
399  if (p0string != "") {
400  m_p0 = strSItoDbl(p0string);
401  }
402 
403  std::string minTstring = hh->attrib("Tmin");
404  if (minTstring != "") {
405  m_minTemp = fpValueCheck(minTstring);
406  }
407 
408  std::string maxTstring = hh->attrib("Tmax");
409  if (maxTstring != "") {
410  m_maxTemp = fpValueCheck(maxTstring);
411  }
412 
413  if (hh->hasChild("DG0_f_Pr_Tr")) {
414  setDeltaG0(getFloat(*hh, "DG0_f_Pr_Tr", "toSI"));
415  hasDGO = 1;
416  }
417 
418  if (hh->hasChild("DH0_f_Pr_Tr")) {
419  setDeltaH0(getFloat(*hh, "DH0_f_Pr_Tr", "toSI"));
420  hasDHO = 1;
421  }
422 
423  if (hh->hasChild("S0_Pr_Tr")) {
424  setS0(getFloat(*hh, "S0_Pr_Tr", "toSI"));
425  hasSO = 1;
426  }
427 
428  const XML_Node* ss = speciesNode.findByName("standardState");
429  if (!ss) {
430  throw CanteraError("PDSS_HKFT::setParametersFromXML",
431  "no 'standardState' Node for species '{}'",
432  speciesNode.name());
433  }
434  if (!caseInsensitiveEquals(ss->attrib("model"), "hkft")) {
435  throw CanteraError("PDSS_HKFT::setParametersFromXML",
436  "standardState model for species '{}' isn't 'hkft'",
437  speciesNode.name());
438  }
439  double a[4] = {getFloat(*ss, "a1", "toSI"), getFloat(*ss, "a2", "toSI"),
440  getFloat(*ss, "a3", "toSI"), getFloat(*ss, "a4", "toSI")};
441  set_a(a);
442 
443  double c[2] = {getFloat(*ss, "c1", "toSI"), getFloat(*ss, "c2", "toSI")};
444  set_c(c);
445 
446  setOmega(getFloat(*ss, "omega_Pr_Tr", "toSI"));
447 
448  int isum = hasDGO + hasDHO + hasSO;
449  if (isum < 2) {
450  throw CanteraError("PDSS_HKFT::setParametersFromXML",
451  "Missing 2 or more of DG0_f_Pr_Tr, DH0_f_Pr_Tr, or S0_f_Pr_Tr fields. "
452  "Need to supply at least two of these fields");
453  }
454 }
455 
456 doublereal PDSS_HKFT::deltaH() const
457 {
458  doublereal pbar = m_pres * 1.0E-5;
459  doublereal c1term = m_c1 * (m_temp - 298.15);
460  doublereal a1term = m_a1 * (pbar - m_presR_bar);
461  doublereal a2term = m_a2 * log((2600. + pbar)/(2600. + m_presR_bar));
462  doublereal c2term = -m_c2 * (1.0/(m_temp - 228.) - 1.0/(298.15 - 228.));
463  double a3tmp = (2.0 * m_temp - 228.)/ (m_temp - 228.) /(m_temp - 228.);
464  doublereal a3term = m_a3 * a3tmp * (pbar - m_presR_bar);
465  doublereal a4term = m_a4 * a3tmp * log((2600. + pbar)/(2600. + m_presR_bar));
466  doublereal omega_j;
467  doublereal domega_jdT;
468  if (m_charge_j == 0.0) {
469  omega_j = m_omega_pr_tr;
470  domega_jdT = 0.0;
471  } else {
472  doublereal nu = 166027;
473  doublereal r_e_j_pr_tr = m_charge_j * m_charge_j / (m_omega_pr_tr/nu + m_charge_j/3.082);
474  doublereal gval = gstar(m_temp, m_pres, 0);
475  doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval;
476  doublereal dgvaldT = gstar(m_temp, m_pres, 1);
477  doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT;
478  omega_j = nu * (m_charge_j * m_charge_j / r_e_j - m_charge_j / (3.082 + gval));
479  domega_jdT = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT)
480  + nu * m_charge_j / (3.082 + gval) / (3.082 + gval) * dgvaldT;
481  }
482 
483  doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0);
484  doublereal drelepsilondT = m_waterProps->relEpsilon(m_temp, m_pres, 1);
485 
486  doublereal Y = drelepsilondT / (relepsilon * relepsilon);
487  doublereal Z = -1.0 / relepsilon;
488 
489  doublereal yterm = m_temp * omega_j * Y;
490  doublereal yrterm = - 298.15 * m_omega_pr_tr * m_Y_pr_tr;
491 
492  doublereal wterm = - omega_j * (Z + 1.0);
493  doublereal wrterm = + m_omega_pr_tr * (m_Z_pr_tr + 1.0);
494 
495  doublereal otterm = m_temp * domega_jdT * (Z + 1.0);
496  doublereal otrterm = - m_temp * m_domega_jdT_prtr * (m_Z_pr_tr + 1.0);
497 
498  doublereal deltaH_calgmol = c1term + a1term + a2term + c2term + a3term + a4term
499  + yterm + yrterm + wterm + wrterm + otterm + otrterm;
500 
501  // Convert to Joules / kmol
502  return deltaH_calgmol * toSI("cal/gmol");
503 }
504 
505 doublereal PDSS_HKFT::deltaG() const
506 {
507  doublereal pbar = m_pres * 1.0E-5;
508  doublereal sterm = - m_Entrop_tr_pr * (m_temp - 298.15);
509  doublereal c1term = -m_c1 * (m_temp * log(m_temp/298.15) - (m_temp - 298.15));
510  doublereal a1term = m_a1 * (pbar - m_presR_bar);
511  doublereal a2term = m_a2 * log((2600. + pbar)/(2600. + m_presR_bar));
512  doublereal c2term = -m_c2 * ((1.0/(m_temp - 228.) - 1.0/(298.15 - 228.)) * (228. - m_temp)/228.
513  - m_temp / (228.*228.) * log((298.15*(m_temp-228.)) / (m_temp*(298.15-228.))));
514  doublereal a3term = m_a3 / (m_temp - 228.) * (pbar - m_presR_bar);
515  doublereal a4term = m_a4 / (m_temp - 228.) * log((2600. + pbar)/(2600. + m_presR_bar));
516 
517  doublereal omega_j;
518  if (m_charge_j == 0.0) {
519  omega_j = m_omega_pr_tr;
520  } else {
521  doublereal nu = 166027;
522  doublereal r_e_j_pr_tr = m_charge_j * m_charge_j / (m_omega_pr_tr/nu + m_charge_j/3.082);
523  doublereal gval = gstar(m_temp, m_pres, 0);
524  doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval;
525  omega_j = nu * (m_charge_j * m_charge_j / r_e_j - m_charge_j / (3.082 + gval));
526  }
527 
528  doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0);
529  doublereal Z = -1.0 / relepsilon;
530  doublereal wterm = - omega_j * (Z + 1.0);
531  doublereal wrterm = m_omega_pr_tr * (m_Z_pr_tr + 1.0);
532  doublereal yterm = m_omega_pr_tr * m_Y_pr_tr * (m_temp - 298.15);
533  doublereal deltaG_calgmol = sterm + c1term + a1term + a2term + c2term + a3term + a4term + wterm + wrterm + yterm;
534 
535  // Convert to Joules / kmol
536  return deltaG_calgmol * toSI("cal/gmol");
537 }
538 
539 doublereal PDSS_HKFT::deltaS() const
540 {
541  doublereal pbar = m_pres * 1.0E-5;
542 
543  doublereal c1term = m_c1 * log(m_temp/298.15);
544  doublereal c2term = -m_c2 / 228. * ((1.0/(m_temp - 228.) - 1.0/(298.15 - 228.))
545  + 1.0 / 228. * log((298.15*(m_temp-228.)) / (m_temp*(298.15-228.))));
546  doublereal a3term = m_a3 / (m_temp - 228.) / (m_temp - 228.) * (pbar - m_presR_bar);
547  doublereal a4term = m_a4 / (m_temp - 228.) / (m_temp - 228.) * log((2600. + pbar)/(2600. + m_presR_bar));
548 
549  doublereal omega_j;
550  doublereal domega_jdT;
551  if (m_charge_j == 0.0) {
552  omega_j = m_omega_pr_tr;
553  domega_jdT = 0.0;
554  } else {
555  doublereal nu = 166027;
556  doublereal r_e_j_pr_tr = m_charge_j * m_charge_j / (m_omega_pr_tr/nu + m_charge_j/3.082);
557  doublereal gval = gstar(m_temp, m_pres, 0);
558  doublereal dgvaldT = gstar(m_temp, m_pres, 1);
559  doublereal r_e_j = r_e_j_pr_tr + fabs(m_charge_j) * gval;
560  doublereal dr_e_jdT = fabs(m_charge_j) * dgvaldT;
561  omega_j = nu * (m_charge_j * m_charge_j / r_e_j - m_charge_j / (3.082 + gval));
562  domega_jdT = - nu * (m_charge_j * m_charge_j / (r_e_j * r_e_j) * dr_e_jdT)
563  + nu * m_charge_j / (3.082 + gval) / (3.082 + gval) * dgvaldT;
564  }
565 
566  doublereal relepsilon = m_waterProps->relEpsilon(m_temp, m_pres, 0);
567  doublereal drelepsilondT = m_waterProps->relEpsilon(m_temp, m_pres, 1);
568  doublereal Y = drelepsilondT / (relepsilon * relepsilon);
569  doublereal Z = -1.0 / relepsilon;
570  doublereal wterm = omega_j * Y;
571  doublereal wrterm = - m_omega_pr_tr * m_Y_pr_tr;
572  doublereal otterm = domega_jdT * (Z + 1.0);
573  doublereal otrterm = - m_domega_jdT_prtr * (m_Z_pr_tr + 1.0);
574  doublereal deltaS_calgmol = c1term + c2term + a3term + a4term + wterm + wrterm + otterm + otrterm;
575 
576  // Convert to Joules / kmol
577  return deltaS_calgmol * toSI("cal/gmol");
578 }
579 
580 doublereal PDSS_HKFT::ag(const doublereal temp, const int ifunc) const
581 {
582  static doublereal ag_coeff[3] = { -2.037662, 5.747000E-3, -6.557892E-6};
583  if (ifunc == 0) {
584  return ag_coeff[0] + ag_coeff[1] * temp + ag_coeff[2] * temp * temp;
585  } else if (ifunc == 1) {
586  return ag_coeff[1] + ag_coeff[2] * 2.0 * temp;
587  }
588  if (ifunc != 2) {
589  return 0.0;
590  }
591  return ag_coeff[2] * 2.0;
592 }
593 
594 doublereal PDSS_HKFT::bg(const doublereal temp, const int ifunc) const
595 {
596  static doublereal bg_coeff[3] = { 6.107361, -1.074377E-2, 1.268348E-5};
597  if (ifunc == 0) {
598  return bg_coeff[0] + bg_coeff[1] * temp + bg_coeff[2] * temp * temp;
599  } else if (ifunc == 1) {
600  return bg_coeff[1] + bg_coeff[2] * 2.0 * temp;
601  }
602  if (ifunc != 2) {
603  return 0.0;
604  }
605  return bg_coeff[2] * 2.0;
606 }
607 
608 doublereal PDSS_HKFT::f(const doublereal temp, const doublereal pres, const int ifunc) const
609 {
610  static doublereal af_coeff[3] = { 3.666666E1, -0.1504956E-9, 0.5107997E-13};
611  doublereal TC = temp - 273.15;
612  doublereal presBar = pres / 1.0E5;
613 
614  if (TC < 155.0) {
615  return 0.0;
616  }
617  TC = std::min(TC, 355.0);
618  if (presBar > 1000.) {
619  return 0.0;
620  }
621 
622  doublereal T1 = (TC-155.0)/300.;
623  doublereal p2 = (1000. - presBar) * (1000. - presBar);
624  doublereal p3 = (1000. - presBar) * p2;
625  doublereal p4 = p2 * p2;
626  doublereal fac2 = af_coeff[1] * p3 + af_coeff[2] * p4;
627  if (ifunc == 0) {
628  return pow(T1,4.8) + af_coeff[0] * pow(T1, 16.0) * fac2;
629  } else if (ifunc == 1) {
630  return (4.8 * pow(T1,3.8) + 16.0 * af_coeff[0] * pow(T1, 15.0)) / 300. * fac2;
631  } else if (ifunc == 2) {
632  return (4.8 * 3.8 * pow(T1,2.8) + 16.0 * 15.0 * af_coeff[0] * pow(T1, 14.0)) / (300. * 300.) * fac2;
633  } else if (ifunc == 3) {
634  double fac1 = pow(T1,4.8) + af_coeff[0] * pow(T1, 16.0);
635  fac2 = - (3.0 * af_coeff[1] * p2 + 4.0 * af_coeff[2] * p3)/ 1.0E5;
636  return fac1 * fac2;
637  } else {
638  throw NotImplementedError("PDSS_HKFT::f");
639  }
640 }
641 
642 doublereal PDSS_HKFT::g(const doublereal temp, const doublereal pres, const int ifunc) const
643 {
644  doublereal afunc = ag(temp, 0);
645  doublereal bfunc = bg(temp, 0);
646  m_waterSS->setState_TP(temp, pres);
648  // density in gm cm-3
649  doublereal dens = m_densWaterSS * 1.0E-3;
650  doublereal gval = afunc * pow((1.0-dens), bfunc);
651  if (dens >= 1.0) {
652  return 0.0;
653  }
654  if (ifunc == 0) {
655  return gval;
656  } else if (ifunc == 1 || ifunc == 2) {
657  doublereal afuncdT = ag(temp, 1);
658  doublereal bfuncdT = bg(temp, 1);
659  doublereal alpha = m_waterSS->thermalExpansionCoeff();
660 
661  doublereal fac1 = afuncdT * gval / afunc;
662  doublereal fac2 = bfuncdT * gval * log(1.0 - dens);
663  doublereal fac3 = gval * alpha * bfunc * dens / (1.0 - dens);
664 
665  doublereal dgdt = fac1 + fac2 + fac3;
666  if (ifunc == 1) {
667  return dgdt;
668  }
669 
670  doublereal afuncdT2 = ag(temp, 2);
671  doublereal bfuncdT2 = bg(temp, 2);
672  doublereal dfac1dT = dgdt * afuncdT / afunc + afuncdT2 * gval / afunc
673  - afuncdT * afuncdT * gval / (afunc * afunc);
674  doublereal ddensdT = - alpha * dens;
675  doublereal dfac2dT = bfuncdT2 * gval * log(1.0 - dens)
676  + bfuncdT * dgdt * log(1.0 - dens)
677  - bfuncdT * gval /(1.0 - dens) * ddensdT;
678  doublereal dalphadT = m_waterSS->dthermalExpansionCoeffdT();
679  doublereal dfac3dT = dgdt * alpha * bfunc * dens / (1.0 - dens)
680  + gval * dalphadT * bfunc * dens / (1.0 - dens)
681  + gval * alpha * bfuncdT * dens / (1.0 - dens)
682  + gval * alpha * bfunc * ddensdT / (1.0 - dens)
683  + gval * alpha * bfunc * dens / ((1.0 - dens) * (1.0 - dens)) * ddensdT;
684 
685  return dfac1dT + dfac2dT + dfac3dT;
686  } else if (ifunc == 3) {
687  doublereal beta = m_waterSS->isothermalCompressibility();
688  return - bfunc * gval * dens * beta / (1.0 - dens);
689  } else {
690  throw NotImplementedError("PDSS_HKFT::g");
691  }
692  return 0.0;
693 }
694 
695 doublereal PDSS_HKFT::gstar(const doublereal temp, const doublereal pres, const int ifunc) const
696 {
697  doublereal gval = g(temp, pres, ifunc);
698  doublereal fval = f(temp, pres, ifunc);
699  double res = gval - fval;
700  return res;
701 }
702 
703 doublereal PDSS_HKFT::LookupGe(const std::string& elemName)
704 {
705  size_t iE = m_tp->elementIndex(elemName);
706  if (iE == npos) {
707  throw CanteraError("PDSS_HKFT::LookupGe", "element " + elemName + " not found");
708  }
709  doublereal geValue = m_tp->entropyElement298(iE);
710  if (geValue == ENTROPY298_UNKNOWN) {
711  throw CanteraError("PDSS_HKFT::LookupGe",
712  "element " + elemName + " does not have a supplied entropy298");
713  }
714  return geValue * -298.15;
715 }
716 
718 {
719  // Ok let's get the element compositions and conversion factors.
720  doublereal totalSum = 0.0;
721  for (size_t m = 0; m < m_tp->nElements(); m++) {
722  double na = m_tp->nAtoms(m_spindex, m);
723  if (na > 0.0) {
724  totalSum += na * LookupGe(m_tp->elementName(m));
725  }
726  }
727  // Add in the charge
728  if (m_charge_j != 0.0) {
729  totalSum -= m_charge_j * LookupGe("H");
730  }
731  // Ok, now do the calculation. Convert to joules kmol-1
732  doublereal dg = m_deltaG_formation_tr_pr * toSI("cal/gmol");
733  //! Store the result into an internal variable.
734  m_Mu0_tr_pr = dg + totalSum;
735 }
736 
737 void PDSS_HKFT::reportParams(size_t& kindex, int& type,
738  doublereal* const c,
739  doublereal& minTemp_,
740  doublereal& maxTemp_,
741  doublereal& refPressure_) const
742 {
743  // Fill in the first part
744  PDSS::reportParams(kindex, type, c, minTemp_, maxTemp_,
745  refPressure_);
746 
749  c[2] = m_Mu0_tr_pr;
750  c[3] = m_Entrop_tr_pr;
751  c[4] = m_a1;
752  c[5] = m_a2;
753  c[6] = m_a3;
754  c[7] = m_a4;
755  c[8] = m_c1;
756  c[9] = m_c2;
757  c[10] = m_omega_pr_tr;
758 }
759 
760 }
#define ENTROPY298_UNKNOWN
Number indicating we don't know the entropy of the element in its most stable state at 298....
Definition: Elements.h:87
Declarations for the class PDSS_HKFT (pressure dependent standard state) which handles calculations f...
Implementation of a pressure dependent standard state virtual function for a Pure Water Phase (see Sp...
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
double convert(const std::string &key, const std::string &units) const
Convert the item stored by the given key to the units specified in units.
Definition: AnyMap.cpp:1055
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
Definition: AnyMap.cpp:984
const UnitSystem & units() const
Return the default units that should be used to convert stored values.
Definition: AnyMap.h:492
A wrapper for a variable whose type is determined at runtime.
Definition: AnyMap.h:77
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:61
An error indicating that an unimplemented function has been called.
Definition: ctexceptions.h:187
void setOmega(double omega)
Set omega [J/kmol].
Definition: PDSS_HKFT.cpp:369
static int s_InputInconsistencyErrorExit
Static variable determining error exiting.
Definition: PDSS_HKFT.h:343
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
Definition: PDSS_HKFT.cpp:212
doublereal m_deltaG_formation_tr_pr
Input value of deltaG of Formation at Tr and Pr (cal gmol-1)
Definition: PDSS_HKFT.h:276
size_t m_spindex
Index of this species within the parent phase.
Definition: PDSS_HKFT.h:142
doublereal m_a3
Input a3 coefficient (cal K gmol-1 bar-1)
Definition: PDSS_HKFT.h:309
doublereal m_domega_jdT_prtr
small value that is not quite zero
Definition: PDSS_HKFT.h:333
doublereal m_a4
Input a4 coefficient (cal K gmol-1)
Definition: PDSS_HKFT.h:312
doublereal m_charge_j
Charge of the ion.
Definition: PDSS_HKFT.h:336
virtual void reportParams(size_t &kindex, int &type, doublereal *const c, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure) const
This utility function reports back the type of parameterization and all of the parameters for the spe...
Definition: PDSS_HKFT.cpp:737
doublereal m_c2
Input c2 coefficient (cal K gmol-1)
Definition: PDSS_HKFT.h:318
doublereal m_c1
Input c1 coefficient (cal gmol-1 K-1)
Definition: PDSS_HKFT.h:315
doublereal deltaH() const
Routine that actually calculates the enthalpy difference between the reference state at Tr,...
Definition: PDSS_HKFT.cpp:456
virtual doublereal cp_mole() const
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
Definition: PDSS_HKFT.cpp:78
VPStandardStateTP * m_tp
Parent VPStandardStateTP (ThermoPhase) object.
Definition: PDSS_HKFT.h:141
virtual doublereal enthalpy_mole() const
Return the molar enthalpy in units of J kmol-1.
Definition: PDSS_HKFT.cpp:50
void setDeltaG0(double dg0)
Set Gibbs free energy of formation at Pr, Tr [J/kmol].
Definition: PDSS_HKFT.cpp:349
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
Definition: PDSS_HKFT.cpp:230
doublereal m_omega_pr_tr
Input omega_pr_tr coefficient(cal gmol-1)
Definition: PDSS_HKFT.h:321
doublereal m_a2
Input a2 coefficient (cal gmol-1)
Definition: PDSS_HKFT.h:306
doublereal m_densWaterSS
density of standard-state water. internal temporary variable
Definition: PDSS_HKFT.h:264
doublereal m_Entrop_tr_pr
Input value of S_j at Tr and Pr (cal gmol-1 K-1)
Definition: PDSS_HKFT.h:300
doublereal bg(const doublereal temp, const int ifunc=0) const
Internal formula for the calculation of b_g()
Definition: PDSS_HKFT.cpp:594
doublereal g(const doublereal temp, const doublereal pres, const int ifunc=0) const
function g appearing in the formulation
Definition: PDSS_HKFT.cpp:642
doublereal m_Y_pr_tr
y = dZdT = 1/(esp*esp) desp/dT at 298.15 and 1 bar
Definition: PDSS_HKFT.h:324
void setS0(double s0)
Set entropy of formation at Pr, Tr [J/kmol/K].
Definition: PDSS_HKFT.cpp:353
doublereal ag(const doublereal temp, const int ifunc=0) const
Internal formula for the calculation of a_g()
Definition: PDSS_HKFT.cpp:580
doublereal f(const doublereal temp, const doublereal pres, const int ifunc=0) const
Difference function f appearing in the formulation.
Definition: PDSS_HKFT.cpp:608
virtual doublereal entropy_mole() const
Return the molar entropy in units of J kmol-1 K-1.
Definition: PDSS_HKFT.cpp:68
doublereal m_a1
Input a1 coefficient (cal gmol-1 bar-1)
Definition: PDSS_HKFT.h:303
doublereal enthalpy_mole2() const
Return the molar enthalpy in units of J kmol-1.
Definition: PDSS_HKFT.cpp:57
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
Definition: PDSS_HKFT.cpp:221
virtual void initThermo()
Initialization routine.
Definition: PDSS_HKFT.cpp:236
doublereal m_Z_pr_tr
Z = -1 / relEpsilon at 298.15 and 1 bar.
Definition: PDSS_HKFT.h:327
doublereal m_deltaH_formation_tr_pr
Input value of deltaH of Formation at Tr and Pr (cal gmol-1)
Definition: PDSS_HKFT.h:285
void set_a(double *a)
Set "a" coefficients (array of 4 elements).
Definition: PDSS_HKFT.cpp:357
doublereal LookupGe(const std::string &elemName)
Function to look up Element Free Energies.
Definition: PDSS_HKFT.cpp:703
virtual doublereal molarVolume() const
Return the molar volume at standard state.
Definition: PDSS_HKFT.cpp:137
void setParametersFromXML(const XML_Node &speciesNode)
Initialization routine for the PDSS object based on the speciesNode.
Definition: PDSS_HKFT.cpp:373
virtual doublereal gibbs_mole() const
Return the molar Gibbs free energy in units of J kmol-1.
Definition: PDSS_HKFT.cpp:73
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
Definition: PDSS_HKFT.cpp:194
doublereal deltaS() const
Main routine that actually calculates the entropy difference between the reference state at Tr,...
Definition: PDSS_HKFT.cpp:539
void convertDGFormation()
Translate a Gibbs free energy of formation value to a NIST-based Chemical potential.
Definition: PDSS_HKFT.cpp:717
doublereal m_Mu0_tr_pr
Value of the Absolute Gibbs Free Energy NIST scale at T_r and P_r.
Definition: PDSS_HKFT.h:294
virtual doublereal density() const
Return the standard state density at standard state.
Definition: PDSS_HKFT.cpp:180
doublereal m_presR_bar
Reference pressure is 1 atm in units of bar= 1.0132.
Definition: PDSS_HKFT.h:330
doublereal gstar(const doublereal temp, const doublereal pres, const int ifunc=0) const
Evaluate the Gstar value appearing in the HKFT formulation.
Definition: PDSS_HKFT.cpp:695
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
Definition: PDSS_HKFT.cpp:203
virtual doublereal gibbs_RT_ref() const
Return the molar Gibbs free energy divided by RT at reference pressure.
Definition: PDSS_HKFT.cpp:185
PDSS_Water * m_waterSS
Water standard state calculator.
Definition: PDSS_HKFT.h:261
doublereal deltaG() const
Main routine that actually calculates the Gibbs free energy difference between the reference state at...
Definition: PDSS_HKFT.cpp:505
std::unique_ptr< WaterProps > m_waterProps
Pointer to the water property calculator.
Definition: PDSS_HKFT.h:267
void set_c(double *c)
Set "c" coefficients (array of 2 elements).
Definition: PDSS_HKFT.cpp:364
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
Definition: PDSS_HKFT.cpp:63
void setDeltaH0(double dh0)
Set enthalpy of formation at Pr, Tr [J/kmol].
Definition: PDSS_HKFT.cpp:345
virtual doublereal entropy_R() const
Return the standard state entropy divided by RT.
Definition: PDSS.cpp:216
virtual doublereal enthalpy_RT() const
Return the standard state molar enthalpy divided by RT.
Definition: PDSS.cpp:211
virtual doublereal gibbs_RT() const
Return the molar Gibbs free energy divided by RT.
Definition: PDSS.cpp:221
virtual doublereal cp_R() const
Return the molar const pressure heat capacity divided by RT.
Definition: PDSS.cpp:226
Class for the liquid water pressure dependent standard state.
Definition: PDSS_Water.h:50
doublereal pref_safe(doublereal temp) const
Returns a reference pressure value that can be safely calculated by the underlying real equation of s...
Definition: PDSS_Water.cpp:241
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
Definition: PDSS_Water.cpp:228
virtual doublereal thermalExpansionCoeff() const
Return the volumetric thermal expansion coefficient. Units: 1/K.
Definition: PDSS_Water.cpp:170
virtual doublereal dthermalExpansionCoeffdT() const
Return the derivative of the volumetric thermal expansion coefficient.
Definition: PDSS_Water.cpp:175
virtual doublereal density() const
Return the standard state density at standard state.
Definition: PDSS_Water.cpp:217
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
Definition: PDSS_Water.cpp:191
virtual void initThermo()
Initialization routine.
Definition: PDSS.h:427
virtual void reportParams(size_t &kindex, int &type, doublereal *const c, doublereal &minTemp, doublereal &maxTemp, doublereal &refPressure) const
This utility function reports back the type of parameterization and all of the parameters for the spe...
Definition: PDSS.cpp:196
virtual void setParametersFromXML(const XML_Node &speciesNode)
Initialization routine for the PDSS object based on the speciesNode.
Definition: PDSS.h:443
doublereal m_pres
State of the system - pressure.
Definition: PDSS.h:467
virtual void setPressure(doublereal pres)
Sets the pressure in the object.
Definition: PDSS.cpp:157
doublereal m_temp
Current temperature used by the PDSS object.
Definition: PDSS.h:464
doublereal m_maxTemp
Maximum temperature.
Definition: PDSS.h:476
virtual void setTemperature(doublereal temp)
Set the internal temperature.
Definition: PDSS.cpp:167
doublereal m_p0
Reference state pressure of the species.
Definition: PDSS.h:470
doublereal m_mw
Molecular Weight of the species.
Definition: PDSS.h:479
AnyMap m_input
Input data supplied via setParameters.
Definition: PDSS.h:483
doublereal m_minTemp
Minimum temperature.
Definition: PDSS.h:473
doublereal entropyElement298(size_t m) const
Entropy of the element in its standard state at 298 K and 1 bar.
Definition: Phase.cpp:140
doublereal charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
Definition: Phase.h:643
size_t elementIndex(const std::string &name) const
Return the index of element named 'name'.
Definition: Phase.cpp:120
std::string speciesName(size_t k) const
Name of the species with index k.
Definition: Phase.cpp:229
doublereal nAtoms(size_t k, size_t m) const
Number of atoms of element m in species k.
Definition: Phase.cpp:168
size_t nElements() const
Number of elements.
Definition: Phase.cpp:95
std::string elementName(size_t m) const
Name of the element with index m.
Definition: Phase.cpp:114
The WaterProps class is used to house several approximation routines for properties of water.
Definition: WaterProps.h:100
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:104
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
Definition: xml.cpp:492
std::string name() const
Returns the name of the XML node.
Definition: xml.h:372
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
Definition: xml.cpp:528
const XML_Node * findByName(const std::string &nm, int depth=100000) const
This routine carries out a recursive search for an XML node based on the name of the node.
Definition: xml.cpp:679
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.
void warn_user(const std::string &method, const std::string &msg, const Args &... args)
Definition: global.h:206
doublereal toSI(const std::string &unit)
Return the conversion factor to convert unit std::string 'unit' to SI units.
Definition: global.cpp:140
const size_t npos
index returned by functions to indicate "no position"
Definition: ct_defs.h:188
const double OneAtm
One atmosphere [Pa].
Definition: ct_defs.h:78
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:264
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
Definition: ctml.cpp:164
bool caseInsensitiveEquals(const std::string &input, const std::string &test)
Case insensitive equality predicate.
doublereal fpValueCheck(const std::string &val)
Translate a string into one doublereal value, with error checking.
doublereal strSItoDbl(const std::string &strSI)
Interpret one or two token string as a single double.
Contains declarations for string manipulation functions within Cantera.