28 PseudoBinaryVPSSTP::PseudoBinaryVPSSTP() :
29 PBType_(PBTYPE_PASSTHROUGH),
31 indexSpecialSpecies_(
npos),
34 numPassThroughSpecies_(0),
35 neutralPBindexStart(0),
40 "To be removed after Cantera 2.2.");
44 PBType_(PBTYPE_PASSTHROUGH),
46 indexSpecialSpecies_(
npos),
49 numPassThroughSpecies_(0),
50 neutralPBindexStart(0),
66 PBMoleFractions_ = b.PBMoleFractions_;
67 cationList_ = b.cationList_;
68 numCationSpecies_ = b.numCationSpecies_;
69 anionList_ = b.anionList_;
70 numAnionSpecies_ = b.numAnionSpecies_;
71 passThroughList_ = b.passThroughList_;
72 numPassThroughSpecies_ = b.numPassThroughSpecies_;
73 neutralPBindexStart = b.neutralPBindexStart;
74 cationPhase_ = b.cationPhase_;
75 anionPhase_ = b.anionPhase_;
76 moleFractionsTmp_ = b.moleFractionsTmp_;
96 for (
size_t k = 0; k <
m_kk; k++) {
104 case PBTYPE_PASSTHROUGH:
105 for (
size_t k = 0; k <
m_kk; k++) {
109 case PBTYPE_SINGLEANION:
112 double sumAnion = 0.0;
113 for (
size_t k = 0; k <
m_kk; k++) {
116 for (
size_t k = 0; k < cationList_.size(); k++) {
120 PBMoleFractions_[0] = sumCat -sumAnion;
124 for (
size_t k = 0; k < numCationSpecies_; k++) {
125 PBMoleFractions_[1+k] = moleFractionsTmp_[cationList_[k]];
128 for (
size_t k = 0; k < numPassThroughSpecies_; k++) {
129 PBMoleFractions_[neutralPBindexStart + k] =
133 double sum = std::max(0.0, PBMoleFractions_[0]);
135 sum += PBMoleFractions_[k];
138 PBMoleFractions_[k] /= sum;
142 case PBTYPE_SINGLECATION:
147 case PBTYPE_MULTICATIONANION:
180 sprintf(p,
" \n %s:\n",
name().c_str());
183 sprintf(p,
" \n temperature %12.6g K\n",
temperature());
185 sprintf(p,
" pressure %12.6g Pa\n",
pressure());
187 sprintf(p,
" density %12.6g kg/m^3\n",
density());
193 sprintf(p,
" potential %12.6g V\n", phi);
212 sprintf(p,
" 1 kg 1 kmol\n");
214 sprintf(p,
" ----------- ------------\n");
216 sprintf(p,
" enthalpy %12.6g %12.4g J\n",
219 sprintf(p,
" internal energy %12.6g %12.4g J\n",
222 sprintf(p,
" entropy %12.6g %12.4g J/K\n",
225 sprintf(p,
" Gibbs function %12.6g %12.4g J\n",
228 sprintf(p,
" heat capacity c_p %12.6g %12.4g J/K\n",
232 sprintf(p,
" heat capacity c_v %12.6g %12.4g J/K\n",
237 sprintf(p,
" heat capacity c_v <not implemented> \n");
Header for intermediate ThermoPhase object for phases which employ Gibbs excess free energy based for...
virtual doublereal standardConcentration(size_t k=0) const
The standard concentration used to normalize the generalized concentration.
PseudoBinaryVPSSTP & operator=(const PseudoBinaryVPSSTP &b)
Assignment operator.
void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object.
virtual doublereal density() const
Density (kg/m^3).
PseudoBinaryVPSSTP()
Constructor.
doublereal electricPotential() const
Returns the electric potential of this phase (V).
virtual doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
GibbsExcessVPSSTP & operator=(const GibbsExcessVPSSTP &b)
Assignment operator.
An error indicating that an unimplemented function has been called.
void initLengths()
Initialize lengths of local variables after all species have been identified.
const size_t npos
index returned by functions to indicate "no position"
virtual void getActivities(doublereal *ac) const
Get the array of non-dimensional activities (molality based for this class and classes that derive fr...
size_t numPBSpecies_
Number of pseudo binary species.
Class XML_Node is a tree-based representation of the contents of an XML file.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
std::string name() const
Return the name of the phase.
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
doublereal intEnergy_mass() const
Specific internal energy.
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine for objects which inherit from ThermoPhase.
Base class for a phase with thermodynamic properties.
virtual doublereal intEnergy_mole() const
Molar internal energy. Units: J/kmol.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
doublereal gibbs_mass() const
Specific Gibbs function.
doublereal entropy_mass() const
Specific entropy.
doublereal pressure() const
Returns the current pressure of the phase.
void getElectrochemPotentials(doublereal *mu) const
Get the species electrochemical potentials.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
doublereal cp_mass() const
Specific heat at constant pressure.
virtual void calcPseudoBinaryMoleFractions() const
Calculate pseudo binary mole fractions.
Base class for exceptions thrown by Cantera classes.
doublereal cv_mass() const
Specific heat at constant volume.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
doublereal temperature() const
Temperature (K).
size_t indexSpecialSpecies_
index of special species
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
doublereal enthalpy_mass() const
Specific enthalpy.
std::vector< doublereal > moleFractions_
Storage for the current values of the mole fractions of the species.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Initialize a ThermoPhase object, potentially reading activity coefficient information from an XML dat...
Contains declarations for string manipulation functions within Cantera.
virtual void initThermo()
virtual void initThermo()
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
size_t m_kk
Number of species in the phase.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity.
virtual std::string report(bool show_thermo=true, doublereal threshold=1e-14) const
returns a summary of the state of the phase as a string
doublereal charge(size_t k) const
Dimensionless electrical charge of a single molecule of species k The charge is normalized by the the...
void save()
Function to put this error onto Cantera's error stack.