| Cantera 3.0.0

Loading...
Searching...
No Matches
IdealSolidSolnPhase.cpp
Go to the documentation of this file.
1/**
2 * @file IdealSolidSolnPhase.cpp Implementation file for an ideal solid
3 * solution model with incompressible thermodynamics (see @ref
4 * thermoprops and @link Cantera::IdealSolidSolnPhase
5 * IdealSolidSolnPhase@endlink).
6 */
7
8// This file is part of Cantera. See License.txt in the top-level directory or
9// at https://cantera.org/license.txt for license and copyright information.
10
11#include "cantera/thermo/IdealSolidSolnPhase.h"
12#include "cantera/thermo/ThermoFactory.h"
13#include "cantera/thermo/Species.h"
14#include "cantera/base/stringUtils.h"
15#include "cantera/base/utilities.h"
16
17 namespace Cantera
18{
19
20 IdealSolidSolnPhase::IdealSolidSolnPhase(const string& inputFile, const string& id_)
21{
22 initThermoFile(inputFile, id_);
23}
24
25// Molar Thermodynamic Properties of the Solution
26
27 double IdealSolidSolnPhase::enthalpy_mole() const
28{
29 double htp = RT() * mean_X(enthalpy_RT_ref());
30 return htp + (pressure() - m_Pref)/molarDensity();
31}
32
33 double IdealSolidSolnPhase::entropy_mole() const
34{
35 return GasConstant * (mean_X(entropy_R_ref()) - sum_xlogx());
36}
37
38 double IdealSolidSolnPhase::gibbs_mole() const
39{
40 double Pv = (pressure() - m_Pref)/molarDensity();
41 return RT() * (mean_X(gibbs_RT_ref()) + sum_xlogx()) + Pv;
42}
43
44 double IdealSolidSolnPhase::cp_mole() const
45{
46 return GasConstant * mean_X(cp_R_ref());
47}
48
49// Mechanical Equation of State
50
51 void IdealSolidSolnPhase::calcDensity()
52{
53 // Calculate the molarVolume of the solution (m**3 kmol-1)
54 double v_mol = mean_X(m_speciesMolarVolume);
55
56 // Set the density in the parent object directly, by calling the
57 // Phase::assignDensity() function.
58 Phase::assignDensity(meanMolecularWeight()/v_mol);
59}
60
61 void IdealSolidSolnPhase::setPressure(double p)
62{
63 m_Pcurrent = p;
64 calcDensity();
65}
66
67 void IdealSolidSolnPhase::compositionChanged()
68{
69 Phase::compositionChanged();
70 calcDensity();
71}
72
73// Chemical Potentials and Activities
74
75 Units IdealSolidSolnPhase::standardConcentrationUnits() const
76{
77 if (m_formGC == 0) {
78 return Units(1.0); // dimensionless
79 } else {
80 // kmol/m^3 for bulk phases
81 return Units(1.0, 0, -static_cast<double>(nDim()), 0, 0, 0, 1);
82 }
83}
84
85 void IdealSolidSolnPhase::getActivityConcentrations(double* c) const
86{
87 getMoleFractions(c);
88 switch (m_formGC) {
89 case 0:
90 break;
91 case 1:
92 for (size_t k = 0; k < m_kk; k++) {
93 c[k] /= m_speciesMolarVolume[k];
94 }
95 break;
96 case 2:
97 for (size_t k = 0; k < m_kk; k++) {
98 c[k] /= m_speciesMolarVolume[m_kk-1];
99 }
100 break;
101 }
102}
103
104 double IdealSolidSolnPhase::standardConcentration(size_t k) const
105{
106 switch (m_formGC) {
107 case 0:
108 return 1.0;
109 case 1:
110 return 1.0 / m_speciesMolarVolume[k];
111 case 2:
112 return 1.0/m_speciesMolarVolume[m_kk-1];
113 }
114 return 0.0;
115}
116
117 void IdealSolidSolnPhase::getActivityCoefficients(double* ac) const
118{
119 for (size_t k = 0; k < m_kk; k++) {
120 ac[k] = 1.0;
121 }
122}
123
124 void IdealSolidSolnPhase::getChemPotentials(double* mu) const
125{
126 double delta_p = m_Pcurrent - m_Pref;
127 const vector<double>& g_RT = gibbs_RT_ref();
128 for (size_t k = 0; k < m_kk; k++) {
129 double xx = std::max(SmallNumber, moleFraction(k));
130 mu[k] = RT() * (g_RT[k] + log(xx))
131 + delta_p * m_speciesMolarVolume[k];
132 }
133}
134
135 void IdealSolidSolnPhase::getChemPotentials_RT(double* mu) const
136{
137 warn_deprecated("IdealSolidSolnPhase::getChemPotentials_RT",
138 "To be removed after Cantera 3.0. Use getChemPotentials instead.");
139 double delta_pdRT = (m_Pcurrent - m_Pref) / (temperature() * GasConstant);
140 const vector<double>& g_RT = gibbs_RT_ref();
141 for (size_t k = 0; k < m_kk; k++) {
142 double xx = std::max(SmallNumber, moleFraction(k));
143 mu[k] = (g_RT[k] + log(xx))
144 + delta_pdRT * m_speciesMolarVolume[k];
145 }
146}
147
148// Partial Molar Properties
149
150 void IdealSolidSolnPhase::getPartialMolarEnthalpies(double* hbar) const
151{
152 const vector<double>& _h = enthalpy_RT_ref();
153 double delta_p = m_Pcurrent - m_Pref;
154 for (size_t k = 0; k < m_kk; k++) {
155 hbar[k] = _h[k]*RT() + delta_p * m_speciesMolarVolume[k];
156 }
157 // scale(_h.begin(), _h.end(), hbar, RT());
158}
159
160 void IdealSolidSolnPhase::getPartialMolarEntropies(double* sbar) const
161{
162 const vector<double>& _s = entropy_R_ref();
163 for (size_t k = 0; k < m_kk; k++) {
164 double xx = std::max(SmallNumber, moleFraction(k));
165 sbar[k] = GasConstant * (_s[k] - log(xx));
166 }
167}
168
169 void IdealSolidSolnPhase::getPartialMolarCp(double* cpbar) const
170{
171 getCp_R(cpbar);
172 for (size_t k = 0; k < m_kk; k++) {
173 cpbar[k] *= GasConstant;
174 }
175}
176
177 void IdealSolidSolnPhase::getPartialMolarVolumes(double* vbar) const
178{
179 getStandardVolumes(vbar);
180}
181
182// Properties of the Standard State of the Species in the Solution
183
184 void IdealSolidSolnPhase::getPureGibbs(double* gpure) const
185{
186 const vector<double>& gibbsrt = gibbs_RT_ref();
187 double delta_p = (m_Pcurrent - m_Pref);
188 for (size_t k = 0; k < m_kk; k++) {
189 gpure[k] = RT() * gibbsrt[k] + delta_p * m_speciesMolarVolume[k];
190 }
191}
192
193 void IdealSolidSolnPhase::getGibbs_RT(double* grt) const
194{
195 const vector<double>& gibbsrt = gibbs_RT_ref();
196 double delta_prt = (m_Pcurrent - m_Pref)/ RT();
197 for (size_t k = 0; k < m_kk; k++) {
198 grt[k] = gibbsrt[k] + delta_prt * m_speciesMolarVolume[k];
199 }
200}
201
202 void IdealSolidSolnPhase::getEnthalpy_RT(double* hrt) const
203{
204 const vector<double>& _h = enthalpy_RT_ref();
205 double delta_prt = (m_Pcurrent - m_Pref) / RT();
206 for (size_t k = 0; k < m_kk; k++) {
207 hrt[k] = _h[k] + delta_prt * m_speciesMolarVolume[k];
208 }
209}
210
211 void IdealSolidSolnPhase::getEntropy_R(double* sr) const
212{
213 const vector<double>& _s = entropy_R_ref();
214 copy(_s.begin(), _s.end(), sr);
215}
216
217 void IdealSolidSolnPhase::getIntEnergy_RT(double* urt) const
218{
219 const vector<double>& _h = enthalpy_RT_ref();
220 double prefrt = m_Pref / RT();
221 for (size_t k = 0; k < m_kk; k++) {
222 urt[k] = _h[k] - prefrt * m_speciesMolarVolume[k];
223 }
224}
225
226 void IdealSolidSolnPhase::getCp_R(double* cpr) const
227{
228 const vector<double>& _cpr = cp_R_ref();
229 copy(_cpr.begin(), _cpr.end(), cpr);
230}
231
232 void IdealSolidSolnPhase::getStandardVolumes(double* vol) const
233{
234 copy(m_speciesMolarVolume.begin(), m_speciesMolarVolume.end(), vol);
235}
236
237// Thermodynamic Values for the Species Reference States
238
239 void IdealSolidSolnPhase::getEnthalpy_RT_ref(double* hrt) const
240{
241 _updateThermo();
242 for (size_t k = 0; k != m_kk; k++) {
243 hrt[k] = m_h0_RT[k];
244 }
245}
246
247 void IdealSolidSolnPhase::getGibbs_RT_ref(double* grt) const
248{
249 _updateThermo();
250 for (size_t k = 0; k != m_kk; k++) {
251 grt[k] = m_g0_RT[k];
252 }
253}
254
255 void IdealSolidSolnPhase::getGibbs_ref(double* g) const
256{
257 _updateThermo();
258 double tmp = RT();
259 for (size_t k = 0; k != m_kk; k++) {
260 g[k] = tmp * m_g0_RT[k];
261 }
262}
263
264 void IdealSolidSolnPhase::getIntEnergy_RT_ref(double* urt) const
265{
266 const vector<double>& _h = enthalpy_RT_ref();
267 double prefrt = m_Pref / RT();
268 for (size_t k = 0; k < m_kk; k++) {
269 urt[k] = _h[k] - prefrt * m_speciesMolarVolume[k];
270 }
271}
272
273 void IdealSolidSolnPhase::getEntropy_R_ref(double* er) const
274{
275 _updateThermo();
276 for (size_t k = 0; k != m_kk; k++) {
277 er[k] = m_s0_R[k];
278 }
279}
280
281 void IdealSolidSolnPhase::getCp_R_ref(double* cpr) const
282{
283 _updateThermo();
284 for (size_t k = 0; k != m_kk; k++) {
285 cpr[k] = m_cp0_R[k];
286 }
287}
288
289 const vector<double>& IdealSolidSolnPhase::enthalpy_RT_ref() const
290{
291 _updateThermo();
292 return m_h0_RT;
293}
294
295 const vector<double>& IdealSolidSolnPhase::entropy_R_ref() const
296{
297 _updateThermo();
298 return m_s0_R;
299}
300
301// Utility Functions
302
303 bool IdealSolidSolnPhase::addSpecies(shared_ptr<Species> spec)
304{
305 bool added = ThermoPhase::addSpecies(spec);
306 if (added) {
307 if (m_kk == 1) {
308 // Obtain the reference pressure by calling the ThermoPhase function
309 // refPressure, which in turn calls the species thermo reference
310 // pressure function of the same name.
311 m_Pref = refPressure();
312 }
313
314 m_h0_RT.push_back(0.0);
315 m_g0_RT.push_back(0.0);
316 m_expg0_RT.push_back(0.0);
317 m_cp0_R.push_back(0.0);
318 m_s0_R.push_back(0.0);
319 m_pp.push_back(0.0);
320 if (spec->input.hasKey("equation-of-state")) {
321 auto& eos = spec->input["equation-of-state"].getMapWhere("model", "constant-volume");
322 double mv;
323 if (eos.hasKey("density")) {
324 mv = molecularWeight(m_kk-1) / eos.convert("density", "kg/m^3");
325 } else if (eos.hasKey("molar-density")) {
326 mv = 1.0 / eos.convert("molar-density", "kmol/m^3");
327 } else if (eos.hasKey("molar-volume")) {
328 mv = eos.convert("molar-volume", "m^3/kmol");
329 } else {
330 throw CanteraError("IdealSolidSolnPhase::addSpecies",
331 "equation-of-state entry for species '{}' is missing "
332 "'density', 'molar-volume', or 'molar-density' "
333 "specification", spec->name);
334 }
335 m_speciesMolarVolume.push_back(mv);
336 } else {
337 throw CanteraError("IdealSolidSolnPhase::addSpecies",
338 "Molar volume not specified for species '{}'", spec->name);
339 }
340 if (ready()) {
341 calcDensity();
342 }
343 }
344 return added;
345}
346
347 void IdealSolidSolnPhase::initThermo()
348{
349 if (m_input.hasKey("standard-concentration-basis")) {
350 setStandardConcentrationModel(m_input["standard-concentration-basis"].asString());
351 }
352 ThermoPhase::initThermo();
353}
354
355 void IdealSolidSolnPhase::getParameters(AnyMap& phaseNode) const
356{
357 ThermoPhase::getParameters(phaseNode);
358 if (m_formGC == 1) {
359 phaseNode["standard-concentration-basis"] = "species-molar-volume";
360 } else if (m_formGC == 2) {
361 phaseNode["standard-concentration-basis"] = "solvent-molar-volume";
362 }
363}
364
365 void IdealSolidSolnPhase::getSpeciesParameters(const string &name,
366 AnyMap& speciesNode) const
367{
368 ThermoPhase::getSpeciesParameters(name, speciesNode);
369 size_t k = speciesIndex(name);
370 const auto S = species(k);
371 auto& eosNode = speciesNode["equation-of-state"].getMapWhere(
372 "model", "constant-volume", true);
373 // Output volume information in a form consistent with the input
374 if (S->input.hasKey("equation-of-state")) {
375 auto& eosIn = S->input["equation-of-state"];
376 if (eosIn.hasKey("density")) {
377 eosNode["density"].setQuantity(
378 molecularWeight(k) / m_speciesMolarVolume[k], "kg/m^3");
379 } else if (eosIn.hasKey("molar-density")) {
380 eosNode["molar-density"].setQuantity(1.0 / m_speciesMolarVolume[k],
381 "kmol/m^3");
382 } else {
383 eosNode["molar-volume"].setQuantity(m_speciesMolarVolume[k],
384 "m^3/kmol");
385 }
386 } else {
387 eosNode["molar-volume"].setQuantity(m_speciesMolarVolume[k],
388 "m^3/kmol");
389 }
390}
391
392 void IdealSolidSolnPhase::setToEquilState(const double* mu_RT)
393{
394 const vector<double>& grt = gibbs_RT_ref();
395
396 // Within the method, we protect against inf results if the exponent is too
397 // high.
398 //
399 // If it is too low, we set the partial pressure to zero. This capability is
400 // needed by the elemental potential method.
401 double pres = 0.0;
402 double m_p0 = refPressure();
403 for (size_t k = 0; k < m_kk; k++) {
404 double tmp = -grt[k] + mu_RT[k];
405 if (tmp < -600.) {
406 m_pp[k] = 0.0;
407 } else if (tmp > 500.0) {
408 // Protect against inf results if the exponent is too high
409 double tmp2 = tmp / 500.;
410 tmp2 *= tmp2;
411 m_pp[k] = m_p0 * exp(500.) * tmp2;
412 } else {
413 m_pp[k] = m_p0 * exp(tmp);
414 }
415 pres += m_pp[k];
416 }
417 // set state
418 setMoleFractions(m_pp.data());
419 setPressure(pres);
420}
421
422 void IdealSolidSolnPhase::setStandardConcentrationModel(const string& model)
423{
424 if (caseInsensitiveEquals(model, "unity")) {
425 m_formGC = 0;
426 } else if (caseInsensitiveEquals(model, "species-molar-volume")
427 || caseInsensitiveEquals(model, "molar_volume")) {
428 m_formGC = 1;
429 } else if (caseInsensitiveEquals(model, "solvent-molar-volume")
430 || caseInsensitiveEquals(model, "solvent_volume")) {
431 m_formGC = 2;
432 } else {
433 throw CanteraError("IdealSolidSolnPhase::setStandardConcentrationModel",
434 "Unknown standard concentration model '{}'", model);
435 }
436}
437
438 double IdealSolidSolnPhase::speciesMolarVolume(int k) const
439{
440 return m_speciesMolarVolume[k];
441}
442
443 void IdealSolidSolnPhase::getSpeciesMolarVolumes(double* smv) const
444{
445 copy(m_speciesMolarVolume.begin(), m_speciesMolarVolume.end(), smv);
446}
447
448 void IdealSolidSolnPhase::_updateThermo() const
449{
450 double tnow = temperature();
451 if (m_tlast != tnow) {
452
453 // Update the thermodynamic functions of the reference state.
454 m_spthermo.update(tnow, m_cp0_R.data(), m_h0_RT.data(), m_s0_R.data());
455 m_tlast = tnow;
456 for (size_t k = 0; k < m_kk; k++) {
457 m_g0_RT[k] = m_h0_RT[k] - m_s0_R[k];
458 }
459 m_tlast = tnow;
460 }
461}
462
463} // end namespace Cantera
IdealSolidSolnPhase.h
Header file for an ideal solid solution model with incompressible thermodynamics (see Thermodynamic P...
Species.h
Declaration for class Cantera::Species.
ThermoFactory.h
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
Cantera::AnyMap
A map of string keys to values whose type can vary at runtime.
Definition AnyMap.h:427
Cantera::AnyMap::hasKey
bool hasKey(const string &key) const
Returns true if the map contains an item named key.
Definition AnyMap.cpp:1423
Cantera::CanteraError
Base class for exceptions thrown by Cantera classes.
Definition ctexceptions.h:66
Cantera::IdealSolidSolnPhase::entropy_R_ref
const vector< double > & entropy_R_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
Definition IdealSolidSolnPhase.cpp:295
Cantera::IdealSolidSolnPhase::enthalpy_mole
double enthalpy_mole() const override
Molar enthalpy of the solution.
Definition IdealSolidSolnPhase.cpp:27
Cantera::IdealSolidSolnPhase::getPartialMolarEnthalpies
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
Definition IdealSolidSolnPhase.cpp:150
Cantera::IdealSolidSolnPhase::getChemPotentials
void getChemPotentials(double *mu) const override
Get the species chemical potentials.
Definition IdealSolidSolnPhase.cpp:124
Cantera::IdealSolidSolnPhase::pressure
double pressure() const override
Pressure.
Definition IdealSolidSolnPhase.h:157
Cantera::IdealSolidSolnPhase::m_g0_RT
vector< double > m_g0_RT
Vector containing the species reference Gibbs functions at T = m_tlast.
Definition IdealSolidSolnPhase.h:609
Cantera::IdealSolidSolnPhase::getSpeciesParameters
void getSpeciesParameters(const string &name, AnyMap &speciesNode) const override
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
Definition IdealSolidSolnPhase.cpp:365
Cantera::IdealSolidSolnPhase::getEntropy_R
void getEntropy_R(double *sr) const override
Get the nondimensional Entropies for the species standard states at the current T and P of the soluti...
Definition IdealSolidSolnPhase.cpp:211
Cantera::IdealSolidSolnPhase::m_h0_RT
vector< double > m_h0_RT
Vector containing the species reference enthalpies at T = m_tlast.
Definition IdealSolidSolnPhase.h:602
Cantera::IdealSolidSolnPhase::getGibbs_ref
void getGibbs_ref(double *g) const override
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
Definition IdealSolidSolnPhase.cpp:255
Cantera::IdealSolidSolnPhase::speciesMolarVolume
double speciesMolarVolume(int k) const
Report the molar volume of species k.
Definition IdealSolidSolnPhase.cpp:438
Cantera::IdealSolidSolnPhase::m_pp
vector< double > m_pp
Temporary array used in equilibrium calculations.
Definition IdealSolidSolnPhase.h:619
Cantera::IdealSolidSolnPhase::m_Pref
double m_Pref
Value of the reference pressure for all species in this phase.
Definition IdealSolidSolnPhase.h:583
Cantera::IdealSolidSolnPhase::getCp_R
void getCp_R(double *cpr) const override
Get the nondimensional heat capacity at constant pressure function for the species standard states at...
Definition IdealSolidSolnPhase.cpp:226
Cantera::IdealSolidSolnPhase::getParameters
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition IdealSolidSolnPhase.cpp:355
Cantera::IdealSolidSolnPhase::initThermo
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
Definition IdealSolidSolnPhase.cpp:347
Cantera::IdealSolidSolnPhase::getActivityConcentrations
void getActivityConcentrations(double *c) const override
This method returns the array of generalized concentrations.
Definition IdealSolidSolnPhase.cpp:85
Cantera::IdealSolidSolnPhase::getSpeciesMolarVolumes
void getSpeciesMolarVolumes(double *smv) const
Fill in a return vector containing the species molar volumes.
Definition IdealSolidSolnPhase.cpp:443
Cantera::IdealSolidSolnPhase::setPressure
void setPressure(double p) override
Set the pressure at constant temperature.
Definition IdealSolidSolnPhase.cpp:61
Cantera::IdealSolidSolnPhase::gibbs_RT_ref
const vector< double > & gibbs_RT_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
Definition IdealSolidSolnPhase.h:496
Cantera::IdealSolidSolnPhase::getPartialMolarVolumes
void getPartialMolarVolumes(double *vbar) const override
returns an array of partial molar volumes of the species in the solution.
Definition IdealSolidSolnPhase.cpp:177
Cantera::IdealSolidSolnPhase::getPureGibbs
void getPureGibbs(double *gpure) const override
Get the Gibbs functions for the pure species at the current T and P of the solution.
Definition IdealSolidSolnPhase.cpp:184
Cantera::IdealSolidSolnPhase::standardConcentration
double standardConcentration(size_t k) const override
The standard concentration used to normalize the generalized concentration.
Definition IdealSolidSolnPhase.cpp:104
Cantera::IdealSolidSolnPhase::setStandardConcentrationModel
void setStandardConcentrationModel(const string &model)
Set the form for the standard and generalized concentrations.
Definition IdealSolidSolnPhase.cpp:422
Cantera::IdealSolidSolnPhase::getIntEnergy_RT_ref
void getIntEnergy_RT_ref(double *urt) const override
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
Definition IdealSolidSolnPhase.cpp:264
Cantera::IdealSolidSolnPhase::getEnthalpy_RT
void getEnthalpy_RT(double *hrt) const override
Get the array of nondimensional Enthalpy functions for the standard state species at the current T an...
Definition IdealSolidSolnPhase.cpp:202
Cantera::IdealSolidSolnPhase::getEntropy_R_ref
void getEntropy_R_ref(double *er) const override
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
Definition IdealSolidSolnPhase.cpp:273
Cantera::IdealSolidSolnPhase::m_s0_R
vector< double > m_s0_R
Vector containing the species reference entropies at T = m_tlast.
Definition IdealSolidSolnPhase.h:612
Cantera::IdealSolidSolnPhase::getGibbs_RT
void getGibbs_RT(double *grt) const override
Get the nondimensional Gibbs function for the species standard states at the current T and P of the s...
Definition IdealSolidSolnPhase.cpp:193
Cantera::IdealSolidSolnPhase::entropy_mole
double entropy_mole() const override
Molar entropy of the solution.
Definition IdealSolidSolnPhase.cpp:33
Cantera::IdealSolidSolnPhase::m_formGC
int m_formGC
The standard concentrations can have one of three different forms: 0 = 'unity', 1 = 'species-molar-vo...
Definition IdealSolidSolnPhase.h:575
Cantera::IdealSolidSolnPhase::m_speciesMolarVolume
vector< double > m_speciesMolarVolume
Vector of molar volumes for each species in the solution.
Definition IdealSolidSolnPhase.h:599
Cantera::IdealSolidSolnPhase::getCp_R_ref
void getCp_R_ref(double *cprt) const override
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
Definition IdealSolidSolnPhase.cpp:281
Cantera::IdealSolidSolnPhase::getStandardVolumes
void getStandardVolumes(double *vol) const override
Get the molar volumes of the species standard states at the current T and P of the solution.
Definition IdealSolidSolnPhase.cpp:232
Cantera::IdealSolidSolnPhase::cp_mole
double cp_mole() const override
Molar heat capacity at constant pressure of the solution.
Definition IdealSolidSolnPhase.cpp:44
Cantera::IdealSolidSolnPhase::getIntEnergy_RT
void getIntEnergy_RT(double *urt) const override
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
Definition IdealSolidSolnPhase.cpp:217
Cantera::IdealSolidSolnPhase::standardConcentrationUnits
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
Definition IdealSolidSolnPhase.cpp:75
Cantera::IdealSolidSolnPhase::IdealSolidSolnPhase
IdealSolidSolnPhase(const string &infile="", const string &id="")
Construct and initialize an IdealSolidSolnPhase ThermoPhase object directly from an input file.
Definition IdealSolidSolnPhase.cpp:20
Cantera::IdealSolidSolnPhase::getPartialMolarCp
void getPartialMolarCp(double *cpbar) const override
Returns an array of partial molar Heat Capacities at constant pressure of the species in the solution...
Definition IdealSolidSolnPhase.cpp:169
Cantera::IdealSolidSolnPhase::compositionChanged
void compositionChanged() override
Apply changes to the state which are needed after the composition changes.
Definition IdealSolidSolnPhase.cpp:67
Cantera::IdealSolidSolnPhase::gibbs_mole
double gibbs_mole() const override
Molar Gibbs free energy of the solution.
Definition IdealSolidSolnPhase.cpp:38
Cantera::IdealSolidSolnPhase::m_cp0_R
vector< double > m_cp0_R
Vector containing the species reference constant pressure heat capacities at T = m_tlast.
Definition IdealSolidSolnPhase.h:606
Cantera::IdealSolidSolnPhase::addSpecies
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition IdealSolidSolnPhase.cpp:303
Cantera::IdealSolidSolnPhase::_updateThermo
virtual void _updateThermo() const
This function gets called for every call to functions in this class.
Definition IdealSolidSolnPhase.cpp:448
Cantera::IdealSolidSolnPhase::setToEquilState
void setToEquilState(const double *mu_RT) override
This method is used by the ChemEquil equilibrium solver.
Definition IdealSolidSolnPhase.cpp:392
Cantera::IdealSolidSolnPhase::getChemPotentials_RT
void getChemPotentials_RT(double *mu) const override
Get the array of non-dimensional species solution chemical potentials at the current T and P .
Definition IdealSolidSolnPhase.cpp:135
Cantera::IdealSolidSolnPhase::getGibbs_RT_ref
void getGibbs_RT_ref(double *grt) const override
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
Definition IdealSolidSolnPhase.cpp:247
Cantera::IdealSolidSolnPhase::getActivityCoefficients
void getActivityCoefficients(double *ac) const override
Get the array of species activity coefficients.
Definition IdealSolidSolnPhase.cpp:117
Cantera::IdealSolidSolnPhase::m_expg0_RT
vector< double > m_expg0_RT
Vector containing the species reference exp(-G/RT) functions at T = m_tlast.
Definition IdealSolidSolnPhase.h:616
Cantera::IdealSolidSolnPhase::getPartialMolarEntropies
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
Definition IdealSolidSolnPhase.cpp:160
Cantera::IdealSolidSolnPhase::cp_R_ref
const vector< double > & cp_R_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
Definition IdealSolidSolnPhase.h:515
Cantera::IdealSolidSolnPhase::m_Pcurrent
double m_Pcurrent
m_Pcurrent = The current pressure Since the density isn't a function of pressure, but only of the mol...
Definition IdealSolidSolnPhase.h:592
Cantera::IdealSolidSolnPhase::getEnthalpy_RT_ref
void getEnthalpy_RT_ref(double *hrt) const override
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
Definition IdealSolidSolnPhase.cpp:239
Cantera::IdealSolidSolnPhase::calcDensity
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
Definition IdealSolidSolnPhase.cpp:51
Cantera::IdealSolidSolnPhase::enthalpy_RT_ref
const vector< double > & enthalpy_RT_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
Definition IdealSolidSolnPhase.cpp:289
Cantera::MultiSpeciesThermo::update
virtual void update(double T, double *cp_R, double *h_RT, double *s_R) const
Compute the reference-state properties for all species.
Definition MultiSpeciesThermo.cpp:94
Cantera::Phase::molarDensity
virtual double molarDensity() const
Molar density (kmol/m^3).
Definition Phase.cpp:689
Cantera::Phase::assignDensity
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
Definition Phase.cpp:718
Cantera::Phase::setMoleFractions
virtual void setMoleFractions(const double *const x)
Set the mole fractions to the specified values.
Definition Phase.cpp:304
Cantera::Phase::m_kk
size_t m_kk
Number of species in the phase.
Definition Phase.h:947
Cantera::Phase::nDim
size_t nDim() const
Returns the number of spatial dimensions (1, 2, or 3)
Definition Phase.h:646
Cantera::Phase::temperature
double temperature() const
Temperature (K).
Definition Phase.h:662
Cantera::Phase::meanMolecularWeight
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
Definition Phase.h:760
Cantera::Phase::getMoleFractions
void getMoleFractions(double *const x) const
Get the species mole fraction vector.
Definition Phase.cpp:540
Cantera::Phase::sum_xlogx
double sum_xlogx() const
Evaluate .
Definition Phase.cpp:747
Cantera::Phase::speciesIndex
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
Definition Phase.cpp:138
Cantera::Phase::moleFraction
double moleFraction(size_t k) const
Return the mole fraction of a single species.
Definition Phase.cpp:545
Cantera::Phase::compositionChanged
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
Definition Phase.cpp:1026
Cantera::Phase::mean_X
double mean_X(const double *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
Definition Phase.cpp:737
Cantera::Phase::ready
virtual bool ready() const
Returns a bool indicating whether the object is ready for use.
Definition Phase.cpp:1006
Cantera::Phase::molecularWeight
double molecularWeight(size_t k) const
Molecular weight of species k.
Definition Phase.cpp:482
Cantera::Phase::species
shared_ptr< Species > species(const string &name) const
Return the Species object for the named species.
Definition Phase.cpp:977
Cantera::Phase::name
string name() const
Return the name of the phase.
Definition Phase.cpp:20
Cantera::ThermoPhase::getParameters
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
Definition ThermoPhase.cpp:1176
Cantera::ThermoPhase::RT
double RT() const
Return the Gas Constant multiplied by the current temperature.
Definition ThermoPhase.h:1077
Cantera::ThermoPhase::m_tlast
double m_tlast
last value of the temperature processed by reference state
Definition ThermoPhase.h:2149
Cantera::ThermoPhase::initThermo
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
Definition ThermoPhase.cpp:1093
Cantera::ThermoPhase::initThermoFile
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
Definition ThermoPhase.cpp:1072
Cantera::ThermoPhase::getSpeciesParameters
virtual void getSpeciesParameters(const string &name, AnyMap &speciesNode) const
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
Definition ThermoPhase.h:1979
Cantera::ThermoPhase::m_spthermo
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
Definition ThermoPhase.h:2126
Cantera::ThermoPhase::refPressure
virtual double refPressure() const
Returns the reference pressure in Pa.
Definition ThermoPhase.h:436
Cantera::ThermoPhase::addSpecies
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
Definition ThermoPhase.cpp:1131
Cantera::ThermoPhase::m_input
AnyMap m_input
Data supplied via setParameters.
Definition ThermoPhase.h:2130
Cantera::Units
A representation of the units associated with a dimensional quantity.
Definition Units.h:35
Cantera::caseInsensitiveEquals
bool caseInsensitiveEquals(const string &input, const string &test)
Case insensitive equality predicate.
Definition stringUtils.cpp:223
Cantera::GasConstant
const double GasConstant
Universal Gas Constant [J/kmol/K].
Definition ct_defs.h:120
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
Cantera::SmallNumber
const double SmallNumber
smallest number to compare to zero.
Definition ct_defs.h:158
Cantera::warn_deprecated
void warn_deprecated(const string &source, const AnyBase &node, const string &message)
A deprecation warning for syntax in an input file.
Definition AnyMap.cpp:1926
stringUtils.h
Contains declarations for string manipulation functions within Cantera.
utilities.h
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...