41 throw CanteraError(
"IdealSolnGasVPSS::setStandardConcentrationModel",
42 "Unknown standard concentration model '{}'", model);
82 double dens = 1.0 /
dot(vss.begin(), vss.end(), dtmp);
91 return Units(1.0, 0, -3, 0, 0, 0, 1);
102 for (
size_t k = 0; k <
m_kk; k++) {
107 for (
size_t k = 0; k <
m_kk; k++) {
112 for (
size_t k = 0; k <
m_kk; k++) {
135 for (
size_t k = 0; k <
m_kk; k++) {
145 for (
size_t k = 0; k <
m_kk; k++) {
147 mu[k] +=
RT() * log(xx);
161 for (
size_t k = 0; k <
m_kk; k++) {
193 doublereal pres = 0.0;
195 for (
size_t k = 0; k <
m_kk; k++) {
196 double tmp = -
m_g0_RT[k] + mu_RT[k];
199 }
else if (tmp > 500.0) {
200 double tmp2 = tmp / 500.;
202 m_pp[k] = m_p0 * exp(500.) * tmp2;
204 m_pp[k] = m_p0 * exp(tmp);
234 phaseNode[
"standard-concentration-basis"] =
"species-molar-volume";
236 phaseNode[
"standard-concentration-basis"] =
"solvent-molar-volume";
247 if (phaseNode.
hasChild(
"standardConc")) {
252 "Unspecified standardConc model");
Definition file for a derived class of ThermoPhase that assumes an ideal solution approximation and h...
Declarations for the virtual base class PDSS (pressure dependent standard state) which handles calcul...
A map of string keys to values whose type can vary at runtime.
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
Base class for exceptions thrown by Cantera classes.
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature,...
virtual void getPartialMolarIntEnergies(doublereal *ubar) const
Return an array of partial molar internal energies for the species in the mixture.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
virtual doublereal enthalpy_mole() const
Molar enthalpy. Units: J/kmol.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
vector_fp m_pp
Temporary storage - length = m_kk.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
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 entropy_mole() const
Molar entropy. Units: J/kmol/K.
virtual void initThermo()
int m_formGC
form of the generalized concentrations
virtual Units standardConcentrationUnits() const
Returns the units of the "standard concentration" for this phase.
void setStandardConcentrationModel(const std::string &model)
Set the standard concentration model.
IdealSolnGasVPSS(const std::string &infile="", std::string id="")
Create an object from an input file.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
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.
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
const double * moleFractdivMMW() const
Returns a const pointer to the start of the moleFraction/MW array.
size_t m_kk
Number of species in the phase.
double moleFraction(size_t k) const
Return the mole fraction of a single species.
doublereal sum_xlogx() const
Evaluate .
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
void initThermoFile(const std::string &inputFile, const std::string &id)
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.
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
AnyMap m_input
Data supplied via setParameters.
virtual void getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
A representation of the units associated with a dimensional quantity.
vector_fp m_g0_RT
Vector containing the species reference Gibbs functions at T = m_tlast and P = p_ref.
virtual bool addSpecies(shared_ptr< Species > spec)
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 getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
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 initThermo()
vector_fp m_sss_R
Vector containing the species Standard State entropies at T = m_tlast and P = m_plast.
vector_fp m_cpss_R
Vector containing the species Standard State constant pressure heat capacities at T = m_tlast and P =...
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
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 for the species at their standard states at the...
virtual void updateStandardStateThermo() const
Updates the standard state thermodynamic functions at the current T and P of the solution.
vector_fp m_hss_RT
Vector containing the species Standard State enthalpies at T = m_tlast and P = m_plast.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
Class XML_Node is a tree-based representation of the contents of an XML file.
std::string attrib(const std::string &attr) const
Function returns the value of an attribute.
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.
Namespace for the Cantera kernel.
doublereal dot(InputIter x_begin, InputIter x_end, InputIter2 y_begin)
Function that calculates a templated inner product.
bool caseInsensitiveEquals(const std::string &input, const std::string &test)
Case insensitive equality predicate.
const double SmallNumber
smallest number to compare to zero.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
const double GasConstant
Universal Gas Constant [J/kmol/K].
Contains declarations for string manipulation functions within Cantera.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
Classes providing support for XML data files.