Cantera  3.2.0a1
Loading...
Searching...
No Matches
IdealMolalSoln.cpp
Go to the documentation of this file.
1/**
2 * @file IdealMolalSoln.cpp
3 * ThermoPhase object for the ideal molal equation of
4 * state (see @ref thermoprops
5 * and class @link Cantera::IdealMolalSoln IdealMolalSoln@endlink).
6 *
7 * Definition file for a derived class of ThermoPhase that handles variable
8 * pressure standard state methods for calculating thermodynamic properties that
9 * are further based upon activities on the molality scale. The Ideal molal
10 * solution assumes that all molality-based activity coefficients are equal to
11 * one. This turns out, actually, to be highly nonlinear when the solvent
12 * densities get low.
13 */
14
15// This file is part of Cantera. See License.txt in the top-level directory or
16// at https://cantera.org/license.txt for license and copyright information.
17
20#include "cantera/thermo/PDSS.h"
22
23#include <iostream>
24
25namespace {
26double X_o_cutoff_default = 0.20;
27double gamma_o_min_default = 0.00001;
28double gamma_k_min_default = 10.0;
29double slopefCut_default = 0.6;
30double slopegCut_default = 0.0;
31double cCut_default = .05;
32}
33
34namespace Cantera
35{
36
37IdealMolalSoln::IdealMolalSoln(const string& inputFile, const string& id_) :
38 IMS_X_o_cutoff_(X_o_cutoff_default),
39 IMS_gamma_o_min_(gamma_o_min_default),
40 IMS_gamma_k_min_(gamma_k_min_default),
41 IMS_slopefCut_(slopefCut_default),
42 IMS_slopegCut_(slopegCut_default),
43 IMS_cCut_(cCut_default)
44{
45 initThermoFile(inputFile, id_);
46}
47
49{
51 return mean_X(m_workS);
52}
53
54// ------- Mechanical Equation of State Properties ------------------------
55
57{
58 return 0.0;
59}
60
62{
63 return 0.0;
64}
65
66// ------- Activities and Activity Concentrations
67
69{
70 if (m_formGC == 0) {
71 return Units(1.0); // dimensionless
72 } else {
73 // kmol/m^3 for bulk phases
74 return Units(1.0, 0, -static_cast<double>(nDim()), 0, 0, 0, 1);
75 }
76}
77
79{
80 if (m_formGC != 1) {
81 double c_solvent = standardConcentration();
83 for (size_t k = 0; k < m_kk; k++) {
84 c[k] *= c_solvent;
85 }
86 } else {
88 for (size_t k = 0; k < m_kk; k++) {
89 double c0 = standardConcentration(k);
90 c[k] *= c0;
91 }
92 }
93}
94
96{
97 switch (m_formGC) {
98 case 0:
99 return 1.0;
100 case 1:
101 return 1.0 / m_speciesMolarVolume[k];
102 case 2:
103 return 1.0 / m_speciesMolarVolume[0];
104 default:
105 throw CanteraError("IdealMolalSoln::standardConcentration",
106 "m_formGC is set to an incorrect value. \
107 Allowed values are 0, 1, and 2");
108 }
109}
110
111void IdealMolalSoln::getActivities(double* ac) const
112{
114
115 // Update the molality array, m_molalities(). This requires an update due to
116 // mole fractions
117 if (IMS_typeCutoff_ == 0) {
119 for (size_t k = 0; k < m_kk; k++) {
120 ac[k] = m_molalities[k];
121 }
122 double xmolSolvent = moleFraction(0);
123 // Limit the activity coefficient to be finite as the solvent mole
124 // fraction goes to zero.
125 xmolSolvent = std::max(m_xmolSolventMIN, xmolSolvent);
126 ac[0] = exp((xmolSolvent - 1.0)/xmolSolvent);
127 } else {
128
130
131 // Now calculate the array of activities.
132 for (size_t k = 1; k < m_kk; k++) {
133 ac[k] = m_molalities[k] * exp(IMS_lnActCoeffMolal_[k]);
134 }
135 double xmolSolvent = moleFraction(0);
136 ac[0] = exp(IMS_lnActCoeffMolal_[0]) * xmolSolvent;
137 }
138}
139
141{
142 if (IMS_typeCutoff_ == 0) {
143 for (size_t k = 0; k < m_kk; k++) {
144 acMolality[k] = 1.0;
145 }
146 double xmolSolvent = moleFraction(0);
147 // Limit the activity coefficient to be finite as the solvent mole
148 // fraction goes to zero.
149 xmolSolvent = std::max(m_xmolSolventMIN, xmolSolvent);
150 acMolality[0] = exp((xmolSolvent - 1.0)/xmolSolvent) / xmolSolvent;
151 } else {
153 std::copy(IMS_lnActCoeffMolal_.begin(), IMS_lnActCoeffMolal_.end(), acMolality);
154 for (size_t k = 0; k < m_kk; k++) {
155 acMolality[k] = exp(acMolality[k]);
156 }
157 }
158}
159
160// ------ Partial Molar Properties of the Solution -----------------
161
163{
164 // First get the standard chemical potentials. This requires updates of
165 // standard state as a function of T and P These are defined at unit
166 // molality.
168
169 // Update the molality array, m_molalities(). This requires an update due to
170 // mole fractions
172
173 // get the solvent mole fraction
174 double xmolSolvent = moleFraction(0);
175
176 if (IMS_typeCutoff_ == 0 || xmolSolvent > 3.* IMS_X_o_cutoff_/2.0) {
177 for (size_t k = 1; k < m_kk; k++) {
178 double xx = std::max(m_molalities[k], SmallNumber);
179 mu[k] += RT() * log(xx);
180 }
181
182 // Do the solvent
183 // -> see my notes
184 double xx = std::max(xmolSolvent, SmallNumber);
185 mu[0] += (RT() * (xmolSolvent - 1.0) / xx);
186 } else {
187 // Update the activity coefficients. This also updates the internal
188 // molality array.
190
191 for (size_t k = 1; k < m_kk; k++) {
192 double xx = std::max(m_molalities[k], SmallNumber);
193 mu[k] += RT() * (log(xx) + IMS_lnActCoeffMolal_[k]);
194 }
195 double xx = std::max(xmolSolvent, SmallNumber);
196 mu[0] += RT() * (log(xx) + IMS_lnActCoeffMolal_[0]);
197 }
198}
199
201{
202 getEnthalpy_RT(hbar);
203 for (size_t k = 0; k < m_kk; k++) {
204 hbar[k] *= RT();
205 }
206}
207
209{
210 getIntEnergy_RT(ubar);
211 for (size_t k = 0; k < m_kk; k++) {
212 ubar[k] *= RT();
213 }
214}
215
217{
218 getEntropy_R(sbar);
220 if (IMS_typeCutoff_ == 0) {
221 for (size_t k = 1; k < m_kk; k++) {
222 double mm = std::max(SmallNumber, m_molalities[k]);
223 sbar[k] -= GasConstant * log(mm);
224 }
225 double xmolSolvent = moleFraction(0);
226 sbar[0] -= (GasConstant * (xmolSolvent - 1.0) / xmolSolvent);
227 } else {
228 // Update the activity coefficients, This also update the internally
229 // stored molalities.
231
232 // First we will add in the obvious dependence on the T term out front
233 // of the log activity term
234 double mm;
235 for (size_t k = 1; k < m_kk; k++) {
236 mm = std::max(SmallNumber, m_molalities[k]);
237 sbar[k] -= GasConstant * (log(mm) + IMS_lnActCoeffMolal_[k]);
238 }
239 double xmolSolvent = moleFraction(0);
240 mm = std::max(SmallNumber, xmolSolvent);
241 sbar[0] -= GasConstant *(log(mm) + IMS_lnActCoeffMolal_[0]);
242 }
243}
244
246{
247 getStandardVolumes(vbar);
248}
249
250void IdealMolalSoln::getPartialMolarCp(double* cpbar) const
251{
252 // Get the nondimensional Gibbs standard state of the species at the T and P
253 // of the solution.
254 getCp_R(cpbar);
255 for (size_t k = 0; k < m_kk; k++) {
256 cpbar[k] *= GasConstant;
257 }
258}
259
260// -------------- Utilities -------------------------------
261
262bool IdealMolalSoln::addSpecies(shared_ptr<Species> spec)
263{
264 bool added = MolalityVPSSTP::addSpecies(spec);
265 if (added) {
266 m_speciesMolarVolume.push_back(0.0);
267 IMS_lnActCoeffMolal_.push_back(0.0);
268 }
269 return added;
270}
271
273{
275
276 if (m_input.hasKey("standard-concentration-basis")) {
277 setStandardConcentrationModel(m_input["standard-concentration-basis"].asString());
278 }
279 if (m_input.hasKey("cutoff")) {
280 auto& cutoff = m_input["cutoff"].as<AnyMap>();
281 setCutoffModel(cutoff.getString("model", "none"));
282 IMS_gamma_o_min_ = cutoff.getDouble("gamma_o", gamma_o_min_default);
283 IMS_gamma_k_min_ = cutoff.getDouble("gamma_k", gamma_k_min_default);
284 IMS_X_o_cutoff_ = cutoff.getDouble("X_o", X_o_cutoff_default);
285 IMS_cCut_ = cutoff.getDouble("c_0", cCut_default);
286 IMS_slopefCut_ = cutoff.getDouble("slope_f", slopefCut_default);
287 IMS_slopegCut_ = cutoff.getDouble("slope_g", slopegCut_default);
288 }
289
290 for (size_t k = 0; k < nSpecies(); k++) {
291 m_speciesMolarVolume[k] = providePDSS(k)->molarVolume();
292 }
293 if (IMS_typeCutoff_ == 2) {
295 }
296 setMoleFSolventMin(1.0E-5);
297}
298
300{
302
303 // "solvent-molar-volume" (m_formGC == 2) is the default, and can be omitted
304 if (m_formGC == 0) {
305 phaseNode["standard-concentration-basis"] = "unity";
306 } else if (m_formGC == 1) {
307 phaseNode["standard-concentration-basis"] = "species-molar-volume";
308 }
309
310 AnyMap cutoff;
311 if (IMS_typeCutoff_ == 1) {
312 cutoff["model"] = "poly";
313 } else if (IMS_typeCutoff_ == 2) {
314 cutoff["model"] = "polyexp";
315 }
316
317 if (IMS_gamma_o_min_ != gamma_o_min_default) {
318 cutoff["gamma_o"] = IMS_gamma_o_min_;
319 }
320 if (IMS_gamma_k_min_ != gamma_k_min_default) {
321 cutoff["gamma_k"] = IMS_gamma_k_min_;
322 }
323 if (IMS_X_o_cutoff_ != X_o_cutoff_default) {
324 cutoff["X_o"] = IMS_X_o_cutoff_;
325 }
326 if (IMS_cCut_ != cCut_default) {
327 cutoff["c_0"] = IMS_cCut_;
328 }
329 if (IMS_slopefCut_ != slopefCut_default) {
330 cutoff["slope_f"] = IMS_slopefCut_;
331 }
332 if (IMS_slopegCut_ != slopegCut_default) {
333 cutoff["slope_g"] = IMS_slopegCut_;
334 }
335
336 if (cutoff.size()) {
337 phaseNode["cutoff"] = std::move(cutoff);
338 }
339}
340
342{
343 if (caseInsensitiveEquals(model, "unity")) {
344 m_formGC = 0;
345 } else if (caseInsensitiveEquals(model, "species-molar-volume")
346 || caseInsensitiveEquals(model, "molar_volume")) {
347 m_formGC = 1;
348 } else if (caseInsensitiveEquals(model, "solvent-molar-volume")
349 || caseInsensitiveEquals(model, "solvent_volume")) {
350 m_formGC = 2;
351 } else {
352 throw CanteraError("IdealMolalSoln::setStandardConcentrationModel",
353 "Unknown standard concentration model '{}'", model);
354 }
355}
356
357void IdealMolalSoln::setCutoffModel(const string& model)
358{
359 if (caseInsensitiveEquals(model, "none")) {
360 IMS_typeCutoff_ = 0;
361 } else if (caseInsensitiveEquals(model, "poly")) {
362 IMS_typeCutoff_ = 1;
363 } else if (caseInsensitiveEquals(model, "polyexp")) {
364 IMS_typeCutoff_ = 2;
365 } else {
366 throw CanteraError("IdealMolalSoln::setCutoffModel",
367 "Unknown cutoff model '{}'", model);
368 }
369}
370
371// ------------ Private and Restricted Functions ------------------
372
374{
375 // Calculate the molalities. Currently, the molalities may not be current
376 // with respect to the contents of the State objects' data.
378
379 double xmolSolvent = moleFraction(0);
380 double xx = std::max(m_xmolSolventMIN, xmolSolvent);
381
382 if (IMS_typeCutoff_ == 0) {
383 for (size_t k = 1; k < m_kk; k++) {
384 IMS_lnActCoeffMolal_[k]= 0.0;
385 }
386 IMS_lnActCoeffMolal_[0] = - log(xx) + (xx - 1.0)/xx;
387 return;
388 } else if (IMS_typeCutoff_ == 1) {
389 if (xmolSolvent > 3.0 * IMS_X_o_cutoff_/2.0) {
390 for (size_t k = 1; k < m_kk; k++) {
391 IMS_lnActCoeffMolal_[k]= 0.0;
392 }
393 IMS_lnActCoeffMolal_[0] = - log(xx) + (xx - 1.0)/xx;
394 return;
395 } else if (xmolSolvent < IMS_X_o_cutoff_/2.0) {
396 double tmp = log(xx * IMS_gamma_k_min_);
397 for (size_t k = 1; k < m_kk; k++) {
398 IMS_lnActCoeffMolal_[k]= tmp;
399 }
401 return;
402 } else {
403 // If we are in the middle region, calculate the connecting polynomials
404 double xminus = xmolSolvent - IMS_X_o_cutoff_/2.0;
405 double xminus2 = xminus * xminus;
406 double xminus3 = xminus2 * xminus;
407 double x_o_cut2 = IMS_X_o_cutoff_ * IMS_X_o_cutoff_;
408 double x_o_cut3 = x_o_cut2 * IMS_X_o_cutoff_;
409
410 double h2 = 3.5 * xminus2 / IMS_X_o_cutoff_ - 2.0 * xminus3 / x_o_cut2;
411 double h2_prime = 7.0 * xminus / IMS_X_o_cutoff_ - 6.0 * xminus2 / x_o_cut2;
412
413 double h1 = (1.0 - 3.0 * xminus2 / x_o_cut2 + 2.0 * xminus3/ x_o_cut3);
414 double h1_prime = (- 6.0 * xminus / x_o_cut2 + 6.0 * xminus2/ x_o_cut3);
415
416 double h1_g = h1 / IMS_gamma_o_min_;
417 double h1_g_prime = h1_prime / IMS_gamma_o_min_;
418
419 double alpha = 1.0 / (exp(1.0) * IMS_gamma_k_min_);
420 double h1_f = h1 * alpha;
421 double h1_f_prime = h1_prime * alpha;
422
423 double f = h2 + h1_f;
424 double f_prime = h2_prime + h1_f_prime;
425
426 double g = h2 + h1_g;
427 double g_prime = h2_prime + h1_g_prime;
428
429 double tmp = (xmolSolvent/ g * g_prime + (1.0-xmolSolvent) / f * f_prime);
430 double lngammak = -1.0 - log(f) + tmp * xmolSolvent;
431 double lngammao =-log(g) - tmp * (1.0-xmolSolvent);
432
433 tmp = log(xmolSolvent) + lngammak;
434 for (size_t k = 1; k < m_kk; k++) {
435 IMS_lnActCoeffMolal_[k]= tmp;
436 }
437 IMS_lnActCoeffMolal_[0] = lngammao;
438 }
439 } else if (IMS_typeCutoff_ == 2) {
440 // Exponentials - trial 2
441 if (xmolSolvent > IMS_X_o_cutoff_) {
442 for (size_t k = 1; k < m_kk; k++) {
443 IMS_lnActCoeffMolal_[k]= 0.0;
444 }
445 IMS_lnActCoeffMolal_[0] = - log(xx) + (xx - 1.0)/xx;
446 return;
447 } else {
448 double xoverc = xmolSolvent/IMS_cCut_;
449 double eterm = std::exp(-xoverc);
450
451 double fptmp = IMS_bfCut_ - IMS_afCut_ / IMS_cCut_ - IMS_bfCut_*xoverc
452 + 2.0*IMS_dfCut_*xmolSolvent - IMS_dfCut_*xmolSolvent*xoverc;
453 double f_prime = 1.0 + eterm*fptmp;
454 double f = xmolSolvent + IMS_efCut_ + eterm * (IMS_afCut_ + xmolSolvent * (IMS_bfCut_ + IMS_dfCut_*xmolSolvent));
455
456 double gptmp = IMS_bgCut_ - IMS_agCut_ / IMS_cCut_ - IMS_bgCut_*xoverc
457 + 2.0*IMS_dgCut_*xmolSolvent - IMS_dgCut_*xmolSolvent*xoverc;
458 double g_prime = 1.0 + eterm*gptmp;
459 double g = xmolSolvent + IMS_egCut_ + eterm * (IMS_agCut_ + xmolSolvent * (IMS_bgCut_ + IMS_dgCut_*xmolSolvent));
460
461 double tmp = (xmolSolvent / g * g_prime + (1.0 - xmolSolvent) / f * f_prime);
462 double lngammak = -1.0 - log(f) + tmp * xmolSolvent;
463 double lngammao =-log(g) - tmp * (1.0-xmolSolvent);
464
465 tmp = log(xx) + lngammak;
466 for (size_t k = 1; k < m_kk; k++) {
467 IMS_lnActCoeffMolal_[k]= tmp;
468 }
469 IMS_lnActCoeffMolal_[0] = lngammao;
470 }
471 }
472}
473
475{
476 IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_);
477 IMS_efCut_ = 0.0;
478 bool converged = false;
479 for (int its = 0; its < 100 && !converged; its++) {
480 double oldV = IMS_efCut_;
481 IMS_afCut_ = 1.0 / (std::exp(1.0) * IMS_gamma_k_min_) - IMS_efCut_;
482 IMS_bfCut_ = IMS_afCut_ / IMS_cCut_ + IMS_slopefCut_ - 1.0;
483 IMS_dfCut_ = ((- IMS_afCut_/IMS_cCut_ + IMS_bfCut_ - IMS_bfCut_*IMS_X_o_cutoff_/IMS_cCut_)
484 /
486 double tmp = IMS_afCut_ + IMS_X_o_cutoff_*(IMS_bfCut_ + IMS_dfCut_ * IMS_X_o_cutoff_);
487 double eterm = std::exp(-IMS_X_o_cutoff_/IMS_cCut_);
488 IMS_efCut_ = - eterm * (tmp);
489 if (fabs(IMS_efCut_ - oldV) < 1.0E-14) {
490 converged = true;
491 }
492 }
493 if (!converged) {
494 throw CanteraError("IdealMolalSoln::calcCutoffParams_",
495 "failed to converge on the f polynomial");
496 }
497 converged = false;
498 double f_0 = IMS_afCut_ + IMS_efCut_;
499 double f_prime_0 = 1.0 - IMS_afCut_ / IMS_cCut_ + IMS_bfCut_;
500 IMS_egCut_ = 0.0;
501 for (int its = 0; its < 100 && !converged; its++) {
502 double oldV = IMS_egCut_;
503 double lng_0 = -log(IMS_gamma_o_min_) - f_prime_0 / f_0;
504 IMS_agCut_ = exp(lng_0) - IMS_egCut_;
505 IMS_bgCut_ = IMS_agCut_ / IMS_cCut_ + IMS_slopegCut_ - 1.0;
506 IMS_dgCut_ = ((- IMS_agCut_/IMS_cCut_ + IMS_bgCut_ - IMS_bgCut_*IMS_X_o_cutoff_/IMS_cCut_)
507 /
509 double tmp = IMS_agCut_ + IMS_X_o_cutoff_*(IMS_bgCut_ + IMS_dgCut_ *IMS_X_o_cutoff_);
510 double eterm = std::exp(-IMS_X_o_cutoff_/IMS_cCut_);
511 IMS_egCut_ = - eterm * (tmp);
512 if (fabs(IMS_egCut_ - oldV) < 1.0E-14) {
513 converged = true;
514 }
515 }
516 if (!converged) {
517 throw CanteraError("IdealMolalSoln::calcCutoffParams_",
518 "failed to converge on the g polynomial");
519 }
520}
521
522}
ThermoPhase object for the ideal molal equation of state (see Thermodynamic Properties and class Idea...
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:432
size_t size() const
Returns the number of elements in this map.
Definition AnyMap.cpp:1728
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
Definition AnyMap.cpp:1477
Base class for exceptions thrown by Cantera classes.
void calcIMSCutoffParams_()
Calculate parameters for cutoff treatments of activity coefficients.
double thermalExpansionCoeff() const override
The thermal expansion coefficient. Units: 1/K.
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
void getChemPotentials(double *mu) const override
Get the species chemical potentials: Units: J/kmol.
double IMS_slopegCut_
Parameter in the polyExp cutoff treatment.
double IMS_gamma_o_min_
gamma_o value for the cutoff process at the zero solvent point
int IMS_typeCutoff_
Cutoff type.
IdealMolalSoln(const string &inputFile="", const string &id="")
Constructor for phase initialization.
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
void getActivityConcentrations(double *c) const override
This method returns an array of generalized concentrations.
void getPartialMolarVolumes(double *vbar) const override
vector< double > IMS_lnActCoeffMolal_
Logarithm of the molal activity coefficients.
void setStandardConcentrationModel(const string &model)
Set the standard concentration model.
double IMS_slopefCut_
Parameter in the polyExp cutoff treatment.
double isothermalCompressibility() const override
The isothermal compressibility. Units: 1/Pa.
double intEnergy_mole() const override
Molar internal energy of the solution: Units: J/kmol.
void setCutoffModel(const string &model)
Set cutoff model. Must be one of 'none', 'poly', or 'polyExp'.
double IMS_gamma_k_min_
gamma_k minimum for the cutoff process at the zero solvent point
int m_formGC
The standard concentrations can have one of three different forms: 0 = 'unity', 1 = 'species-molar-vo...
vector< double > m_speciesMolarVolume
Species molar volume .
void getActivities(double *ac) const override
Get the array of non-dimensional activities at the current solution temperature, pressure,...
double IMS_X_o_cutoff_
value of the solute mole fraction that centers the cutoff polynomials for the cutoff =1 process;
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
void getPartialMolarCp(double *cpbar) const override
Partial molar heat capacity of the solution:. UnitsL J/kmol/K.
double standardConcentration(size_t k=0) const override
Return the standard concentration for the kth species.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
void getPartialMolarIntEnergies(double *hbar) const override
Returns an array of partial molar internal energies for the species in the mixture.
void s_updateIMS_lnMolalityActCoeff() const
This function will be called to update the internally stored natural logarithm of the molality activi...
void getMolalityActivityCoefficients(double *acMolality) const override
Get the array of non-dimensional molality-based activity coefficients at the current solution tempera...
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
double m_xmolSolventMIN
In any molality implementation, it makes sense to have a minimum solvent mole fraction requirement,...
vector< double > m_molalities
Current value of the molalities of the species in the phase.
void setMoleFSolventMin(double xmolSolventMIN)
Sets the minimum mole fraction in the molality formulation.
void calcMolalities() const
Calculates the molality of all species and stores the result internally.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
virtual double molarVolume() const
Return the molar volume at standard state.
Definition PDSS.cpp:63
vector< double > m_workS
Vector of size m_kk, used as a temporary holding area.
Definition Phase.h:879
size_t nSpecies() const
Returns the number of species in the phase.
Definition Phase.h:232
size_t m_kk
Number of species in the phase.
Definition Phase.h:855
size_t nDim() const
Returns the number of spatial dimensions (1, 2, or 3)
Definition Phase.h:547
double moleFraction(size_t k) const
Return the mole fraction of a single species.
Definition Phase.cpp:439
double mean_X(const double *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
Definition Phase.cpp:616
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
double RT() const
Return the Gas Constant multiplied by the current temperature.
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
AnyMap m_input
Data supplied via setParameters.
A representation of the units associated with a dimensional quantity.
Definition Units.h:35
void getEntropy_R(double *sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
virtual void _updateStandardStateThermo() const
Updates the standard state thermodynamic functions at the current T and P of the solution.
void getStandardChemPotentials(double *mu) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
void getCp_R(double *cpr) const override
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
void getEnthalpy_RT(double *hrt) const override
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
void getStandardVolumes(double *vol) const override
Get the molar volumes of the species standard states at the current T and P of the solution.
void getIntEnergy_RT(double *urt) const override
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
bool caseInsensitiveEquals(const string &input, const string &test)
Case insensitive equality predicate.
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:120
Namespace for the Cantera kernel.
Definition AnyMap.cpp:595
const double SmallNumber
smallest number to compare to zero.
Definition ct_defs.h:158
Contains declarations for string manipulation functions within Cantera.