Cantera  2.4.0
ThermoFactory.cpp
Go to the documentation of this file.
1 /**
2  * @file ThermoFactory.cpp
3  * Definitions for the factory class that can create known ThermoPhase objects
4  * (see \ref thermoprops and class \link Cantera::ThermoFactory ThermoFactory\endlink).
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 
11 
12 #include "cantera/thermo/Species.h"
18 
37 #include "cantera/thermo/HMWSoln.h"
43 
44 using namespace std;
45 
46 namespace Cantera
47 {
48 
49 ThermoFactory* ThermoFactory::s_factory = 0;
50 std::mutex ThermoFactory::thermo_mutex;
51 
52 ThermoFactory::ThermoFactory()
53 {
54  reg("IdealGas", []() { return new IdealGasPhase(); });
55  reg("Incompressible", []() { return new ConstDensityThermo(); });
56  reg("Surface", []() { return new SurfPhase(); });
57  reg("Edge", []() { return new EdgePhase(); });
58  reg("Metal", []() { return new MetalPhase(); });
59  reg("StoichSubstance", []() { return new StoichSubstance(); });
60  reg("PureFluid", []() { return new PureFluidPhase(); });
61  reg("LatticeSolid", []() { return new LatticeSolidPhase(); });
62  reg("Lattice", []() { return new LatticePhase(); });
63  reg("HMW", []() { return new HMWSoln(); });
64  reg("IdealSolidSolution", []() { return new IdealSolidSolnPhase(); });
65  reg("DebyeHuckel", []() { return new DebyeHuckel(); });
66  reg("IdealMolalSolution", []() { return new IdealMolalSoln(); });
67  reg("IdealGasVPSS", []() { return new IdealSolnGasVPSS(); });
68  m_synonyms["IdealGasVPSS"] = "IdealSolnVPSS";
69  reg("MineralEQ3", []() { return new MineralEQ3(); });
70  reg("MetalSHEelectrons", []() { return new MetalSHEelectrons(); });
71  reg("Margules", []() { return new MargulesVPSSTP(); });
72  reg("PhaseCombo_Interaction", []() { return new PhaseCombo_Interaction(); });
73  reg("IonsFromNeutralMolecule", []() { return new IonsFromNeutralVPSSTP(); });
74  reg("FixedChemPot", []() { return new FixedChemPotSSTP(); });
75  reg("MolarityIonicVPSSTP", []() { return new MolarityIonicVPSSTP(); });
76  reg("Redlich-Kister", []() { return new RedlichKisterVPSSTP(); });
77  reg("RedlichKwong", []() { return new RedlichKwongMFTP(); });
78  m_synonyms["RedlichKwongMFTP"] = "RedlichKwong";
79  reg("MaskellSolidSolnPhase", []() { return new MaskellSolidSolnPhase(); });
80 }
81 
82 ThermoPhase* ThermoFactory::newThermoPhase(const std::string& model)
83 {
84  return create(model);
85 }
86 
88 {
89  string model = xmlphase.child("thermo")["model"];
90  unique_ptr<ThermoPhase> t(newThermoPhase(model));
91  importPhase(xmlphase, t.get());
92  return t.release();
93 }
94 
95 ThermoPhase* newPhase(const std::string& infile, std::string id)
96 {
97  XML_Node* root = get_XML_File(infile);
98  if (id == "-") {
99  id = "";
100  }
101  XML_Node* xphase = get_XML_NameID("phase", "#"+id, root);
102  if (!xphase) {
103  throw CanteraError("newPhase",
104  "Couldn't find phase named \"" + id + "\" in file, " + infile);
105  }
106  return newPhase(*xphase);
107 }
108 
109 //! Gather a vector of pointers to XML_Nodes for a phase
110 /*!
111  * @param spDataNodeList Output vector of pointer to XML_Nodes which contain
112  * the species XML_Nodes for the species in the current phase.
113  * @param spNamesList Output Vector of strings, which contain the names
114  * of the species in the phase
115  * @param spRuleList Output Vector of ints, which contain the value of
116  * sprule for each species in the phase
117  * @param spArray_names Vector of pointers to the XML_Nodes which contains
118  * the names of the species in the phase
119  * @param spArray_dbases Input vector of pointers to species data bases. We
120  * search each data base for the required species
121  * names
122  * @param sprule Input vector of sprule values
123  */
124 static void formSpeciesXMLNodeList(std::vector<XML_Node*> &spDataNodeList,
125  std::vector<std::string> &spNamesList,
126  vector_int &spRuleList,
127  const std::vector<XML_Node*> spArray_names,
128  const std::vector<XML_Node*> spArray_dbases,
129  const vector_int sprule)
130 {
131  // used to check that each species is declared only once
132  std::map<std::string, bool> declared;
133 
134  for (size_t jsp = 0; jsp < spArray_dbases.size(); jsp++) {
135  const XML_Node& speciesArray = *spArray_names[jsp];
136 
137  // Get the top XML for the database
138  const XML_Node* db = spArray_dbases[jsp];
139 
140  // Get the array of species name strings and then count them
141  std::vector<std::string> spnames;
142  getStringArray(speciesArray, spnames);
143  size_t nsp = spnames.size();
144 
145  // if 'all' is specified as the one and only species in the
146  // spArray_names field, then add all species defined in the
147  // corresponding database to the phase
148  if (nsp == 1 && spnames[0] == "all") {
149  std::vector<XML_Node*> allsp = db->getChildren("species");
150  nsp = allsp.size();
151  spnames.resize(nsp);
152  for (size_t nn = 0; nn < nsp; nn++) {
153  string stemp = (*allsp[nn])["name"];
154  if (!declared[stemp] || sprule[jsp] < 10) {
155  declared[stemp] = true;
156  spNamesList.push_back(stemp);
157  spDataNodeList.push_back(allsp[nn]);
158  spRuleList.push_back(sprule[jsp]);
159  }
160  }
161  } else if (nsp == 1 && spnames[0] == "unique") {
162  std::vector<XML_Node*> allsp = db->getChildren("species");
163  nsp = allsp.size();
164  spnames.resize(nsp);
165  for (size_t nn = 0; nn < nsp; nn++) {
166  string stemp = (*allsp[nn])["name"];
167  if (!declared[stemp]) {
168  declared[stemp] = true;
169  spNamesList.push_back(stemp);
170  spDataNodeList.push_back(allsp[nn]);
171  spRuleList.push_back(sprule[jsp]);
172  }
173  }
174  } else {
175  std::map<std::string, XML_Node*> speciesNodes;
176  for (size_t k = 0; k < db->nChildren(); k++) {
177  XML_Node& child = db->child(k);
178  speciesNodes[child["name"]] = &child;
179  }
180  for (size_t k = 0; k < nsp; k++) {
181  string stemp = spnames[k];
182  if (!declared[stemp] || sprule[jsp] < 10) {
183  declared[stemp] = true;
184  // Find the species in the database by name.
185  auto iter = speciesNodes.find(stemp);
186  if (iter == speciesNodes.end()) {
187  throw CanteraError("importPhase","no data for species, \""
188  + stemp + "\"");
189  }
190  spNamesList.push_back(stemp);
191  spDataNodeList.push_back(iter->second);
192  spRuleList.push_back(sprule[jsp]);
193  }
194  }
195  }
196  }
197 }
198 
200 {
201  // Check the the supplied XML node in fact represents a phase.
202  if (phase.name() != "phase") {
203  throw CanteraError("importPhase",
204  "Current const XML_Node named, " + phase.name() +
205  ", is not a phase element.");
206  }
207 
208  // In this section of code, we get the reference to the phase XML tree
209  // within the ThermoPhase object. Then, we clear it and fill it with the
210  // current information that we are about to use to construct the object. We
211  // will then be able to resurrect the information later by calling xml().
212  th->setXMLdata(phase);
213 
214  // set the id attribute of the phase to the 'id' attribute in the XML tree.
215  th->setID(phase.id());
216  th->setName(phase.id());
217 
218  // Number of spatial dimensions. Defaults to 3 (bulk phase)
219  if (phase.hasAttrib("dim")) {
220  int idim = intValue(phase["dim"]);
221  if (idim < 1 || idim > 3) {
222  throw CanteraError("importPhase",
223  "phase, " + th->id() +
224  ", has unphysical number of dimensions: " + phase["dim"]);
225  }
226  th->setNDim(idim);
227  } else {
228  th->setNDim(3); // default
229  }
230 
231  // Set equation of state parameters. The parameters are specific to each
232  // subclass of ThermoPhase, so this is done by method setParametersFromXML
233  // in each subclass.
234  const XML_Node& eos = phase.child("thermo");
235  if (phase.hasChild("thermo")) {
236  th->setParametersFromXML(eos);
237  } else {
238  throw CanteraError("importPhase",
239  " phase, " + th->id() +
240  ", XML_Node does not have a \"thermo\" XML_Node");
241  }
242 
243  VPStandardStateTP* vpss_ptr = 0;
244  int ssConvention = th->standardStateConvention();
245  if (ssConvention == cSS_CONVENTION_VPSS) {
246  vpss_ptr = dynamic_cast <VPStandardStateTP*>(th);
247  if (vpss_ptr == 0) {
248  throw CanteraError("importPhase",
249  "phase, " + th->id() + ", was VPSS, but dynamic cast failed");
250  }
251  }
252 
253  // Add the elements.
254  if (ssConvention != cSS_CONVENTION_SLAVE) {
255  installElements(*th, phase);
256  }
257 
258  // Add the species.
259  //
260  // Species definitions may be imported from multiple sources. For each one,
261  // a speciesArray element must be present.
262  vector<XML_Node*> sparrays = phase.getChildren("speciesArray");
263  if (ssConvention != cSS_CONVENTION_SLAVE && sparrays.empty()) {
264  throw CanteraError("importPhase",
265  "phase, " + th->id() + ", has zero \"speciesArray\" XML nodes.\n"
266  + " There must be at least one speciesArray nodes "
267  "with one or more species");
268  }
269  vector<XML_Node*> dbases;
270  vector_int sprule(sparrays.size(),0);
271 
272  // Default behavior when importing from CTI/XML is for undefined elements to
273  // be treated as an error
275 
276  // loop over the speciesArray elements
277  for (size_t jsp = 0; jsp < sparrays.size(); jsp++) {
278  const XML_Node& speciesArray = *sparrays[jsp];
279 
280  // If the speciesArray element has a child element
281  //
282  // <skip element="undeclared">
283  //
284  // then set sprule[jsp] to 1, so that any species with an undeclared
285  // element will be quietly skipped when importing species. Additionally,
286  // if the skip node has the following attribute:
287  //
288  // <skip species="duplicate">
289  //
290  // then duplicate species names will not cause Cantera to throw an
291  // exception. Instead, the duplicate entry will be discarded.
292  if (speciesArray.hasChild("skip")) {
293  const XML_Node& sk = speciesArray.child("skip");
294  string eskip = sk["element"];
295  if (eskip == "undeclared") {
296  sprule[jsp] = 1;
297  }
298  string dskip = sk["species"];
299  if (dskip == "duplicate") {
300  sprule[jsp] += 10;
301  }
302  }
303 
304  // Get a pointer to the node containing the species definitions for the
305  // species declared in this speciesArray element. This may be in the
306  // local file containing the phase element, or may be in another file.
307  XML_Node* db = get_XML_Node(speciesArray["datasrc"], &phase.root());
308  if (db == 0) {
309  throw CanteraError("importPhase()",
310  " Can not find XML node for species database: "
311  + speciesArray["datasrc"]);
312  }
313 
314  // add this node to the list of species database nodes.
315  dbases.push_back(db);
316  }
317 
318  // Now, collect all the species names and all the XML_Node * pointers for
319  // those species in a single vector. This is where we decide what species
320  // are to be included in the phase. The logic is complicated enough that we
321  // put it in a separate routine.
322  std::vector<XML_Node*> spDataNodeList;
323  std::vector<std::string> spNamesList;
324  vector_int spRuleList;
325  formSpeciesXMLNodeList(spDataNodeList, spNamesList, spRuleList,
326  sparrays, dbases, sprule);
327 
328  size_t nsp = spDataNodeList.size();
329  if (ssConvention == cSS_CONVENTION_SLAVE && nsp > 0) {
330  throw CanteraError("importPhase()", "For Slave standard states, "
331  "number of species must be zero: {}", nsp);
332  }
333  for (size_t k = 0; k < nsp; k++) {
334  XML_Node* s = spDataNodeList[k];
335  AssertTrace(s != 0);
336  if (spRuleList[k]) {
338  }
339  th->addSpecies(newSpecies(*s));
340  if (vpss_ptr) {
341  const XML_Node* const ss = s->findByName("standardState");
342  std::string ss_model = (ss) ? ss->attrib("model") : "ideal-gas";
343  unique_ptr<PDSS> kPDSS(newPDSS(ss_model));
344  kPDSS->setParametersFromXML(*s);
345  vpss_ptr->installPDSS(k, std::move(kPDSS));
346  }
347  th->saveSpeciesData(k, s);
348  }
349 
350  // Done adding species. Perform any required subclass-specific
351  // initialization.
352  th->initThermo();
353 
354  // Perform any required subclass-specific initialization that requires the
355  // XML phase object
356  std::string id = "";
357  th->initThermoXML(phase, id);
358 }
359 
360 void installElements(Phase& th, const XML_Node& phaseNode)
361 {
362  // get the declared element names
363  if (!phaseNode.hasChild("elementArray")) {
364  throw CanteraError("installElements",
365  "phase XML node doesn't have \"elementArray\" XML Node");
366  }
367  XML_Node& elements = phaseNode.child("elementArray");
368  vector<string> enames;
369  getStringArray(elements, enames);
370 
371  // // element database defaults to elements.xml
372  string element_database = "elements.xml";
373  if (elements.hasAttrib("datasrc")) {
374  element_database = elements["datasrc"];
375  }
376 
377  XML_Node* doc = get_XML_File(element_database);
378  XML_Node* dbe = &doc->child("elementData");
379 
380  XML_Node& root = phaseNode.root();
381  XML_Node* local_db = 0;
382  if (root.hasChild("elementData")) {
383  local_db = &root.child("elementData");
384  }
385 
386  for (size_t i = 0; i < enames.size(); i++) {
387  // Find the element data
388  XML_Node* e = 0;
389  if (local_db) {
390  e = local_db->findByAttr("name",enames[i]);
391  }
392  if (!e) {
393  e = dbe->findByAttr("name",enames[i]);
394  }
395  if (!e) {
396  throw CanteraError("addElementsFromXML","no data for element "
397  +enames[i]);
398  }
399 
400  // Add the element
401  doublereal weight = 0.0;
402  if (e->hasAttrib("atomicWt")) {
403  weight = fpValue(e->attrib("atomicWt"));
404  }
405  int anum = 0;
406  if (e->hasAttrib("atomicNumber")) {
407  anum = intValue(e->attrib("atomicNumber"));
408  }
409  string symbol = e->attrib("name");
410  doublereal entropy298 = ENTROPY298_UNKNOWN;
411  if (e->hasChild("entropy298")) {
412  XML_Node& e298Node = e->child("entropy298");
413  if (e298Node.hasAttrib("value")) {
414  entropy298 = fpValueCheck(e298Node["value"]);
415  }
416  }
417  th.addElement(symbol, weight, anum, entropy298);
418  }
419 }
420 
421 const XML_Node* speciesXML_Node(const std::string& kname,
422  const XML_Node* phaseSpeciesData)
423 {
424  if (!phaseSpeciesData) {
425  return 0;
426  }
427  string jname = phaseSpeciesData->name();
428  if (jname != "speciesData") {
429  throw CanteraError("speciesXML_Node()",
430  "Unexpected phaseSpeciesData name: " + jname);
431  }
432  vector<XML_Node*> xspecies = phaseSpeciesData->getChildren("species");
433  for (size_t j = 0; j < xspecies.size(); j++) {
434  const XML_Node& sp = *xspecies[j];
435  jname = sp["name"];
436  if (jname == kname) {
437  return &sp;
438  }
439  }
440  return 0;
441 }
442 
443 }
Header for a general species thermodynamic property manager for a phase (see MultiSpeciesThermo).
XML_Node * get_XML_Node(const std::string &file_ID, XML_Node *root)
This routine will locate an XML node in either the input XML tree or in another input file specified ...
Definition: global.cpp:189
doublereal fpValue(const std::string &val)
Translate a string into one doublereal value.
std::vector< XML_Node * > getChildren(const std::string &name) const
Get a vector of pointers to XML_Node containing all of the children of the current node which match t...
Definition: xml.cpp:864
ThermoPhase object for the ideal molal equation of state (see Thermodynamic Properties and class Idea...
virtual bool addSpecies(shared_ptr< Species > spec)
Implementation of a multi-species Redlich-Kwong equation of state.
XML_Node * get_XML_File(const std::string &file, int debug)
Return a pointer to the XML tree for a Cantera input file.
Definition: global.cpp:105
std::string name() const
Returns the name of the XML node.
Definition: xml.h:370
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase, assuming an ideal solution model (see Thermodynamic Properties and class SurfPhase).
(see Thermodynamic Properties and class MargulesVPSSTP).
This phase object consists of a single component that can be a gas, a liquid, a mixed gas-liquid flui...
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:695
Header for intermediate ThermoPhase object for phases which employ the Margules Gibbs free energy for...
RedlichKisterVPSSTP is a derived class of GibbsExcessVPSSTP that employs the Redlich-Kister approxima...
Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state...
Header for intermediate ThermoPhase object for phases which consist of ions whose thermodynamics is c...
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
Definition file for a derived class of ThermoPhase that assumes either an ideal gas or ideal solution...
Class MetalPhase represents electrons in a metal.
Definition: MetalPhase.h:22
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
Class XML_Node is a tree-based representation of the contents of an XML file.
Definition: xml.h:97
STL namespace.
Class Phase is the base class for phases of matter, managing the species and elements in a phase...
Definition: Phase.h:96
A simple thermodynamic model for a bulk phase, assuming a lattice of solid atoms. ...
Definition: LatticePhase.h:230
const XML_Node * speciesXML_Node(const std::string &kname, const XML_Node *phaseSpeciesData)
Search an XML tree for species data.
Class FixedChemPotSSTP represents a stoichiometric (fixed composition) incompressible substance...
Header for a Thermo manager for incompressible ThermoPhases (see Thermodynamic Properties and ConstDe...
ThermoPhase * newPhase(const std::string &infile, std::string id)
Create and Initialize a ThermoPhase object from an XML input file.
bool hasAttrib(const std::string &a) const
Tests whether the current node has an attribute with a particular name.
Definition: xml.cpp:541
void saveSpeciesData(const size_t k, const XML_Node *const data)
Store a reference pointer to the XML tree containing the species data for this phase.
(see Thermodynamic Properties and class MolarityIonicVPSSTP).
Headers for the DebyeHuckel ThermoPhase object, which models dilute electrolyte solutions (see Thermo...
Class StoichSubstance represents a stoichiometric (fixed composition) incompressible substance...
Class DebyeHuckel represents a dilute liquid electrolyte phase which obeys the Debye Huckel formulati...
Definition: DebyeHuckel.h:558
Base class for a phase with thermodynamic properties.
Definition: ThermoPhase.h:93
Header file for a solid solution model following Maskell, Shaw, and Tye.
void setName(const std::string &nm)
Sets the string name for the phase.
Definition: Phase.cpp:83
std::vector< int > vector_int
Vector of ints.
Definition: ct_defs.h:159
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
void throwUndefinedElements()
Set the behavior when adding a species containing undefined elements to throw an exception.
Definition: Phase.cpp:821
A thermodynamic phase representing a one dimensional edge between two surfaces.
Definition: EdgePhase.h:30
shared_ptr< Species > newSpecies(const XML_Node &species_node)
Create a new Species object from a &#39;species&#39; XML_Node.
Definition: Species.cpp:35
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
Definition: SurfPhase.h:142
void ignoreUndefinedElements()
Set behavior when adding a species containing undefined elements to just skip the species...
Definition: Phase.cpp:813
Header file for the MetalSHEElectrons class, which represents the electrons in a metal that are consi...
Headers for the HMWSoln ThermoPhase object, which models concentrated electrolyte solutions (see Ther...
Header for a simple thermodynamics model of a bulk solid phase derived from ThermoPhase, assuming an ideal solution model based on a lattice of solid atoms (see Thermodynamic Properties and class LatticeSolidPhase).
ThermoPhase object for the ideal gas equation of state - workhorse for Cantera (see Thermodynamic Pro...
Header for a ThermoPhase class for a pure fluid phase consisting of gas, liquid, mixed-gas-liquid and...
Class MetalSHEelectrons represents electrons within a metal, adjacent to an aqueous electrolyte...
Header file for an ideal solid solution model with incompressible thermodynamics (see Thermodynamic P...
Overloads the virtual methods of class ThermoPhase to implement the incompressible equation of state...
Base class for exceptions thrown by Cantera classes.
Definition: ctexceptions.h:65
void installPDSS(size_t k, std::unique_ptr< PDSS > &&pdss)
Install a PDSS object for species k
virtual int standardStateConvention() const
This method returns the convention used in specification of the standard state, of which there are cu...
Definition: ThermoPhase.cpp:60
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
void installElements(Phase &th, const XML_Node &phaseNode)
Add the elements given in an XML_Node tree to the specified phase.
#define ENTROPY298_UNKNOWN
Number indicating we don&#39;t know the entropy of the element in its most stable state at 298...
Definition: Elements.h:87
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
Definition: xml.cpp:536
XML_Node & child(const size_t n) const
Return a changeable reference to the n&#39;th child of the current node.
Definition: xml.cpp:546
int intValue(const std::string &val)
Translate a string into one integer value.
void setNDim(size_t ndim)
Set the number of spatial dimensions (1, 2, or 3).
Definition: Phase.h:592
XML_Node & root() const
Return the root of the current XML_Node tree.
Definition: xml.cpp:1025
#define AssertTrace(expr)
Assertion must be true or an error is thrown.
Definition: ctexceptions.h:233
Header for factory functions to build instances of classes that manage the standard-state thermodynam...
std::string id() const
Return the string id for the phase.
Definition: Phase.cpp:68
size_t addElement(const std::string &symbol, doublereal weight=-12345.0, int atomicNumber=0, doublereal entropy298=ENTROPY298_UNKNOWN, int elem_type=CT_ELEM_TYPE_ABSPOS)
Add an element.
Definition: Phase.cpp:629
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
Definition: xml.cpp:500
Class IdealSolidSolnPhase represents a condensed phase ideal solution compound.
Header file for the MineralEQ3 class, which represents a fixed-composition incompressible substance b...
void getStringArray(const XML_Node &node, std::vector< std::string > &v)
This function interprets the value portion of an XML element as a string.
Definition: ctml.cpp:427
PhaseCombo_Interaction is a derived class of GibbsExcessVPSSTP that employs the Margules approximatio...
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
Definition: ThermoPhase.h:1468
A phase that is comprised of a fixed additive combination of other lattice phases.
std::string id() const
Return the id attribute, if present.
Definition: xml.cpp:428
const int cSS_CONVENTION_VPSS
Standard state uses the molality convention.
Definition: ThermoPhase.h:38
Contains declarations for string manipulation functions within Cantera.
Header file for the FixedChemPotSSTP class, which represents a fixed-composition incompressible subst...
Header file for the StoichSubstance class, which represents a fixed-composition incompressible substa...
static void formSpeciesXMLNodeList(std::vector< XML_Node *> &spDataNodeList, std::vector< std::string > &spNamesList, vector_int &spRuleList, const std::vector< XML_Node *> spArray_names, const std::vector< XML_Node *> spArray_dbases, const vector_int sprule)
Gather a vector of pointers to XML_Nodes for a phase.
MargulesVPSSTP is a derived class of GibbsExcessVPSSTP that employs the Margules approximation for th...
Class HMWSoln represents a dilute or concentrated liquid electrolyte phase which obeys the Pitzer for...
Definition: HMWSoln.h:1038
void setXMLdata(XML_Node &xmlPhase)
Stores the XML tree information for the current phase.
Definition: Phase.cpp:49
Class MaskellSolidSolnPhase represents a condensed phase non-ideal solution with 2 species following ...
void setID(const std::string &id)
Set the string id for the phase.
Definition: Phase.cpp:73
XML_Node * findByAttr(const std::string &attr, const std::string &val, int depth=100000) const
This routine carries out a recursive search for an XML node based on an attribute of each XML node...
Definition: xml.cpp:661
Declaration for class Cantera::Species.
ThermoPhase * newThermoPhase(const std::string &model)
Create a new thermo manager instance.
This phase is based upon the mixing-rule assumption that all molality-based activity coefficients are...
Namespace for the Cantera kernel.
Definition: AnyMap.cpp:8
(see Thermodynamic Properties and class RedlichKisterVPSSTP).
Class MineralEQ3 represents a stoichiometric (fixed composition) incompressible substance based on EQ...
Definition: MineralEQ3.h:97
doublereal fpValueCheck(const std::string &val)
Translate a string into one doublereal value, with error checking.
size_t nChildren(bool discardComments=false) const
Return the number of children.
Definition: xml.cpp:556
XML_Node * get_XML_NameID(const std::string &nameTarget, const std::string &file_ID, XML_Node *root)
This routine will locate an XML node in either the input XML tree or in another input file specified ...
Definition: global.cpp:227
Header for a simple thermodynamics model of a bulk phase derived from ThermoPhase, assuming a lattice of solid atoms (see Thermodynamic Properties and class LatticePhase).
Declarations for the EdgePhase ThermoPhase object, which models the interface between two surfaces (s...
const int cSS_CONVENTION_SLAVE
Standard state thermodynamics is obtained from slave ThermoPhase objects.
Definition: ThermoPhase.h:40
An ideal solution or an ideal gas approximation of a phase.