From 76d3a03921abe6a9ad5da41e8779c0295e9bed54 Mon Sep 17 00:00:00 2001 From: Ray Speth Date: Fri, 12 Apr 2013 23:05:38 +0000 Subject: [PATCH] Updated Doxygen documentation for falloff-related classes --- include/cantera/kinetics/FalloffFactory.h | 48 +-- include/cantera/kinetics/FalloffMgr.h | 20 +- src/kinetics/FalloffFactory.cpp | 383 ++++++---------------- 3 files changed, 121 insertions(+), 330 deletions(-) diff --git a/include/cantera/kinetics/FalloffFactory.h b/include/cantera/kinetics/FalloffFactory.h index 2fca6c487..132f35c49 100644 --- a/include/cantera/kinetics/FalloffFactory.h +++ b/include/cantera/kinetics/FalloffFactory.h @@ -35,7 +35,6 @@ namespace Cantera class Falloff { public: - //! Default constructor is empty Falloff() {} @@ -43,12 +42,10 @@ public: virtual ~Falloff() {} /** - * Initialize. Must be called before any other method is - * invoked. + * Initialize. Must be called before any other method is invoked. * - * @param c Vector of coefficients of the parameterization. - * The number and meaning of these coefficients is - * subclass-dependent. + * @param c Vector of coefficients of the parameterization. The number and + * meaning of these coefficients is subclass-dependent. */ virtual void init(const vector_fp& c) =0; @@ -83,17 +80,10 @@ public: */ virtual doublereal F(doublereal pr, const doublereal* work) const =0; - /** - * The size of the work array required. - */ + //! The size of the work array required. virtual size_t workSize() =0; - -protected: -private: }; - - /** * Factory class to construct falloff function calculators. * The falloff factory is accessed through static method factory: @@ -107,12 +97,10 @@ private: class FalloffFactory : public FactoryBase { public: - /** - * Return a pointer to the factory. On the first call, a new - * instance is created. Since there is no need to instantiate - * more than one factory, on all subsequent calls, a pointer - * to the existing factory is returned. + * Return a pointer to the factory. On the first call, a new instance is + * created. Since there is no need to instantiate more than one factory, + * on all subsequent calls, a pointer to the existing factory is returned. */ static FalloffFactory* factory() { ScopedLock lock(falloff_mutex) ; @@ -131,26 +119,22 @@ public: } /** - * Destructor doesn't do anything. We do not delete statically - * created single instance of this class here, because it would - * create an infinite loop if destructor is called for that - * single instance. Instead, to delete single instance, we - * call delete[] from FalloffMng's destructor. + * Destructor doesn't do anything. We do not delete statically created + * single instance of this class here, because it would create an infinite + * loop if destructor is called for that single instance. Instead, to + * delete single instance, we call delete[] from FalloffMng's destructor. */ virtual ~FalloffFactory() { } - //! Return a pointer to a new falloff function calculator. /*! - * - * @param type Integer flag specifying the type of falloff function. - * The standard types are defined in file reaction_defs.h. A factory - * class derived from FalloffFactory may define other types as well. - * + * @param type Integer flag specifying the type of falloff function. The + * standard types are defined in file reaction_defs.h. A + * factory class derived from FalloffFactory may define other + * types as well. * @param c input vector of doubles which populates the falloff * parameterization. - * * @return Returns a pointer to a new Falloff class. */ virtual Falloff* newFalloff(int type, const vector_fp& c); @@ -168,5 +152,3 @@ private: } #endif - - diff --git a/include/cantera/kinetics/FalloffMgr.h b/include/cantera/kinetics/FalloffMgr.h index a01454330..109559d25 100644 --- a/include/cantera/kinetics/FalloffMgr.h +++ b/include/cantera/kinetics/FalloffMgr.h @@ -20,7 +20,6 @@ namespace Cantera class FalloffMgr { public: - //! Constructor. FalloffMgr(/*FalloffFactory* f = 0*/) : m_n(0), m_n0(0), m_worksize(0) { @@ -30,10 +29,7 @@ public: //else m_factory = f; } - /** - * Destructor. Deletes all installed falloff function - * calculators. - */ + //! Destructor. Deletes all installed falloff function calculators. virtual ~FalloffMgr() { int i; for (i = 0; i < m_n; i++) { @@ -45,11 +41,10 @@ public: //} } - /** - * Install a new falloff function calculator. @param rxn - * Index of the falloff reaction. This will be used to determine - * which array entry is modified in method pr_to_falloff. - * + //! Install a new falloff function calculator. + /* + * @param rxn Index of the falloff reaction. This will be used to + * determine which array entry is modified in method pr_to_falloff. * @param type of falloff function to install. * @param c vector of coefficients for the falloff function. */ @@ -68,9 +63,7 @@ public: } } - /** - * Size of the work array required to store intermediate results. - */ + //! Size of the work array required to store intermediate results. size_t workSize() { return m_worksize; } @@ -118,4 +111,3 @@ protected: } #endif - diff --git a/src/kinetics/FalloffFactory.cpp b/src/kinetics/FalloffFactory.cpp index 79205d430..c53f58ff1 100644 --- a/src/kinetics/FalloffFactory.cpp +++ b/src/kinetics/FalloffFactory.cpp @@ -20,54 +20,38 @@ mutex_t FalloffFactory::falloff_mutex; * The falloff function defines the value of \f$ F \f$ in the following * rate expression * - * \f[ - * k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F - * \f] + * \f[ k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F \f] * where - * \f[ - * P_r = \frac{k_0 [M]}{k_{\infty}} - * \f] + * \f[ P_r = \frac{k_0 [M]}{k_{\infty}} \f] * * This parameterization is defined by - * \f[ - * F = F_{cent}^{1/(1 + f_1^2)} - * \f] + * \f[ F = F_{cent}^{1/(1 + f_1^2)} \f] * where - * \f[ - * F_{cent} = (1 - A)\exp(-T/T_3) + A \exp(-T/T_1) - * \f] + * \f[ F_{cent} = (1 - A)\exp(-T/T_3) + A \exp(-T/T_1) \f] * - * \f[ - * f_1 = (\log_{10} P_r + C) / \left(N - 0.14 - * (\log_{10} P_r + C)\right) - * \f] + * \f[ f_1 = (\log_{10} P_r + C) / \left(N - 0.14 + * (\log_{10} P_r + C)\right) \f] * - * \f[ - * C = -0.4 - 0.67 \log_{10} F_{cent} - * \f] + * \f[ C = -0.4 - 0.67 \log_{10} F_{cent} \f] * - * \f[ - * N = 0.75 - 1.27 \log_{10} F_{cent} - * \f] + * \f[ N = 0.75 - 1.27 \log_{10} F_{cent} \f] * - * There are a few requirements for the parameters + * There are a few requirements for the parameters: * - * T_3 is required to greater than or equal to zero. If it is zero, - * then the term is set to zero. - * - * T_1 is required to greater than or equal to zero. If it is zero, - * then the term is set to zero. + * - T_3 is required to greater than or equal to zero. If it is zero, then + * the term is set to zero. + * - T_1 is required to greater than or equal to zero. If it is zero, then + * the term is set to zero. * * @ingroup falloffGroup */ class Troe3 : public Falloff { public: - //! Default constructor. Troe3() : m_a(0.0), m_rt3(0.0), m_rt1(0.0) {} - //! Destructor. Does nothing. + //! Destructor. virtual ~Troe3() {} /** @@ -113,11 +97,6 @@ public: *work = log10(std::max(Fcent, SmallNumber)); } - //! Function that returns F - /*! - * @param pr Value of the reduced pressure for this reaction - * @param work Pointer to the previously saved work space - */ virtual doublereal F(doublereal pr, const doublereal* work) const { doublereal lpr,f1,lgf, cc, nn; lpr = log10(std::max(pr,SmallNumber)); @@ -128,31 +107,22 @@ public: return pow(10.0, lgf); } - //! Utility function that returns the size of the workspace virtual size_t workSize() { return 1; } protected: - - //! parameter a in the 4-parameter Troe falloff function - /*! - * This is unitless - */ + //! parameter a in the 4-parameter Troe falloff function. This is + //! unitless. doublereal m_a; - //! parameter 1/T_3 in the 4-parameter Troe falloff function - /*! - * This has units of Kelvin-1 - */ + //! parameter 1/T_3 in the 4-parameter Troe falloff function. This has + //! units of Kelvin-1 doublereal m_rt3; - //! parameter 1/T_1 in the 4-parameter Troe falloff function - /*! - * This has units of Kelvin-1 - */ + //! parameter 1/T_1 in the 4-parameter Troe falloff function. This has + //! units of Kelvin-1. doublereal m_rt1; - }; //! The 4-parameter Troe falloff parameterization. @@ -160,45 +130,29 @@ protected: * The falloff function defines the value of \f$ F \f$ in the following * rate expression * - * \f[ - * k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F - * \f] + * \f[ k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F \f] * where - * \f[ - * P_r = \frac{k_0 [M]}{k_{\infty}} - * \f] + * \f[ P_r = \frac{k_0 [M]}{k_{\infty}} \f] * * This parameterization is defined by * - * \f[ - * F = F_{cent}^{1/(1 + f_1^2)} - * \f] + * \f[ F = F_{cent}^{1/(1 + f_1^2)} \f] * where - * \f[ - * F_{cent} = (1 - A)\exp(-T/T_3) + A \exp(-T/T_1) + \exp(-T_2/T) - * \f] + * \f[ F_{cent} = (1 - A)\exp(-T/T_3) + A \exp(-T/T_1) + \exp(-T_2/T) \f] * - * \f[ - * f_1 = (\log_{10} P_r + C) / - * \left(N - 0.14 (\log_{10} P_r + C)\right) - * \f] + * \f[ f_1 = (\log_{10} P_r + C) / + * \left(N - 0.14 (\log_{10} P_r + C)\right) \f] * - * \f[ - * C = -0.4 - 0.67 \log_{10} F_{cent} - * \f] - * - * \f[ - * N = 0.75 - 1.27 \log_{10} F_{cent} - * \f] + * \f[ C = -0.4 - 0.67 \log_{10} F_{cent} \f] * + * \f[ N = 0.75 - 1.27 \log_{10} F_{cent} \f] * * There are a few requirements for the parameters * - * T_3 is required to greater than or equal to zero. If it is zero, - * then the term is set to zero. - * - * T_1 is required to greater than or equal to zero. If it is zero, - * then the term is set to zero. + * - T_3 is required to greater than or equal to zero. If it is zero, + * then the term is set to zero. + * - T_1 is required to greater than or equal to zero. If it is zero, + * then the term is set to zero. * * @ingroup falloffGroup */ @@ -212,11 +166,10 @@ public: //! Destructor virtual ~Troe4() {} - //! Initialization of the object /*! * @param c Vector of four doubles: The doubles are the parameters, - * a,, T_3, T_1, and T_2 of the SRI parameterization + * a,, T_3, T_1, and T_2 of the Troe parameterization */ virtual void init(const vector_fp& c) { m_a = c[0]; @@ -257,11 +210,6 @@ public: *work = log10(std::max(Fcent, SmallNumber)); } - //! Function that returns F - /*! - * @param pr Value of the reduced pressure for this reaction - * @param work Pointer to the previously saved work space - */ virtual doublereal F(doublereal pr, const doublereal* work) const { doublereal lpr,f1,lgf, cc, nn; lpr = log10(std::max(pr,SmallNumber)); @@ -272,70 +220,49 @@ public: return pow(10.0, lgf); } - //! Utility function that returns the size of the workspace virtual size_t workSize() { return 1; } protected: - - //! parameter a in the 4-parameter Troe falloff function - /*! - * This is unitless - */ + //! parameter a in the 4-parameter Troe falloff function. This is + //! unitless. doublereal m_a; - //! parameter 1/T_3 in the 4-parameter Troe falloff function - /*! - * This has units of Kelvin-1 - */ + //! parameter 1/T_3 in the 4-parameter Troe falloff function. This has + //! units of Kelvin-1. doublereal m_rt3; - //! parameter 1/T_1 in the 4-parameter Troe falloff function - /*! - * This has units of Kelvin-1 - */ + //! parameter 1/T_1 in the 4-parameter Troe falloff function. This has + //! units of Kelvin-1. doublereal m_rt1; - //! parameter T_2 in the 4-parameter Troe falloff function - /*! - * This has units of Kelvin - */ + //! parameter T_2 in the 4-parameter Troe falloff function. This has + //! units of Kelvin. doublereal m_t2; }; - //! The 3-parameter SRI falloff function for F /*! * The falloff function defines the value of \f$ F \f$ in the following * rate expression * - * \f[ - * k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F - * \f] + * \f[ k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F \f] * where - * \f[ - * P_r = \frac{k_0 [M]}{k_{\infty}} - * \f] + * \f[ P_r = \frac{k_0 [M]}{k_{\infty}} \f] * - * \f[ - * F = {\left( a \; exp(\frac{-b}{T}) + exp(\frac{-T}{c})\right)}^n - * \f] + * \f[ F = {\left( a \; exp(\frac{-b}{T}) + exp(\frac{-T}{c})\right)}^n \f] * where - * \f[ - * n = \frac{1.0}{1.0 + {\log_{10} P_r}^2} - * \f] + * \f[ n = \frac{1.0}{1.0 + {\log_{10} P_r}^2} \f] * - * \f$ c \f$ s required to greater than or equal to zero. If it is zero, - * then the corresponding term is set to zero. + * \f$ c \f$ s required to greater than or equal to zero. If it is zero, + * then the corresponding term is set to zero. * * @ingroup falloffGroup */ class SRI3 : public Falloff { - public: - //! Constructor SRI3() {} @@ -373,81 +300,57 @@ public: } } - //! Function that returns F - /*! - * @param pr Value of the reduced pressure for this reaction - * @param work Pointer to the previously saved work space - */ virtual doublereal F(doublereal pr, const doublereal* work) const { doublereal lpr = log10(std::max(pr,SmallNumber)); doublereal xx = 1.0/(1.0 + lpr*lpr); return pow(*work , xx); } - //! Utility function that returns the size of the workspace virtual size_t workSize() { return 1; } protected: - - //! parameter a in the 3-parameter SRI falloff function - /*! - * This is unitless - */ + //! parameter a in the 3-parameter SRI falloff function. This is + //! unitless. doublereal m_a; - //! parameter b in the 3-parameter SRI falloff function - /*! - * This has units of Kelvin - */ + //! parameter b in the 3-parameter SRI falloff function. This has units + //! of Kelvin. doublereal m_b; - //! parameter c in the 3-parameter SRI falloff function - /*! - * This has units of Kelvin - */ + //! parameter c in the 3-parameter SRI falloff function. This has units + //! of Kelvin. doublereal m_c; }; - //! The 5-parameter SRI falloff function. /*! * The falloff function defines the value of \f$ F \f$ in the following * rate expression * - * \f[ - * k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F - * \f] + * \f[ k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F \f] * where - * \f[ - * P_r = \frac{k_0 [M]}{k_{\infty}} - * \f] + * \f[ P_r = \frac{k_0 [M]}{k_{\infty}} \f] * - * \f[ - * F = {\left( a \; exp(\frac{-b}{T}) + exp(\frac{-T}{c})\right)}^n - * \; d \; exp(\frac{-e}{T}) - * \f] + * \f[ F = {\left( a \; exp(\frac{-b}{T}) + exp(\frac{-T}{c})\right)}^n + * \; d \; exp(\frac{-e}{T}) \f] * where - * \f[ - * n = \frac{1.0}{1.0 + {\log_{10} P_r}^2} - * \f] + * \f[ n = \frac{1.0}{1.0 + {\log_{10} P_r}^2} \f] * - * \f$ c \f$ s required to greater than or equal to zero. If it is zero, - * then the corresponding term is set to zero. + * \f$ c \f$ s required to greater than or equal to zero. If it is zero, then + * the corresponding term is set to zero. * - * m_c is required to greater than or equal to zero. If it is zero, - * then the corresponding term is set to zero. + * m_c is required to greater than or equal to zero. If it is zero, then the + * corresponding term is set to zero. * - * m_d is required to be greater than zero. + * m_d is required to be greater than zero. * * @ingroup falloffGroup */ class SRI5 : public Falloff { - public: - //! Constructor SRI5() {} @@ -492,104 +395,61 @@ public: work[1] = m_d * pow(T,m_e); } - //! Function that returns F - /*! - * @param pr Value of the reduced pressure for this reaction - * @param work Pointer to the previously saved work space - */ virtual doublereal F(doublereal pr, const doublereal* work) const { doublereal lpr = log10(std::max(pr,SmallNumber)); doublereal xx = 1.0/(1.0 + lpr*lpr); return pow(*work, xx) * work[1]; } - //! Utility function that returns the size of the workspace virtual size_t workSize() { return 2; } protected: - - //! parameter a in the 5-parameter SRI falloff function - /*! - * This is unitless - */ + //! parameter a in the 5-parameter SRI falloff function. This is unitless. doublereal m_a; - //! parameter b in the 5-parameter SRI falloff function - /*! - * This has units of Kelvin - */ + //! parameter b in the 5-parameter SRI falloff function. This has units of + //! Kelvin. doublereal m_b; - //! parameter c in the 5-parameter SRI falloff function - /*! - * This has units of Kelvin - */ + //! parameter c in the 5-parameter SRI falloff function. This has units of + //! Kelvin. doublereal m_c; - //! parameter d in the 5-parameter SRI falloff function - /*! - * This is unitless - */ + //! parameter d in the 5-parameter SRI falloff function. This is unitless. doublereal m_d; - //! parameter d in the 5-parameter SRI falloff function - /*! - * This is unitless - */ + //! parameter d in the 5-parameter SRI falloff function. This is unitless. doublereal m_e; - }; - //! Wang-Frenklach falloff function. /*! - * * The falloff function defines the value of \f$ F \f$ in the following * rate expression * - * \f[ - * k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F - * \f] + * \f[ k = k_{\infty} \left( \frac{P_r}{1 + P_r} \right) F \f] * where - * \f[ - * P_r = \frac{k_0 [M]}{k_{\infty}} - * \f] + * \f[ P_r = \frac{k_0 [M]}{k_{\infty}} \f] * - * \f[ - * F = 10.0^{Flog} - * \f] + * \f[ F = 10.0^{Flog} \f] * where - * \f[ - * Flog = \frac{\log_{10} F_{cent}}{\exp{(\frac{\log_{10} P_r - \alpha}{\sigma})^2}} - * \f] + * \f[ Flog = \frac{\log_{10} F_{cent}}{\exp{(\frac{\log_{10} P_r - \alpha}{\sigma})^2}} \f] * where + * \f[ F_{cent} = (1 - A)\exp(-T/T_3) + A \exp(-T/T_1) + \exp(-T/T_2) \f] * - * \f[ - * F_{cent} = (1 - A)\exp(-T/T_3) + A \exp(-T/T_1) + \exp(-T/T_2) - * \f] + * \f[ \alpha = \alpha_0 + \alpha_1 T + \alpha_2 T^2 \f] * - * \f[ - * \alpha = \alpha_0 + \alpha_1 T + \alpha_2 T^2 - * \f] - * - * \f[ - * \sigma = \sigma_0 + \sigma_1 T + \sigma_2 T^2 - * \f] - * - * - * Reference: Wang, H., and - * Frenklach, M., Chem. Phys. Lett. vol. 205, 271 (1993). + * \f[ \sigma = \sigma_0 + \sigma_1 T + \sigma_2 T^2 \f] * + * Reference: Wang, H., and Frenklach, M., Chem. Phys. Lett. vol. 205, 271 (1993). * * @ingroup falloffGroup */ class WF93 : public Falloff { - public: - //! Default constructor WF93() {} @@ -598,10 +458,8 @@ public: //! Initialization routine /*! - * @param c Vector of 10 doubles - * with the following ordering: - * a, T_1, T_2, T_3, alpha0, alpha1, alpha2 - * sigma0, sigma1, sigma2 + * @param c Vector of 10 doubles with the following ordering: a, T_1, + * T_2, T_3, alpha0, alpha1, alpha2 sigma0, sigma1, sigma2 */ virtual void init(const vector_fp& c) { m_a = c[0]; @@ -633,11 +491,6 @@ public: work[2] = log10(Fcent); } - //! Function that returns F - /*! - * @param pr Value of the reduced pressure for this reaction - * @param work Pointer to the previously saved work space - */ virtual doublereal F(doublereal pr, const doublereal* work) const { doublereal lpr = log10(std::max(pr, SmallNumber)); doublereal x = (lpr - work[0])/work[1]; @@ -645,87 +498,52 @@ public: return pow(10.0, flog); } - //! Utility function that returns the size of the workspace virtual size_t workSize() { return 3; } protected: - - //! Value of the \f$ \alpha_0 \f$ coefficient - /*! - * This is the fifth coefficient in the xml list - */ + //! Value of the \f$ \alpha_0 \f$ coefficient. This is the fifth + //! coefficient in the xml list. doublereal m_alpha0; - //! Value of the \f$ \alpha_1 \f$ coefficient - /*! - * This is the 6th coefficient in the xml list - */ + //! Value of the \f$ \alpha_1 \f$ coefficient. This is the 6th coefficient + //! in the xml list. doublereal m_alpha1; - //! Value of the \f$ \alpha_2 \f$ coefficient - /*! - * This is the 7th coefficient in the xml list - */ + //! Value of the \f$ \alpha_2 \f$ coefficient. This is the 7th coefficient + //! in the xml list. doublereal m_alpha2; - //! Value of the \f$ \sigma_0 \f$ coefficient - /*! - * This is the 8th coefficient in the xml list - */ + //! Value of the \f$ \sigma_0 \f$ coefficient. This is the 8th coefficient + //! in the xml list. doublereal m_sigma0; - //! Value of the \f$ \sigma_1 \f$ coefficient - /*! - * This is the 9th coefficient in the xml list - */ + //! Value of the \f$ \sigma_1 \f$ coefficient. This is the 9th coefficient + //! in the xml list. doublereal m_sigma1; - //! Value of the \f$ \sigma_2 \f$ coefficient - /*! - * This is the 10th coefficient in the xml list - */ + //! Value of the \f$ \sigma_2 \f$ coefficient. This is the 10th + //! coefficient in the xml list. doublereal m_sigma2; - //! Value of the \f$ a \f$ coefficient - /*! - * This is the first coefficient in the xml list - */ + //! Value of the \f$ a \f$ coefficient. This is the first coefficient in + //! the xml list. doublereal m_a; - //! Value of inverse of the \f$ t1 \f$ coefficient - /*! - * This is the second coefficient in the xml list - */ + //! Value of inverse of the \f$ t1 \f$ coefficient. This is the second + //! coefficient in the xml list. doublereal m_rt1; - //! Value of the \f$ t2 \f$ coefficient - /*! - * This is the third coefficient in the xml list - */ + //! Value of the \f$ t2 \f$ coefficient. This is the third coefficient in + //! the xml list. doublereal m_t2; - //! Value of the inverse of the \f$ t3 \f$ coefficient - /*! - * This is the 4th coefficient in the xml list - */ + //! Value of the inverse of the \f$ t3 \f$ coefficient. This is the 4th + //! coefficient in the xml list. doublereal m_rt3; - -private: - }; -// Factory routine that returns a new Falloff parameterization object -/* - * @param type Integer type of the falloff parameterization. These - * integers are listed in reaction_defs.h - * - * @param c Vector of input parameterizations for the Falloff - * object. The function is initialized with this vector. - * - * @return Returns a pointer to a newly malloced Falloff object - */ Falloff* FalloffFactory::newFalloff(int type, const vector_fp& c) { Falloff* f; @@ -753,4 +571,3 @@ Falloff* FalloffFactory::newFalloff(int type, const vector_fp& c) } } -