22 IdealSolidSolnPhase::IdealSolidSolnPhase(
int formGC) :
27 if (formGC < 0 || formGC > 2) {
29 " Illegal value of formGC");
34 const std::string& id_,
int formGC) :
39 if (formGC < 0 || formGC > 2) {
41 " Illegal value of formGC");
52 if (formGC < 0 || formGC > 2) {
54 " Illegal value of formGC");
103 "Density is not an independent variable");
115 throw CanteraError(
"IdealSolidSolnPhase::setMolarDensity",
116 "Density is not an independent variable");
133 for (
size_t k = 0; k <
m_kk; k++) {
134 c[k] = dtmp[k] * mmw;
138 for (
size_t k = 0; k <
m_kk; k++) {
144 for (
size_t k = 0; k <
m_kk; k++) {
145 c[k] = dtmp[k] * atmp;
166 for (
size_t k = 0; k <
m_kk; k++) {
175 for (
size_t k = 0; k <
m_kk; k++) {
177 mu[k] =
RT() * (g_RT[k] + log(xx))
186 for (
size_t k = 0; k <
m_kk; k++) {
188 mu[k] = (g_RT[k] + log(xx))
198 scale(_h.begin(), _h.end(), hbar,
RT());
204 for (
size_t k = 0; k <
m_kk; k++) {
213 for (
size_t k = 0; k <
m_kk; k++) {
229 for (
size_t k = 0; k <
m_kk; k++) {
238 for (
size_t k = 0; k <
m_kk; k++) {
247 for (
size_t k = 0; k <
m_kk; k++) {
255 copy(_s.begin(), _s.end(), sr);
262 for (
size_t k = 0; k <
m_kk; k++) {
270 copy(_cpr.begin(), _cpr.end(), cpr);
283 for (
size_t k = 0; k !=
m_kk; k++) {
291 for (
size_t k = 0; k !=
m_kk; k++) {
300 for (
size_t k = 0; k !=
m_kk; k++) {
309 for (
size_t k = 0; k <
m_kk; k++) {
317 for (
size_t k = 0; k !=
m_kk; k++) {
325 for (
size_t k = 0; k !=
m_kk; k++) {
360 m_pe.push_back(0.0);;
362 if (spec->extra.hasKey(
"molar_volume")) {
366 "Molar volume not specified for species '{}'", spec->name);
375 if (id_.size() > 0 && phaseNode.
id() != id_) {
376 throw CanteraError(
"IdealSolidSolnPhase::initThermoXML",
377 "phasenode and Id are incompatible");
385 throw CanteraError(
"IdealSolidSolnPhase::initThermoXML",
386 "Unknown thermo model: " + thNode[
"model"]);
389 throw CanteraError(
"IdealSolidSolnPhase::initThermoXML",
390 "Unspecified thermo model");
398 if (phaseNode.
hasChild(
"standardConc")) {
401 throw CanteraError(
"IdealSolidSolnPhase::initThermoXML",
402 "Unspecified standardConc model");
414 doublereal pres = 0.0;
415 for (
size_t k = 0; k <
m_kk; k++) {
417 for (
size_t m = 0; m <
nElements(); m++) {
435 throw CanteraError(
"IdealSolidSolnPhase::setStandardConcentrationModel",
436 "Unknown standard concentration model '{}'", model);
458 doublereal rrt = 1.0 /
RT();
459 for (
size_t k = 0; k <
m_kk; k++) {
460 double deltaE = rrt *
m_pe[k];
size_t nElements() const
Number of elements.
virtual void getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void initThermoXML(XML_Node &phaseNode, const std::string &id)
Import and initialize a ThermoPhase object using an XML tree.
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data...
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure of the solution.
const doublereal OneAtm
One atmosphere [Pa].
vector_fp m_pp
Temporary array used in equilibrium calculations.
virtual void getPartialMolarVolumes(doublereal *vbar) const
returns an array of partial molar volumes of the species in the solution.
doublereal temperature() const
Temperature (K).
virtual void getIntEnergy_RT(doublereal *urt) const
Returns the vector of nondimensional Internal Energies of the standard state species at the current T...
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
Various templated functions that carry out common vector operations (see Templated Utility Functions)...
virtual void update(doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
doublereal moleFraction(size_t k) const
Return the mole fraction of a single species.
virtual void getChemPotentials(doublereal *mu) const
Get the species chemical potentials.
doublereal sum_xlogx() const
Evaluate .
Headers for the factory class that can create known ThermoPhase objects (see Thermodynamic Properties...
void calcDensity()
Calculate the density of the mixture using the partial molar volumes and mole fractions as input...
Class XML_Node is a tree-based representation of the contents of an XML file.
const vector_fp & gibbs_RT_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
virtual void setPressure(doublereal p)
Set the pressure at constant temperature.
virtual doublereal density() const
Density (kg/m^3).
vector_fp m_speciesMolarVolume
Vector of molar volumes for each species in the solution.
doublereal m_tlast
last value of the temperature processed by reference state
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_RT(doublereal *grt) const
Get the nondimensional Gibbs function for the species standard states at the current T and P of the s...
double speciesMolarVolume(int k) const
Report the molar volume of species k.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
int m_formGC
The standard concentrations can have one of three different forms: 0 = 'unity', 1 = 'molar_volume'...
doublereal m_Pcurrent
m_Pcurrent = The current pressure Since the density isn't a function of pressure, but only of the mol...
doublereal molarDensity() const
Molar density (kmol/m^3).
const vector_fp & cp_R_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
virtual void getActivityCoefficients(doublereal *ac) const
Get the array of species activity coefficients.
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
virtual doublereal gibbs_mole() const
Molar Gibbs free energy of the solution.
doublereal m_Pref
Value of the reference pressure for all species in this phase.
const doublereal * moleFractdivMMW() const
Returns a const pointer to the start of the moleFraction/MW array.
Header file for an ideal solid solution model with incompressible thermodynamics (see Thermodynamic P...
virtual doublereal standardConcentration(size_t k) const
The standard concentration used to normalize the generalized concentration.
virtual void getActivityConcentrations(doublereal *c) const
This method returns the array of generalized concentrations.
bool caseInsensitiveEquals(const std::string &input, const std::string &test)
Case insensitive equality predicate.
Base class for exceptions thrown by Cantera classes.
virtual void compositionChanged()
Apply changes to the state which are needed after the composition changes.
virtual void getIntEnergy_RT_ref(doublereal *urt) const
Returns the vector of nondimensional internal Energies of the reference state at the current temperat...
vector_fp m_expg0_RT
Vector containing the species reference exp(-G/RT) functions at T = m_tlast.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
const vector_fp & enthalpy_RT_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
virtual void getEntropy_R(doublereal *sr) const
Get the nondimensional Entropies for the species standard states at the current T and P of the soluti...
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
virtual void setToEquilState(const doublereal *lambda_RT)
This method is used by the ChemEquil equilibrium solver.
doublereal dot(InputIter x_begin, InputIter x_end, InputIter2 y_begin)
Function that calculates a templated inner product.
virtual bool addSpecies(shared_ptr< Species > spec)
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
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.
virtual void getGibbs_RT_ref(doublereal *grt) const
Returns the vector of nondimensional Gibbs Free Energies of the reference state at the current temper...
vector_fp m_cp0_R
Vector containing the species reference constant pressure heat capacities at T = m_tlast.
virtual void setMolarDensity(const doublereal rho)
Overridden setMolarDensity() function is necessary because the density is not an independent variable...
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 getChemPotentials_RT(doublereal *mu) const
Get the array of non-dimensional species solution chemical potentials at the current T and P ...
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.
const vector_fp & entropy_R_ref() const
Returns a reference to the vector of nondimensional enthalpies of the reference state at the current ...
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.
void _updateThermo() const
This function gets called for every call to functions in this class.
virtual doublereal refPressure() const
Returns the reference pressure in Pa.
virtual void setDensity(const doublereal rho)
Overridden setDensity() function is necessary because the density is not an independent variable...
std::string id() const
Return the id attribute, if present.
const doublereal GasConstant
Universal Gas Constant. [J/kmol/K].
virtual void setState_PX(doublereal p, doublereal *x)
Set the pressure (Pa) and mole fractions.
Contains declarations for string manipulation functions within Cantera.
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...
vector_fp m_h0_RT
Vector containing the species reference enthalpies at T = m_tlast.
virtual void getPureGibbs(doublereal *gpure) const
Get the Gibbs functions for the pure species at the current T and P of the solution.
size_t m_kk
Number of species in the phase.
virtual void getCp_R(doublereal *cpr) const
Get the nondimensional heat capacity at constant pressure function for the species standard states at...
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
vector_fp m_pe
Vector of potential energies for the species.
Namespace for the Cantera kernel.
doublereal nAtoms(size_t k, size_t m) const
Number of atoms of element m in species k.
void getSpeciesMolarVolumes(doublereal *smv) const
Fill in a return vector containing the species molar volumes.
virtual doublereal pressure() const
Pressure.
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 enthalpy_mole() const
Molar enthalpy of the solution.
void setStandardConcentrationModel(const std::string &model)
Set the form for the standard and generalized concentrations.
IdealSolidSolnPhase(int formCG=0)
Constructor for IdealSolidSolnPhase.
virtual void setDensity(const doublereal density_)
Set the internally stored density (kg/m^3) of the phase.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the array of nondimensional Enthalpy functions for the standard state species at the current T an...
virtual doublereal entropy_mole() const
Molar entropy of the solution.
vector_fp m_s0_R
Vector containing the species reference entropies at T = m_tlast.
vector_fp m_g0_RT
Vector containing the species reference Gibbs functions at T = m_tlast.