32 "no 'standardState' Node for species '{}'",
35 std::string model = ss->
attrib(
"model");
37 getFloatArray(*ss, coeffs,
true,
"toSI",
"volumeTemperaturePolynomial");
38 if (coeffs.size() != 4) {
40 "Didn't get 4 density polynomial numbers for species '{}'",
43 if (model ==
"temperature_polynomial") {
45 }
else if (model ==
"density_temperature_polynomial") {
49 "Unknown 'standardState' model '{}' for species '{}'",
50 model, speciesNode.
name());
55 for (
size_t i = 0; i < 4; i++) {
62 for (
size_t i = 0; i < 4; i++) {
71 std::vector<AnyValue> data(4);
73 eosNode[
"model"] =
"density-temperature-polynomial";
74 data[0].setQuantity(
TCoeff_[0],
"kg/m^3");
75 data[1].setQuantity(
TCoeff_[1],
"kg/m^3/K");
76 data[2].setQuantity(
TCoeff_[2],
"kg/m^3/K^2");
77 data[3].setQuantity(
TCoeff_[3],
"kg/m^3/K^3");
79 eosNode[
"model"] =
"molar-volume-temperature-polynomial";
80 data[0].setQuantity(
TCoeff_[0],
"m^3/kmol");
81 data[1].setQuantity(
TCoeff_[1],
"m^3/kmol/K");
82 data[2].setQuantity(
TCoeff_[2],
"m^3/kmol/K^2");
83 data[3].setQuantity(
TCoeff_[3],
"m^3/kmol/K^3");
85 eosNode[
"data"] = std::move(data);
92 const string& model =
m_input[
"model"].asString();
94 if (model ==
"density-temperature-polynomial") {
102 }
else if (model ==
"molar-volume-temperature-polynomial") {
139 doublereal dens2 = dens * dens;
143 d2VdT2_ = 2.0 *
m_mw / (dens2 * dens) * ddensdT * ddensdT -
m_mw / dens2 * d2densdT2;
153 if (fabs(deltaP) < 1.0E-10) {
175 if (fabs(deltaP) < 1.0E-10) {
Declarations for the class PDSS_SSVol (pressure dependent standard state) which handles calculations ...
Header file for a derived class of ThermoPhase that handles variable pressure standard state methods ...
A map of string keys to values whose type can vary at runtime.
const UnitSystem & units() const
Return the default units that should be used to convert stored values.
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
A wrapper for a variable whose type is determined at runtime.
Base class for exceptions thrown by Cantera classes.
An error indicating that an unimplemented function has been called.
double m_sss_R
Standard state entropy divided by R.
virtual doublereal cp_mole() const
Return the molar const pressure heat capacity in units of J kmol-1 K-1.
double m_cpss_R
Standard state heat capacity divided by R.
double m_h0_RT
Reference state enthalpy divided by RT.
double m_g0_RT
Reference state Gibbs free energy divided by RT.
double m_s0_R
Reference state entropy divided by R.
double m_gss_RT
Standard state Gibbs free energy divided by RT.
double m_cp0_R
Reference state heat capacity divided by R.
double m_Vss
Standard State molar volume (m^3/kmol)
double m_hss_RT
Standard state enthalpy divided by RT.
double m_V0
Reference state molar volume (m^3/kmol)
virtual void getParameters(AnyMap &eosNode) const
Store the parameters needed to reconstruct a copy of this PDSS object.
doublereal d2VdT2_
2nd derivative of the volume wrt temperature
virtual void setPressure(doublereal pres)
Sets the pressure in the object.
void setDensityPolynomial(double *coeffs)
Set polynomial coefficients for the standard state density as a function of temperature.
void setVolumePolynomial(double *coeffs)
Set polynomial coefficients for the standard state molar volume as a function of temperature.
virtual void setState_TP(doublereal temp, doublereal pres)
Set the internal temperature and pressure.
virtual doublereal cv_mole() const
Return the molar const volume heat capacity in units of J kmol-1 K-1.
vector_fp TCoeff_
coefficients for the temperature representation
virtual void setTemperature(doublereal temp)
Set the internal temperature.
PDSS_SSVol()
Default Constructor.
doublereal dVdT_
Derivative of the volume wrt temperature.
virtual void initThermo()
Initialization routine.
SSVolume_Model
Types of general formulations for the specification of the standard state volume.
@ tpoly
This approximation is for a species with a cubic polynomial in temperature.
@ density_tpoly
This approximation is for a species where the density is expressed as a cubic polynomial in temperatu...
virtual void setParametersFromXML(const XML_Node &speciesNode)
Initialization routine for the PDSS object based on the speciesNode.
void calcMolarVolume()
Does the internal calculation of the volume.
virtual doublereal satPressure(doublereal t)
saturation pressure
SSVolume_Model volumeModel_
Enumerated data type describing the type of volume model used to calculate the standard state volume ...
virtual doublereal intEnergy_mole() const
Return the molar internal Energy in units of J kmol-1.
virtual void initThermo()
Initialization routine.
virtual void setParametersFromXML(const XML_Node &speciesNode)
Initialization routine for the PDSS object based on the speciesNode.
doublereal m_pres
State of the system - pressure.
shared_ptr< SpeciesThermoInterpType > m_spthermo
Pointer to the species thermodynamic property manager.
doublereal m_temp
Current temperature used by the PDSS object.
doublereal m_maxTemp
Maximum temperature.
doublereal m_p0
Reference state pressure of the species.
doublereal m_mw
Molecular Weight of the species.
AnyMap m_input
Input data supplied via setParameters.
virtual void getParameters(AnyMap &eosNode) const
Store the parameters needed to reconstruct a copy of this PDSS object.
doublereal m_minTemp
Minimum temperature.
double convert(double value, const std::string &src, const std::string &dest) const
Convert value from the units of src to the units of dest.
Class XML_Node is a tree-based representation of the contents of an XML file.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
std::string name() const
Returns the name of the XML node.
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.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.
Namespace for the Cantera kernel.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
const double GasConstant
Universal Gas Constant [J/kmol/K].
size_t getFloatArray(const XML_Node &node, vector_fp &v, const bool convert=true, const std::string &unitsString="", const std::string &nodeName="floatArray")
This function reads the current node or a child node of the current node with the default name,...