25 neutralMoleculePhase_(0),
34 const std::string& inputFile,
const std::string&
id) :
36 neutralMoleculePhase_(0),
46 const XML_Node& phaseRoot,
bool spInstalled) :
48 neutralMoleculePhase_(0),
54 throw CanteraError(
"PDSS_IonsFromNeutral",
"sp installing not done yet");
108 throw CanteraError(
"PDSS_IonsFromNeutral::initAllPts",
"Dynamic cast failed");
115 const XML_Node& phaseNode,
const std::string&
id)
119 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSXML",
120 "no thermo Node for species " + speciesNode.
name());
123 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSXML",
124 "thermo model for species isn't IonsFromNeutral: "
125 + speciesNode.
name());
129 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSXML",
130 "no Thermo::neutralSpeciesMultipliers Node for species " + speciesNode.
name());
135 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSXML",
"Dynamic cast failed");
139 std::vector<std::string> key;
140 std::vector<std::string> val;
147 for (
size_t i = 0; i <
numMult_; i++) {
167 const std::string& inputFile,
const std::string&
id)
169 if (inputFile.size() == 0) {
170 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSFile",
171 "input file is null");
174 ifstream fin(path.c_str());
176 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSFile",
"could not open "
177 +path+
" for reading.");
188 throw CanteraError(
"PDSS_IonsFromNeutral::constructPDSSFile",
189 "ERROR: Can not find phase named " +
190 id +
" in file named " + inputFile);
195 &(fxml_phase->
root()));
213 doublereal val = 0.0;
214 for (
size_t i = 0; i <
numMult_; i++) {
231 doublereal val = 0.0;
232 for (
size_t i = 0; i <
numMult_; i++) {
237 val -= 2.0 * log(2.0);
246 doublereal val = 0.0;
247 for (
size_t i = 0; i <
numMult_; i++) {
252 val += 2.0 * log(2.0);
261 doublereal val = 0.0;
262 for (
size_t i = 0; i <
numMult_; i++) {
273 doublereal val = 0.0;
274 for (
size_t i = 0; i <
numMult_; i++) {
291 doublereal val = 0.0;
292 for (
size_t i = 0; i <
numMult_; i++) {
297 val += 2.0 * log(2.0);
305 doublereal val = 0.0;
306 for (
size_t i = 0; i <
numMult_; i++) {
316 doublereal val = 0.0;
317 for (
size_t i = 0; i <
numMult_; i++) {
322 val -= 2.0 * log(2.0);
330 doublereal val = 0.0;
331 for (
size_t i = 0; i <
numMult_; i++) {
341 doublereal val = 0.0;
342 for (
size_t i = 0; i <
numMult_; i++) {
doublereal temperature() const
Return the temperature stored in the object.
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...
std::vector< size_t > idNeutralMoleculeVec
Vector of species indices in the neutral molecule ThermoPhase.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
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.
SpeciesThermo * m_spthermo
Pointer to the species thermodynamic property manager.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
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 base class for the classes that manage the calculation of standard state properties for all t...
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 doublereal maxTemp(size_t k=npos) const =0
Maximum temperature.
doublereal m_pres
State of the system - pressure.
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.
virtual void getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
virtual doublereal enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
virtual void getStandardVolumes(doublereal *vol) const
Get the molar volumes of the species standard states at the current T and P of the solution...
virtual doublereal molarVolume() const
Return the molar volume at standard state.
VPSSMgr * m_vpssmgr_ptr
Pointer to the VPSS manager for this object.
virtual void initAllPtrs(VPStandardStateTP *vptp_ptr, VPSSMgr *vpssmgr_ptr, SpeciesThermo *spthermo_ptr)
Initialize or Reinitialize all shallow pointers in the object.
size_t m_spindex
Species index in the ThermoPhase corresponding to this species.
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
std::string lowercase(const std::string &s)
Cast a copy of a string to lower case.
virtual doublereal density() const
Return the standard state density at standard state.
PDSS_enumType m_pdssType
Enumerated type describing the type of the PDSS object.
virtual void initAllPtrs(VPStandardStateTP *vptp_ptr, VPSSMgr *vpssmgr_ptr, SpeciesThermo *spthermo_ptr)
Initialize or Reinitialize all shallow pointers in the object.
Pure Virtual base class for the species thermo manager classes.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
std::vector< double > factorVec
Stoichiometric coefficient for this species using the Neutral Molecule Species in the vector idNeutra...
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...
virtual doublereal entropy_R() const
Return the standard state entropy divided by RT.
size_t speciesIndex(const std::string &name) const
Returns the index of a species named 'name' within the Phase object.
virtual void initThermo()
Initialization routine for all of the shallow pointers.
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.
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 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 name() const
Returns the name of the XML node.
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
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 cp_R() const
Return the molar const pressure heat capacity divided by RT.
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
virtual doublereal entropy_R_ref() const
Return the molar entropy 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 refPressure(size_t k=npos) const =0
The reference-state pressure for species k.
Base class for exceptions thrown by Cantera classes.
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 enthalpy_RT() const
Return the standard state molar enthalpy divided by RT.
const ThermoPhase * neutralMoleculePhase_
Pointer to the Neutral Molecule ThermoPhase object.
doublereal m_maxTemp
Maximum temperature.
virtual doublereal gibbs_RT_ref() const
Return the molar Gibbs free energy divided by RT at reference pressure.
doublereal m_minTemp
Minimum 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...
PDSS_IonsFromNeutral & operator=(const PDSS_IonsFromNeutral &b)
Assignment operator.
size_t nSpecies() const
Returns the number of species in the phase.
virtual doublereal minTemp(size_t k=npos) const =0
Minimum temperature.
virtual void initThermo()
Initialization routine for all of the shallow pointers.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
Virtual base class for a species with a pressure dependent standard state.
std::vector< double > tmpNM
Vector of length equal to the number of species in the neutral molecule phase.
virtual doublereal temperature() const
Return the current stored temperature.
VPStandardStateTP * m_tp
ThermoPhase which this species belongs to.
virtual PDSS * duplMyselfAsPDSS() const
Duplication routine for objects which inherit from PDSS.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
doublereal m_temp
Current temperature used by the PDSS object.
PDSS & operator=(const PDSS &b)
Assignment operator.
Contains declarations for string manipulation functions within Cantera.
#define DATA_PTR(vec)
Creates a pointer to the start of the raw data for a vector.
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
virtual SpeciesThermo & speciesThermo(int k=-1)
Return a changeable reference to the calculation manager for species reference-state thermodynamic pr...
bool add2RTln2_
Add 2RTln2 to the entropy and Gibbs free energies for this species.
XML_Node & root() const
Return the root of the current XML_Node tree.
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.
virtual doublereal gibbs_RT() const
Return the molar Gibbs free energy divided by RT.
void build(std::istream &f)
Main routine to create an tree-like representation of an XML file.
std::string speciesName(size_t k) const
Name of the species with index k.
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.
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
doublereal m_p0
Reference state pressure of the species.
doublereal m_mw
Molecular Weight of the species.