24 IdealSolnGasVPSS::IdealSolnGasVPSS() :
30 IdealSolnGasVPSS::IdealSolnGasVPSS(
const std::string& infile, std::string id_) :
41 "Couldn't find phase named \"" + id_ +
"\" in file, " + infile);
49 throw CanteraError(
"IdealSolnGasVPSS::setStandardConcentrationModel",
50 "Standard concentration model not applicable for ideal gas");
60 throw CanteraError(
"IdealSolnGasVPSS::setStandardConcentrationModel",
61 "Unknown standard concentration model '{}'", model);
106 double dens = 1.0 /
dot(vss.begin(), vss.end(), dtmp);
118 throw CanteraError(
"IdealSolnGasVPSS::isothermalCompressibility() ",
132 for (
size_t k = 0; k <
m_kk; k++) {
137 for (
size_t k = 0; k <
m_kk; k++) {
142 for (
size_t k = 0; k <
m_kk; k++) {
170 for (
size_t k = 0; k <
m_kk; k++) {
180 for (
size_t k = 0; k <
m_kk; k++) {
182 mu[k] +=
RT() * log(xx);
196 for (
size_t k = 0; k <
m_kk; k++) {
228 doublereal pres = 0.0;
230 for (
size_t k = 0; k <
m_kk; k++) {
231 double tmp = -
m_g0_RT[k] + mu_RT[k];
234 }
else if (tmp > 500.0) {
235 double tmp2 = tmp / 500.;
237 m_pp[k] = m_p0 * exp(500.) * tmp2;
239 m_pp[k] = m_p0 * exp(tmp);
261 "solution / gas mode not set");
269 std::string model = thermoNode[
"model"];
270 if (model ==
"IdealGasVPSS") {
272 }
else if (model ==
"IdealSolnVPSS") {
276 "Unknown thermo model : " + model);
285 if (phaseNode.
hasChild(
"standardConc")) {
290 "Unspecified standardConc model");
299 std::string model = thermoNode[
"model"];
300 if (model ==
"IdealGasVPSS") {
302 }
else if (model ==
"IdealSolnVPSS") {
306 "Unknown thermo model : " + model);
virtual void updateStandardStateThermo() const
Updates the standard state thermodynamic functions at the current T and P of the solution.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
XML_Node * get_XML_File(const std::string &file, int debug)
Return a pointer to the XML tree for a Cantera input file.
vector_fp m_sss_R
Vector containing the species Standard State entropies at T = m_tlast and P = m_plast.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
doublereal moleFraction(size_t k) const
Return the mole fraction of a single species.
Definition file for a derived class of ThermoPhase that assumes either an ideal gas or ideal solution...
doublereal sum_xlogx() const
Evaluate .
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 getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
virtual bool addSpecies(shared_ptr< Species > spec)
vector_fp m_pp
Temporary storage - length = m_kk.
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
virtual bool addSpecies(shared_ptr< Species > spec)
void setStandardConcentrationModel(const std::string &model)
Set the standard concentration model.
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...
virtual doublereal standardConcentration(size_t k=0) const
Returns the standard concentration , which is used to normalize the generalized concentration.
const doublereal * moleFractdivMMW() const
Returns a const pointer to the start of the moleFraction/MW array.
int m_formGC
form of the generalized concentrations
bool caseInsensitiveEquals(const std::string &input, const std::string &test)
Case insensitive equality predicate.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
Base class for exceptions thrown by Cantera classes.
virtual void initThermo()
vector_fp m_cpss_R
Vector containing the species Standard State constant pressure heat capacities at T = m_tlast and P =...
void setSolnMode()
Set this phase to represent an ideal liquid or solid solution.
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
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.
virtual doublereal pressure() const
Returns the current pressure of the phase.
void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
virtual void setParametersFromXML(const XML_Node &thermoNode)
Set equation of state parameter values from XML entries.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
const doublereal SmallNumber
smallest number to compare to zero.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
vector_fp m_hss_RT
Vector containing the species Standard State enthalpies at T = m_tlast and P = m_plast.
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
vector_fp m_g0_RT
Vector containing the species reference Gibbs functions at T = m_tlast and P = p_ref.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
virtual void setState_PX(doublereal p, doublereal *x)
Set the pressure (Pa) and mole fractions.
Contains declarations for string manipulation functions within Cantera.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
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 initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
size_t m_kk
Number of species in the phase.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
void setGasMode()
Set this phase to represent an ideal gas.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
doublereal m_Pcurrent
Current value of the pressure - state variable.
Namespace for the Cantera kernel.
void getConcentrations(doublereal *const c) const
Get the species concentrations (kmol/m^3).
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
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 ...
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
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 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.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.