Cantera  2.3.0
vcs_prob.cpp
Go to the documentation of this file.
1 /**
2  * @file vcs_prob.cpp
3  * Implementation for the Interface class for the vcs thermo
4  * equilibrium solver package,
5  */
6 
7 // This file is part of Cantera. See License.txt in the top-level directory or
8 // at http://www.cantera.org/license.txt for license and copyright information.
9 
10 #include "cantera/equil/vcs_prob.h"
14 #include "cantera/equil/vcs_defs.h"
16 
17 #include <cstdio>
18 
19 using namespace std;
20 
21 namespace Cantera
22 {
23 
24 VCS_PROB::VCS_PROB(size_t nsp, size_t nel, size_t nph) :
25  prob_type(VCS_PROBTYPE_TP),
26  nspecies(nsp),
27  NSPECIES0(0),
28  ne(nel),
29  NE0(0),
30  NPhase(nph),
31  NPHASE0(0),
32  T(298.15),
33  PresPA(1.0),
34  Vol(0.0),
35  // The default is to not expect an initial estimate of the species
36  // concentrations
37  iest(-1),
38  tolmaj(1.0E-8),
39  tolmin(1.0E-6),
40  m_Iterations(0),
41  m_NumBasisOptimizations(0),
42  m_printLvl(0),
43  vcs_debug_print_lvl(0)
44 {
46  if (nspecies <= 0) {
47  throw CanteraError("VCS_PROB::VCS_PROB",
48  "number of species is zero or neg");
49  }
50  NE0 = ne;
51  if (ne <= 0) {
52  throw CanteraError("VCS_PROB::VCS_PROB",
53  "number of elements is zero or neg");
54  }
55  NPHASE0 = NPhase;
56  if (NPhase <= 0) {
57  throw CanteraError("VCS_PROB::VCS_PROB",
58  "number of phases is zero or neg");
59  }
60  if (nspecies < NPhase) {
61  throw CanteraError("VCS_PROB::VCS_PROB",
62  "number of species is less than number of phases");
63  }
64 
65  m_gibbsSpecies.resize(nspecies, 0.0);
66  w.resize(nspecies, 0.0);
67  mf.resize(nspecies, 0.0);
68  gai.resize(ne, 0.0);
71  VolPM.resize(nspecies, 0.0);
72  PhaseID.resize(nspecies, npos);
73  SpName.resize(nspecies, "");
74  ElName.resize(ne, "");
76  ElActive.resize(ne, 1);
77  WtSpecies.resize(nspecies, 0.0);
78  Charge.resize(nspecies, 0.0);
79  SpeciesThermo.resize(nspecies,0);
80  for (size_t kspec = 0; kspec < nspecies; kspec++) {
81  VCS_SPECIES_THERMO* ts_tmp = new VCS_SPECIES_THERMO(0, 0);
82  if (ts_tmp == 0) {
83  throw CanteraError("VCS_PROB::VCS_PROB",
84  "Failed to init a ts struct");
85  }
86  SpeciesThermo[kspec] = ts_tmp;
87  }
88  VPhaseList.resize(nph, 0);
89  for (size_t iphase = 0; iphase < NPhase; iphase++) {
90  VPhaseList[iphase] = new vcs_VolPhase();
91  }
92 }
93 
94 VCS_PROB::~VCS_PROB()
95 {
96  for (size_t i = 0; i < nspecies; i++) {
97  delete SpeciesThermo[i];
98  }
99  for (size_t iph = 0; iph < NPhase; iph++) {
100  delete VPhaseList[iph];
101  }
102 }
103 
104 void VCS_PROB::resizePhase(size_t nPhase, int force)
105 {
106  warn_deprecated("VCS_PROB::resizePhase",
107  "Unused. To be removed after Cantera 2.3.");
108  if (force || nPhase > NPHASE0) {
109  NPHASE0 = nPhase;
110  }
111 }
112 
113 void VCS_PROB::resizeSpecies(size_t nsp, int force)
114 {
115  warn_deprecated("VCS_PROB::resizeSpecies",
116  "Unused. To be removed after Cantera 2.3.");
117  if (force || nsp > NSPECIES0) {
118  m_gibbsSpecies.resize(nsp, 0.0);
119  w.resize(nsp, 0.0);
120  mf.resize(nsp, 0.0);
121  FormulaMatrix.resize(nsp, NE0, 0.0);
123  VolPM.resize(nsp, 0.0);
124  PhaseID.resize(nsp, 0);
125  SpName.resize(nsp, "");
126  WtSpecies.resize(nsp, 0.0);
127  Charge.resize(nsp, 0.0);
128  NSPECIES0 = nsp;
129  if (nspecies > NSPECIES0) {
130  throw CanteraError("VCS_PROB::resizeSpecies", "shouldn't be here");
131  }
132  }
133 }
134 
135 void VCS_PROB::resizeElements(size_t nel, int force)
136 {
137  if (force || nel > NE0) {
138  gai.resize(nel, 0.0);
139  FormulaMatrix.resize(NSPECIES0, nel, 0.0);
140  ElName.resize(nel, "");
141  m_elType.resize(nel, VCS_ELEM_TYPE_ABSPOS);
142  ElActive.resize(nel, 1);
143  NE0 = nel;
144  ne = std::min(ne, NE0);
145  }
146 }
147 
149 {
150  gai.assign(gai.size(), 0.0);
151  for (size_t j = 0; j < ne; j++) {
152  for (size_t kspec = 0; kspec < nspecies; kspec++) {
154  gai[j] += FormulaMatrix(kspec,j) * w[kspec];
155  }
156  }
157  }
158 }
159 
160 void VCS_PROB::prob_report(int print_lvl)
161 {
162  m_printLvl = print_lvl;
163 
164  // Printout the species information: PhaseID's and mole nums
165  if (m_printLvl > 0) {
166  writeline('=', 80, true, true);
167  writeline('=', 20, false);
168  plogf(" VCS_PROB: PROBLEM STATEMENT ");
169  writeline('=', 31);
170  writeline('=', 80);
171  plogf("\n");
172  if (prob_type == 0) {
173  plogf("\tSolve a constant T, P problem:\n");
174  plogf("\t\tT = %g K\n", T);
175  double pres_atm = PresPA / 1.01325E5;
176 
177  plogf("\t\tPres = %g atm\n", pres_atm);
178  } else {
179  throw CanteraError("VCS_PROB::prob_report", "Unknown problem type");
180  }
181  plogf("\n");
182  plogf(" Phase IDs of species\n");
183  plogf(" species phaseID phaseName ");
184  plogf(" Initial_Estimated_Moles Species_Type\n");
185  for (size_t i = 0; i < nspecies; i++) {
186  vcs_VolPhase* Vphase = VPhaseList[PhaseID[i]];
187  plogf("%16s %5d %16s", SpName[i], PhaseID[i],
188  Vphase->PhaseName);
189  if (iest >= 0) {
190  plogf(" %-10.5g", w[i]);
191  } else {
192  plogf(" N/A");
193  }
195  plogf(" Mol_Num");
197  plogf(" Voltage");
198  } else {
199  plogf(" ");
200  }
201  plogf("\n");
202  }
203 
204  // Printout of the Phase structure information
205  writeline('-', 80, true, true);
206  plogf(" Information about phases\n");
207  plogf(" PhaseName PhaseNum SingSpec GasPhase "
208  " EqnState NumSpec");
209  plogf(" TMolesInert TKmoles\n");
210 
211  for (size_t iphase = 0; iphase < NPhase; iphase++) {
212  vcs_VolPhase* Vphase = VPhaseList[iphase];
213  plogf("%16s %5d %5d %8d ", Vphase->PhaseName,
214  Vphase->VP_ID_, Vphase->m_singleSpecies, Vphase->m_gasPhase);
215  plogf("%16s %8d %16e ", Vphase->eos_name(),
216  Vphase->nSpecies(), Vphase->totalMolesInert());
217  if (iest >= 0) {
218  plogf("%16e\n", Vphase->totalMoles());
219  } else {
220  plogf(" N/A\n");
221  }
222  }
223 
224  plogf("\nElemental Abundances: ");
225  plogf(" Target_kmol ElemType ElActive\n");
226  for (size_t i = 0; i < ne; ++i) {
227  writeline(' ', 26, false);
228  plogf("%-2.2s", ElName[i]);
229  plogf("%20.12E ", gai[i]);
230  plogf("%3d %3d\n", m_elType[i], ElActive[i]);
231  }
232 
233  plogf("\nChemical Potentials: (J/kmol)\n");
234  plogf(" Species (phase) "
235  " SS0ChemPot StarChemPot\n");
236  for (size_t iphase = 0; iphase < NPhase; iphase++) {
237  vcs_VolPhase* Vphase = VPhaseList[iphase];
238  Vphase->setState_TP(T, PresPA);
239  for (size_t kindex = 0; kindex < Vphase->nSpecies(); kindex++) {
240  size_t kglob = Vphase->spGlobalIndexVCS(kindex);
241  plogf("%16s ", SpName[kglob]);
242  if (kindex == 0) {
243  plogf("%16s", Vphase->PhaseName);
244  } else {
245  plogf(" ");
246  }
247 
248  plogf("%16g %16g\n", Vphase->G0_calc_one(kindex),
249  Vphase->GStar_calc_one(kindex));
250  }
251  }
252  writeline('=', 80, true, true);
253  writeline('=', 20, false);
254  plogf(" VCS_PROB: END OF PROBLEM STATEMENT ");
255  writeline('=', 24);
256  writeline('=', 80);
257  plogf("\n");
258  }
259 }
260 
262 {
263  size_t neVP = volPhase->nElemConstraints();
264 
265  // Loop through the elements in the vol phase object
266  for (size_t eVP = 0; eVP < neVP; eVP++) {
267  size_t foundPos = npos;
268  std::string enVP = volPhase->elementName(eVP);
269 
270  // Search for matches with the existing elements. If found, then fill in
271  // the entry in the global mapping array.
272  for (size_t e = 0; e < ne; e++) {
273  std::string en = ElName[e];
274  if (!strcmp(enVP.c_str(), en.c_str())) {
275  volPhase->setElemGlobalIndex(eVP, e);
276  foundPos = e;
277  }
278  }
279  if (foundPos == npos) {
280  int elType = volPhase->elementType(eVP);
281  int elactive = volPhase->elementActive(eVP);
282  size_t e = addElement(enVP.c_str(), elType, elactive);
283  volPhase->setElemGlobalIndex(eVP, e);
284  }
285  }
286 }
287 
288 size_t VCS_PROB::addElement(const char* elNameNew, int elType, int elactive)
289 {
290  if (!elNameNew) {
291  throw CanteraError("VCS_PROB::addElement",
292  "error: element must have a name");
293  }
294  size_t nel = ne + 1;
295  resizeElements(nel, 1);
296  ne = nel;
297  ElName[ne-1] = elNameNew;
298  m_elType[ne-1] = elType;
299  ElActive[ne-1] = elactive;
300  return ne - 1;
301 }
302 
303 size_t VCS_PROB::addOnePhaseSpecies(vcs_VolPhase* volPhase, size_t k, size_t kT)
304 {
305  if (kT > nspecies) {
306  // Need to expand the number of species here
307  throw CanteraError("VCS_PROB::addOnePhaseSpecies", "Shouldn't be here");
308  }
309  const Array2D& fm = volPhase->getFormulaMatrix();
310  for (size_t eVP = 0; eVP < volPhase->nElemConstraints(); eVP++) {
311  size_t e = volPhase->elemGlobalIndex(eVP);
312  AssertThrowMsg(e != npos, "VCS_PROB::addOnePhaseSpecies",
313  "element not found");
314  FormulaMatrix(kT,e) = fm(k,eVP);
315  }
316 
317  // Tell the phase object about the current position of the species within
318  // the global species vector
319  volPhase->setSpGlobalIndexVCS(k, kT);
320  return kT;
321 }
322 
323 void VCS_PROB::reportCSV(const std::string& reportFile)
324 {
325  FILE* FP = fopen(reportFile.c_str(), "w");
326  if (!FP) {
327  throw CanteraError("VCS_PROB::reportCSV", "Failure to open file");
328  }
329 
330  vector_fp volPM(nspecies, 0.0);
331  vector_fp activity(nspecies, 0.0);
332  vector_fp ac(nspecies, 0.0);
333  vector_fp mu(nspecies, 0.0);
334  vector_fp mu0(nspecies, 0.0);
335  vector_fp molalities(nspecies, 0.0);
336  double vol = 0.0;
337  size_t iK = 0;
338  for (size_t iphase = 0; iphase < NPhase; iphase++) {
339  size_t istart = iK;
340  vcs_VolPhase* volP = VPhaseList[iphase];
341  size_t nSpeciesPhase = volP->nSpecies();
342  volPM.resize(nSpeciesPhase, 0.0);
343  volP->sendToVCS_VolPM(&volPM[0]);
344 
345  double TMolesPhase = volP->totalMoles();
346  double VolPhaseVolumes = 0.0;
347  for (size_t k = 0; k < nSpeciesPhase; k++) {
348  iK++;
349  VolPhaseVolumes += volPM[istart + k] * mf[istart + k];
350  }
351  VolPhaseVolumes *= TMolesPhase;
352  vol += VolPhaseVolumes;
353  }
354 
355  fprintf(FP,"--------------------- VCS_MULTIPHASE_EQUIL FINAL REPORT"
356  " -----------------------------\n");
357  fprintf(FP,"Temperature = %11.5g kelvin\n", T);
358  fprintf(FP,"Pressure = %11.5g Pascal\n", PresPA);
359  fprintf(FP,"Total Volume = %11.5g m**3\n", vol);
360  fprintf(FP,"Number Basis optimizations = %d\n", m_NumBasisOptimizations);
361  fprintf(FP,"Number VCS iterations = %d\n", m_Iterations);
362 
363  iK = 0;
364  for (size_t iphase = 0; iphase < NPhase; iphase++) {
365  size_t istart = iK;
366 
367  vcs_VolPhase* volP = VPhaseList[iphase];
368  const ThermoPhase* tp = volP->ptrThermoPhase();
369  string phaseName = volP->PhaseName;
370  size_t nSpeciesPhase = volP->nSpecies();
371  volP->sendToVCS_VolPM(&volPM[0]);
372  double TMolesPhase = volP->totalMoles();
373  activity.resize(nSpeciesPhase, 0.0);
374  ac.resize(nSpeciesPhase, 0.0);
375  mu0.resize(nSpeciesPhase, 0.0);
376  mu.resize(nSpeciesPhase, 0.0);
377  volPM.resize(nSpeciesPhase, 0.0);
378  molalities.resize(nSpeciesPhase, 0.0);
379  int actConvention = tp->activityConvention();
380  tp->getActivities(&activity[0]);
381  tp->getActivityCoefficients(&ac[0]);
382  tp->getStandardChemPotentials(&mu0[0]);
383  tp->getPartialMolarVolumes(&volPM[0]);
384  tp->getChemPotentials(&mu[0]);
385  double VolPhaseVolumes = 0.0;
386  for (size_t k = 0; k < nSpeciesPhase; k++) {
387  VolPhaseVolumes += volPM[k] * mf[istart + k];
388  }
389  VolPhaseVolumes *= TMolesPhase;
390  vol += VolPhaseVolumes;
391 
392  if (actConvention == 1) {
393  const MolalityVPSSTP* mTP = static_cast<const MolalityVPSSTP*>(tp);
394  tp->getChemPotentials(&mu[0]);
395  mTP->getMolalities(&molalities[0]);
396  tp->getChemPotentials(&mu[0]);
397 
398  if (iphase == 0) {
399  fprintf(FP," Name, Phase, PhaseMoles, Mole_Fract, "
400  "Molalities, ActCoeff, Activity,"
401  "ChemPot_SS0, ChemPot, mole_num, PMVol, Phase_Volume\n");
402 
403  fprintf(FP," , , (kmol), , "
404  " , , ,"
405  " (J/kmol), (J/kmol), (kmol), (m**3/kmol), (m**3)\n");
406  }
407  for (size_t k = 0; k < nSpeciesPhase; k++) {
408  std::string sName = tp->speciesName(k);
409  fprintf(FP,"%12s, %11s, %11.3e, %11.3e, %11.3e, %11.3e, %11.3e,"
410  "%11.3e, %11.3e, %11.3e, %11.3e, %11.3e\n",
411  sName.c_str(),
412  phaseName.c_str(), TMolesPhase,
413  mf[istart + k], molalities[k], ac[k], activity[k],
414  mu0[k]*1.0E-6, mu[k]*1.0E-6,
415  mf[istart + k] * TMolesPhase,
416  volPM[k], VolPhaseVolumes);
417  }
418  } else {
419  if (iphase == 0) {
420  fprintf(FP," Name, Phase, PhaseMoles, Mole_Fract, "
421  "Molalities, ActCoeff, Activity,"
422  " ChemPotSS0, ChemPot, mole_num, PMVol, Phase_Volume\n");
423 
424  fprintf(FP," , , (kmol), , "
425  " , , ,"
426  " (J/kmol), (J/kmol), (kmol), (m**3/kmol), (m**3)\n");
427  }
428  for (size_t k = 0; k < nSpeciesPhase; k++) {
429  molalities[k] = 0.0;
430  }
431  for (size_t k = 0; k < nSpeciesPhase; k++) {
432  std::string sName = tp->speciesName(k);
433  fprintf(FP,"%12s, %11s, %11.3e, %11.3e, %11.3e, %11.3e, %11.3e, "
434  "%11.3e, %11.3e,% 11.3e, %11.3e, %11.3e\n",
435  sName.c_str(),
436  phaseName.c_str(), TMolesPhase,
437  mf[istart + k], molalities[k], ac[k],
438  activity[k], mu0[k]*1.0E-6, mu[k]*1.0E-6,
439  mf[istart + k] * TMolesPhase,
440  volPM[k], VolPhaseVolumes);
441  }
442  }
443 
444  iK += nSpeciesPhase;
445  }
446  fclose(FP);
447 }
448 
450 {
451  vcs_debug_print_lvl = lvl;
452 }
453 
454 }
vector_fp VolPM
Partial Molar Volumes of species.
Definition: vcs_prob.h:113
int m_printLvl
Print level for print routines.
Definition: vcs_prob.h:175
bool m_singleSpecies
If true, this phase consists of a single species.
Definition: vcs_VolPhase.h:566
double totalMolesInert() const
Returns the value of the total kmol of inert in the phase.
void resize(size_t n, size_t m, doublereal v=0.0)
Resize the array, and fill the new entries with &#39;v&#39;.
Definition: Array.h:112
size_t nElemConstraints() const
Returns the number of element constraints.
const size_t npos
index returned by functions to indicate "no position"
Definition: ct_defs.h:165
std::vector< std::string > ElName
vector of strings containing the element names
Definition: vcs_prob.h:136
int iest
Specification of the initial estimate method.
Definition: vcs_prob.h:121
size_t NSPECIES0
Species number used to size data structures.
Definition: vcs_prob.h:33
const Array2D & getFormulaMatrix() const
Get a constant form of the Species Formula Matrix.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Definition: global.cpp:54
size_t spGlobalIndexVCS(const size_t spIndex) const
Return the Global VCS index of the kth species in the phase.
STL namespace.
size_t addOnePhaseSpecies(vcs_VolPhase *volPhase, size_t k, size_t kT)
This routines adds entries for the formula matrix for one species.
Definition: vcs_prob.cpp:303
void resizePhase(size_t nPhase, int force)
Resizes all of the phase lists within the structure.
Definition: vcs_prob.cpp:104
std::string elementName(const size_t e) const
Name of the element constraint with index e.
std::string PhaseName
String name for the phase.
Definition: vcs_VolPhase.h:653
size_t elemGlobalIndex(const size_t e) const
Returns the global index of the local element index for the phase.
std::vector< vcs_VolPhase * > VPhaseList
Array of phase structures.
Definition: vcs_prob.h:158
int m_Iterations
Number of iterations. This is an output variable.
Definition: vcs_prob.h:169
A class for 2D arrays stored in column-major (Fortran-compatible) form.
Definition: Array.h:31
Header for intermediate ThermoPhase object for phases which employ molality based activity coefficien...
#define VCS_PROBTYPE_TP
Current, it is always done holding T and P constant.
Definition: vcs_defs.h:34
void resizeElements(size_t nel, int force)
Resizes all of the element lists within the structure.
Definition: vcs_prob.cpp:135
std::vector< size_t > PhaseID
Mapping between the species and the phases.
Definition: vcs_prob.h:130
size_t VP_ID_
Original ID of the phase in the problem.
Definition: vcs_VolPhase.h:563
Header for the object representing each phase within vcs.
double GStar_calc_one(size_t kspec) const
Gibbs free energy calculation for standard state of one species.
#define VCS_SPECIES_TYPE_MOLNUM
Unknown refers to mole number of a single species.
Definition: vcs_defs.h:301
#define VCS_ELEM_TYPE_ABSPOS
Normal element constraint consisting of positive coefficients for the formula matrix.
Definition: vcs_defs.h:248
Defines and definitions within the vcs package.
vector_fp gai
Element abundances for jth element.
Definition: vcs_prob.h:72
void addPhaseElements(vcs_VolPhase *volPhase)
Add elements to the local element list.
Definition: vcs_prob.cpp:261
Array2D FormulaMatrix
Formula Matrix for the problem.
Definition: vcs_prob.h:78
void setDebugPrintLvl(int vcs_debug_print_lvl)
Set the debug level.
Definition: vcs_prob.cpp:449
Internal declarations for the VCSnonideal package.
vector_int ElActive
Specifies whether an element constraint is active.
Definition: vcs_prob.h:146
std::string eos_name() const
Return the name corresponding to the equation of state.
vector_int SpeciesUnknownType
Specifies the species unknown type.
Definition: vcs_prob.h:91
Header for the Interface class for the vcs thermo equilibrium solver package,.
size_t NPHASE0
Number of phases used to size data structures.
Definition: vcs_prob.h:46
vector_fp Charge
Charge of each species.
Definition: vcs_prob.h:155
size_t nspecies
Total number of species in the problems.
Definition: vcs_prob.h:30
vector_fp w
Total number of moles of the kth species.
Definition: vcs_prob.h:61
size_t nSpecies() const
Return the number of species in the phase.
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:65
int elementType(const size_t e) const
Type of the element constraint with index e.
void prob_report(int print_lvl)
Print out the problem specification in all generality as it currently exists in the VCS_PROB object...
Definition: vcs_prob.cpp:160
bool m_gasPhase
If true, this phase is a gas-phase like phase.
Definition: vcs_VolPhase.h:573
double totalMoles() const
Return the total moles in the phase.
vector_fp WtSpecies
Molecular weight of species.
Definition: vcs_prob.h:152
vector_fp mf
Mole fraction vector.
Definition: vcs_prob.h:65
int m_NumBasisOptimizations
Number of basis optimizations used. This is an output variable.
Definition: vcs_prob.h:172
size_t addElement(const char *elNameNew, int elType, int elactive)
This routine resizes the number of elements in the VCS_PROB object by adding a new element to the end...
Definition: vcs_prob.cpp:288
double PresPA
Pressure.
Definition: vcs_prob.h:100
Phase information and Phase calculations for vcs.
Definition: vcs_VolPhase.h:81
size_t ne
Number of element constraints in the equilibrium problem.
Definition: vcs_prob.h:36
vector_fp m_gibbsSpecies
Vector of chemical potentials of the species.
Definition: vcs_prob.h:50
int prob_type
Problem type.
Definition: vcs_prob.h:27
#define AssertThrowMsg(expr, procedure,...)
Assertion must be true or an error is thrown.
Definition: ctexceptions.h:270
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
Definition: ct_defs.h:157
std::vector< std::string > SpName
Vector of strings containing the species names.
Definition: vcs_prob.h:133
vector_int m_elType
vector of Element types
Definition: vcs_prob.h:139
size_t NE0
Number of element constraints used to size data structures involving elements.
Definition: vcs_prob.h:40
void setSpGlobalIndexVCS(const size_t spIndex, const size_t spGlobalIndex)
set the Global VCS index of the kth species in the phase
double T
Temperature (Kelvin)
Definition: vcs_prob.h:97
void resizeSpecies(size_t nsp, int force)
Resizes all of the species lists within the structure.
Definition: vcs_prob.cpp:113
#define plogf
define this Cantera function to replace printf
Definition: vcs_internal.h:18
#define VCS_SPECIES_TYPE_INTERFACIALVOLTAGE
Unknown refers to the voltage level of a phase.
Definition: vcs_defs.h:309
void set_gai()
Calculate the element abundance vector from the mole numbers.
Definition: vcs_prob.cpp:148
size_t NPhase
Number of phases in the problem.
Definition: vcs_prob.h:43
Namespace for the Cantera kernel.
Definition: application.cpp:29
void setState_TP(const double temperature_Kelvin, const double pressure_PA)
Sets the temperature and pressure in this object and underlying ThermoPhase objects.
int vcs_debug_print_lvl
Debug print lvl.
Definition: vcs_prob.h:178
double G0_calc_one(size_t kspec) const
Gibbs free energy calculation at a temperature for the reference state of a species, return a value for one species.
void setElemGlobalIndex(const size_t eLocal, const size_t eGlobal)
sets a local phase element to a global index value