30 VPSSMgrFactory* VPSSMgrFactory::s_factory = 0;
33 std::mutex VPSSMgrFactory::vpss_species_thermo_mutex;
65 int& has_nasa_idealGas,
66 int& has_nasa_constVol,
67 int& has_shomate_idealGas,
68 int& has_shomate_constVol,
69 int& has_simple_idealGas,
70 int& has_simple_constVol,
76 string ssModel =
"idealGas";
77 for (
size_t n = 0; n < spDataNodeList.size(); n++) {
79 XML_Node* spNode = spDataNodeList[n];
80 if (spNode->
hasChild(
"standardState")) {
81 string mm = spNode->
child(
"standardState")[
"model"];
82 if (mm ==
"waterIAPWS" || mm ==
"waterPDSS") {
94 if (spNode->
hasChild(
"standardState")) {
95 ssModel = spNode->
child(
"standardState")[
"model"];
98 if (ssModel ==
"idealGas") {
100 }
else if (ssModel ==
"constant_incompressible" ||
101 ssModel ==
"constantVolume") {
103 }
else if (ssModel ==
"temperature_polynomial" ||
104 ssModel ==
"density_temperature_polynomial" ||
105 ssModel ==
"constant") {
109 "Specified VPSSMgr model {} does not match any known type.",
115 if (ssModel ==
"idealGas") {
116 has_shomate_idealGas++;
117 }
else if (ssModel ==
"constant_incompressible" ||
118 ssModel ==
"constantVolume") {
119 has_shomate_constVol++;
120 }
else if (ssModel ==
"temperature_polynomial" ||
121 ssModel ==
"density_temperature_polynomial" ||
122 ssModel ==
"constant") {
126 "Specified VPSSMgr model {} does not match any known type.",
132 if (ssModel ==
"idealGas") {
133 has_simple_idealGas++;
134 }
else if (ssModel ==
"constant_incompressible" ||
135 ssModel ==
"constantVolume") {
136 has_simple_constVol++;
137 }
else if (ssModel ==
"temperature_polynomial" ||
138 ssModel ==
"density_temperature_polynomial" ||
139 ssModel ==
"constant") {
143 "Specified VPSSMgr model {} does not match any known type.",
149 if (th.
child(
"poly")[
"order"] ==
"1") {
150 has_simple_constVol = 1;
153 "poly with order > 1 not yet supported");
163 if (th.
hasChild(
"NASA9MULTITEMP")) {
177 "Specified VPSSMgr model {} does not match any known type.",
184 VPSSMgrFactory::VPSSMgrFactory()
192 reg(
"water_constvol",
203 void VPSSMgrFactory::deleteFactory()
205 std::unique_lock<std::mutex> lock(vpss_species_thermo_mutex);
211 VPSSMgrFactory::VPSSMgr_StringConversion(
const std::string& ssModel)
const 214 "To be removed after Cantera 2.3.");
215 std::string lssModel = ba::to_lower_copy(ssModel);
217 if (lssModel ==
"idealgas") {
219 }
else if (lssModel ==
"constvol") {
221 }
else if (lssModel ==
"purefuild") {
222 type = cVPSSMGR_PUREFLUID;
223 }
else if (lssModel ==
"water_constvol") {
225 }
else if (lssModel ==
"water_hkft") {
227 }
else if (lssModel ==
"general") {
230 type = cVPSSMGR_UNDEF;
237 std::vector<XML_Node*> & spDataNodeList)
239 std::string ssManager;
240 std::string vpssManager;
244 if (phaseNode_ptr && phaseNode_ptr->
hasChild(
"thermo")) {
246 if (thermoNode.
hasChild(
"standardStateManager")) {
247 const XML_Node& ssNode = thermoNode.
child(
"standardStateManager");
248 ssManager = ssNode[
"model"];
250 if (thermoNode.
hasChild(
"variablePressureStandardStateManager")) {
251 const XML_Node& vpssNode = thermoNode.
child(
"variablePressureStandardStateManager");
252 vpssManager = ba::to_lower_copy(vpssNode[
"model"]);
261 if (vpssManager !=
"") {
262 return create(vpssManager, vp_ptr, spth);
265 int inasaIG = 0, inasaCV = 0, ishomateIG = 0, ishomateCV = 0,
266 isimpleIG = 0, isimpleCV = 0, iwater = 0, itpx = 0, iother = 0;
270 getVPSSMgrTypes(spDataNodeList, inasaIG, inasaCV, ishomateIG, ishomateCV,
271 isimpleIG, isimpleCV, iwater, itpx, ihptx, iother);
278 if (inasaIG || ishomateIG || isimpleIG) {
279 throw CanteraError(
"newVPSSMgr",
"Ideal gas with liquid water");
284 if (inasaIG || ishomateIG || isimpleIG) {
285 throw CanteraError(
"newVPSSMgr",
"Ideal gas with liquid water");
286 }
else if (inasaCV || ishomateCV || isimpleCV) {
293 if ((inasaCV || ishomateCV || isimpleCV) &&
294 !inasaIG && !ishomateIG && !isimpleIG && !itpx && !ihptx && !iother) {
305 warn_deprecated(
"VPSSMgrFactory::newVPSSMgr(VPSSMgr_enumType, VPStandardStateTP*)",
306 "To be removed after Cantera 2.3.");
307 static unordered_map<int, std::string> types {
315 return create(types.at(type), vp_ptr, &spthermoRef);
322 warn_deprecated(
"newVPSSMgr(VPSSMgr_enumType, VPStandardStateTP*, VPSSMgrFactory*)",
323 "To be removed after Cantera 2.3.");
325 f = VPSSMgrFactory::factory();
332 std::vector<XML_Node*> & spDataNodeList,
336 f = VPSSMgrFactory::factory();
338 warn_deprecated(
"newVPSSMgr(VPStandardStateTP*, XML_Node*, vector<XML_Node*>, VPSSMgrFactory*)",
339 "The `VPSSMgrFactory*` argument to this function is deprecated and" 340 " will be removed after Cantera 2.3.");
342 return f->
newVPSSMgr(tp_ptr, phaseNode_ptr, spDataNodeList);
Header for a general species thermodynamic property manager for a phase (see MultiSpeciesThermo).
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
Virtual base class for the classes that manage the calculation of standard state properties for all t...
Variable pressure SS calculate for phases consisting of real water as the first species and species o...
Declaration file for a derived class that handles the calculation of standard state thermo properties...
Variable pressure SS calculate for phases consisting of completing general representations.
Declaration file for a derived class that handles the calculation of standard state thermo properties...
Class XML_Node is a tree-based representation of the contents of an XML file.
VPSSMgr * newVPSSMgr(VPStandardStateTP *tp_ptr, XML_Node *phaseNode_ptr, std::vector< XML_Node *> &spDataNodeList, VPSSMgrFactory *f)
Function to return VPSSMgr manager.
Handles the calculation of standard state thermo properties for real water and a set of species which...
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
Variable pressure SS calculate for phases consisting of real water as the first species and species h...
Constant Molar Volume e VPSS species thermo manager class.
virtual MultiSpeciesThermo & speciesThermo(int k=-1)
Return a changeable reference to the calculation manager for species reference-state thermodynamic pr...
VPSSMgr_enumType
enum for VPSSMgr types that are responsible for calculating the species standard state and reference-...
Declaration file for a derived class that handles the calculation of standard state thermo properties...
Variable pressure SS calculate for phases consisting all species having a constant molar volume prope...
Factory to build instances of classes that manage the standard-state thermodynamic properties of a se...
Base class for exceptions thrown by Cantera classes.
static void getVPSSMgrTypes(std::vector< XML_Node *> &spDataNodeList, int &has_nasa_idealGas, int &has_nasa_constVol, int &has_shomate_idealGas, int &has_shomate_constVol, int &has_simple_idealGas, int &has_simple_constVol, int &has_water, int &has_tpx, int &has_hptx, int &has_other)
Examine the types of species thermo parameterizations, and return a flag indicating the type of param...
Manages standard state thermo properties for real water and a set of species which have the HKFT equa...
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
Variable pressures SS calculator for ideal gas phases.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
Header for factory functions to build instances of classes that manage the standard-state thermodynam...
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
Declarations for a derived class for the calculation of multiple-species thermodynamic property manag...
Contains declarations for string manipulation functions within Cantera.
A VPSSMgr where all species in the phase obey an ideal gas equation of state.
Header for factory to build instances of classes that manage the standard-state thermodynamic propert...
A species thermodynamic property manager for a phase.
Class that handles the calculation of standard state thermo properties for a set of species belonging...
Namespace for the Cantera kernel.
virtual VPSSMgr * newVPSSMgr(VPSSMgr_enumType type, VPStandardStateTP *vp_ptr)
Create a new species variable pressure standard state calculator.
Declaration file for a derived class that handles the calculation of standard state thermo properties...