diff --git a/Cantera/src/base/utilities.h b/Cantera/src/base/utilities.h index 7b5221555..e54f87c61 100644 --- a/Cantera/src/base/utilities.h +++ b/Cantera/src/base/utilities.h @@ -29,7 +29,7 @@ //! Unary operator to multiply the argument by a constant. /*! * The form of this operator is designed for use by std::transform. - * @see @ref scale. + * @see @ref scale(). */ template struct timesConstant : public std::unary_function { @@ -574,9 +574,9 @@ namespace Cantera { return sum; } - //! scale a templated vector by a constant factor. + //! Scale a templated vector by a constant factor. /*! - * The template arguments are: template + * The template arguments are: template * * This function is essentially a wrapper around the stl * function %scale(). The function is has one template diff --git a/Cantera/src/base/xml.cpp b/Cantera/src/base/xml.cpp index a3cd5423e..927f36a04 100644 --- a/Cantera/src/base/xml.cpp +++ b/Cantera/src/base/xml.cpp @@ -246,7 +246,7 @@ namespace Cantera { } } - /** + /* * Searches a string for the first occurrence of a valid * quoted string. Quotes can start with either a single * quote or a double quote, but must also end with the same @@ -289,7 +289,7 @@ namespace Cantera { return static_cast(iloc1)+1; } - /** + /* * parseTag parses XML tags, i.e., the XML elements that are * inbetween angle brackets. */ @@ -679,9 +679,9 @@ namespace Cantera { return child(cname).value(); } - //! Overloaded parenthesis operator with one augment - //! returns the value of an XML child node as a string - /*! + // Overloaded parenthesis operator with one augment + // returns the value of an XML child node as a string + /* * @param cname Name of the child node to the current * node, for which you want the value */ @@ -716,7 +716,7 @@ namespace Cantera { m_attribs[attrib] = fp2str(value, fmt); } - // The operator[] is overloaded to provide a lookup capability + // The operator[] is overloaded to provide a lookup capability // on attributes for the current XML element. /* * For example @@ -754,7 +754,7 @@ namespace Cantera { return ""; } - // Returns a changeable value of the attributes map for the current node + // Returns a changeable value of the attributes map for the current node /* * Note this is a simple accessor routine. And, it is a private function. * It's used in some internal copy and assignment routines @@ -861,9 +861,9 @@ namespace Cantera { } - //! This routine carries out a search for an XML node based - //! on both the xml element name and the attribute ID. - /*! + // This routine carries out a search for an XML node based + // on both the xml element name and the attribute ID. + /* * If exact matches are found for both fields, the pointer * to the matching XML Node is returned. * @@ -946,8 +946,8 @@ namespace Cantera { return 0; } - // This routine carries out a recursive search for an XML node based - // on an attribute of each XML node + // This routine carries out a recursive search for an XML node based + // on an attribute of each XML node /* * If exact match is found with respect to the attribute name and * value of the attribute, the pointer @@ -1236,7 +1236,7 @@ namespace Cantera { } } - /** + /* * Write an XML subtree to an output stream. This is the * main recursive routine. It doesn't put a final endl * on. This is fixed up in the public method. diff --git a/Cantera/src/base/xml.h b/Cantera/src/base/xml.h index b66567446..f3063ba9f 100644 --- a/Cantera/src/base/xml.h +++ b/Cantera/src/base/xml.h @@ -303,7 +303,7 @@ namespace Cantera { */ std::string value(const std::string &cname) const; - //! Overloaded parenthesis operator with one augment + //! The Overloaded parenthesis operator with one augment //! returns the value of an XML child node as a string /*! * @param cname Name of the child node to the current diff --git a/Cantera/src/thermo/Elements.cpp b/Cantera/src/thermo/Elements.cpp index 61e4a260b..5e5943361 100644 --- a/Cantera/src/thermo/Elements.cpp +++ b/Cantera/src/thermo/Elements.cpp @@ -39,136 +39,135 @@ using namespace std; namespace Cantera { - /* awData structure */ - /** - * Database for atomic molecular weights - * - * Values are taken from the 1989 Standard Atomic Weights, CRC - * - * awTable[] is a static function with scope limited to this file. - * It can only be referenced via the static Elements class function, - * LookupWtElements(). - * - * units = kg / kg-mol (or equivalently gm / gm-mol) - * - * (note: this structure was picked because it's simple, compact, - * and extensible). - * - */ - struct awData { - char name[4]; ///< Null Terminated name, First letter capitalized - double atomicWeight; ///< atomic weight in kg / kg-mol - }; + /* awData structure */ + /** + * Database for atomic molecular weights + * + * Values are taken from the 1989 Standard Atomic Weights, CRC + * + * awTable[] is a static function with scope limited to this file. + * It can only be referenced via the static Elements class function, + * LookupWtElements(). + * + * units = kg / kg-mol (or equivalently gm / gm-mol) + * + * (note: this structure was picked because it's simple, compact, + * and extensible). + * + */ + struct awData { + char name[4]; ///< Null Terminated name, First letter capitalized + double atomicWeight; ///< atomic weight in kg / kg-mol + }; - /*! - * @var static struct awData aWTable[] - * \brief aWTable is a vector containing the atomic weights database. - * - * The size of the table is given by the initial instantiation. - */ - static struct awData aWTable[] = { - {"H", 1.00794}, - {"D", 2.0 }, - {"Tr", 3.0 }, - {"He", 4.002602}, - {"Li", 6.941 }, - {"Be", 9.012182}, - {"B", 10.811 }, - {"C", 12.011 }, - {"N", 14.00674}, - {"O", 15.9994 }, - {"F", 18.9984032}, - {"Ne", 20.1797 }, - {"Na", 22.98977}, - {"Mg", 24.3050 }, - {"Al", 26.98154}, - {"Si", 28.0855 }, - {"P", 30.97376}, - {"S", 32.066 }, - {"Cl", 35.4527 }, - {"Ar", 39.948 }, - {"K", 39.0983 }, - {"Ca", 40.078 }, - {"Sc", 44.95591}, - {"Ti", 47.88 }, - {"V", 50.9415 }, - {"Cr", 51.9961 }, - {"Mn", 54.9381 }, - {"Fe", 55.847 }, - {"Co", 58.9332 }, - {"Ni", 58.69 }, - {"Cu", 63.546 }, - {"Zn", 65.39 }, - {"Ga", 69.723 }, - {"Ge", 72.61 }, - {"As", 74.92159}, - {"Se", 78.96 }, - {"Br", 79.904 }, - {"Kr", 83.80 }, - {"Rb", 85.4678 }, - {"Sr", 87.62 }, - {"Y", 88.90585}, - {"Zr", 91.224 }, - {"Nb", 92.90638}, - {"Mo", 95.94 }, - {"Tc", 97.9072 }, - {"Ru", 101.07 }, - {"Rh", 102.9055 }, - {"Pd", 106.42 }, - {"Ag", 107.8682 }, - {"Cd", 112.411 }, - {"In", 114.82 }, - {"Sn", 118.710 }, - {"Sb", 121.75 }, - {"Te", 127.6 }, - {"I", 126.90447}, - {"Xe", 131.29 }, - {"Cs", 132.90543}, - {"Ba", 137.327 }, - {"La", 138.9055 }, - {"Ce", 140.115 }, - {"Pr", 140.90765}, - {"Nd", 144.24 }, - {"Pm", 144.9127 }, - {"Sm", 150.36 }, - {"Eu", 151.965 }, - {"Gd", 157.25 }, - {"Tb", 158.92534}, - {"Dy", 162.50 }, - {"Ho", 164.93032}, - {"Er", 167.26 }, - {"Tm", 168.93421}, - {"Yb", 173.04 }, - {"Lu", 174.967 }, - {"Hf", 178.49 }, - {"Ta", 180.9479 }, - {"W", 183.85 }, - {"Re", 186.207 }, - {"Os", 190.2 }, - {"Ir", 192.22 }, - {"Pt", 195.08 }, - {"Au", 196.96654}, - {"Hg", 200.59 }, - {"Ti", 204.3833 }, - {"Pb", 207.2 }, - {"Bi", 208.98037}, - {"Po", 208.9824 }, - {"At", 209.9871 }, - {"Rn", 222.0176 }, - {"Fr", 223.0197 }, - {"Ra", 226.0254 }, - {"Ac", 227.0279 }, - {"Th", 232.0381 }, - {"Pa", 231.03588}, - {"U", 238.0508 }, - {"Np", 237.0482 }, - {"Pu", 244.0482 } - }; + /*! + * @var static struct awData aWTable[] + * \brief aWTable is a vector containing the atomic weights database. + * + * The size of the table is given by the initial instantiation. + */ + static struct awData aWTable[] = { + {"H", 1.00794}, + {"D", 2.0 }, + {"Tr", 3.0 }, + {"He", 4.002602}, + {"Li", 6.941 }, + {"Be", 9.012182}, + {"B", 10.811 }, + {"C", 12.011 }, + {"N", 14.00674}, + {"O", 15.9994 }, + {"F", 18.9984032}, + {"Ne", 20.1797 }, + {"Na", 22.98977}, + {"Mg", 24.3050 }, + {"Al", 26.98154}, + {"Si", 28.0855 }, + {"P", 30.97376}, + {"S", 32.066 }, + {"Cl", 35.4527 }, + {"Ar", 39.948 }, + {"K", 39.0983 }, + {"Ca", 40.078 }, + {"Sc", 44.95591}, + {"Ti", 47.88 }, + {"V", 50.9415 }, + {"Cr", 51.9961 }, + {"Mn", 54.9381 }, + {"Fe", 55.847 }, + {"Co", 58.9332 }, + {"Ni", 58.69 }, + {"Cu", 63.546 }, + {"Zn", 65.39 }, + {"Ga", 69.723 }, + {"Ge", 72.61 }, + {"As", 74.92159}, + {"Se", 78.96 }, + {"Br", 79.904 }, + {"Kr", 83.80 }, + {"Rb", 85.4678 }, + {"Sr", 87.62 }, + {"Y", 88.90585}, + {"Zr", 91.224 }, + {"Nb", 92.90638}, + {"Mo", 95.94 }, + {"Tc", 97.9072 }, + {"Ru", 101.07 }, + {"Rh", 102.9055 }, + {"Pd", 106.42 }, + {"Ag", 107.8682 }, + {"Cd", 112.411 }, + {"In", 114.82 }, + {"Sn", 118.710 }, + {"Sb", 121.75 }, + {"Te", 127.6 }, + {"I", 126.90447}, + {"Xe", 131.29 }, + {"Cs", 132.90543}, + {"Ba", 137.327 }, + {"La", 138.9055 }, + {"Ce", 140.115 }, + {"Pr", 140.90765}, + {"Nd", 144.24 }, + {"Pm", 144.9127 }, + {"Sm", 150.36 }, + {"Eu", 151.965 }, + {"Gd", 157.25 }, + {"Tb", 158.92534}, + {"Dy", 162.50 }, + {"Ho", 164.93032}, + {"Er", 167.26 }, + {"Tm", 168.93421}, + {"Yb", 173.04 }, + {"Lu", 174.967 }, + {"Hf", 178.49 }, + {"Ta", 180.9479 }, + {"W", 183.85 }, + {"Re", 186.207 }, + {"Os", 190.2 }, + {"Ir", 192.22 }, + {"Pt", 195.08 }, + {"Au", 196.96654}, + {"Hg", 200.59 }, + {"Ti", 204.3833 }, + {"Pb", 207.2 }, + {"Bi", 208.98037}, + {"Po", 208.9824 }, + {"At", 209.9871 }, + {"Rn", 222.0176 }, + {"Fr", 223.0197 }, + {"Ra", 226.0254 }, + {"Ac", 227.0279 }, + {"Th", 232.0381 }, + {"Pa", 231.03588}, + {"U", 238.0508 }, + {"Np", 237.0482 }, + {"Pu", 244.0482 } + }; - //! Static function to look up an atomic weight - /*! - * + // Static function to look up an atomic weight + /* * This static function looks up the argument string in the * database above and returns the associated molecular weight. * The data are from the periodic table. @@ -177,8 +176,7 @@ namespace Cantera { * source for the element atomic weights. This helps to * ensure that mass is conserved. * - * @param - * ElemName String. Only the first 3 characters are significant + * @param s String, Only the first 3 characters are significant * * @return * Return value contains the atomic weight of the element @@ -188,11 +186,10 @@ namespace Cantera { * @exception CanteraError * If a match is not found, a CanteraError is thrown as well */ - doublereal Elements::LookupWtElements(const std::string& s) { + doublereal Elements::LookupWtElements(const std::string& ename) { int num = sizeof(aWTable) / sizeof(struct awData); - string s3 = s.substr(0,3); + string s3 = ename.substr(0,3); for (int i = 0; i < num; i++) { - //if (!std::strncmp(s.c_str(), aWTable[i].name, 3)) { if (s3 == aWTable[i].name) { return (aWTable[i].atomicWeight); } @@ -267,68 +264,68 @@ namespace Cantera { - /* - * freezeElements(): - * - * Set the freeze flag. This is a prerequesite to other - * activivities, i.e., this is done before species are defined. - */ - void Elements::freezeElements() { - m_elementsFrozen = true; - } + /* + * freezeElements(): + * + * Set the freeze flag. This is a prerequesite to other + * activivities, i.e., this is done before species are defined. + */ + void Elements::freezeElements() { + m_elementsFrozen = true; + } #ifdef INCL_DEPRECATED_METHODS - /* - * - * Returns an ElementData struct that contains the parameters - * for element index m. - */ - ElementData Elements::element(int m) const { - ElementData e; - e.name = m_elementNames[m]; - e.atomicWeight = m_atomicWeights[m]; - return e; - } + /* + * + * Returns an ElementData struct that contains the parameters + * for element index m. + */ + ElementData Elements::element(int m) const { + ElementData e; + e.name = m_elementNames[m]; + e.atomicWeight = m_atomicWeights[m]; + return e; + } #endif - /* - * elementIndex(): - * - * Index of element named \c name. The index is an integer - * assigned to each element in the order it was added, - * beginning with 0 for the first element. If \c name is not - * the name of an element in the set, then the value -1 is - * returned. - * - */ + /* + * elementIndex(): + * + * Index of element named \c name. The index is an integer + * assigned to each element in the order it was added, + * beginning with 0 for the first element. If \c name is not + * the name of an element in the set, then the value -1 is + * returned. + * + */ #ifdef USE_DGG_CODE - int Elements::elementIndex(std::string name) const{ - map::const_iterator it; - it = m_definedElements.find(name); - if (it != m_definedElements.end()) { - return it->second; - } - return -1; + int Elements::elementIndex(std::string name) const{ + map::const_iterator it; + it = m_definedElements.find(name); + if (it != m_definedElements.end()) { + return it->second; } + return -1; + } #else - int Elements::elementIndex(std::string name) const { - for (int i = 0; i < m_mm; i++) { - if (m_elementNames[i] == name) return i; - } - return -1; + int Elements::elementIndex(std::string name) const { + for (int i = 0; i < m_mm; i++) { + if (m_elementNames[i] == name) return i; } + return -1; + } #endif - /* - * - * Name of the element with index \c m. @param m Element - * index. If m < 0 or m >= nElements() an exception is thrown. - */ - string Elements::elementName(int m) const { - if (m >= 0 && m < nElements()) - return m_elementNames[m]; - else - throw ElementRangeError("Elements::elementName", m, nElements()); - } + /* + * + * Name of the element with index \c m. @param m Element + * index. If m < 0 or m >= nElements() an exception is thrown. + */ + string Elements::elementName(int m) const { + if (m >= 0 && m < nElements()) + return m_elementNames[m]; + else + throw ElementRangeError("Elements::elementName", m, nElements()); + } @@ -340,46 +337,46 @@ namespace Cantera { return (m_entropy298[m]); } - /* - * - * Add an element to the current set of elements in the current object. - * @param symbol symbol string - * @param weight atomic weight in kg/kmol. - * - * The default weight is a special value, which will cause the - * routine to look up the actual weight via a string lookup. - * - * There are two interfaces to this routine. The XML interface - * looks up the required parameters for the regular interface - * and then calls the base routine. - */ - void Elements:: - addElement(const std::string& symbol, doublereal weight) - { - if (weight == -12345.0) { - weight = LookupWtElements(symbol); - if (weight < 0.0) { - throw ElementsFrozen("addElement"); - } - } - if (m_elementsFrozen) { - throw ElementsFrozen("addElement"); - return; - } - m_atomicWeights.push_back(weight); - m_elementNames.push_back(symbol); + /* + * + * Add an element to the current set of elements in the current object. + * @param symbol symbol string + * @param weight atomic weight in kg/kmol. + * + * The default weight is a special value, which will cause the + * routine to look up the actual weight via a string lookup. + * + * There are two interfaces to this routine. The XML interface + * looks up the required parameters for the regular interface + * and then calls the base routine. + */ + void Elements:: + addElement(const std::string& symbol, doublereal weight) + { + if (weight == -12345.0) { + weight = LookupWtElements(symbol); + if (weight < 0.0) { + throw ElementsFrozen("addElement"); + } + } + if (m_elementsFrozen) { + throw ElementsFrozen("addElement"); + return; + } + m_atomicWeights.push_back(weight); + m_elementNames.push_back(symbol); #ifdef USE_DGG_CODE - m_definedElements[symbol] = nElements() + 1; + m_definedElements[symbol] = nElements() + 1; #endif - m_mm++; - } + m_mm++; + } - void Elements:: - addElement(const XML_Node& e) { - doublereal weight = atof(e["atomicWt"].c_str()); - string symbol = e["name"]; - addElement(symbol, weight); - } + void Elements:: + addElement(const XML_Node& e) { + doublereal weight = atof(e["atomicWt"].c_str()); + string symbol = e["name"]; + addElement(symbol, weight); + } /* * addUniqueElement(): @@ -572,31 +569,31 @@ namespace Cantera { } } - } + } - /* - * subscribe(), unsubscribe(), and reportSubscriptions(): - * - * Handles setting and reporting the number of subscriptions to this - * object. - */ - void Elements::subscribe() { - ++numSubscribers; - } - int Elements::unsubscribe() { - --numSubscribers; - return numSubscribers; - } - int Elements::reportSubscriptions() const { - return numSubscribers; - } + /* + * subscribe(), unsubscribe(), and reportSubscriptions(): + * + * Handles setting and reporting the number of subscriptions to this + * object. + */ + void Elements::subscribe() { + ++numSubscribers; + } + int Elements::unsubscribe() { + --numSubscribers; + return numSubscribers; + } + int Elements::reportSubscriptions() const { + return numSubscribers; + } - /********************* GLOBAL STATIC SECTION **************************/ - /* - * We keep track of a vector of pointers to element objects. - * Initially there are no Elements objects. Whenever one is created, - * the pointer to that object is added onto this list. - */ - vector Elements::Global_Elements_List; - /***********************************************************************/ + /********************* GLOBAL STATIC SECTION **************************/ + /* + * We keep track of a vector of pointers to element objects. + * Initially there are no Elements objects. Whenever one is created, + * the pointer to that object is added onto this list. + */ + vector Elements::Global_Elements_List; + /***********************************************************************/ } diff --git a/Cantera/src/thermo/Elements.h b/Cantera/src/thermo/Elements.h index 148cf2abf..fa0e5dc2b 100644 --- a/Cantera/src/thermo/Elements.h +++ b/Cantera/src/thermo/Elements.h @@ -23,8 +23,8 @@ namespace Cantera { - class XML_Node; - class ElementRangeError; + class XML_Node; + class ElementRangeError; //! Positive number indicating we don't know the gibbs free energy //! of the element in its most stable state at 298.15 K and 1 bar. @@ -45,249 +45,266 @@ namespace Cantera { * * @ingroup phases */ - class Elements { + class Elements { - public: + public: - /// Default constructor for the elements class - Elements(); + //! Default constructor for the elements class + Elements(); - //! Default destructor for the elements class - ~Elements(); + //! Default destructor for the elements class + ~Elements(); - //! copy constructor - /*! - * This copy constructor just calls the assignment operator for this - * class. It sets the number of subscribers to zer0. - * - * @param right Reference to the object to be copied. - */ - Elements(const Elements& right); + //! copy constructor + /*! + * This copy constructor just calls the assignment operator for this + * class. It sets the number of subscribers to zer0. + * + * @param right Reference to the object to be copied. + */ + Elements(const Elements& right); - //! Assigntment operator - /*! - * This is the assignment operator for the Elements class. - * Right now we pretty much do a straight uncomplicated - * assignment. However, subscribers are not mucked with, as they - * have to do with the address of the object to be subscribed to - * - * @param right Reference to the object to be copied. - */ - Elements& operator=(const Elements& right); + //! Assigntment operator + /*! + * This is the assignment operator for the Elements class. + * Right now we pretty much do a straight uncomplicated + * assignment. However, subscribers are not mucked with, as they + * have to do with the address of the object to be subscribed to + * + * @param right Reference to the object to be copied. + */ + Elements& operator=(const Elements& right); - //! Function to lookup the atomic weight of an element - /*! - * @param ename Element symbol name. - */ - static double LookupWtElements(const std::string &ename); - /// Atomic weight of element m. - /*! - * @param m element index - */ - doublereal atomicWeight(int m) const { return m_atomicWeights[m]; } + //! Static function to look up an atomic weight + /*! + * This static function looks up the argument string in the + * database above and returns the associated molecular weight. + * The data are from the periodic table. + * + * Note: The idea behind this function is to provide a unified + * source for the element atomic weights. This helps to + * ensure that mass is conserved. + * + * @param ename String, Only the first 3 characters are significant + * + * @return + * Return value contains the atomic weight of the element + * If a match for the string is not found, a value of -1.0 is + * returned. + * + * @exception CanteraError + * If a match is not found, a CanteraError is thrown as well + */ + static double LookupWtElements(const std::string &ename); - /// Atomic number of element m. - /*! - * @param m element index - */ - int atomicNumber(int m) const { return m_atomicNumbers[m]; } + /// Atomic weight of element m. + /*! + * @param m element index + */ + doublereal atomicWeight(int m) const { return m_atomicWeights[m]; } - //! Entropy at 298.15 K and 1 bar of stable state - //! of the element - /*! - * units J kmol-1 K-1 - * - * @param m Element index - */ - doublereal entropyElement298(int m) const; + /// Atomic number of element m. + /*! + * @param m element index + */ + int atomicNumber(int m) const { return m_atomicNumbers[m]; } - /// vector of element atomic weights - const vector_fp& atomicWeights() const { return m_atomicWeights; } + //! Entropy at 298.15 K and 1 bar of stable state + //! of the element + /*! + * units J kmol-1 K-1 + * + * @param m Element index + */ + doublereal entropyElement298(int m) const; - /** - * Inline function that returns the number of elements in the object. - * - * @return - * \c int: The number of elements in the object. - */ - int nElements() const { return m_mm; } + /// vector of element atomic weights + const vector_fp& atomicWeights() const { return m_atomicWeights; } - //! Function that returns the index of an element. - /*! - * Index of element named \c name. The index is an integer - * assigned to each element in the order it was added, - * beginning with 0 for the first element. If \c name is not - * the name of an element in the set, then the value -1 is - * returned. - * - * @param name String containing the index. - */ - int elementIndex(std::string name) const; + /** + * Inline function that returns the number of elements in the object. + * + * @return + * \c int: The number of elements in the object. + */ + int nElements() const { return m_mm; } + + //! Function that returns the index of an element. + /*! + * Index of element named \c name. The index is an integer + * assigned to each element in the order it was added, + * beginning with 0 for the first element. If \c name is not + * the name of an element in the set, then the value -1 is + * returned. + * + * @param name String containing the index. + */ + int elementIndex(std::string name) const; - //! Name of the element with index \c m. - /*! - * @param m Element index. If m < 0 or m >= nElements() an exception is thrown. - */ - std::string elementName(int m) const; + //! Name of the element with index \c m. + /*! + * @param m Element index. If m < 0 or m >= nElements() an exception is thrown. + */ + std::string elementName(int m) const; - //! Returns a string vector containing the element names - /*! - * Returns a read-only reference to the vector of element names. - * @return const vector& : The vector contains - * the element names in their indexed order. - */ - const std::vector& elementNames() const { - return m_elementNames; - } + //! Returns a string vector containing the element names + /*! + * Returns a read-only reference to the vector of element names. + * @return const vector& : The vector contains + * the element names in their indexed order. + */ + const std::vector& elementNames() const { + return m_elementNames; + } - //! Add an element to the current set of elements in the current object. - /*! - * The default weight is a special value, which will cause the - * routine to look up the actual weight via a string lookup. - * - * There are two interfaces to this routine. The XML interface - * looks up the required parameters for the regular interface - * and then calls the base routine. - * - * @param symbol string symbol for the element. - * @param weight Atomic weight of the element. If no argument - * is provided, a lookup is attempted. - */ - void addElement(const std::string& symbol, - doublereal weight = -12345.0); + //! Add an element to the current set of elements in the current object. + /*! + * The default weight is a special value, which will cause the + * routine to look up the actual weight via a string lookup. + * + * There are two interfaces to this routine. The XML interface + * looks up the required parameters for the regular interface + * and then calls the base routine. + * + * @param symbol string symbol for the element. + * @param weight Atomic weight of the element. If no argument + * is provided, a lookup is attempted. + */ + void addElement(const std::string& symbol, + doublereal weight = -12345.0); - //! Add an element to the current set of elements in the current object. - /*! - * @param e Reference to the XML_Node containing the element information - * The node name is the element symbol and the atomWt attribute - * is used as the atomic weight. - */ - void addElement(const XML_Node& e); + //! Add an element to the current set of elements in the current object. + /*! + * @param e Reference to the XML_Node containing the element information + * The node name is the element symbol and the atomWt attribute + * is used as the atomic weight. + */ + void addElement(const XML_Node& e); - //! Add an element only if the element hasn't been added before. - /*! - * This is accomplished via a string match on symbol. - * - * @param symbol string symbol for the element. - * @param weight Atomic weight of the element. If no argument - * is provided, a lookup is attempted. - * @param atomicNumber defaults to 0 - * @param entropy298 Value of the entropy at 298 and 1 bar of the - * element in its most stable form. - * The default is to specify an ENTROPY298_UNKNOWN value, - * which will cause a throw error if its ever - * needed. - */ - void addUniqueElement(const std::string& symbol, - doublereal weight = -12345.0, int atomicNumber = 0, - doublereal entropy298 = ENTROPY298_UNKNOWN); + //! Add an element only if the element hasn't been added before. + /*! + * This is accomplished via a string match on symbol. + * + * @param symbol string symbol for the element. + * @param weight Atomic weight of the element. If no argument + * is provided, a lookup is attempted. + * @param atomicNumber defaults to 0 + * @param entropy298 Value of the entropy at 298 and 1 bar of the + * element in its most stable form. + * The default is to specify an ENTROPY298_UNKNOWN value, + * which will cause a throw error if its ever + * needed. + */ + void addUniqueElement(const std::string& symbol, + doublereal weight = -12345.0, int atomicNumber = 0, + doublereal entropy298 = ENTROPY298_UNKNOWN); - //! Add an element to the current set of elements in the current object. - /*! - * @param e Reference to the XML_Node containing the element information - * The node name is the element symbol and the atomWt attribute - * is used as the atomic weight. - */ - void addUniqueElement(const XML_Node& e); + //! Add an element to the current set of elements in the current object. + /*! + * @param e Reference to the XML_Node containing the element information + * The node name is the element symbol and the atomWt attribute + * is used as the atomic weight. + */ + void addUniqueElement(const XML_Node& e); - //! Add multiple elements from a XML_Node phase description - /*! - * @param phase XML_Node reference to a phase - */ - void addElementsFromXML(const XML_Node& phase); + //! Add multiple elements from a XML_Node phase description + /*! + * @param phase XML_Node reference to a phase + */ + void addElementsFromXML(const XML_Node& phase); - //! Prohibit addition of more elements, and prepare to add species. - void freezeElements(); + //! Prohibit addition of more elements, and prepare to add species. + void freezeElements(); - /// True if freezeElements has been called. - bool elementsFrozen() { return m_elementsFrozen; } + /// True if freezeElements has been called. + bool elementsFrozen() { return m_elementsFrozen; } - /// Remove all elements - void clear(); + /// Remove all elements + void clear(); - /// True if both elements and species have been frozen - bool ready() const; + /// True if both elements and species have been frozen + bool ready() const; - //! subscribe to this object - /*! - * Increment by one the number of subscriptions to this object. - */ - void subscribe(); + //! subscribe to this object + /*! + * Increment by one the number of subscriptions to this object. + */ + void subscribe(); - //! unsubscribe to this object - /*! - * decrement by one the number of subscriptions to this object. - */ - int unsubscribe(); + //! unsubscribe to this object + /*! + * decrement by one the number of subscriptions to this object. + */ + int unsubscribe(); - //! report the number of subscriptions - int reportSubscriptions() const; + //! report the number of subscriptions + int reportSubscriptions() const; - protected: + protected: - /******************************************************************/ - /* Description of DATA in the Object */ - /******************************************************************/ + /******************************************************************/ + /* Description of DATA in the Object */ + /******************************************************************/ - //! Number of elements. - int m_mm; + //! Number of elements. + int m_mm; - /* m_elementsFrozen: */ - /** boolean indicating completion of object - * - * If this is true, then no elements may be added to the - * object. - */ - bool m_elementsFrozen; + /* m_elementsFrozen: */ + /** boolean indicating completion of object + * + * If this is true, then no elements may be added to the + * object. + */ + bool m_elementsFrozen; - /** - * Vector of element atomic weights: - * - * units = kg / kmol - */ - vector_fp m_atomicWeights; + /** + * Vector of element atomic weights: + * + * units = kg / kmol + */ + vector_fp m_atomicWeights; - /** - * Vector of element atomic numbers: - * - */ - vector_int m_atomicNumbers; + /** + * Vector of element atomic numbers: + * + */ + vector_int m_atomicNumbers; - /** Vector of strings containing the names of the elements - * - * Note, a string search is the primary way to identify elements. - */ - std::vector m_elementNames; + /** Vector of strings containing the names of the elements + * + * Note, a string search is the primary way to identify elements. + */ + std::vector m_elementNames; - //! Entropy at 298.15 K and 1 bar of stable state - /*! - * units J kmol-1 - */ - vector_fp m_entropy298; + //! Entropy at 298.15 K and 1 bar of stable state + /*! + * units J kmol-1 + */ + vector_fp m_entropy298; - /** - * Number of Constituents Objects that use this object - * - * Number of Constituents Objects that require this Elements object - * to complete its definition. - * The destructor checks to see that this is equal to zero. - * when the element object is released. - */ - int numSubscribers; + /** + * Number of Constituents Objects that use this object + * + * Number of Constituents Objects that require this Elements object + * to complete its definition. + * The destructor checks to see that this is equal to zero. + * when the element object is released. + */ + int numSubscribers; - /********* GLOBAL STATIC SECTION *************/ + /********* GLOBAL STATIC SECTION *************/ - public: - /** Vector of pointers to Elements Objects - * - */ - static std::vector Global_Elements_List; + public: + /** Vector of pointers to Elements Objects + * + */ + static std::vector Global_Elements_List; - friend class Constituents; - }; + friend class Constituents; + }; } // namespace diff --git a/Cantera/src/thermo/HMWSoln.cpp b/Cantera/src/thermo/HMWSoln.cpp index 8e30b0ac5..a250de5f0 100644 --- a/Cantera/src/thermo/HMWSoln.cpp +++ b/Cantera/src/thermo/HMWSoln.cpp @@ -197,7 +197,7 @@ namespace Cantera { constructPhaseXML(phaseRoot, id); } - /** + /* * Copy Constructor: * * Note this stuff will not work until the underlying phase @@ -254,7 +254,7 @@ namespace Cantera { *this = b; } - /** + /* * operator=() * * Note this stuff will not work until the underlying phase @@ -578,7 +578,7 @@ namespace Cantera { printCoeffs(); } - /** + /* * ~HMWSoln(): (virtual) * * Destructor: does nothing: @@ -589,7 +589,7 @@ namespace Cantera { } } - /** + /* * duplMyselfAsThermoPhase(): * * This routine operates at the ThermoPhase level to @@ -601,7 +601,7 @@ namespace Cantera { return (ThermoPhase *) mtp; } - /** + /* * Equation of state type flag. The base class returns * zero. Subclasses should define this to return a unique * non-zero value. Constants defined for this purpose are @@ -628,7 +628,7 @@ namespace Cantera { // // -------- Molar Thermodynamic Properties of the Solution --------------- // - /** + /* * Molar enthalpy of the solution. Units: J/kmol. */ doublereal HMWSoln::enthalpy_mole() const { @@ -695,7 +695,7 @@ namespace Cantera { return L; } - /** + /* * Molar internal energy of the solution. Units: J/kmol. * * This is calculated from the soln enthalpy and then @@ -709,7 +709,7 @@ namespace Cantera { return uu; } - /** + /* * Molar soln entropy at constant pressure. Units: J/kmol/K. * * This is calculated from the partial molar entropies. @@ -725,7 +725,7 @@ namespace Cantera { return mean_X(DATA_PTR(m_tmpV)); } - /** Molar heat capacity at constant pressure. Units: J/kmol/K. + /* Molar heat capacity at constant pressure. Units: J/kmol/K. * * Returns the solution heat capacition at constant pressure. * This is calculated from the partial molar heat capacities. @@ -736,7 +736,7 @@ namespace Cantera { return val; } - /// Molar heat capacity at constant volume. Units: J/kmol/K. + // Molar heat capacity at constant volume. Units: J/kmol/K. doublereal HMWSoln::cv_mole() const { //getPartialMolarCv(m_tmpV.begin()); //return mean_X(m_tmpV.begin()); @@ -757,7 +757,7 @@ namespace Cantera { return m_Pcurrent; } - /** + /* * Set the pressure at constant temperature. Units: Pa. * This method sets a constant within the object. * The mass density is not a function of pressure. @@ -779,7 +779,7 @@ namespace Cantera { State::setDensity(dd); } - /** + /* * The isothermal compressibility. Units: 1/Pa. * The isothermal compressibility is defined as * \f[ @@ -795,7 +795,7 @@ namespace Cantera { //return 0.0; } - /** + /* * The thermal expansion coefficient. Units: 1/K. * The thermal expansion coefficient is defined as * @@ -817,7 +817,7 @@ namespace Cantera { return State::density(); } - /** + /* * Overwritten setDensity() function is necessary because the * density is not an indendent variable. * @@ -846,7 +846,7 @@ namespace Cantera { } } - /** + /* * Overwritten setMolarDensity() function is necessary because the * density is not an indendent variable. * @@ -1057,7 +1057,7 @@ namespace Cantera { // // ------ Partial Molar Properties of the Solution ----------------- // - /** + /* * Get the species chemical potentials. Units: J/kmol. * * This function returns a vector of chemical potentials of the @@ -1333,12 +1333,12 @@ namespace Cantera { * -------------- Utilities ------------------------------- */ - /** + /* * @internal * Set equation of state parameters. The number and meaning of * these depends on the subclass. * @param n number of parameters - * @param c array of \i n coefficients + * @param c array of n coefficients * */ void HMWSoln::setParameters(int n, doublereal* const c) { @@ -1346,7 +1346,7 @@ namespace Cantera { void HMWSoln::getParameters(int &n, doublereal * const c) const { } - /** + /* * Set equation of state parameter values from XML * entries. This method is called by function importPhase in * file importCTML.cpp when processing a phase definition in @@ -1382,7 +1382,7 @@ namespace Cantera { return pres; } - /** + /* * Report the molar volume of species k * * units - \f$ m^3 kmol^-1 \f$ @@ -1442,7 +1442,7 @@ namespace Cantera { return A; } - /** + /* * dA_DebyedT_TP() (virtual) * * Returns the derivative of the A_Debye parameter with @@ -1477,7 +1477,7 @@ namespace Cantera { return dAdT; } - /** + /* * dA_DebyedP_TP() (virtual) * * Returns the derivative of the A_Debye parameter with @@ -1512,7 +1512,7 @@ namespace Cantera { } - /** + /* * Calculate the DH Parameter used for the Enthalpy calcalations * * ADebye_L = 4 R T**2 d(Aphi) / dT @@ -1533,7 +1533,7 @@ namespace Cantera { return retn; } - /** + /* * Calculate the DH Parameter used for the Volume calcalations * * ADebye_V = - 4 R T d(Aphi) / dP @@ -1554,7 +1554,7 @@ namespace Cantera { return retn; } - /** + /* * Return Pitzer's definition of A_J. This is basically the * temperature derivative of A_L, and the second derivative * of Aphi @@ -1584,7 +1584,7 @@ namespace Cantera { return retn; } - /** + /* * d2A_DebyedT2_TP() (virtual) * * Returns the 2nd derivative of the A_Debye parameter with @@ -1645,7 +1645,7 @@ namespace Cantera { - /** + /* * initLengths(): * * This internal function adjusts the lengths of arrays based on @@ -1922,8 +1922,8 @@ namespace Cantera { /* * Find the counterIJ for the symmetric binary interaction */ - //n = m_kk*i + j; - //counterIJ = m_CounterIJ[n]; + // n = m_kk*i + j; + // counterIJ = m_CounterIJ[n]; /* * Only loop over oppositely charge species */ diff --git a/Cantera/src/thermo/HMWSoln.h b/Cantera/src/thermo/HMWSoln.h index f174a9469..17339386b 100644 --- a/Cantera/src/thermo/HMWSoln.h +++ b/Cantera/src/thermo/HMWSoln.h @@ -672,7 +672,7 @@ namespace Cantera { * @code q0, q1, q2, q3, q4 - <\binarySaltParameters> + @endcode * * The parameters for \f$ \beta^{(0)}\f$ fit the following equation: @@ -686,9 +686,9 @@ namespace Cantera { * * This same COMPLEX1 temperature * dependence given above is used for the following parameters: - * \f$\beta^{(0)}_{MX} \f$, \f$\beta^{(1)}_{MX} \f$, - * \f$\beta^{(2)}_{MX} \f$, \f$ \Theta_{cc'} \f$, \f$\Theta_{aa'} \f$, - * \f$ \Psi_{c{c'}a}\f$ and \f$ \Psi_{ca{a'}} \f$. + * \f$ \beta^{(0)}_{MX} \f$, \f$ \beta^{(1)}_{MX} \f$, + * \f$ \beta^{(2)}_{MX} \f$, \f$ \Theta_{cc'} \f$, \f$\Theta_{aa'} \f$, + * \f$ \Psi_{c{c'}a} \f$ and \f$ \Psi_{ca{a'}} \f$. * * *

Like-Charged Binary Ion Parameters and the Mixing Parameters

@@ -813,8 +813,7 @@ namespace Cantera { 0.05 - @endcode - + @endcode * *

Example of the Specification of Parameters for the Activity * Coefficients

@@ -824,7 +823,7 @@ namespace Cantera { * An example activityCoefficients XML block for this * formulation is supplied below * - * @code + * @verbatim