| Cantera 3.0.0

Loading...
Searching...
No Matches
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 https://cantera.org/license.txt for license and copyright information.
9
10#include "cantera/thermo/ThermoFactory.h"
11
12#include "cantera/thermo/Species.h"
13#include "cantera/thermo/speciesThermoTypes.h"
14#include "cantera/thermo/SpeciesThermoFactory.h"
15#include "cantera/thermo/PDSSFactory.h"
16#include "cantera/thermo/MultiSpeciesThermo.h"
17#include "cantera/thermo/IdealGasPhase.h"
18#include "cantera/thermo/PlasmaPhase.h"
19
20#include "cantera/thermo/IdealSolidSolnPhase.h"
21#include "cantera/thermo/MaskellSolidSolnPhase.h"
22#include "cantera/thermo/MargulesVPSSTP.h"
23#include "cantera/thermo/RedlichKisterVPSSTP.h"
24#include "cantera/thermo/IonsFromNeutralVPSSTP.h"
25#include "cantera/thermo/PureFluidPhase.h"
26#include "cantera/thermo/RedlichKwongMFTP.h"
27#include "cantera/thermo/PengRobinson.h"
28#include "cantera/thermo/SurfPhase.h"
29#include "cantera/thermo/CoverageDependentSurfPhase.h"
30#include "cantera/thermo/EdgePhase.h"
31#include "cantera/thermo/MetalPhase.h"
32#include "cantera/thermo/StoichSubstance.h"
33#include "cantera/thermo/LatticeSolidPhase.h"
34#include "cantera/thermo/LatticePhase.h"
35#include "cantera/thermo/HMWSoln.h"
36#include "cantera/thermo/DebyeHuckel.h"
37#include "cantera/thermo/IdealMolalSoln.h"
38#include "cantera/thermo/IdealSolnGasVPSS.h"
39#include "cantera/thermo/WaterSSTP.h"
40#include "cantera/thermo/BinarySolutionTabulatedThermo.h"
41#include "cantera/base/stringUtils.h"
42
43#include <boost/algorithm/string.hpp>
44
45 namespace Cantera
46{
47
48ThermoFactory* ThermoFactory::s_factory = 0;
49std::mutex ThermoFactory::thermo_mutex;
50
51 ThermoFactory::ThermoFactory()
52{
53 reg("none", []() { return new ThermoPhase(); });
54 addDeprecatedAlias("none", "ThermoPhase");
55 addDeprecatedAlias("none", "None");
56 reg("ideal-gas", []() { return new IdealGasPhase(); });
57 addDeprecatedAlias("ideal-gas", "IdealGas");
58 reg("plasma", []() { return new PlasmaPhase(); });
59 reg("ideal-surface", []() { return new SurfPhase(); });
60 addDeprecatedAlias("ideal-surface", "Surface");
61 addDeprecatedAlias("ideal-surface", "Surf");
62 reg("coverage-dependent-surface", []() { return new CoverageDependentSurfPhase(); });
63 reg("edge", []() { return new EdgePhase(); });
64 addDeprecatedAlias("edge", "Edge");
65 reg("electron-cloud", []() { return new MetalPhase(); });
66 addDeprecatedAlias("electron-cloud", "Metal");
67 reg("fixed-stoichiometry", []() { return new StoichSubstance(); });
68 addDeprecatedAlias("fixed-stoichiometry", "StoichSubstance");
69 reg("pure-fluid", []() { return new PureFluidPhase(); });
70 addDeprecatedAlias("pure-fluid", "PureFluid");
71 reg("compound-lattice", []() { return new LatticeSolidPhase(); });
72 addDeprecatedAlias("compound-lattice", "LatticeSolid");
73 reg("lattice", []() { return new LatticePhase(); });
74 addDeprecatedAlias("lattice", "Lattice");
75 reg("HMW-electrolyte", []() { return new HMWSoln(); });
76 addDeprecatedAlias("HMW-electrolyte", "HMW");
77 addDeprecatedAlias("HMW-electrolyte", "HMWSoln");
78 reg("ideal-condensed", []() { return new IdealSolidSolnPhase(); });
79 addDeprecatedAlias("ideal-condensed", "IdealSolidSolution");
80 addDeprecatedAlias("ideal-condensed", "IdealSolidSoln");
81 reg("Debye-Huckel", []() { return new DebyeHuckel(); });
82 addDeprecatedAlias("Debye-Huckel", "DebyeHuckel");
83 reg("ideal-molal-solution", []() { return new IdealMolalSoln(); });
84 addDeprecatedAlias("ideal-molal-solution", "IdealMolalSolution");
85 addDeprecatedAlias("ideal-molal-solution", "IdealMolalSoln");
86 reg("ideal-solution-VPSS", []() { return new IdealSolnGasVPSS(); });
87 reg("ideal-gas-VPSS", []() { return new IdealSolnGasVPSS(); });
88 addDeprecatedAlias("ideal-solution-VPSS", "IdealSolnVPSS");
89 addDeprecatedAlias("ideal-solution-VPSS", "IdealSolnGas");
90 addDeprecatedAlias("ideal-gas-VPSS", "IdealGasVPSS");
91 reg("Margules", []() { return new MargulesVPSSTP(); });
92 reg("ions-from-neutral-molecule", []() { return new IonsFromNeutralVPSSTP(); });
93 addAlias("ions-from-neutral-molecule", "IonsFromNeutralMolecule");
94 addAlias("ions-from-neutral-molecule", "IonsFromNeutral");
95 reg("Redlich-Kister", []() { return new RedlichKisterVPSSTP(); });
96 addDeprecatedAlias("Redlich-Kister", "RedlichKister");
97 reg("Redlich-Kwong", []() { return new RedlichKwongMFTP(); });
98 addDeprecatedAlias("Redlich-Kwong", "RedlichKwongMFTP");
99 addDeprecatedAlias("Redlich-Kwong", "RedlichKwong");
100 reg("Maskell-solid-solution", []() { return new MaskellSolidSolnPhase(); });
101 addAlias("Maskell-solid-solution", "MaskellSolidSolnPhase");
102 addAlias("Maskell-solid-solution", "MaskellSolidsoln");
103 reg("liquid-water-IAPWS95", []() { return new WaterSSTP(); });
104 addDeprecatedAlias("liquid-water-IAPWS95", "PureLiquidWater");
105 addDeprecatedAlias("liquid-water-IAPWS95", "Water");
106 reg("binary-solution-tabulated", []() { return new BinarySolutionTabulatedThermo(); });
107 addDeprecatedAlias("binary-solution-tabulated", "BinarySolutionTabulatedThermo");
108 reg("Peng-Robinson", []() { return new PengRobinson(); });
109}
110
111 ThermoFactory* ThermoFactory::factory()
112{
113 std::unique_lock<std::mutex> lock(thermo_mutex);
114 if (!s_factory) {
115 s_factory = new ThermoFactory;
116 }
117 return s_factory;
118}
119
120 void ThermoFactory::deleteFactory()
121{
122 std::unique_lock<std::mutex> lock(thermo_mutex);
123 delete s_factory;
124 s_factory = 0;
125}
126
127 ThermoPhase* ThermoFactory::newThermoPhase(const string& model)
128{
129 warn_deprecated("newThermoPhase",
130 "To be removed after Cantera 3.0; superseded by newThermoModel.");
131 return create(model);
132}
133
134 ThermoPhase* newThermoPhase(const string& model)
135{
136 warn_deprecated("newThermoPhase",
137 "To be removed after Cantera 3.0; superseded by newThermo.");
138 return ThermoFactory::factory()->create(model);
139}
140
141shared_ptr<ThermoPhase> newThermoModel(const string& model)
142{
143 shared_ptr<ThermoPhase> tptr(ThermoFactory::factory()->create(model));
144 return tptr;
145}
146
147shared_ptr<ThermoPhase> newThermo(const AnyMap& phaseNode, const AnyMap& rootNode)
148{
149 if (!phaseNode.hasKey("kinetics") && phaseNode.hasKey("reactions")) {
150 throw InputFileError("newThermo", phaseNode["reactions"],
151 "Phase entry includes a 'reactions' field but does not "
152 "specify a kinetics model.");
153 }
154 string model = phaseNode["thermo"].asString();
155 shared_ptr<ThermoPhase> t = newThermoModel(model);
156 setupPhase(*t, phaseNode, rootNode);
157 return t;
158}
159
160shared_ptr<ThermoPhase> newThermo(const string& infile, const string& id)
161{
162 size_t dot = infile.find_last_of(".");
163 if (dot == npos) {
164 // @todo Remove after Cantera 3.0
165 warn_deprecated("newThermo",
166 "Changed in Cantera 3.0. Replaced by newThermoModel.\n");
167 newThermoModel(infile);
168 }
169 string extension;
170 extension = toLowerCopy(infile.substr(dot+1));
171 string id_ = id;
172 if (id == "-") {
173 id_ = "";
174 }
175 if (extension == "cti" || extension == "xml") {
176 throw CanteraError("newThermo",
177 "The CTI and XML formats are no longer supported.");
178 }
179
180 AnyMap root = AnyMap::fromYamlFile(infile);
181 AnyMap& phase = root["phases"].getMapWhere("name", id_);
182 return newThermo(phase, root);
183}
184
185unique_ptr<ThermoPhase> newPhase(const AnyMap& phaseNode, const AnyMap& rootNode)
186{
187 warn_deprecated("newPhase",
188 "To be removed after Cantera 3.0; superseded by\n"
189 "newThermo(const AnyMap&, const AnyMap&).");
190 if (!phaseNode.hasKey("kinetics") && phaseNode.hasKey("reactions")) {
191 throw InputFileError("newPhase", phaseNode["reactions"],
192 "Phase entry includes a 'reactions' field but does not "
193 "specify a kinetics model.");
194 }
195 unique_ptr<ThermoPhase> t(newThermoPhase(phaseNode["thermo"].asString()));
196 setupPhase(*t, phaseNode, rootNode);
197 return t;
198}
199
200 ThermoPhase* newPhase(const string& infile, string id)
201{
202 warn_deprecated("newPhase",
203 "To be removed after Cantera 3.0; superseded by\n"
204 "newThermo(const string&, const string&).");
205 size_t dot = infile.find_last_of(".");
206 if (dot == npos) {
207 newThermoModel(infile);
208 }
209 string extension;
210 extension = toLowerCopy(infile.substr(dot+1));
211 string id_ = id;
212 if (id == "-") {
213 id_ = "";
214 }
215 if (extension == "cti" || extension == "xml") {
216 throw CanteraError("newPhase",
217 "The CTI and XML formats are no longer supported.");
218 }
219
220 AnyMap root = AnyMap::fromYamlFile(infile);
221 AnyMap& phase = root["phases"].getMapWhere("name", id_);
222 string model = phase["thermo"].asString();
223 unique_ptr<ThermoPhase> t(ThermoFactory::factory()->create(model));
224 setupPhase(*t, phase, root);
225 return t.release();
226}
227
228 void addDefaultElements(ThermoPhase& thermo, const vector<string>& element_names) {
229 for (const auto& symbol : element_names) {
230 thermo.addElement(symbol);
231 }
232}
233
234 void addElements(ThermoPhase& thermo, const vector<string>& element_names,
235 const AnyValue& elements, bool allow_default)
236{
237 const auto& local_elements = elements.asMap("symbol");
238 for (const auto& symbol : element_names) {
239 if (local_elements.count(symbol)) {
240 auto& element = *local_elements.at(symbol);
241 double weight = element["atomic-weight"].asDouble();
242 long int number = element.getInt("atomic-number", 0);
243 double e298 = element.getDouble("entropy298", ENTROPY298_UNKNOWN);
244 thermo.addElement(symbol, weight, number, e298);
245 } else if (allow_default) {
246 thermo.addElement(symbol);
247 } else {
248 throw InputFileError("addElements", elements,
249 "Element '{}' not found", symbol);
250 }
251 }
252}
253
254 void addSpecies(ThermoPhase& thermo, const AnyValue& names, const AnyValue& species)
255{
256 if (names.is<vector<string>>()) {
257 // 'names' is a list of species names which should be found in 'species'
258 const auto& species_nodes = species.asMap("name");
259 for (const auto& name : names.asVector<string>()) {
260 if (species_nodes.count(name)) {
261 thermo.addSpecies(newSpecies(*species_nodes.at(name)));
262 } else {
263 throw InputFileError("addSpecies", names, species,
264 "Could not find a species named '{}'.", name);
265 }
266 }
267 } else if (names == "all") {
268 // The keyword 'all' means to add all species from this source
269 for (const auto& item : species.asVector<AnyMap>()) {
270 thermo.addSpecies(newSpecies(item));
271 }
272 } else {
273 throw InputFileError("addSpecies", names,
274 "Could not parse species declaration of type '{}'", names.type_str());
275 }
276}
277
278 void setupPhase(ThermoPhase& thermo, const AnyMap& phaseNode, const AnyMap& rootNode)
279{
280 thermo.setName(phaseNode["name"].asString());
281
282 if (phaseNode.hasKey("deprecated")) {
283 string msg = phaseNode["deprecated"].asString();
284 string filename = phaseNode.getString("__file__",
285 rootNode.getString("__file__", "unknown file"));
286 string method = fmt::format("{}/{}", filename, phaseNode["name"].asString());
287 warn_deprecated(method, phaseNode, msg);
288 }
289
290 // Add elements
291 if (phaseNode.hasKey("elements")) {
292 if (phaseNode.getBool("skip-undeclared-elements", false)) {
293 thermo.ignoreUndefinedElements();
294 } else {
295 thermo.throwUndefinedElements();
296 }
297
298 if (phaseNode["elements"].is<vector<string>>()) {
299 // 'elements' is a list of element symbols
300 if (rootNode.hasKey("elements")) {
301 addElements(thermo, phaseNode["elements"].asVector<string>(),
302 rootNode["elements"], true);
303 } else {
304 addDefaultElements(thermo, phaseNode["elements"].asVector<string>());
305 }
306 } else if (phaseNode["elements"].is<vector<AnyMap>>()) {
307 // Each item in 'elements' is a map with one item, where the key is
308 // a section in this file or another YAML file, and the value is a
309 // list of element symbols to read from that section
310 for (const auto& elemNode : phaseNode["elements"].asVector<AnyMap>()) {
311 const string& source = elemNode.begin()->first;
312 const auto& names = elemNode.begin()->second.asVector<string>();
313 const auto& slash = boost::ifind_last(source, "/");
314 if (slash) {
315 string fileName(source.begin(), slash.begin());
316 string node(slash.end(), source.end());
317 const AnyMap elements = AnyMap::fromYamlFile(fileName,
318 rootNode.getString("__file__", ""));
319 addElements(thermo, names, elements.at(node), false);
320 } else if (rootNode.hasKey(source)) {
321 addElements(thermo, names, rootNode.at(source), false);
322 } else if (source == "default") {
323 addDefaultElements(thermo, names);
324 } else {
325 throw InputFileError("setupPhase", elemNode,
326 "Could not find elements section named '{}'", source);
327 }
328 }
329 } else {
330 throw InputFileError("setupPhase", phaseNode["elements"],
331 "Could not parse elements declaration of type '{}'",
332 phaseNode["elements"].type_str());
333 }
334 } else {
335 // If no elements list is provided, just add elements as-needed from the
336 // default list.
337 thermo.addUndefinedElements();
338 }
339
340 // Add species
341 if (phaseNode.hasKey("species")) {
342 if (phaseNode["species"].is<vector<string>>()) {
343 // 'species' is a list of species names to be added from the current
344 // file's 'species' section
345 addSpecies(thermo, phaseNode["species"], rootNode["species"]);
346 } else if (phaseNode["species"].is<string>()) {
347 // 'species' is a keyword applicable to the current file's 'species'
348 // section
349 addSpecies(thermo, phaseNode["species"], rootNode["species"]);
350 } else if (phaseNode["species"].is<vector<AnyMap>>()) {
351 // Each item in 'species' is a map with one item, where the key is
352 // a section in this file or another YAML file, and the value is a
353 // list of species names to read from that section
354 for (const auto& speciesNode : phaseNode["species"].asVector<AnyMap>()) {
355 const string& source = speciesNode.begin()->first;
356 const auto& names = speciesNode.begin()->second;
357 const auto& slash = boost::ifind_last(source, "/");
358 if (slash) {
359 // source is a different input file
360 string fileName(source.begin(), slash.begin());
361 string node(slash.end(), source.end());
362 AnyMap species = AnyMap::fromYamlFile(fileName,
363 rootNode.getString("__file__", ""));
364 addSpecies(thermo, names, species[node]);
365 } else if (rootNode.hasKey(source)) {
366 // source is in the current file
367 addSpecies(thermo, names, rootNode[source]);
368 } else {
369 throw InputFileError("setupPhase", speciesNode,
370 "Could not find species section named '{}'", source);
371 }
372 }
373 } else {
374 throw InputFileError("setupPhase", phaseNode["species"],
375 "Could not parse species declaration of type '{}'",
376 phaseNode["species"].type_str());
377 }
378 } else if (rootNode.hasKey("species")) {
379 // By default, add all species from the 'species' section
380 addSpecies(thermo, AnyValue("all"), rootNode["species"]);
381 }
382
383 auto* vpssThermo = dynamic_cast<VPStandardStateTP*>(&thermo);
384 if (vpssThermo) {
385 for (size_t k = 0; k < thermo.nSpecies(); k++) {
386 unique_ptr<PDSS> pdss;
387 if (thermo.species(k)->input.hasKey("equation-of-state")) {
388 // Use the first node which specifies a valid PDSS model
389 auto& eos = thermo.species(k)->input["equation-of-state"];
390 bool found = false;
391 for (auto& node : eos.asVector<AnyMap>()) {
392 string model = node["model"].asString();
393 if (PDSSFactory::factory()->exists(model)) {
394 pdss.reset(newPDSS(model));
395 pdss->setParameters(node);
396 found = true;
397 break;
398 }
399 }
400 if (!found) {
401 throw InputFileError("setupPhase", eos,
402 "Could not find an equation-of-state specification "
403 "which defines a known PDSS model.");
404 }
405 } else {
406 pdss.reset(newPDSS("ideal-gas"));
407 }
408 vpssThermo->installPDSS(k, std::move(pdss));
409 }
410 }
411
412 thermo.setParameters(phaseNode, rootNode);
413 thermo.initThermo();
414
415 if (phaseNode.hasKey("state")) {
416 auto node = phaseNode["state"].as<AnyMap>();
417 thermo.setState(node);
418 } else {
419 thermo.setState_TP(298.15, OneAtm);
420 }
421}
422
423}
BinarySolutionTabulatedThermo.h
Header file for an binary solution model with tabulated standard state thermodynamic data (see Thermo...
CoverageDependentSurfPhase.h
Header for a thermodynamics model of a coverage-dependent surface phase derived from SurfPhase,...
DebyeHuckel.h
Headers for the DebyeHuckel ThermoPhase object, which models dilute electrolyte solutions (see Thermo...
EdgePhase.h
Declarations for the EdgePhase ThermoPhase object, which models the interface between two surfaces (s...
ENTROPY298_UNKNOWN
#define ENTROPY298_UNKNOWN
Number indicating we don't know the entropy of the element in its most stable state at 298....
Definition Elements.h:85
HMWSoln.h
Headers for the HMWSoln ThermoPhase object, which models concentrated electrolyte solutions (see Ther...
IdealGasPhase.h
ThermoPhase object for the ideal gas equation of state - workhorse for Cantera (see Thermodynamic Pro...
IdealMolalSoln.h
ThermoPhase object for the ideal molal equation of state (see Thermodynamic Properties and class Idea...
IdealSolidSolnPhase.h
Header file for an ideal solid solution model with incompressible thermodynamics (see Thermodynamic P...
IdealSolnGasVPSS.h
Definition file for a derived class of ThermoPhase that assumes an ideal solution approximation and h...
IonsFromNeutralVPSSTP.h
Header for intermediate ThermoPhase object for phases which consist of ions whose thermodynamics is c...
LatticePhase.h
Header for a simple thermodynamics model of a bulk phase derived from ThermoPhase,...
LatticeSolidPhase.h
Header for a simple thermodynamics model of a bulk solid phase derived from ThermoPhase,...
MargulesVPSSTP.h
(see Thermodynamic Properties and class MargulesVPSSTP).
MaskellSolidSolnPhase.h
Header file for a solid solution model following Maskell, Shaw, and Tye.
MetalPhase.h
MultiSpeciesThermo.h
Header for a general species thermodynamic property manager for a phase (see MultiSpeciesThermo).
PDSSFactory.h
PengRobinson.h
PlasmaPhase.h
Header file for class PlasmaPhase.
PureFluidPhase.h
Header for a ThermoPhase class for a pure fluid phase consisting of gas, liquid, mixed-gas-liquid and...
RedlichKisterVPSSTP.h
(see Thermodynamic Properties and class RedlichKisterVPSSTP).
RedlichKwongMFTP.h
SpeciesThermoFactory.h
Header for factory functions to build instances of classes that manage the standard-state thermodynam...
Species.h
Declaration for class Cantera::Species.
StoichSubstance.h
Header file for the StoichSubstance class, which represents a fixed-composition incompressible substa...
SurfPhase.h
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
ThermoFactory.h
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
WaterSSTP.h
Declares a ThermoPhase class consisting of pure water (see Thermodynamic Properties and class WaterSS...
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::AnyMap::getBool
bool getBool(const string &key, bool default_) const
If key exists, return it as a bool, otherwise return default_.
Definition AnyMap.cpp:1515
Cantera::AnyMap::getString
const string & getString(const string &key, const string &default_) const
If key exists, return it as a string, otherwise return default_.
Definition AnyMap.cpp:1530
Cantera::AnyMap::fromYamlFile
static AnyMap fromYamlFile(const string &name, const string &parent_name="")
Create an AnyMap from a YAML file.
Definition AnyMap.cpp:1771
Cantera::AnyMap::at
const AnyValue & at(const string &key) const
Get the value of the item stored in key.
Definition AnyMap.cpp:1408
Cantera::AnyValue
A wrapper for a variable whose type is determined at runtime.
Definition AnyMap.h:86
Cantera::BinarySolutionTabulatedThermo
Overloads the virtual methods of class IdealSolidSolnPhase to implement tabulated standard state ther...
Definition BinarySolutionTabulatedThermo.h:162
Cantera::CanteraError
Base class for exceptions thrown by Cantera classes.
Definition ctexceptions.h:66
Cantera::CoverageDependentSurfPhase
A thermodynamic model for a coverage-dependent surface phase, applying surface species lateral intera...
Definition CoverageDependentSurfPhase.h:127
Cantera::DebyeHuckel
Class DebyeHuckel represents a dilute liquid electrolyte phase which obeys the Debye Huckel formulati...
Definition DebyeHuckel.h:415
Cantera::EdgePhase
A thermodynamic phase representing a one dimensional edge between two surfaces.
Definition EdgePhase.h:31
Cantera::Factory< ThermoPhase >::create
ThermoPhase * create(const string &name, Args... args)
Create an object using the object construction function corresponding to "name" and the provided cons...
Definition FactoryBase.h:75
Cantera::Factory< ThermoPhase >::reg
void reg(const string &name, function< ThermoPhase *(Args...)> f)
Register a new object construction function.
Definition FactoryBase.h:80
Cantera::Factory< ThermoPhase >::addAlias
void addAlias(const string &original, const string &alias)
Add an alias for an existing registered type.
Definition FactoryBase.h:85
Cantera::Factory< ThermoPhase >::addDeprecatedAlias
void addDeprecatedAlias(const string &original, const string &alias)
Add a deprecated alias for an existing registered type.
Definition FactoryBase.h:116
Cantera::HMWSoln
Class HMWSoln represents a dilute or concentrated liquid electrolyte phase which obeys the Pitzer for...
Definition HMWSoln.h:778
Cantera::IdealGasPhase
Class IdealGasPhase represents low-density gases that obey the ideal gas equation of state.
Definition IdealGasPhase.h:250
Cantera::IdealMolalSoln
This phase is based upon the mixing-rule assumption that all molality-based activity coefficients are...
Definition IdealMolalSoln.h:68
Cantera::IdealSolidSolnPhase
Class IdealSolidSolnPhase represents a condensed phase ideal solution compound.
Definition IdealSolidSolnPhase.h:40
Cantera::IdealSolnGasVPSS
An ideal solution approximation of a phase.
Definition IdealSolnGasVPSS.h:28
Cantera::InputFileError
Error thrown for problems processing information contained in an AnyMap or AnyValue.
Definition AnyMap.h:738
Cantera::IonsFromNeutralVPSSTP
The IonsFromNeutralVPSSTP is a derived class of ThermoPhase that handles the specification of the che...
Definition IonsFromNeutralVPSSTP.h:70
Cantera::LatticePhase
A simple thermodynamic model for a bulk phase, assuming a lattice of solid atoms.
Definition LatticePhase.h:184
Cantera::LatticeSolidPhase
A phase that is comprised of a fixed additive combination of other lattice phases.
Definition LatticeSolidPhase.h:105
Cantera::MargulesVPSSTP
MargulesVPSSTP is a derived class of GibbsExcessVPSSTP that employs the Margules approximation for th...
Definition MargulesVPSSTP.h:215
Cantera::MaskellSolidSolnPhase
Class MaskellSolidSolnPhase represents a condensed phase non-ideal solution with 2 species following ...
Definition MaskellSolidSolnPhase.h:31
Cantera::MetalPhase
Class MetalPhase represents electrons in a metal.
Definition MetalPhase.h:22
Cantera::PengRobinson
Implementation of a multi-species Peng-Robinson equation of state.
Definition PengRobinson.h:20
Cantera::Phase::nSpecies
size_t nSpecies() const
Returns the number of species in the phase.
Definition Phase.h:245
Cantera::Phase::ignoreUndefinedElements
void ignoreUndefinedElements()
Set behavior when adding a species containing undefined elements to just skip the species.
Definition Phase.cpp:994
Cantera::Phase::addUndefinedElements
void addUndefinedElements()
Set behavior when adding a species containing undefined elements to add those elements to the phase.
Definition Phase.cpp:998
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::throwUndefinedElements
void throwUndefinedElements()
Set the behavior when adding a species containing undefined elements to throw an exception.
Definition Phase.cpp:1002
Cantera::Phase::setName
void setName(const string &nm)
Sets the string name for the phase.
Definition Phase.cpp:25
Cantera::PlasmaPhase
Base class for a phase with plasma properties.
Definition PlasmaPhase.h:58
Cantera::PureFluidPhase
This phase object consists of a single component that can be a gas, a liquid, a mixed gas-liquid flui...
Definition PureFluidPhase.h:31
Cantera::RedlichKisterVPSSTP
RedlichKisterVPSSTP is a derived class of GibbsExcessVPSSTP that employs the Redlich-Kister approxima...
Definition RedlichKisterVPSSTP.h:233
Cantera::RedlichKwongMFTP
Implementation of a multi-species Redlich-Kwong equation of state.
Definition RedlichKwongMFTP.h:20
Cantera::StoichSubstance
Class StoichSubstance represents a stoichiometric (fixed composition) incompressible substance.
Definition StoichSubstance.h:89
Cantera::SurfPhase
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
Definition SurfPhase.h:98
Cantera::ThermoFactory
Factory class for thermodynamic property managers.
Definition ThermoFactory.h:31
Cantera::ThermoFactory::deleteFactory
void deleteFactory() override
delete the static instance of this factory
Definition ThermoFactory.cpp:120
Cantera::ThermoFactory::ThermoFactory
ThermoFactory()
Private constructors prevents usage.
Definition ThermoFactory.cpp:51
Cantera::ThermoFactory::factory
static ThermoFactory * factory()
Static function that creates a static instance of the factory.
Definition ThermoFactory.cpp:111
Cantera::ThermoFactory::thermo_mutex
static std::mutex thermo_mutex
Decl for locking mutex for thermo factory singleton.
Definition ThermoFactory.h:56
Cantera::ThermoFactory::newThermoPhase
ThermoPhase * newThermoPhase(const string &model)
Create a new thermodynamic property manager.
Definition ThermoFactory.cpp:127
Cantera::ThermoFactory::s_factory
static ThermoFactory * s_factory
static member of a single instance
Definition ThermoFactory.h:50
Cantera::ThermoPhase
Base class for a phase with thermodynamic properties.
Definition ThermoPhase.h:390
Cantera::ThermoPhase::setParameters
virtual void setParameters(const AnyMap &phaseNode, const AnyMap &rootNode=AnyMap())
Set equation of state parameters from an AnyMap phase description.
Definition ThermoPhase.cpp:1161
Cantera::ThermoPhase::setState_TP
virtual void setState_TP(double t, double p)
Set the temperature (K) and pressure (Pa)
Definition ThermoPhase.cpp:121
Cantera::ThermoPhase::setState
virtual void setState(const AnyMap &state)
Set the state using an AnyMap containing any combination of properties supported by the thermodynamic...
Definition ThermoPhase.cpp:222
Cantera::ThermoPhase::initThermo
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
Definition ThermoPhase.cpp:1093
Cantera::VPStandardStateTP
This is a filter class for ThermoPhase that implements some preparatory steps for efficiently handlin...
Definition VPStandardStateTP.h:44
Cantera::WaterSSTP
Class for single-component water.
Definition WaterSSTP.h:69
Cantera::toLowerCopy
string toLowerCopy(const string &input)
Convert to lower case.
Definition stringUtils.cpp:219
Cantera::dot
double dot(InputIter x_begin, InputIter x_end, InputIter2 y_begin)
Function that calculates a templated inner product.
Definition utilities.h:82
Cantera::OneAtm
const double OneAtm
One atmosphere [Pa].
Definition ct_defs.h:96
Cantera::newThermo
shared_ptr< ThermoPhase > newThermo(const AnyMap &phaseNode, const AnyMap &rootNode)
Create a new ThermoPhase object and initialize it.
Definition ThermoFactory.cpp:147
Cantera::setupPhase
void setupPhase(ThermoPhase &thermo, const AnyMap &phaseNode, const AnyMap &rootNode)
Initialize a ThermoPhase object.
Definition ThermoFactory.cpp:278
Cantera::newPhase
unique_ptr< ThermoPhase > newPhase(const AnyMap &phaseNode, const AnyMap &rootNode)
Create a new ThermoPhase object and initialize it.
Definition ThermoFactory.cpp:185
Cantera::newThermoModel
shared_ptr< ThermoPhase > newThermoModel(const string &model)
Create a new ThermoPhase instance.
Definition ThermoFactory.cpp:141
Cantera::newThermoPhase
ThermoPhase * newThermoPhase(const string &model)
Create a new ThermoPhase instance.
Definition ThermoFactory.cpp:134
Cantera
Namespace for the Cantera kernel.
Definition AnyMap.cpp:564
Cantera::npos
const size_t npos
index returned by functions to indicate "no position"
Definition ct_defs.h:195
Cantera::newSpecies
unique_ptr< Species > newSpecies(const AnyMap &node)
Create a new Species object from an AnyMap specification.
Definition Species.cpp:105
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
speciesThermoTypes.h
Contains const definitions for types of species reference-state thermodynamics managers (see Species ...
stringUtils.h
Contains declarations for string manipulation functions within Cantera.