24 m_speciesMolarVolume(0),
32 m_speciesMolarVolume(0),
38 LatticePhase& LatticePhase::operator=(
const LatticePhase& right)
72 return RT() *
mean_X(enthalpy_RT_ref()) +
116 for (
size_t k = 0; k <
m_kk; k++) {
135 for (
size_t k = 0; k <
m_kk; k++) {
137 mu[k] =
RT() * (g_RT[k] + log(xx))
145 scale(_h.begin(), _h.end(), hbar,
RT());
151 for (
size_t k = 0; k <
m_kk; k++) {
160 for (
size_t k = 0; k <
m_kk; k++) {
173 scale(gibbsrt.begin(), gibbsrt.end(), mu0,
RT());
180 for (
size_t k = 0; k <
m_kk; k++) {
189 for (
size_t k = 0; k <
m_kk; k++) {
197 std::copy(_s.begin(), _s.end(), sr);
204 for (
size_t k = 0; k <
m_kk; k++) {
212 for (
size_t k = 0; k <
m_kk; k++) {
220 std::copy(_cpr.begin(), _cpr.end(), cpr);
228 const vector_fp& LatticePhase::enthalpy_RT_ref()
const 243 for (
size_t k = 0; k <
m_kk; k++) {
278 if (!id_.empty() && id_ != phaseNode.
id()) {
287 if (!ba::iequals(thNode[
"model"],
"lattice")) {
289 "Unknown thermo model: " + thNode[
"model"]);
293 "Unspecified thermo model");
300 for (
size_t k = 0; k <
m_kk; k++) {
304 throw CanteraError(
" LatticePhase::initThermoXML",
"database problems");
322 for (
size_t k = 0; k <
m_kk; k++) {
343 eosdata.
_require(
"model",
"Lattice");
const vector_fp & entropy_R_ref() const
Returns a reference to the dimensionless reference state Entropy vector.
virtual doublereal pressure() const
In this equation of state implementation, the density is a function only of the mole fractions...
virtual bool addSpecies(shared_ptr< Species > spec)
doublereal m_site_density
Site Density of the lattice solid.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the species standard states at the current T an...
doublereal m_Pref
Reference state pressure.
std::string getChildValue(const XML_Node &parent, const std::string &nameString)
This function reads a child node with the name, nameString, and returns its XML value as the return s...
const XML_Node * findByName(const std::string &nm, int depth=100000) const
This routine carries out a recursive search for an XML node based on the name of the node...
const doublereal OneAtm
One atmosphere [Pa].
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure of the solution.
doublereal temperature() const
Temperature (K).
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
virtual void update(doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all 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.
doublereal moleFraction(size_t k) const
Return the mole fraction of a single species.
ThermoPhase & operator=(const ThermoPhase &right)
vector_fp m_s0_R
Temporary storage for the reference state entropies at the current temperature.
virtual void getPartialMolarCp(doublereal *cpbar) const
Returns an array of partial molar Heat Capacities at constant pressure of the species in the solution...
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
doublereal sum_xlogx() const
Evaluate .
vector_fp m_h0_RT
Reference state enthalpies / RT.
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
virtual void getParameters(int &n, doublereal *const c) const
Get the equation of state parameters in a vector.
Class XML_Node is a tree-based representation of the contents of an XML file.
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...
virtual void setParameters(int n, doublereal *const c)
Set the equation of state parameters from the argument list.
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 setPressure(doublereal p)
Set the internally stored pressure (Pa) at constant temperature and composition.
A simple thermodynamic model for a bulk phase, assuming a lattice of solid atoms. ...
virtual doublereal cv_mole() const
Molar heat capacity at constant volume of the solution.
virtual void setParametersFromXML(const XML_Node &eosdata)
Set equation of state parameter values from XML entries.
std::string m_vacancy
String name for the species which represents a vacancy in the lattice.
doublereal m_tlast
last value of the temperature processed by reference state
const vector_fp & cp_R_ref() const
Returns a reference to the dimensionless reference state Heat Capacity vector.
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
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...
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional Heat Capacities at constant pressure for the species standard states at the cu...
Base class for a phase with thermodynamic properties.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
void _require(const std::string &a, const std::string &v) const
Require that the current XML node have an attribute named by the first argument, a, and that this attribute have the the string value listed in the second argument, v.
virtual doublereal enthalpy_mole() const
Return the Molar Enthalpy. Units: J/kmol.
doublereal molarDensity() const
Molar density (kmol/m^3).
std::string speciesName(size_t k) const
Name of the species with index k.
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of non-dimensional activity coefficients at the current solution temperature, pressure, and solution concentration.
doublereal m_Pcurrent
The current pressure.
void _updateThermo() const
Update the species reference state thermodynamic functions.
vector_fp m_cp0_R
Temporary storage for the reference state heat capacities.
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine for objects which inherit from ThermoPhase.
Base class for exceptions thrown by Cantera classes.
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 getActivityConcentrations(doublereal *c) const
The activity of a species in solution is related to the chemical potential by The quantity is the ...
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species standard states at their standard states at...
void getMoleFractions(doublereal *const x) const
Get the species mole fraction vector.
virtual void setMolarDensity(const doublereal molarDensity)
Set the internally stored molar density (kmol/m^3) of the phase.
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
MultiSpeciesThermo * m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
XML_Node & child(const size_t n) const
Return a changeable reference to the n'th child of the current node.
XML_Node & root() const
Return the root of the current XML_Node tree.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
const doublereal SmallNumber
smallest number to compare to zero.
std::vector< double > vector_fp
Turn on the use of stl vectors for the basic array type within cantera Vector of doubles.
doublereal meanMolecularWeight() const
The mean molecular weight. Units: (kg/kmol)
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
vector_fp m_speciesMolarVolume
Vector of molar volumes for each species in the solution.
std::string id() const
Return the id attribute, if present.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
Contains declarations for string manipulation functions within Cantera.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual doublereal entropy_mole() const
Molar entropy of the solution. Units: J/kmol/K.
size_t m_kk
Number of species in the phase.
XML_Node * findByAttr(const std::string &attr, const std::string &val, int depth=100000) const
This routine carries out a recursive search for an XML node based on an attribute of each XML node...
const vector_fp & gibbs_RT_ref() const
Returns a reference to the dimensionless reference state Gibbs free energy vector.
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
Namespace for the Cantera kernel.
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
XML_Node * get_XML_NameID(const std::string &nameTarget, const std::string &file_ID, XML_Node *root)
This routine will locate an XML node in either the input XML tree or in another input file specified ...
Header for a simple thermodynamics model of a bulk phase derived from ThermoPhase, assuming a lattice of solid atoms (see Thermodynamic Properties and class LatticePhase).
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 compositionChanged()
Apply changes to the state which are needed after the composition changes.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.