Added IonsFromNeutraVPSSTP to the ThermoFactory.

This commit is contained in:
Harry Moffat 2009-09-02 19:03:26 +00:00
parent 06276fba6d
commit 95b94a7a57
4 changed files with 28 additions and 5 deletions

View file

@ -52,6 +52,7 @@ namespace Cantera {
numAnionSpecies_(0),
numPassThroughSpecies_(0),
neutralMoleculePhase_(0),
IOwnNThermoPhase_(true),
cationPhase_(0),
anionPhase_(0)
{
@ -76,9 +77,13 @@ namespace Cantera {
numAnionSpecies_(0),
numPassThroughSpecies_(0),
neutralMoleculePhase_(neutralPhase),
IOwnNThermoPhase_(true),
cationPhase_(0),
anionPhase_(0)
{
if (neutralPhase) {
IOwnNThermoPhase_ = false;
}
constructPhaseFile(inputFile, id);
}
@ -93,9 +98,13 @@ namespace Cantera {
numAnionSpecies_(0),
numPassThroughSpecies_(0),
neutralMoleculePhase_(neutralPhase),
IOwnNThermoPhase_(true),
cationPhase_(0),
anionPhase_(0)
{
if (neutralPhase) {
IOwnNThermoPhase_ = false;
}
constructPhaseXML(phaseRoot, id);
}
@ -117,6 +126,7 @@ namespace Cantera {
numAnionSpecies_(0),
numPassThroughSpecies_(0),
neutralMoleculePhase_(0),
IOwnNThermoPhase_(true),
cationPhase_(0),
anionPhase_(0)
{
@ -153,6 +163,7 @@ namespace Cantera {
if (neutralMoleculePhase_) {
exit(-1);
}
IOwnNThermoPhase_ = b.IOwnNThermoPhase_;
cationPhase_ = b.cationPhase_;
anionPhase_ = b.anionPhase_;
@ -169,6 +180,10 @@ namespace Cantera {
*
*/
IonsFromNeutralVPSSTP::~IonsFromNeutralVPSSTP() {
if (IOwnNThermoPhase_) {
delete neutralMoleculePhase_;
neutralMoleculePhase_=0;
}
}
/*
@ -195,7 +210,7 @@ namespace Cantera {
* zero, as it is a non-complete class.
*/
int IonsFromNeutralVPSSTP::eosType() const {
return cIonFromNeutral;
return cIonsFromNeutral;
}

View file

@ -663,6 +663,7 @@ namespace Cantera {
public:
ThermoPhase *neutralMoleculePhase_;
protected:
bool IOwnNThermoPhase_;
//! ThermoPhase for the cation lattice
/*!
* Currently this is unimplemented and may be deleted

View file

@ -28,6 +28,7 @@
#ifdef WITH_IDEAL_SOLUTIONS
#include "IdealSolidSolnPhase.h"
#include "MargulesVPSSTP.h"
#include "IonsFromNeutralVPSSTP.h"
#endif
#ifdef WITH_PURE_FLUIDS
@ -86,13 +87,14 @@ namespace Cantera {
boost::mutex ThermoFactory::thermo_mutex;
#endif
static int ntypes = 17;
static int ntypes = 18;
static string _types[] = {"IdealGas", "Incompressible",
"Surface", "Edge", "Metal", "StoichSubstance",
"PureFluid", "LatticeSolid", "Lattice",
"HMW", "IdealSolidSolution", "DebyeHuckel",
"IdealMolalSolution", "IdealGasVPSS",
"MineralEQ3", "electrodeElectron", "Margules"
"MineralEQ3", "electrodeElectron", "Margules",
"IonsFromNeutralMolecule"
};
static int _itypes[] = {cIdealGas, cIncompressible,
@ -101,7 +103,7 @@ namespace Cantera {
cHMW, cIdealSolidSolnPhase, cDebyeHuckel,
cIdealMolalSoln, cVPSS_IdealGas,
cMineralEQ3, cElectrodeElectron,
cMargulesVPSSTP
cMargulesVPSSTP, cIonsFromNeutral
};
/*
@ -142,6 +144,10 @@ namespace Cantera {
case cMargulesVPSSTP:
th = new MargulesVPSSTP();
break;
case cIonsFromNeutral:
th = new IonsFromNeutralVPSSTP();
break;
#endif
#ifdef WITH_METAL

View file

@ -72,7 +72,8 @@ namespace Cantera {
const int cMargulesVPSSTP = 301;
const int cIonFromNeutral = 2000;
const int cIonsFromNeutral = 2000;
//! Variable Pressure Standard State ThermoPhase objects
const int cVPSS_IdealGas = 1001;