35 #include "cantera/thermo/mix_defs.h"
46 VPSSMgrFactory* VPSSMgrFactory::s_factory = 0;
49 mutex_t VPSSMgrFactory::vpss_species_thermo_mutex;
72 int& has_nasa_idealGas,
73 int& has_nasa_constVol,
74 int& has_shomate_idealGas,
75 int& has_shomate_constVol,
76 int& has_simple_idealGas,
77 int& has_simple_constVol,
85 string ssModel =
"idealGas";
86 size_t ns = spDataNodeList.size();
87 for (
size_t n = 0; n < ns; n++) {
89 XML_Node* spNode = spDataNodeList[n];
90 if (spNode->
hasChild(
"standardState")) {
92 string mm = ssN[
"model"];
93 if (mm ==
"waterIAPWS" || mm ==
"waterPDSS") {
105 if (spNode->
hasChild(
"standardState")) {
106 ss_ptr = &(spNode->
child(
"standardState"));
107 ssModel = ss_ptr->
attrib(
"model");
110 if (ssModel ==
"idealGas") {
112 }
else if (ssModel ==
"constant_incompressible" ||
113 ssModel ==
"constantVolume") {
115 }
else if (ssModel ==
"temperature_polynomial" ||
116 ssModel ==
"density_temperature_polynomial" ||
117 ssModel ==
"constant") {
126 if (ssModel ==
"idealGas") {
127 has_shomate_idealGas++;
128 }
else if (ssModel ==
"constant_incompressible" ||
129 ssModel ==
"constantVolume") {
130 has_shomate_constVol++;
131 }
else if (ssModel ==
"temperature_polynomial" ||
132 ssModel ==
"density_temperature_polynomial" ||
133 ssModel ==
"constant") {
142 if (ssModel ==
"idealGas") {
143 has_simple_idealGas++;
144 }
else if (ssModel ==
"constant_incompressible" ||
145 ssModel ==
"constantVolume") {
146 has_simple_constVol++;
147 }
else if (ssModel ==
"temperature_polynomial" ||
148 ssModel ==
"density_temperature_polynomial" ||
149 ssModel ==
"constant") {
158 if (th.
child(
"poly")[
"order"] ==
"1") {
159 has_simple_constVol = 1;
162 "poly with order > 1 not yet supported");
172 if (th.
hasChild(
"NASA9MULTITEMP")) {
198 void VPSSMgrFactory::deleteFactory()
200 ScopedLock lock(vpss_species_thermo_mutex);
207 VPSSMgrFactory::~VPSSMgrFactory()
212 VPSSMgrFactory::VPSSMgr_StringConversion(std::string ssModel)
const
214 std::string lssModel =
lowercase(ssModel);
216 if (lssModel ==
"idealgas") {
217 type = cVPSSMGR_IDEALGAS;
218 }
else if (lssModel ==
"constvol") {
219 type = cVPSSMGR_CONSTVOL;
220 }
else if (lssModel ==
"purefuild") {
221 type = cVPSSMGR_PUREFLUID;
222 }
else if (lssModel ==
"water_constvol") {
223 type = cVPSSMGR_WATER_CONSTVOL;
224 }
else if (lssModel ==
"water_hkft") {
225 type = cVPSSMGR_WATER_HKFT;
226 }
else if (lssModel ==
"general") {
227 type = cVPSSMGR_GENERAL;
229 type = cVPSSMGR_UNDEF;
239 std::vector<XML_Node*> & spDataNodeList)
242 std::string ssManager=
"";
243 std::string vpssManager=
"";
250 if (phaseNode_ptr->
hasChild(
"thermo")) {
252 if (thermoNode.
hasChild(
"standardStateManager")) {
253 const XML_Node& ssNode = thermoNode.
child(
"standardStateManager");
254 ssManager = ssNode[
"model"];
256 if (thermoNode.
hasChild(
"variablePressureStandardStateManager")) {
257 const XML_Node& vpssNode = thermoNode.
child(
"variablePressureStandardStateManager");
258 vpssManager = vpssNode[
"model"];
266 if (ssManager !=
"") {
275 if (vpssManager !=
"") {
285 }
else if (vp_ptr->
eosType() == cVPSS_ConstVol) {
291 int inasaIG = 0, inasaCV = 0, ishomateIG = 0, ishomateCV = 0,
292 isimpleIG = 0, isimpleCV = 0,
293 iwater = 0, itpx = 0, iother = 0;
297 getVPSSMgrTypes(spDataNodeList, inasaIG, inasaCV, ishomateIG, ishomateCV,
298 isimpleIG, isimpleCV, iwater, itpx, ihptx, iother);
306 if (inasaIG || ishomateIG || isimpleIG) {
307 throw CanteraError(
"newVPSSMgr",
"Ideal gas with liquid water");
312 if (inasaIG || ishomateIG || isimpleIG) {
313 throw CanteraError(
"newVPSSMgr",
"Ideal gas with liquid water");
314 }
else if (inasaCV || ishomateCV || isimpleCV) {
322 if (inasaCV || ishomateCV || isimpleCV) {
323 if (!inasaIG && !ishomateIG && !isimpleIG && !itpx && !ihptx && !iother) {
343 case cVPSSMGR_IDEALGAS:
345 case cVPSSMGR_CONSTVOL:
347 case cVPSSMGR_PUREFLUID:
350 case cVPSSMGR_WATER_CONSTVOL:
352 case cVPSSMGR_WATER_HKFT:
354 case cVPSSMGR_GENERAL:
368 f = VPSSMgrFactory::factory();
377 std::vector<XML_Node*> & spDataNodeList,
381 f = VPSSMgrFactory::factory();