Go to the documentation of this file.
24 IdealSolnGasVPSS::IdealSolnGasVPSS() :
30 IdealSolnGasVPSS::IdealSolnGasVPSS(
const std::string& infile, std::string id_) :
41 "Couldn't find phase named '{} in file '{}'",
50 throw CanteraError(
"IdealSolnGasVPSS::setStandardConcentrationModel",
51 "Standard concentration model not applicable for ideal gas");
63 throw CanteraError(
"IdealSolnGasVPSS::setStandardConcentrationModel",
64 "Unknown standard concentration model '{}'", model);
109 double dens = 1.0 /
dot(vss.begin(), vss.end(), dtmp);
128 return Units(1.0, 0, -3, 0, 0, 0, 1);
142 for (
size_t k = 0; k <
m_kk; k++) {
147 for (
size_t k = 0; k <
m_kk; k++) {
152 for (
size_t k = 0; k <
m_kk; k++) {
180 for (
size_t k = 0; k <
m_kk; k++) {
190 for (
size_t k = 0; k <
m_kk; k++) {
192 mu[k] +=
RT() * log(xx);
206 for (
size_t k = 0; k <
m_kk; k++) {
238 doublereal pres = 0.0;
240 for (
size_t k = 0; k <
m_kk; k++) {
241 double tmp = -
m_g0_RT[k] + mu_RT[k];
244 }
else if (tmp > 500.0) {
245 double tmp2 = tmp / 500.;
247 m_pp[k] = m_p0 * exp(500.) * tmp2;
249 m_pp[k] = m_p0 * exp(tmp);
270 const string& model =
m_input[
"thermo"].asString();
271 if (model ==
"ideal-solution-VPSS") {
273 }
else if (model ==
"ideal-gas-VPSS") {
283 "solution / gas mode not set");
291 std::string model = thermoNode[
"model"];
292 if (model ==
"IdealGasVPSS") {
294 }
else if (model ==
"IdealSolnVPSS") {
298 "Unknown thermo model : " + model);
307 if (phaseNode.
hasChild(
"standardConc")) {
312 "Unspecified standardConc model");
321 std::string model = thermoNode[
"model"];
322 if (model ==
"IdealGasVPSS") {
324 }
else if (model ==
"IdealSolnVPSS") {
327 throw CanteraError(
"IdealSolnGasVPSS::setParametersFromXML",
328 "Unknown thermo model : " + model);
doublereal m_Pcurrent
Current value of the pressure - state variable.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
virtual doublereal pressure() const
Returns the current pressure of the phase.
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
int m_formGC
form of the generalized concentrations
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
virtual Units standardConcentrationUnits() const
Returns the units of the "standard concentration" for this phase.
vector_fp m_g0_RT
Vector containing the species reference Gibbs functions at T = m_tlast and P = p_ref.
virtual void setState_PX(doublereal p, doublereal *x)
Set the pressure (Pa) and mole fractions.
int m_idealGas
boolean indicating what ideal solution this is
const double SmallNumber
smallest number to compare to zero.
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
vector_fp m_hss_RT
Vector containing the species Standard State enthalpies at T = m_tlast and P = m_plast.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
An error indicating that an unimplemented function has been called.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
virtual doublereal standardConcentration(size_t k=0) const
Returns the standard concentration , which is used to normalize the generalized concentration.
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void setParametersFromXML(const XML_Node &thermoNode)
Set equation of state parameter values from XML entries.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
virtual doublereal isothermalCompressibility() const
Returns the isothermal compressibility. Units: 1/Pa.
void setSolnMode()
Set this phase to represent an ideal liquid or solid solution.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
vector_fp m_sss_R
Vector containing the species Standard State entropies at T = m_tlast and P = m_plast.
void getConcentrations(double *const c) const
Get the species concentrations (kmol/m^3).
vector_fp m_cpss_R
Vector containing the species Standard State constant pressure heat capacities at T = m_tlast and P =...
double moleFraction(size_t k) const
Return the mole fraction of a single species.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
void setGasMode()
Set this phase to represent an ideal gas.
virtual doublereal entropy_mole() const
Molar entropy. Units: J/kmol/K.
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
size_t m_kk
Number of species in the phase.
AnyMap m_input
Data supplied via setParameters.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature,...
Class XML_Node is a tree-based representation of the contents of an XML file.
bool caseInsensitiveEquals(const std::string &input, const std::string &test)
Case insensitive equality predicate.
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
doublereal sum_xlogx() const
Evaluate .
virtual void initThermo()
doublereal dot(InputIter x_begin, InputIter x_end, InputIter2 y_begin)
Function that calculates a templated inner product.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual void initThermo()
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
const double * moleFractdivMMW() const
Returns a const pointer to the start of the moleFraction/MW array.
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
A representation of the units associated with a dimensional quantity.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
const double GasConstant
Universal Gas Constant [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.
void setStandardConcentrationModel(const std::string &model)
Set the standard concentration model.
Base class for exceptions thrown by Cantera classes.
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
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.
Namespace for the Cantera kernel.
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
vector_fp m_pp
Temporary storage - length = m_kk.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.