27 IdealSolnGasVPSS::IdealSolnGasVPSS() :
46 "Couldn't find phase named \"" + id_ +
"\" in file, " + infile);
85 return cIdealSolnGasVPSS;
87 return cIdealSolnGasVPSS_iscv;
153 double invDens =
dot(vss.begin(), vss.end(), dtmp);
158 double dens = 1.0/invDens;
168 throw CanteraError(
"IdealSolnGasVPSS::isothermalCompressibility() ",
182 for (
size_t k = 0; k <
m_kk; k++) {
187 for (
size_t k = 0; k <
m_kk; k++) {
192 for (
size_t k = 0; k <
m_kk; k++) {
229 if (eos == cIdealSolnGasPhase0) {
230 for (
int i = 0; i < sizeUA; i++) {
234 for (
int i = 0; i < sizeUA; i++) {
239 uA[1] = -int(
nDim());
259 for (
size_t k = 0; k <
m_kk; k++) {
271 doublereal invRT = 1.0 /
_RT();
272 for (
size_t k = 0; k <
m_kk; k++) {
282 for (
size_t k = 0; k <
m_kk; k++) {
284 mu[k] += rt*(log(xx));
300 for (
size_t k = 0; k <
m_kk; k++) {
302 sbar[k] += r * (- log(xx));
345 doublereal pres = 0.0;
347 for (
size_t k = 0; k <
m_kk; k++) {
348 tmp = -grt[k] + mu_RT[k];
351 }
else if (tmp > 500.0) {
354 m_pp[k] = m_p0 * exp(500.) * tmp2;
356 m_pp[k] = m_p0 * exp(tmp);
376 std::string model = thermoNode[
"model"];
377 if (model ==
"IdealGasVPSS") {
379 }
else if (model ==
"IdealSolnVPSS") {
383 "Unknown thermo model : " + model);
394 if (phaseNode.
hasChild(
"standardConc")) {
397 "standardConc node for ideal gas");
400 string formStringa = scNode.
attrib(
"model");
401 string formString =
lowercase(formStringa);
402 if (formString ==
"unity") {
404 }
else if (formString ==
"molar_volume") {
406 }
else if (formString ==
"solvent_volume") {
410 "Unknown standardConc model: " + formStringa);
415 "Unspecified standardConc model");
425 std::string model = thermoNode[
"model"];
426 if (model ==
"IdealGasVPSS") {
428 }
else if (model ==
"IdealSolnVPSS") {
432 "Unknown thermo model : " + model);
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Get the species partial molar enthalpies. Units: J/kmol.
const vector_fp & Gibbs_RT_ref() const
Return a reference to the vector of Gibbs free energies of the species.
XML_Node * get_XML_File(const std::string &file, int debug)
Return a pointer to the XML tree for a Cantera input file.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Get the species partial molar entropies. Units: J/kmol/K.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
Declaration file for a virtual base class that manages the calculation of standard state properties f...
IdealSolnGasVPSS()
Constructor.
doublereal _RT() const
Return the Gas Constant multiplied by the current temperature.
virtual void getStandardVolumes(doublereal *vol) const
Get the molar volumes of each species in their standard states at the current T and P of the solution...
Definition file for a derived class of ThermoPhase that assumes either an ideal gas or ideal solution...
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the standard state of the species at ...
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
Class XML_Node is a tree-based representation of the contents of an XML file.
virtual void updateStandardStateThermo() const
Updates the standard state thermodynamic functions at the current T and P of the solution.
doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine.
const vector_fp & cp_R() const
Return a reference to a vector of the constant pressure heat capacities of the species.
doublereal molarDensity() const
Molar density (kmol/m^3).
std::string lowercase(const std::string &s)
Cast a copy of a string to lower case.
VPSSMgr * m_VPSS_ptr
Pointer to the VPSS manager that calculates all of the standard state info efficiently.
void getConcentrations(doublereal *const c) const
Get the species concentrations (kmol/m^3).
vector_fp m_pp
Temporary storage - length = m_kk.
doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
const vector_fp & enthalpy_RT() const
Return a reference to a vector of the molar enthalpies of the species in their standard states...
VPStandardStateTP & operator=(const VPStandardStateTP &b)
Assignment operator.
Base class for a phase with thermodynamic properties.
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
virtual void getPartialMolarCp(doublereal *cpbar) const
Get the partial molar heat capacities Units: J/kmol/K.
bool importPhase(XML_Node &phase, ThermoPhase *th, SpeciesThermoFactory *spfactory)
Import a phase information into an empty thermophase object.
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input...
doublereal pressure() const
Returns the current pressure of the phase.
doublereal sum_xlogx() const
Evaluate .
virtual doublereal standardConcentration(size_t k=0) const
Returns the standard concentration , which is used to normalize the generalized concentration.
doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
int m_formGC
form of the generalized concentrations
virtual doublereal refPressure(size_t k=npos) const
The reference-state pressure for the standard state.
Base class for exceptions thrown by Cantera classes.
virtual void initThermo()
This is a filter class for ThermoPhase that implements some prepatory steps for efficiently handling ...
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
IdealSolnGasVPSS & operator=(const IdealSolnGasVPSS &)
Assignment operator.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Get the species partial molar volumes. Units: m^3/kmol.
int m_idealGas
boolean indicating what ideal solution this is
doublereal dot(InputIter x_begin, InputIter x_end, InputIter2 y_begin)
Function that calculates a templated inner product.
const vector_fp & entropy_R() const
Return a reference to a vector of the entropies of the species.
void setPressure(doublereal p)
Set the pressure in the fluid.
size_t nSpecies() const
Returns the number of species in the phase.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the standard state at the current temperatu...
virtual void setParametersFromXML(const XML_Node &thermoNode)
Set equation of state parameter values from XML entries.
doublereal moleFraction(size_t k) const
Return the mole fraction of a single species.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Enthalpy functions for the standard state species at the current T an...
doublereal temperature() const
Temperature (K).
size_t nDim() const
Returns the number of spatial dimensions (1, 2, or 3)
const doublereal SmallNumber
smallest number to compare to zero.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
virtual int eosType() const
Equation of state type flag.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature, pressure, and solution concentration.
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 void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual doublereal logStandardConc(size_t k=0) const
Returns the natural logarithm of the standard concentration of the kth species.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Initialize a ThermoPhase object, potentially reading activity coefficient information from an XML dat...
virtual void setState_PX(doublereal p, doublereal *x)
Set the pressure (Pa) and mole fractions.
virtual void getUnitsStandardConc(double *uA, int k=0, int sizeUA=6) const
Returns the units of the standard and generalized concentrations.
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.
doublereal intEnergy_mole() const
Molar internal energy. Units: J/kmol.
doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Initialize a ThermoPhase object, potentially reading activity coefficient information from an XML dat...
virtual void getStandardVolumes(doublereal *vol) const
Get the molar volumes of each species in their standard states at the current T and P of the solution...
size_t m_kk
Number of species in the phase.
doublereal m_Pcurrent
Current value of the pressure - state variable.
doublereal gibbs_mole() const
Molar Gibbs function. Units: J/kmol.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity.
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Get the species partial molar enthalpies. Units: J/kmol.
const doublereal * moleFractdivMMW() const
Returns a const pointer to the start of the moleFraction/MW array.
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 ...
void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
virtual void setDensity(const doublereal density_)
Set the internally stored density (kg/m^3) of the phase Note the density of a phase is an independent...
An ideal solution or an ideal gas approximation of a phase.
void getChemPotentials_RT(doublereal *mu) const
Get the array of non-dimensional species chemical potentials These are partial molar Gibbs free energ...