81 return Units(1.0, 0, -
static_cast<double>(
nDim()), 0, 0, 0, 1);
92 for (
size_t k = 0; k <
m_kk; k++) {
97 for (
size_t k = 0; k <
m_kk; k++) {
119 for (
size_t k = 0; k <
m_kk; k++) {
128 for (
size_t k = 0; k <
m_kk; k++) {
130 mu[k] =
RT() * (g_RT[k] + log(xx))
141 for (
size_t k = 0; k <
m_kk; k++) {
150 for (
size_t k = 0; k <
m_kk; k++) {
159 for (
size_t k = 0; k <
m_kk; k++) {
175 for (
size_t k = 0; k <
m_kk; k++) {
184 for (
size_t k = 0; k <
m_kk; k++) {
193 for (
size_t k = 0; k <
m_kk; k++) {
201 copy(_s.begin(), _s.end(), sr);
208 for (
size_t k = 0; k <
m_kk; k++) {
215 const vector<double>& _cpr =
cp_R_ref();
216 copy(_cpr.begin(), _cpr.end(), cpr);
229 for (
size_t k = 0; k !=
m_kk; k++) {
237 for (
size_t k = 0; k !=
m_kk; k++) {
246 for (
size_t k = 0; k !=
m_kk; k++) {
255 for (
size_t k = 0; k <
m_kk; k++) {
263 for (
size_t k = 0; k !=
m_kk; k++) {
271 for (
size_t k = 0; k !=
m_kk; k++) {
307 if (spec->input.hasKey(
"equation-of-state")) {
308 auto& eos = spec->input[
"equation-of-state"].getMapWhere(
"model",
"constant-volume");
310 if (eos.hasKey(
"density")) {
312 }
else if (eos.hasKey(
"molar-density")) {
313 mv = 1.0 / eos.convert(
"molar-density",
"kmol/m^3");
314 }
else if (eos.hasKey(
"molar-volume")) {
315 mv = eos.convert(
"molar-volume",
"m^3/kmol");
318 "equation-of-state entry for species '{}' is missing "
319 "'density', 'molar-volume', or 'molar-density' "
320 "specification", spec->name);
325 "Molar volume not specified for species '{}'", spec->name);
346 phaseNode[
"standard-concentration-basis"] =
"species-molar-volume";
348 phaseNode[
"standard-concentration-basis"] =
"solvent-molar-volume";
353 AnyMap& speciesNode)
const
358 auto& eosNode = speciesNode[
"equation-of-state"].getMapWhere(
359 "model",
"constant-volume",
true);
361 if (S->input.hasKey(
"equation-of-state")) {
362 auto& eosIn = S->input[
"equation-of-state"];
363 if (eosIn.hasKey(
"density")) {
364 eosNode[
"density"].setQuantity(
366 }
else if (eosIn.hasKey(
"molar-density")) {
390 for (
size_t k = 0; k <
m_kk; k++) {
391 double tmp = -grt[k] + mu_RT[k];
394 }
else if (tmp > 500.0) {
396 double tmp2 = tmp / 500.;
398 m_pp[k] = m_p0 * exp(500.) * tmp2;
400 m_pp[k] = m_p0 * exp(tmp);
420 throw CanteraError(
"IdealSolidSolnPhase::setStandardConcentrationModel",
421 "Unknown standard concentration model '{}'", model);
443 for (
size_t k = 0; k <
m_kk; k++) {
Header file for an ideal solid solution model with incompressible thermodynamics (see Thermodynamic P...
Declaration for class Cantera::Species.
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
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.
const vector< double > & entropy_R_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
double enthalpy_mole() const override
Molar enthalpy of the solution.
void getPartialMolarEnthalpies(double *hbar) const override
Returns an array of partial molar enthalpies for the species in the mixture.
void getChemPotentials(double *mu) const override
Get the species chemical potentials.
double pressure() const override
Pressure.
vector< double > m_g0_RT
Vector containing the species reference Gibbs functions at T = m_tlast.
const vector< double > & cp_R_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
void getSpeciesParameters(const string &name, AnyMap &speciesNode) const override
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
const vector< double > & gibbs_RT_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
void getEntropy_R(double *sr) const override
Get the nondimensional Entropies for the species standard states at the current T and P of the soluti...
vector< double > m_h0_RT
Vector containing the species reference enthalpies at T = m_tlast.
void getGibbs_ref(double *g) const override
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
double speciesMolarVolume(int k) const
Report the molar volume of species k.
vector< double > m_pp
Temporary array used in equilibrium calculations.
double m_Pref
Value of the reference pressure for all species in this phase.
void getCp_R(double *cpr) const override
Get the nondimensional heat capacity at constant pressure function for the species standard states at...
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.
void getActivityConcentrations(double *c) const override
This method returns the array of generalized concentrations.
void getSpeciesMolarVolumes(double *smv) const
Fill in a return vector containing the species molar volumes.
void setPressure(double p) override
Set the pressure at constant temperature.
void getPartialMolarVolumes(double *vbar) const override
returns an array of partial molar volumes of the species in the solution.
void getPureGibbs(double *gpure) const override
Get the Gibbs functions for the pure species at the current T and P of the solution.
double standardConcentration(size_t k) const override
The standard concentration used to normalize the generalized concentration.
void setStandardConcentrationModel(const string &model)
Set the form for the standard and generalized concentrations.
void getIntEnergy_RT_ref(double *urt) const override
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
void getEnthalpy_RT(double *hrt) const override
Get the array of nondimensional Enthalpy functions for the standard state species at the current T an...
void getEntropy_R_ref(double *er) const override
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
vector< double > m_s0_R
Vector containing the species reference entropies at T = m_tlast.
void getGibbs_RT(double *grt) const override
Get the nondimensional Gibbs function for the species standard states at the current T and P of the s...
double entropy_mole() const override
Molar entropy of the solution.
int m_formGC
The standard concentrations can have one of three different forms: 0 = 'unity', 1 = 'species-molar-vo...
vector< double > m_speciesMolarVolume
Vector of molar volumes for each species in the solution.
void getCp_R_ref(double *cprt) const override
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
void getStandardVolumes(double *vol) const override
Get the molar volumes of the species standard states at the current T and P of the solution.
double cp_mole() const override
Molar heat capacity at constant pressure of the solution.
void getIntEnergy_RT(double *urt) const override
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
Units standardConcentrationUnits() const override
Returns the units of the "standard concentration" for this phase.
IdealSolidSolnPhase(const string &infile="", const string &id="")
Construct and initialize an IdealSolidSolnPhase ThermoPhase object directly from an input file.
void getPartialMolarCp(double *cpbar) const override
Returns an array of partial molar Heat Capacities at constant pressure of the species in the solution...
void compositionChanged() override
Apply changes to the state which are needed after the composition changes.
double gibbs_mole() const override
Molar Gibbs free energy of the solution.
vector< double > m_cp0_R
Vector containing the species reference constant pressure heat capacities at T = m_tlast.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
virtual void _updateThermo() const
This function gets called for every call to functions in this class.
void setToEquilState(const double *mu_RT) override
This method is used by the ChemEquil equilibrium solver.
void getGibbs_RT_ref(double *grt) const override
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
void getActivityCoefficients(double *ac) const override
Get the array of species activity coefficients.
vector< double > m_expg0_RT
Vector containing the species reference exp(-G/RT) functions at T = m_tlast.
void getPartialMolarEntropies(double *sbar) const override
Returns an array of partial molar entropies of the species in the solution.
double m_Pcurrent
m_Pcurrent = The current pressure Since the density isn't a function of pressure, but only of the mol...
void getEnthalpy_RT_ref(double *hrt) const override
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
virtual void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
const vector< double > & enthalpy_RT_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
virtual void update(double T, double *cp_R, double *h_RT, double *s_R) const
Compute the reference-state properties for all species.
virtual double molarDensity() const
Molar density (kmol/m^3).
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
virtual void setMoleFractions(const double *const x)
Set the mole fractions to the specified values.
size_t m_kk
Number of species in the phase.
size_t nDim() const
Returns the number of spatial dimensions (1, 2, or 3)
double temperature() const
Temperature (K).
double meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
void getMoleFractions(double *const x) const
Get the species mole fraction vector.
double sum_xlogx() const
Evaluate .
size_t speciesIndex(const string &name) const
Returns the index of a species named 'name' within the Phase object.
double moleFraction(size_t k) const
Return the mole fraction of a single species.
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
double mean_X(const double *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
virtual bool ready() const
Returns a bool indicating whether the object is ready for use.
double molecularWeight(size_t k) const
Molecular weight of species k.
shared_ptr< Species > species(const string &name) const
Return the Species object for the named species.
string name() const
Return the name of the phase.
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.
double m_tlast
last value of the temperature processed by reference state
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
void initThermoFile(const string &inputFile, const string &id)
Initialize a ThermoPhase object using an input file.
virtual void getSpeciesParameters(const string &name, AnyMap &speciesNode) const
Get phase-specific parameters of a Species object such that an identical one could be reconstructed a...
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
virtual double refPressure() const
Returns the reference pressure in Pa.
bool addSpecies(shared_ptr< Species > spec) override
Add a Species to this Phase.
AnyMap m_input
Data supplied via setParameters.
A representation of the units associated with a dimensional quantity.
bool caseInsensitiveEquals(const string &input, const string &test)
Case insensitive equality predicate.
const double GasConstant
Universal Gas Constant [J/kmol/K].
Namespace for the Cantera kernel.
const double SmallNumber
smallest number to compare to zero.
Contains declarations for string manipulation functions within Cantera.
Various templated functions that carry out common vector and polynomial operations (see Templated Arr...