Cleaned up Doxygen documentation for class SurfPhase and descendants

This commit is contained in:
Ray Speth 2013-02-14 01:02:54 +00:00
parent 6b0a708389
commit b15640a741
4 changed files with 24 additions and 153 deletions

View file

@ -11,7 +11,6 @@
namespace Cantera
{
//! An interface between multiple bulk phases.
/*!
* This class is defined mostly for convenience. It inherits both from
@ -107,17 +106,14 @@ public:
}
protected:
//! Flag indicating that the object has been instantiated
bool m_ok;
//! XML_Node pointer to the XML File object that contains the Surface and the Interfacial Reaction object
//! description
Cantera::XML_Node* m_r;
};
//! Import an instance of class Interface from a specification in an input file.
/*!
* This is the preferred method to create an Interface instance.
@ -130,5 +126,4 @@ Interface* importInterface(const std::string& infile, const std::string& id,
}
#endif

View file

@ -16,23 +16,21 @@
namespace Cantera
{
//! A thermodynamic %Phase representing a one dimensional edge between two surfaces
//! A thermodynamic phase representing a one dimensional edge between two
//! surfaces.
/*!
* This thermodynamic function is largely a wrapper around the SurfPhase
* thermodynamic object.
*
* All of the equations and formulations carry through from SurfPhase to this
* EdgePhase object.
* It should be noted however, that dimensional object with length dimensions,
* have their dimensions reduced by one.
* EdgePhase object. It should be noted however, that dimensional object with
* length dimensions, have their dimensions reduced by one.
*
* @ingroup thermoprops
*/
class EdgePhase : public SurfPhase
{
public:
//! Constructor
/*!
* @param n0 Surface site density (kmol m-1).
@ -62,10 +60,8 @@ public:
return cEdge;
}
//! Set the Equation-of-State parameters by reading an XML Node Input
/*!
*
* The Equation-of-State data consists of one item, the site density.
*
* @param thermoData Reference to an XML_Node named thermo
@ -89,5 +85,3 @@ public:
}
#endif

View file

@ -76,7 +76,7 @@ namespace Cantera
* s_k(T,P) = s^o_k(T) - R \log(\theta_k)
* \f]
*
* <b> Application within %Kinetics Managers </b>
* <b> %Application within %Kinetics Managers </b>
*
* The activity concentration,\f$ C^a_k \f$, used by the kinetics manager, is equal to
* the actual concentration, \f$ C^s_k \f$, and is given by the following
@ -93,7 +93,7 @@ namespace Cantera
* <b> Instantiation of the Class </b>
*
* The constructor for this phase is located in the default ThermoFactory
* for Cantera. A new SurfPhase may be created by the following code snippet:
* for %Cantera. A new SurfPhase may be created by the following code snippet:
*
* @code
* XML_Node *xc = get_XML_File("diamond.xml");
@ -115,7 +115,7 @@ namespace Cantera
* An example of an XML Element named phase setting up a SurfPhase object named diamond_100
* is given below.
*
* @verbatim
* @code
* <phase dim="2" id="diamond_100">
* <elementArray datasrc="elements.xml">H C</elementArray>
* <speciesArray datasrc="#species_data">c6HH c6H* c6*H c6** c6HM c6HM* c6*M c6B </speciesArray>
@ -133,8 +133,7 @@ namespace Cantera
* gas_phase diamond_bulk
* </phaseArray>
* </phase>
*
* @endverbatim
* @endcode
*
* The model attribute, "Surface", on the thermo element identifies the phase as being
* a SurfPhase object.
@ -143,9 +142,7 @@ namespace Cantera
*/
class SurfPhase : public ThermoPhase
{
public:
//! Constructor.
/*!
* @param n0 Site Density of the Surface Phase
@ -203,8 +200,6 @@ public:
*/
ThermoPhase* duplMyselfAsThermoPhase() const;
//----- reimplemented methods of class ThermoPhase ------
//! Equation of state type flag.
/*!
* Redefine this to return cSurf, listed in mix_defs.h.
@ -263,8 +258,6 @@ public:
*/
virtual void getPartialMolarEntropies(doublereal* sbar) const;
//! Return an array of partial molar heat capacities for the
//! species in the mixture. Units: J/kmol/K
/*!
@ -294,8 +287,6 @@ public:
*/
virtual void getStandardChemPotentials(doublereal* mu0) const;
//! Return a vector of activity concentrations for each species
/*!
* For this phase the activity concentrations,\f$ C^a_k \f$, are defined to be
@ -362,7 +353,6 @@ public:
//! Set the Equation-of-State parameters by reading an XML Node Input
/*!
*
* The Equation-of-State data consists of one item, the site density.
*
* @param thermoData Reference to an XML_Node named thermo
@ -375,15 +365,14 @@ public:
* site density in any convenient form. Internally it is changed
* into MKS form.
*
* @verbatim
* @code
* <thermo model="Surface">
* <site_density units="mol/cm2"> 3e-09 </site_density>
* </thermo>
* @endverbatim
* @endcode
*/
virtual void setParametersFromXML(const XML_Node& thermoData);
//! Initialize the SurfPhase object after all species have been set up
/*!
* @internal Initialize.
@ -403,7 +392,6 @@ public:
*/
virtual void initThermo();
//! Set the initial state of the Surface Phase from an XML_Node
/*!
* State variables that can be set by this routine are
@ -413,12 +401,12 @@ public:
*
* An example of the XML code block is given below.
*
* @verbatim
* @code
* <state>
* <temperature units="K">1200.0</temperature>
* <coverages>c6H*:0.1, c6HH:0.9</coverages>
* </state>
* @endverbatim
* @endcode
*/
virtual void setStateFromXML(const XML_Node& state);
@ -551,10 +539,9 @@ public:
*/
virtual void getEntropy_R_ref(doublereal* er) const;
//! Returns the vector of nondimensional
//! constant pressure heat capacities of the reference state
//! at the current temperature of the solution
//! and reference pressure for each species.
//! Returns the vector of nondimensional constant pressure heat capacities
//! of the reference state at the current temperature of the solution and
//! reference pressure for each species.
/*!
* @param cprt Output vector of nondimensional reference state
* heat capacities at constant pressure for the species.
@ -562,9 +549,6 @@ public:
*/
virtual void getCp_R_ref(doublereal* cprt) const;
//------- new methods defined in this class ----------
//! Set the surface site fractions to a specified state.
/*!
* This routine converts to concentrations
@ -597,7 +581,6 @@ public:
*/
void setCoveragesNoNorm(const doublereal* theta);
//! Set the coverages from a string of colon-separated name:value pairs.
/*!
* @param cov String containing colon-separated name:value pairs
@ -614,7 +597,6 @@ public:
void getCoverages(doublereal* theta) const;
protected:
//! Surface site density (kmol m-2)
doublereal m_n0;
@ -650,7 +632,6 @@ protected:
mutable vector_fp m_logsize;
private:
//! Update the species reference state thermodynamic functions
/*!
* The polynomials for the standard state functions are only
@ -661,13 +642,7 @@ private:
* default = false.
*/
void _updateThermo(bool force=false) const;
};
}
#endif

View file

@ -15,15 +15,8 @@
using namespace ctml;
using namespace std;
///////////////////////////////////////////////////////////
//
// class SurfPhase methods
//
///////////////////////////////////////////////////////////
namespace Cantera
{
SurfPhase::SurfPhase(doublereal n0):
ThermoPhase(),
m_n0(n0),
@ -63,7 +56,6 @@ SurfPhase::SurfPhase(const std::string& infile, std::string id) :
importPhase(*xphase, this);
}
SurfPhase::SurfPhase(XML_Node& xmlphase) :
ThermoPhase(),
m_n0(0.0),
@ -80,15 +72,6 @@ SurfPhase::SurfPhase(XML_Node& xmlphase) :
importPhase(xmlphase, this);
}
// Copy Constructor
/*
* Copy constructor for the object. Constructed
* object will be a clone of this object, but will
* also own all of its data.
* This is a wrapper around the assignment operator
*
* @param right Object to be copied.
*/
SurfPhase::SurfPhase(const SurfPhase& right) :
m_n0(right.m_n0),
m_logn0(right.m_logn0),
@ -98,14 +81,6 @@ SurfPhase::SurfPhase(const SurfPhase& right) :
*this = operator=(right);
}
// Assignment operator
/*
* Assignment operator for the object. Constructed
* object will be a clone of this object, but will
* also own all of its data.
*
* @param right Object to be copied.
*/
SurfPhase& SurfPhase::
operator=(const SurfPhase& right)
{
@ -125,21 +100,12 @@ operator=(const SurfPhase& right)
return *this;
}
// Duplicator from the %ThermoPhase parent class
/*
* Given a pointer to a %ThermoPhase object, this function will
* duplicate the %ThermoPhase object and all underlying structures.
* This is basically a wrapper around the copy constructor.
*
* @return returns a pointer to a %ThermoPhase
*/
ThermoPhase* SurfPhase::duplMyselfAsThermoPhase() const
{
return new SurfPhase(*this);
}
doublereal SurfPhase::
enthalpy_mole() const
doublereal SurfPhase::enthalpy_mole() const
{
if (m_n0 <= 0.0) {
return 0.0;
@ -152,21 +118,11 @@ SurfPhase::~SurfPhase()
{
}
/*
* For a surface phase, the pressure is not a relevant
* thermodynamic variable, and so the Enthalpy is equal to the
* internal energy.
*/
doublereal SurfPhase::
intEnergy_mole() const
doublereal SurfPhase::intEnergy_mole() const
{
return enthalpy_mole();
}
/*
* Get the array of partial molar enthalpies of the species
* units = J / kmol
*/
void SurfPhase::getPartialMolarEnthalpies(doublereal* hbar) const
{
getEnthalpy_RT(hbar);
@ -176,12 +132,6 @@ void SurfPhase::getPartialMolarEnthalpies(doublereal* hbar) const
}
}
// Returns an array of partial molar entropies of the species in the
// solution. Units: J/kmol/K.
/*
* @param sbar Output vector of species partial molar entropies.
* Length = m_kk. units are J/kmol/K.
*/
void SurfPhase::getPartialMolarEntropies(doublereal* sbar) const
{
getEntropy_R(sbar);
@ -190,12 +140,6 @@ void SurfPhase::getPartialMolarEntropies(doublereal* sbar) const
}
}
// Returns an array of partial molar heat capacities of the species in the
// solution. Units: J/kmol/K.
/*
* @param sbar Output vector of species partial molar entropies.
* Length = m_kk. units are J/kmol/K.
*/
void SurfPhase::getPartialMolarCp(doublereal* cpbar) const
{
getCp_R(cpbar);
@ -243,7 +187,6 @@ doublereal SurfPhase::logStandardConc(size_t k) const
return m_logn0 - m_logsize[k];
}
/// The only parameter that can be set is the site density.
void SurfPhase::setParameters(int n, doublereal* const c)
{
if (n != 1) {
@ -341,17 +284,7 @@ void SurfPhase::setSiteDensity(doublereal n0)
setParameters(1, &x);
}
/**
* Set the coverage fractions to a specified
* state. This routine converts to concentrations
* in kmol/m2, using m_n0, the surface site density,
* and size(k), which is defined to be the number of
* surface sites occupied by the kth molecule.
* It then calls Phase::setConcentrations to set the
* internal concentration in the object.
*/
void SurfPhase::
setCoverages(const doublereal* theta)
void SurfPhase::setCoverages(const doublereal* theta)
{
double sum = 0.0;
for (size_t k = 0; k < m_kk; k++) {
@ -374,8 +307,7 @@ setCoverages(const doublereal* theta)
setConcentrations(DATA_PTR(m_work));
}
void SurfPhase::
setCoveragesNoNorm(const doublereal* theta)
void SurfPhase::setCoveragesNoNorm(const doublereal* theta)
{
for (size_t k = 0; k < m_kk; k++) {
m_work[k] = m_n0*theta[k]/(size(k));
@ -387,8 +319,7 @@ setCoveragesNoNorm(const doublereal* theta)
setConcentrations(DATA_PTR(m_work));
}
void SurfPhase::
getCoverages(doublereal* theta) const
void SurfPhase::getCoverages(doublereal* theta) const
{
getConcentrations(theta);
for (size_t k = 0; k < m_kk; k++) {
@ -396,8 +327,7 @@ getCoverages(doublereal* theta) const
}
}
void SurfPhase::
setCoveragesByName(const std::string& cov)
void SurfPhase::setCoveragesByName(const std::string& cov)
{
size_t kk = nSpecies();
compositionMap cc = parseCompString(cov, speciesNames());
@ -418,9 +348,7 @@ setCoveragesByName(const std::string& cov)
setCoverages(DATA_PTR(cv));
}
void SurfPhase::
_updateThermo(bool force) const
void SurfPhase::_updateThermo(bool force) const
{
doublereal tnow = temperature();
if (m_tlast != tnow || force) {
@ -438,8 +366,7 @@ _updateThermo(bool force) const
}
}
void SurfPhase::
setParametersFromXML(const XML_Node& eosdata)
void SurfPhase::setParametersFromXML(const XML_Node& eosdata)
{
eosdata._require("model","Surface");
doublereal n = getFloat(eosdata, "site_density", "toSI");
@ -450,7 +377,6 @@ setParametersFromXML(const XML_Node& eosdata)
m_logn0 = log(m_n0);
}
void SurfPhase::setStateFromXML(const XML_Node& state)
{
@ -465,16 +391,11 @@ void SurfPhase::setStateFromXML(const XML_Node& state)
}
}
// Default constructor
EdgePhase::EdgePhase(doublereal n0) : SurfPhase(n0)
{
setNDim(1);
}
// Copy Constructor
/*
* @param right Object to be copied
*/
EdgePhase::EdgePhase(const EdgePhase& right) :
SurfPhase(right.m_n0)
{
@ -482,10 +403,6 @@ EdgePhase::EdgePhase(const EdgePhase& right) :
*this = operator=(right);
}
// Assignment Operator
/*
* @param right Object to be copied
*/
EdgePhase& EdgePhase::operator=(const EdgePhase& right)
{
if (&right != this) {
@ -495,21 +412,12 @@ EdgePhase& EdgePhase::operator=(const EdgePhase& right)
return *this;
}
// Duplicator from the %ThermoPhase parent class
/*
* Given a pointer to a %ThermoPhase object, this function will
* duplicate the %ThermoPhase object and all underlying structures.
* This is basically a wrapper around the copy constructor.
*
* @return returns a pointer to a %ThermoPhase
*/
ThermoPhase* EdgePhase::duplMyselfAsThermoPhase() const
{
return new EdgePhase(*this);
}
void EdgePhase::
setParametersFromXML(const XML_Node& eosdata)
void EdgePhase::setParametersFromXML(const XML_Node& eosdata)
{
eosdata._require("model","Edge");
doublereal n = getFloat(eosdata, "site_density", "toSI");
@ -520,5 +428,4 @@ setParametersFromXML(const XML_Node& eosdata)
m_logn0 = log(m_n0);
}
}