24 IdealSolnGasVPSS::IdealSolnGasVPSS() :
30 IdealSolnGasVPSS::IdealSolnGasVPSS(
const std::string& infile, std::string id_) :
41 "Couldn't find phase named \"" + id_ +
"\" in file, " + infile);
53 IdealSolnGasVPSS& IdealSolnGasVPSS::operator=(
const IdealSolnGasVPSS& b)
58 VPStandardStateTP::operator=(b);
75 "To be removed after Cantera 2.3.");
77 return cIdealSolnGasVPSS;
79 return cIdealSolnGasVPSS_iscv;
123 double dens = 1.0 /
dot(vss.begin(), vss.end(), dtmp);
135 throw CanteraError(
"IdealSolnGasVPSS::isothermalCompressibility() ",
149 for (
size_t k = 0; k <
m_kk; k++) {
154 for (
size_t k = 0; k <
m_kk; k++) {
159 for (
size_t k = 0; k <
m_kk; k++) {
187 for (
size_t k = 0; k <
m_kk; k++) {
197 for (
size_t k = 0; k <
m_kk; k++) {
199 mu[k] +=
RT() * log(xx);
213 for (
size_t k = 0; k <
m_kk; k++) {
246 doublereal pres = 0.0;
248 for (
size_t k = 0; k <
m_kk; k++) {
249 double tmp = -grt[k] + mu_RT[k];
252 }
else if (tmp > 500.0) {
253 double tmp2 = tmp / 500.;
255 m_pp[k] = m_p0 * exp(500.) * tmp2;
257 m_pp[k] = m_p0 * exp(tmp);
278 std::string model = thermoNode[
"model"];
279 if (model ==
"IdealGasVPSS") {
281 }
else if (model ==
"IdealSolnVPSS") {
285 "Unknown thermo model : " + model);
294 if (phaseNode.
hasChild(
"standardConc")) {
297 "standardConc node for ideal gas");
300 string formString = scNode.
attrib(
"model");
301 if (ba::iequals(formString,
"unity")) {
303 }
else if (ba::iequals(formString,
"molar_volume")) {
305 }
else if (ba::iequals(formString,
"solvent_volume")) {
309 "Unknown standardConc model: " + formString);
314 "Unspecified standardConc model");
324 std::string model = thermoNode[
"model"];
325 if (model ==
"IdealGasVPSS") {
327 }
else if (model ==
"IdealSolnVPSS") {
331 "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.
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.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
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.
Base class for a phase with thermodynamic properties.
virtual bool addSpecies(shared_ptr< Species > spec)
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
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
virtual int eosType() const
Equation of state type flag.
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 ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine for objects which inherit from ThermoPhase.
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.
std::unique_ptr< VPSSMgr > m_VPSS_ptr
Pointer to the VPSS manager that calculates all of the standard state info efficiently.
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.
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.
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
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...
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.
An ideal solution or an ideal gas approximation of a 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.