28 m_constMolarVolume(-1.0)
37 size_t spindex,
const std::string& inputFile,
const std::string&
id) :
40 m_constMolarVolume(-1.0)
53 m_constMolarVolume(-1.0)
62 m_constMolarVolume(-1.0)
90 const XML_Node& phaseNode,
bool spInstalled)
97 throw CanteraError(
"PDSS_SSVol::constructPDSSXML",
"spInstalled false not handled");
103 "no standardState Node for species " + speciesNode.
name());
105 std::string model = (*ss)[
"model"];
106 if (model ==
"constant_incompressible" || model ==
"constant") {
109 }
else if (model ==
"temperature_polynomial") {
114 " Didn't get 4 density polynomial numbers for species " + speciesNode.
name());
116 }
else if (model ==
"density_temperature_polynomial") {
121 " Didn't get 4 density polynomial numbers for species " + speciesNode.
name());
125 "standardState model for species isn't constant_incompressible: " + speciesNode.
name());
131 const std::string& inputFile,
const std::string&
id)
133 if (inputFile.size() == 0) {
135 "input file is null");
138 ifstream fin(path.c_str());
140 throw CanteraError(
"PDSS_SSVol::initThermo",
"could not open "
141 +path+
" for reading.");
153 "ERROR: Can not find phase named " +
154 id +
" in file named " + inputFile);
159 &(fxml_phase->
root()));
300 d2VdT2_ = 2.0 * TCoeff_[2] + 6.0 * m_temp * TCoeff_[3];
304 doublereal dens2 = dens * dens;
306 doublereal d2densdT2 = 2.0 * TCoeff_[2] + 6.0 * m_temp * TCoeff_[3];
308 d2VdT2_ = 2.0 *
m_mw / (dens2 * dens) * ddensdT * ddensdT -
m_mw / dens2 * d2densdT2;
310 throw CanteraError(
"PDSS_SSVol::calcMolarVolume",
"unimplemented");
316 throw CanteraError(
"PDSS_SSVol::critTemperature()",
"unimplemented");
322 throw CanteraError(
"PDSS_SSVol::critPressure()",
"unimplemented");
328 throw CanteraError(
"PDSS_SSVol::critDensity()",
"unimplemented");
336 if (fabs(deltaP) < 1.0E-10) {
358 if (fabs(deltaP) < 1.0E-10) {
382 if (fabs(rhoStored - rho) / (rhoStored + rho) > 1.0E-4) {
384 "Inconsistent supplied rho");
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...
PDSS_SSVol & operator=(const PDSS_SSVol &b)
Assignment operator.
doublereal molecularWeight(size_t k) const
Molecular weight of species k.
virtual doublereal molarVolume() const
Return the molar volume at standard state.
virtual doublereal enthalpy_RT() const
Return the standard state molar enthalpy divided by RT.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
XML_Node * findXMLPhase(XML_Node *root, const std::string &idtarget)
Search an XML_Node tree for a named phase XML_Node.
virtual doublereal satPressure(doublereal t)
saturation pressure
SpeciesThermo * m_spthermo
Pointer to the species thermodynamic property manager.
virtual doublereal cv_mole() const
Return the molar const volume heat capacity in units of J kmol-1 K-1.
void constructPDSSXML(VPStandardStateTP *vptp_ptr, size_t spindex, const XML_Node &speciesNode, const XML_Node &phaseNode, bool spInstalled)
Initialization of a PDSS object using an xml tree.
doublereal * m_cpss_R_ptr
Standard state heat capacity divided by R.
virtual void initThermoXML(const XML_Node &phaseNode, const std::string &id)
Initialization routine for the PDSS object based on the phaseNode.
doublereal * m_h0_RT_ptr
Reference state enthalpy divided by RT.
void calcMolarVolume() const
Does the internal calculation of the volume.
virtual doublereal gibbs_RT() const
Return the molar Gibbs free energy divided by RT.
virtual doublereal maxTemp(size_t k=npos) const =0
Maximum temperature.
virtual void update_one(size_t k, doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Like update(), but only updates the single species k.
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
doublereal m_pres
State of the system - pressure.
virtual void setTemperature(doublereal temp)
Set the internal temperature.
virtual void initThermoXML(const XML_Node &phaseNode, const std::string &id)
Initialization routine for the PDSS object based on the phaseNode.
Class XML_Node is a tree-based representation of the contents of an XML file.
This file contains definitions of terms that are used in internal routines and are unlikely to need m...
doublereal getFloat(const Cantera::XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
virtual doublereal critPressure() const
critical pressure
This approximation is for a constant volume.
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.
doublereal * m_gss_RT_ptr
Standard state Gibbs free energy divided by RT.
PDSS_enumType m_pdssType
Enumerated type describing the type of the PDSS object.
Pure Virtual base class for the species thermo manager classes.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
doublereal * m_sss_R_ptr
Standard state entropy divided by R.
virtual doublereal critTemperature() const
critical temperature
virtual void setPressure(doublereal pres)
Sets the pressure in the object.
virtual doublereal cp_R_ref() const
Return the molar heat capacity divided by R at reference pressure.
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 enthalpy_RT_ref() const
Return the molar enthalpy divided by RT at reference pressure.
virtual void initThermo()
Initialization routine for all of the shallow pointers.
virtual doublereal gibbs_RT_ref() const
Return the molar gibbs free energy divided by RT at reference pressure.
virtual doublereal gibbs_mole() const
Return the molar Gibbs free energy in units of J kmol-1.
doublereal d2VdT2_
2nd derivative of the volume wrt temperature
SSVolume_Model_enumType volumeModel_
Enumerated data type describing the type of volume model used to calculate the standard state volume ...
virtual doublereal cp_mole() const
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
doublereal m_constMolarVolume
Value of the constant molar volume for the species.
std::string name() const
Returns the name of the XML node.
Declarations for the class PDSS_SSVol (pressure dependent standard state) which handles calculations ...
Classes providing support for XML data files.
This approximation is for a species with a quadratic polynomial in temperature.
virtual doublereal molarVolume_ref() const
Return the molar volume at reference pressure.
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
virtual doublereal refPressure(size_t k=npos) const =0
The reference-state pressure for species k.
virtual doublereal critDensity() const
critical density
doublereal * m_s0_R_ptr
Reference state entropy divided by R.
Base class for exceptions thrown by Cantera classes.
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
vector_fp TCoeff_
coefficients for the temperature representation
virtual doublereal enthalpy_mole() const
Return the molar enthalpy in units of J kmol-1.
doublereal dVdT_
Derivative of the volume wrt temperature.
doublereal m_maxTemp
Maximum temperature.
doublereal m_minTemp
Minimum temperature.
Class for pressure dependent standard states that uses a standard state volume model of some sort...
doublereal * m_hss_RT_ptr
Standard state enthalpy divided by RT.
virtual doublereal minTemp(size_t k=npos) const =0
Minimum temperature.
const std::vector< std::string > & speciesNames() const
Return a const reference to the vector of species names.
virtual void initThermo()
Initialization routine for all of the shallow pointers.
virtual doublereal density() const
Return the standard state density at standard state.
virtual doublereal cp_R() const
Return the molar const pressure heat capacity divided by RT.
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
virtual doublereal entropy_R_ref() const
Return the molar entropy divided by R at reference pressure.
Virtual base class for a species with a pressure dependent standard state.
virtual PDSS * duplMyselfAsPDSS() const
Duplication routine for objects which inherit from PDSS.
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.
PDSS & operator=(const PDSS &b)
Assignment operator.
doublereal * m_g0_RT_ptr
Reference state Gibbs free energy divided by RT.
doublereal * m_cp0_R_ptr
Reference state heat capacity divided by R.
virtual SpeciesThermo & speciesThermo(int k=-1)
Return a changeable reference to the calculation manager for species reference-state thermodynamic pr...
PDSS_SSVol(VPStandardStateTP *tp, size_t spindex)
Constructor.
virtual void setState_TR(doublereal temp, doublereal rho)
Set the internal temperature and density.
This approximation is for a species where the density is expressed as a quadratic polynomial in tempe...
doublereal * m_Vss_ptr
Standard State molar volume (m3 kg-1)
virtual doublereal entropy_mole() const
Return the molar entropy in units of J kmol-1 K-1.
doublereal * m_V0_ptr
Reference state molar volume (m3 kg-1)
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.
XML_Node & root() const
Return the root of the current XML_Node tree.
void build(std::istream &f)
Main routine to create an tree-like representation of an XML file.
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 ...
size_t getFloatArray(const Cantera::XML_Node &node, std::vector< doublereal > &v, const bool convert, const std::string &unitsString, const std::string &nodeName)
This function reads the current node or a child node of the current node with the default name...
doublereal m_p0
Reference state pressure of the species.
doublereal m_mw
Molecular Weight of the species.