21 neutralMoleculePhase_(0),
30 const std::string& inputFile,
const std::string&
id) :
32 neutralMoleculePhase_(0),
38 "To be removed after Cantera 2.3.");
44 const XML_Node& phaseRoot,
bool spInstalled) :
46 neutralMoleculePhase_(0),
52 throw CanteraError(
"PDSS_IonsFromNeutral",
"sp installing not done yet");
67 PDSS_IonsFromNeutral& PDSS_IonsFromNeutral::operator=(
const PDSS_IonsFromNeutral& b)
102 throw CanteraError(
"PDSS_IonsFromNeutral::initAllPts",
"Dynamic cast failed");
109 const XML_Node& phaseNode,
const std::string&
id)
113 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSXML",
114 "no thermo Node for species " + speciesNode.
name());
116 if (!ba::iequals(tn->
attrib(
"model"),
"ionfromneutral")) {
117 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSXML",
118 "thermo model for species isn't IonsFromNeutral: " 119 + speciesNode.
name());
123 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSXML",
124 "no Thermo::neutralSpeciesMultipliers Node for species " + speciesNode.
name());
129 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSXML",
"Dynamic cast failed");
133 std::vector<std::string> key;
134 std::vector<std::string> val;
139 for (
size_t i = 0; i <
numMult_; i++) {
159 const std::string& inputFile,
const std::string&
id)
162 "To be removed after Cantera 2.3.");
163 if (inputFile.size() == 0) {
164 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSFile",
165 "input file is null");
174 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSFile",
175 "ERROR: Can not find phase named " +
176 id +
" in file named " + inputFile);
181 &fxml_phase->
root());
197 doublereal val = 0.0;
198 for (
size_t i = 0; i <
numMult_; i++) {
213 doublereal val = 0.0;
214 for (
size_t i = 0; i <
numMult_; i++) {
219 val -= 2.0 * log(2.0);
227 doublereal val = 0.0;
228 for (
size_t i = 0; i <
numMult_; i++) {
233 val += 2.0 * log(2.0);
241 doublereal val = 0.0;
242 for (
size_t i = 0; i <
numMult_; i++) {
252 doublereal val = 0.0;
253 for (
size_t i = 0; i <
numMult_; i++) {
268 doublereal val = 0.0;
269 for (
size_t i = 0; i <
numMult_; i++) {
274 val += 2.0 * log(2.0);
282 doublereal val = 0.0;
283 for (
size_t i = 0; i <
numMult_; i++) {
293 doublereal val = 0.0;
294 for (
size_t i = 0; i <
numMult_; i++) {
299 val -= 2.0 * log(2.0);
307 doublereal val = 0.0;
308 for (
size_t i = 0; i <
numMult_; i++) {
318 doublereal val = 0.0;
319 for (
size_t i = 0; i <
numMult_; i++) {
virtual doublereal temperature() const
Return the current stored temperature.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
virtual doublereal maxTemp(size_t k=npos) const
Maximum temperature.
virtual void getStandardVolumes_ref(doublereal *vol) const
Get the molar volumes of the species reference states at the current T and P_ref of the solution...
virtual PDSS * duplMyselfAsPDSS() const
Duplication routine for objects which inherit from PDSS.
std::vector< size_t > idNeutralMoleculeVec
Vector of species indices in the neutral molecule ThermoPhase.
doublereal temperature() const
Return the temperature stored in the object.
vector_fp factorVec
Stoichiometric coefficient for this species using the Neutral Molecule Species in the vector idNeutra...
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
std::string name() const
Returns the name of the XML node.
size_t numMult_
Number of neutral molecule species that make up the stoichiometric vector for this species...
XML_Node * findXMLPhase(XML_Node *root, const std::string &idtarget)
Search an XML_Node tree for a named phase XML_Node.
Derived class for pressure dependent standard states of an ideal gas species.
virtual void getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
const XML_Node * findByName(const std::string &nm, int depth=100000) const
This routine carries out a recursive search for an XML node based on the name of the node...
size_t speciesIndex(const std::string &name) const
Returns the index of a species named 'name' within the Phase object.
Virtual base class for the classes that manage the calculation of standard state properties for all t...
virtual doublereal density() const
Return the standard state density at standard state.
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
Header for intermediate ThermoPhase object for phases which consist of ions whose thermodynamics is c...
doublereal * m_h0_RT_ptr
Reference state enthalpy divided by RT.
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
virtual void getStandardVolumes(doublereal *vol) const
Get the molar volumes of the species standard states at the current T and P of the solution...
doublereal m_pres
State of the system - pressure.
vector_fp tmpNM
Vector of length equal to the number of species in the neutral molecule phase.
Class XML_Node is a tree-based representation of the contents of an XML file.
virtual void setTemperature(doublereal temp)
Set the internal temperature.
virtual void setState_TR(doublereal temp, doublereal rho)
Set the internal temperature and density.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
size_t nSpecies() const
Returns the number of species in the phase.
VPSSMgr * m_vpssmgr_ptr
Pointer to the VPSS manager for this object.
virtual doublereal refPressure(size_t k=npos) const
The reference-state pressure for species k.
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
size_t m_spindex
Species index in the ThermoPhase corresponding to this species.
virtual doublereal cp_R() const
Return the molar const pressure heat capacity divided by RT.
PDSS_enumType m_pdssType
Enumerated type describing the type of the PDSS object.
virtual MultiSpeciesThermo & speciesThermo(int k=-1)
Return a changeable reference to the calculation manager for species reference-state thermodynamic pr...
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
virtual void initAllPtrs(VPStandardStateTP *vptp_ptr, VPSSMgr *vpssmgr_ptr, MultiSpeciesThermo *spthermo_ptr)
Initialize or Reinitialize all shallow pointers in the object.
virtual void initThermo()
Initialization routine for all of the shallow pointers.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
virtual doublereal gibbs_RT() const
Return the molar Gibbs free energy divided by RT.
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
void constructPDSSFile(VPStandardStateTP *vptp_ptr, size_t spindex, const std::string &inputFile, const std::string &id)
Initialization of a PDSS object using an input XML file.
std::string speciesName(size_t k) const
Name of the species with index k.
virtual doublereal enthalpy_RT() const
Return the standard state molar enthalpy divided by RT.
void constructPDSSXML(VPStandardStateTP *vptp_ptr, size_t spindex, const XML_Node &speciesNode, const XML_Node &phaseNode, const std::string &id)
Initialization of a PDSS object using an XML tree.
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
int getPairs(const XML_Node &node, std::vector< std::string > &key, std::vector< std::string > &val)
This function interprets the value portion of an XML element as a series of "Pairs" separated by whit...
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
Base class for exceptions thrown by Cantera classes.
void build(const std::string &filename)
Populate the XML tree from an input file.
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
PDSS_IonsFromNeutral(VPStandardStateTP *tp, size_t spindex)
Constructor.
virtual doublereal gibbs_RT_ref() const
Return the molar Gibbs free energy divided by RT at reference pressure.
const ThermoPhase * neutralMoleculePhase_
Pointer to the Neutral Molecule ThermoPhase object.
doublereal m_maxTemp
Maximum temperature.
virtual doublereal minTemp(size_t k=npos) const
Minimum temperature.
doublereal m_minTemp
Minimum temperature.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
XML_Node & root() const
Return the root of the current XML_Node tree.
virtual void initThermo()
Initialization routine for all of the shallow pointers.
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
Virtual base class for a species with a pressure dependent standard state.
virtual doublereal entropy_R() const
Return the standard state entropy divided by RT.
VPStandardStateTP * m_tp
ThermoPhase which this species belongs to.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
doublereal m_temp
Current temperature used by the PDSS object.
virtual void initAllPtrs(VPStandardStateTP *vptp_ptr, VPSSMgr *vpssmgr_ptr, MultiSpeciesThermo *spthermo_ptr)
Initialize or Reinitialize all shallow pointers in the object.
PDSS & operator=(const PDSS &b)
Contains declarations for string manipulation functions within Cantera.
virtual doublereal molarVolume() const
Return the molar volume at standard state.
MultiSpeciesThermo * m_spthermo
Pointer to the species thermodynamic property manager.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
XML_Node * findByAttr(const std::string &attr, const std::string &val, int depth=100000) const
This routine carries out a recursive search for an XML node based on an attribute of each XML node...
A species thermodynamic property manager for a phase.
bool add2RTln2_
Add 2RTln2 to the entropy and Gibbs free energies for this species.
Namespace for the Cantera kernel.
Declarations for the class PDSS_IonsFromNeutral ( which handles calculations for a single ion in a fl...
ThermoPhase * neutralMoleculePhase_
This is a pointer to the neutral Molecule Phase.
doublereal fpValueCheck(const std::string &val)
Translate a string into one doublereal value, with error checking.
XML_Node * get_XML_NameID(const std::string &nameTarget, const std::string &file_ID, XML_Node *root)
This routine will locate an XML node in either the input XML tree or in another input file specified ...
int specialSpecies_
True if this species is the special species.
doublereal m_p0
Reference state pressure of the species.
doublereal m_mw
Molecular Weight of the species.