23 SurfPhase::SurfPhase(doublereal n0):
60 for (
size_t k = 0; k <
m_kk; k++) {
81 for (
size_t k = 0; k <
m_kk; k++) {
89 for (
size_t k = 0; k <
m_kk; k++) {
97 for (
size_t k = 0; k <
m_kk; k++) {
120 for (
size_t k = 0; k <
m_kk; k++) {
144 "Bad value for number of parameter");
182 for (
size_t k = 0; k <
m_kk; k++) {
213 m_cp0.push_back(0.0);
214 m_mu0.push_back(0.0);
230 "Site density must be positive. Got {}", n0);
239 for (
size_t k = 0; k <
m_kk; k++) {
244 "Sum of Coverage fractions is zero or negative");
246 for (
size_t k = 0; k <
m_kk; k++) {
255 for (
size_t k = 0; k <
m_kk; k++) {
264 for (
size_t k = 0; k <
m_kk; k++) {
278 for (
size_t k = 0; k <
m_kk; k++) {
287 "Input coverages are all zero or negative");
293 if (state.
hasKey(
"coverages")) {
294 if (state[
"coverages"].is<string>()) {
306 if (
m_tlast != tnow || force) {
309 for (
size_t k = 0; k <
m_kk; k++) {
321 eosdata.
_require(
"model",
"Surface");
322 doublereal n =
getFloat(eosdata,
"site_density",
"toSI");
331 Units(1.0, 0, -
static_cast<double>(
m_ndim), 0, 0, 0, 1)));
356 doublereal n =
getFloat(eosdata,
"site_density",
"toSI");
Declarations for the EdgePhase ThermoPhase object, which models the interface between two surfaces (s...
Header for a simple thermodynamics model of a surface phase derived from ThermoPhase,...
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.
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.
bool hasKey(const std::string &key) const
Returns true if the map contains an item named key.
Base class for exceptions thrown by Cantera classes.
virtual void setParametersFromXML(const XML_Node &thermoData)
Set the Equation-of-State parameters by reading an XML Node Input.
EdgePhase(doublereal n0=1.0)
Constructor.
virtual void update(doublereal T, doublereal *cp_R, doublereal *h_RT, doublereal *s_R) const
Compute the reference-state properties for all species.
void getConcentrations(double *const c) const
Get the species concentrations (kmol/m^3).
doublereal mean_X(const doublereal *const Q) const
Evaluate the mole-fraction-weighted mean of an array Q.
virtual void setConcentrationsNoNorm(const double *const conc)
Set the concentrations without ignoring negative concentrations.
void setNDim(size_t ndim)
Set the number of spatial dimensions (1, 2, or 3).
size_t m_kk
Number of species in the phase.
size_t m_ndim
Dimensionality of the phase.
virtual void setConcentrations(const double *const conc)
Set the concentrations to the specified values within the phase.
double concentration(const size_t k) const
Concentration of species k.
std::string speciesName(size_t k) const
Name of the species with index k.
double moleFraction(size_t k) const
Return the mole fraction of a single species.
doublereal temperature() const
Temperature (K).
const std::vector< std::string > & speciesNames() const
Return a const reference to the vector of species names.
virtual void setTemperature(const doublereal temp)
Set the internally stored temperature of the phase (K).
A simple thermodynamic model for a surface phase, assuming an ideal solution model.
virtual void setStateFromXML(const XML_Node &state)
Set the initial state of the Surface Phase from an XML_Node.
void setCoveragesNoNorm(const doublereal *theta)
Set the surface site fractions to a specified state.
void setCoveragesByName(const std::string &cov)
Set the coverages from a string of colon-separated name:value pairs.
virtual bool addSpecies(shared_ptr< Species > spec)
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_s0
Temporary storage for the reference state entropies.
virtual void getGibbs_RT(doublereal *grt) const
Get the nondimensional Gibbs functions for the species in their standard states at the current T and ...
virtual void setState(const AnyMap &state)
Set the state using an AnyMap containing any combination of properties supported by the thermodynamic...
virtual doublereal cp_mole() const
Molar heat capacity at constant pressure. Units: J/kmol/K.
virtual void getPartialMolarEnthalpies(doublereal *hbar) const
Returns an array of partial molar enthalpies for the species in the mixture.
vector_fp m_speciesSize
Vector of species sizes (number of sites occupied). length m_kk.
virtual void getPartialMolarEntropies(doublereal *sbar) const
Returns an array of partial molar entropies of the species in the solution.
virtual doublereal enthalpy_mole() const
Return the Molar Enthalpy. Units: J/kmol.
virtual doublereal logStandardConc(size_t k=0) const
Natural logarithm of the standard concentration of the kth species.
virtual void getPartialMolarVolumes(doublereal *vbar) const
Return an array of partial molar volumes for the species in the mixture.
void getCoverages(doublereal *theta) const
Return a vector of surface coverages.
virtual void getStandardVolumes(doublereal *vol) const
Get the molar volumes of the species standard states at the current T and P of the solution.
void setSiteDensity(doublereal n0)
Set the site density of the surface phase (kmol m-2)
virtual doublereal cv_mole() const
Molar heat capacity at constant volume. Units: J/kmol/K.
virtual void getActivityConcentrations(doublereal *c) const
Return a vector of activity concentrations for each species.
virtual void setParametersFromXML(const XML_Node &thermoData)
Set the Equation-of-State parameters by reading an XML Node Input.
doublereal m_n0
Surface site density (kmol m-2)
doublereal m_logn0
log of the surface site density
vector_fp m_h0
Temporary storage for the reference state enthalpies.
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 getPartialMolarCp(doublereal *cpbar) const
Return an array of partial molar heat capacities for the species in the mixture.
virtual void getStandardChemPotentials(doublereal *mu0) const
Get the array of chemical potentials at unit activity for the species at their standard states at the...
virtual double size(size_t k) const
Returns the number of sites occupied by one molecule of species k.
virtual void getEntropy_R(doublereal *sr) const
Get the array of nondimensional Entropy functions for the standard state species at the current T and...
virtual doublereal entropy_mole() const
Return the Molar Entropy. Units: J/kmol-K.
vector_fp m_work
Temporary work array.
virtual void initThermo()
Initialize the ThermoPhase object after all species have been set up.
vector_fp m_mu0
Temporary storage for the reference state Gibbs energies.
virtual void getEntropy_R_ref(doublereal *er) const
Returns the vector of nondimensional entropies of the reference state at the current temperature of t...
void _updateThermo(bool force=false) const
Update the species reference state thermodynamic functions.
virtual void getCp_R_ref(doublereal *cprt) const
Returns the vector of nondimensional constant pressure heat capacities of the reference state at the ...
vector_fp m_cp0
Temporary storage for the reference state heat capacities.
virtual void getPureGibbs(doublereal *g) 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 getChemPotentials(doublereal *mu) const
Get the species chemical potentials. Units: J/kmol.
virtual void getEnthalpy_RT(doublereal *hrt) const
Get the nondimensional Enthalpy functions for the species at their standard states at the current T a...
void setCoverages(const doublereal *theta)
Set the surface site fractions to a specified state.
SurfPhase(doublereal n0=1.0)
Constructor.
virtual doublereal intEnergy_mole() const
Return the Molar Internal Energy. Units: J/kmol.
vector_fp m_logsize
vector storing the log of the size of each species.
virtual void getEnthalpy_RT_ref(doublereal *hrt) const
Returns the vector of nondimensional enthalpies of the reference state at the current temperature of ...
virtual doublereal standardConcentration(size_t k=0) const
Return the standard concentration for the kth species.
virtual bool addSpecies(shared_ptr< Species > spec)
doublereal RT() const
Return the Gas Constant multiplied by the current temperature.
doublereal m_tlast
last value of the temperature processed by reference state
virtual void setState(const AnyMap &state)
Set the state using an AnyMap containing any combination of properties supported by the thermodynamic...
virtual void initThermoFile(const std::string &inputFile, const std::string &id)
MultiSpeciesThermo m_spthermo
Pointer to the calculation manager for species reference-state thermodynamic properties.
AnyMap m_input
Data supplied via setParameters.
A representation of the units associated with a dimensional quantity.
Class XML_Node is a tree-based representation of the contents of an XML file.
bool hasChild(const std::string &ch) const
Tests whether the current node has a child node with a particular name.
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,...
CTML ("Cantera Markup Language") is the variant of XML that Cantera uses to store data.
const double OneAtm
One atmosphere [Pa].
const double 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 double GasConstant
Universal Gas Constant [J/kmol/K].
std::map< std::string, double > compositionMap
Map connecting a string name with a double.
void importPhase(XML_Node &phase, ThermoPhase *th)
Import a phase information into an empty ThermoPhase object.
Namespace for the Cantera kernel.
const U & getValue(const std::map< T, U > &m, const T &key, const U &default_val)
Const accessor for a value in a std::map.
doublereal getFloat(const XML_Node &parent, const std::string &name, const std::string &type)
Get a floating-point value from a child element.
bool getOptionalFloat(const XML_Node &parent, const std::string &name, doublereal &fltRtn, const std::string &type)
Get an optional floating-point value from a child element.
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...
void scale(InputIter begin, InputIter end, OutputIter out, S scale_factor)
Multiply elements of an array by a scale factor.
compositionMap parseCompString(const std::string &ss, const std::vector< std::string > &names)
Parse a composition string into a map consisting of individual key:composition pairs.
Contains declarations for string manipulation functions within Cantera.
Various templated functions that carry out common vector operations (see Templated Utility Functions)...