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");
64 IdealSolidSolnPhase& IdealSolidSolnPhase::operator=(
const IdealSolidSolnPhase& b)
92 "To be removed after Cantera 2.3.");
96 res = cIdealSolidSolnPhase0;
99 res = cIdealSolidSolnPhase1;
102 res = cIdealSolidSolnPhase2;
155 "Density is not an independent variable");
167 throw CanteraError(
"IdealSolidSolnPhase::setMolarDensity",
168 "Density is not an independent variable");
185 for (
size_t k = 0; k <
m_kk; k++) {
186 c[k] = dtmp[k] * mmw;
190 for (
size_t k = 0; k <
m_kk; k++) {
196 for (
size_t k = 0; k <
m_kk; k++) {
197 c[k] = dtmp[k] * atmp;
218 "Unused duplicate of standardConcentration. " 219 "To be removed after Cantera 2.3.");
233 for (
size_t k = 0; k <
m_kk; k++) {
242 for (
size_t k = 0; k <
m_kk; k++) {
244 mu[k] =
RT() * (g_RT[k] + log(xx))
253 for (
size_t k = 0; k <
m_kk; k++) {
255 mu[k] = (g_RT[k] + log(xx))
265 scale(_h.begin(), _h.end(), hbar,
RT());
271 for (
size_t k = 0; k <
m_kk; k++) {
280 for (
size_t k = 0; k <
m_kk; k++) {
296 for (
size_t k = 0; k <
m_kk; k++) {
305 for (
size_t k = 0; k <
m_kk; k++) {
314 for (
size_t k = 0; k <
m_kk; k++) {
322 copy(_s.begin(), _s.end(), sr);
329 for (
size_t k = 0; k <
m_kk; k++) {
337 copy(_cpr.begin(), _cpr.end(), cpr);
350 for (
size_t k = 0; k !=
m_kk; k++) {
358 for (
size_t k = 0; k !=
m_kk; k++) {
367 for (
size_t k = 0; k !=
m_kk; k++) {
376 for (
size_t k = 0; k <
m_kk; k++) {
384 for (
size_t k = 0; k !=
m_kk; k++) {
392 for (
size_t k = 0; k !=
m_kk; k++) {
427 m_pe.push_back(0.0);;
437 if (id_.size() > 0 && phaseNode.
id() != id_) {
438 throw CanteraError(
"IdealSolidSolnPhase::initThermoXML",
439 "phasenode and Id are incompatible");
446 if (!ba::iequals(thNode[
"model"],
"idealsolidsolution")) {
447 throw CanteraError(
"IdealSolidSolnPhase::initThermoXML",
448 "Unknown thermo model: " + thNode[
"model"]);
451 throw CanteraError(
"IdealSolidSolnPhase::initThermoXML",
452 "Unspecified thermo model");
460 if (phaseNode.
hasChild(
"standardConc")) {
462 string formString = scNode.
attrib(
"model");
463 if (ba::iequals(formString,
"unity")) {
465 }
else if (ba::iequals(formString,
"molar_volume")) {
467 }
else if (ba::iequals(formString,
"solvent_volume")) {
470 throw CanteraError(
"IdealSolidSolnPhase::initThermoXML",
471 "Unknown standardConc model: " + formString);
474 throw CanteraError(
"IdealSolidSolnPhase::initThermoXML",
475 "Unspecified standardConc model");
483 for (
size_t k = 0; k <
m_kk; k++) {
498 doublereal pres = 0.0;
499 for (
size_t k = 0; k <
m_kk; k++) {
501 for (
size_t m = 0; m <
nElements(); m++) {
528 doublereal rrt = 1.0 /
RT();
529 for (
size_t k = 0; k <
m_kk; k++) {
530 double deltaE = rrt *
m_pe[k];
virtual doublereal referenceConcentration(int k) const
The reference (ie standard) concentration used to normalize the generalized concentration.
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...
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure of the solution.
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].
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.
virtual int eosType() const
Equation of state flag.
doublereal moleFraction(size_t k) const
Return the mole fraction of a single species.
ThermoPhase & operator=(const ThermoPhase &right)
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.
void warn_deprecated(const std::string &method, const std::string &extra)
Print a warning indicating that method is deprecated.
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.
Base class for a phase with thermodynamic properties.
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
Format for the generalized concentrations.
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.
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 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.
virtual ThermoPhase * duplMyselfAsThermoPhase() const
Duplication routine for objects which inherit from ThermoPhase.
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.
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 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::string attrib(const std::string &attr) const
Function returns the value of an attribute.
Class IdealSolidSolnPhase represents a condensed phase ideal solution compound.
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.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
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.
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...
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...
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 ...
virtual doublereal enthalpy_mole() const
Molar enthalpy of the solution.
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.