Go to the documentation of this file.
24 m_speciesMolarVolume(0),
41 return RT() *
mean_X(enthalpy_RT_ref()) +
90 for (
size_t k = 0; k <
m_kk; k++) {
109 for (
size_t k = 0; k <
m_kk; k++) {
111 mu[k] =
RT() * (g_RT[k] + log(xx))
119 scale(_h.begin(), _h.end(), hbar,
RT());
125 for (
size_t k = 0; k <
m_kk; k++) {
134 for (
size_t k = 0; k <
m_kk; k++) {
147 scale(gibbsrt.begin(), gibbsrt.end(), mu0,
RT());
154 for (
size_t k = 0; k <
m_kk; k++) {
163 for (
size_t k = 0; k <
m_kk; k++) {
171 std::copy(_s.begin(), _s.end(), sr);
178 for (
size_t k = 0; k <
m_kk; k++) {
186 for (
size_t k = 0; k <
m_kk; k++) {
194 std::copy(_cpr.begin(), _cpr.end(), cpr);
202 const vector_fp& LatticePhase::enthalpy_RT_ref()
const
217 for (
size_t k = 0; k <
m_kk; k++) {
246 if (spec->input.hasKey(
"equation-of-state")) {
247 auto& eos = spec->input[
"equation-of-state"].getMapWhere(
248 "model",
"constant-volume");
249 if (eos.hasKey(
"density")) {
251 }
else if (eos.hasKey(
"molar-density")) {
252 mv = 1.0 / eos.convert(
"molar-density",
"kmol/m^3");
253 }
else if (eos.hasKey(
"molar-volume")) {
254 mv = eos.convert(
"molar-volume",
"m^3/kmol");
256 }
else if (spec->extra.hasKey(
"molar_volume")) {
258 mv = spec->extra[
"molar_volume"].asDouble();
268 for (
size_t k = 0; k <
m_kk; k++) {
269 if (
species(k)->extra.hasKey(
"molar_volume")) {
272 auto& eos =
species(k)->input[
"equation-of-state"].getMapWhere(
273 "model",
"constant-volume");
274 if (eos.hasKey(
"molar-volume") || eos.hasKey(
"density")
275 || eos.hasKey(
"molar-density")) {
289 for (
size_t k = 0; k <
m_kk; k++) {
305 eosdata.
_require(
"model",
"Lattice");
virtual void getPartialMolarCp(doublereal *cpbar) const
Returns an array of partial molar Heat Capacities at constant pressure of the species in the solution...
vector_fp m_h0_RT
Reference state enthalpies / RT.
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure of the solution.
virtual doublereal pressure() const
In this equation of state implementation, the density is a function only of the mole fractions.
virtual void getPureGibbs(doublereal *gpure) const
Get the Gibbs functions for the standard state of the species at the current T and P of the solution.
void getMoleFractions(double *const x) const
Get the species mole fraction vector.
const double SmallNumber
smallest number to compare to zero.
doublereal m_site_density
Site Density of the lattice solid.
double convert(const std::string &key, const std::string &units) const
Convert the item stored by the given key to the units specified in units.
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the species standard states at the current T an...
const vector_fp & cp_R_ref() const
Returns a reference to the dimensionless reference state Heat Capacity vector.
virtual void getGibbs_ref(doublereal *g) const
Returns the vector of the Gibbs function of the reference state at the current temperature of the sol...
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
virtual void setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
void assignDensity(const double density_)
Set the internally stored constant density (kg/m^3) of the phase.
virtual void update(doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
doublereal calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input.
vector_fp m_g0_RT
Temporary storage for the reference state Gibbs energies.
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 getStandardVolumes(doublereal *vol) const
Get the molar volumes of the species standard states at the current T and P of the solution.
vector_fp m_s0_R
Temporary storage for the reference state entropies at the current temperature.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
virtual doublereal cv_mole() const
Molar heat capacity at constant volume of the solution.
double moleFraction(size_t k) const
Return the mole fraction of a single species.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
size_t m_kk
Number of species in the phase.
virtual bool addSpecies(shared_ptr< Species > spec)
AnyMap m_input
Data supplied via setParameters.
void setSiteDensity(double sitedens)
Set the density of lattice sites [kmol/m^3].
doublereal molecularWeight(size_t k) const
Molecular weight of species k.
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species standard states at the current T and P of the ...
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species standard states at their standard states at...
virtual doublereal enthalpy_mole() const
Return the Molar Enthalpy. Units: J/kmol.
const AnyMap & input() const
Access input data associated with the phase description.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual Units standardConcentrationUnits() const
The activity of a species in solution is related to the chemical potential by.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
Class XML_Node is a tree-based representation of the contents of an XML file.
doublereal m_tlast
last value of the temperature processed by reference state
const double OneAtm
One atmosphere [Pa].
doublereal m_Pcurrent
The current pressure.
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
vector_fp m_cp0_R
Temporary storage for the reference state heat capacities.
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
doublereal sum_xlogx() const
Evaluate .
virtual void getActivityConcentrations(doublereal *c) const
This method returns an array of generalized concentrations.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
doublereal temperature() const
Temperature (K).
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature,...
virtual doublereal entropy_mole() const
Molar entropy of the solution. Units: J/kmol/K.
void _updateThermo() const
Update the species reference state thermodynamic functions.
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
const vector_fp & gibbs_RT_ref() const
Returns a reference to the dimensionless reference state Gibbs free energy vector.
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
vector_fp m_speciesMolarVolume
Vector of molar volumes for each species in the solution.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
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.
double molarDensity() const
Molar density (kmol/m^3).
const double GasConstant
Universal Gas Constant [J/kmol/K].
const vector_fp & entropy_R_ref() const
Returns a reference to the dimensionless reference state Entropy vector.
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
void _require(const std::string &a, const std::string &v) const
Require that the current XML node has an attribute named by the first argument, a,...
virtual void getStandardChemPotentials(doublereal *mu) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
LatticePhase()
Base Empty constructor.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
doublereal m_Pref
Reference state pressure.
shared_ptr< Species > species(const std::string &name) const
Return the Species object for the named species.
Namespace for the Cantera kernel.
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
virtual bool addSpecies(shared_ptr< Species > spec)