26 IdealSolnGasVPSS::IdealSolnGasVPSS() :
43 "Couldn't find phase named \"" + id_ +
"\" in file, " + infile);
80 return cIdealSolnGasVPSS;
82 return cIdealSolnGasVPSS_iscv;
132 double dens = 1.0 /
dot(vss.begin(), vss.end(), dtmp);
146 throw CanteraError(
"IdealSolnGasVPSS::isothermalCompressibility() ",
160 for (
size_t k = 0; k <
m_kk; k++) {
165 for (
size_t k = 0; k <
m_kk; k++) {
170 for (
size_t k = 0; k <
m_kk; k++) {
201 "To be removed after Cantera 2.2.");
203 if (
eosType() == cIdealSolnGasPhase0) {
204 for (
int i = 0; i < sizeUA; i++) {
208 for (
int i = 0; i < sizeUA; i++) {
213 uA[1] = -int(
nDim());
233 for (
size_t k = 0; k <
m_kk; k++) {
245 doublereal invRT = 1.0 /
_RT();
246 for (
size_t k = 0; k <
m_kk; k++) {
255 for (
size_t k = 0; k <
m_kk; k++) {
257 mu[k] += rt*(log(xx));
271 for (
size_t k = 0; k <
m_kk; k++) {
313 doublereal pres = 0.0;
315 for (
size_t k = 0; k <
m_kk; k++) {
316 double tmp = -grt[k] + mu_RT[k];
319 }
else if (tmp > 500.0) {
320 double tmp2 = tmp / 500.;
322 m_pp[k] = m_p0 * exp(500.) * tmp2;
324 m_pp[k] = m_p0 * exp(tmp);
343 std::string model = thermoNode[
"model"];
344 if (model ==
"IdealGasVPSS") {
346 }
else if (model ==
"IdealSolnVPSS") {
350 "Unknown thermo model : " + model);
361 if (phaseNode.
hasChild(
"standardConc")) {
364 "standardConc node for ideal gas");
367 string formStringa = scNode.
attrib(
"model");
368 string formString =
lowercase(formStringa);
369 if (formString ==
"unity") {
371 }
else if (formString ==
"molar_volume") {
373 }
else if (formString ==
"solvent_volume") {
377 "Unknown standardConc model: " + formStringa);
382 "Unspecified standardConc model");
392 std::string model = thermoNode[
"model"];
393 if (model ==
"IdealGasVPSS") {
395 }
else if (model ==
"IdealSolnVPSS") {
399 "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.
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.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
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.
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()
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()
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.
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.
Templates for operations on vector-like objects.
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 void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
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.
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.
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...