37 throw CanteraError(
"IdealSolnGasVPSS::setStandardConcentrationModel",
38 "Unknown standard concentration model '{}'", model);
84 return Units(1.0, 0, -3, 0, 0, 0, 1);
96 for (
size_t k = 0; k <
m_kk; k++) {
101 for (
size_t k = 0; k <
m_kk; k++) {
106 for (
size_t k = 0; k <
m_kk; k++) {
130 for (
size_t k = 0; k <
m_kk; k++) {
140 for (
size_t k = 0; k <
m_kk; k++) {
142 mu[k] +=
RT() * log(xx);
149 scale(hbar.begin(), hbar.end(), hbar.begin(),
RT());
156 for (
size_t k = 0; k <
m_kk; k++) {
165 scale(ubar.begin(), ubar.end(), ubar.begin(),
RT());
191 for (
size_t k = 0; k <
m_kk; k++) {
192 double tmp = -
m_g0_RT[k] + mu_RT[k];
195 }
else if (tmp > 500.0) {
196 double tmp2 = tmp / 500.;
198 m_pp[k] = m_p0 * exp(500.) * tmp2;
200 m_pp[k] = m_p0 * exp(tmp);
231 phaseNode[
"standard-concentration-basis"] =
"species-molar-volume";
233 phaseNode[
"standard-concentration-basis"] =
"solvent-molar-volume";
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 string &key) const
Returns true if the map contains an item named key.
Base class for exceptions thrown by Cantera classes.
double enthalpy_mole() const override
Molar enthalpy. Units: J/kmol.
void getPartialMolarEnthalpies(span< double > hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
void getPartialMolarCp(span< double > cpbar) const override
Return an array of partial molar heat capacities for the species in the mixture.
vector< double > m_pp
Temporary storage - length = m_kk.
void getActivityCoefficients(span< double > ac) const override
Get the array of non-dimensional molar-based activity coefficients at the current solution temperatur...
void getParameters(AnyMap &phaseNode) const override
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
IdealSolnGasVPSS(const string &infile="", string id="")
Create an object from an input file.
void setPressure(double p) override
Set the internally stored pressure (Pa) at constant temperature and composition.
double cv_mole() const override
Molar heat capacity at constant volume and composition [J/kmol/K].
void setStandardConcentrationModel(const string &model)
Set the standard concentration model.
double entropy_mole() const override
Molar entropy. Units: J/kmol/K.
void calcDensity() override
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
int m_formGC
form of the generalized concentrations
double cp_mole() const override
Molar heat capacity at constant pressure and composition [J/kmol/K].
void setToEquilState(span< const double > lambda_RT) override
This method is used by the ChemEquil equilibrium solver.
void getPartialMolarVolumes(span< double > vbar) const override
Return an array of partial molar volumes for the species in the mixture.
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
void getPartialMolarEntropies(span< double > sbar) const override
Returns an array of partial molar entropies of the species in the solution.
double standardConcentration(size_t k=0) const override
Returns the standard concentration , which is used to normalize the generalized concentration.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
void getChemPotentials(span< double > mu) const override
Get the species chemical potentials. Units: J/kmol.
void getActivityConcentrations(span< double > c) const override
This method returns an array of generalized concentrations.
void getPartialMolarIntEnergies(span< double > ubar) const override
Return an array of partial molar internal energies for the species in the mixture.
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
size_t m_kk
Number of species in the phase.
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
double sum_xlogx() const
Evaluate .
double mean_X(span< const double > Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
double moleFraction(size_t k) const
Return the mole fraction of a single species.
virtual void setMoleFractions(span< const double > x)
Set the mole fractions to the specified values.
virtual void getParameters(AnyMap &phaseNode) const
Store the parameters of a ThermoPhase object such that an identical one could be reconstructed using ...
double RT() const
Return the Gas Constant multiplied by the current temperature.
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
virtual double refPressure() const
Returns the reference pressure in Pa.
AnyMap m_input
Data supplied via setParameters.
A representation of the units associated with a dimensional quantity.
void getCp_R(span< double > cpr) const override
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
vector< double > m_g0_RT
Vector containing the species reference Gibbs functions at T = m_tlast and P = p_ref.
void getIntEnergy_RT(span< double > urt) const override
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
vector< double > m_sss_R
Vector containing the species Standard State entropies at T = m_tlast and P = m_plast.
void getStandardChemPotentials(span< double > mu) const override
Get the array of chemical potentials at unit activity for the species at their standard states at the...
void initThermo() override
Initialize the ThermoPhase object after all species have been set up.
void getEnthalpy_RT(span< double > hrt) const override
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
void getEntropy_R(span< double > sr) const override
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
vector< double > m_cpss_R
Vector containing the species Standard State constant pressure heat capacities at T = m_tlast and P =...
void getStandardVolumes(span< double > vol) const override
Get the molar volumes of the species standard states at the current T and P of the solution.
virtual void updateStandardStateThermo() const
Updates the standard state thermodynamic functions at the current T and P of the solution.
vector< double > m_hss_RT
Vector containing the species Standard State enthalpies at T = m_tlast and P = m_plast.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
double m_Pcurrent
Current value of the pressure - state variable.
bool caseInsensitiveEquals(const string &input, const string &test)
Case insensitive equality predicate.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
const double GasConstant
Universal Gas Constant [J/kmol/K].
Namespace for the Cantera kernel.
const double SmallNumber
smallest number to compare to zero.
void checkArraySize(const char *procedure, size_t available, size_t required)
Wrapper for throwing ArraySizeError.
Contains declarations for string manipulation functions within Cantera.
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...