diff --git a/include/cantera/thermo/GeneralSpeciesThermo.h b/include/cantera/thermo/GeneralSpeciesThermo.h index b359c922b..678eacc21 100644 --- a/include/cantera/thermo/GeneralSpeciesThermo.h +++ b/include/cantera/thermo/GeneralSpeciesThermo.h @@ -16,7 +16,6 @@ #include "StatMech.h" #include "speciesThermoTypes.h" - namespace Cantera { @@ -32,9 +31,7 @@ namespace Cantera */ class GeneralSpeciesThermo : public SpeciesThermo { - public: - //! Constructor GeneralSpeciesThermo(); @@ -53,7 +50,6 @@ public: //! Destructor virtual ~GeneralSpeciesThermo(); - //! Duplicator virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const ; //! Install a new species thermodynamic property @@ -78,8 +74,7 @@ public: * is valid. * @param maxTemp maximum temperature for which this parameterization * is valid. - * @param refPressure standard-state pressure for this - * parameterization. + * @param refPressure standard-state pressure for this parameterization. * @see speciesThermoTypes.h * * @todo Create a factory method for SpeciesThermoInterpType. @@ -90,12 +85,6 @@ public: doublereal minTemp, doublereal maxTemp, doublereal refPressure); - //! Install a new species thermodynamic property - //! parameterization for one species. - /*! - * @param stit_ptr Pointer to the SpeciesThermoInterpType object - * This will set up the thermo for one species - */ virtual void install_STIT(SpeciesThermoInterpType* stit_ptr); //! Install a PDSS object to handle the reference state thermodynamics @@ -113,93 +102,21 @@ public: /*! * @param k species index * @param T Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). + * @param cp_R Vector of Dimensionless heat capacities. (length m_kk). + * @param h_RT Vector of Dimensionless enthalpies. (length m_kk). + * @param s_R Vector of Dimensionless entropies. (length m_kk). */ virtual void update_one(size_t k, doublereal T, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const; - //! Compute the reference-state properties for all species. - /*! - * Given temperature T in K, this method updates the values of - * the non-dimensional heat capacity at constant pressure, - * enthalpy, and entropy, at the reference pressure, Pref - * of each of the standard states. - * - * @param T Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). - */ virtual void update(doublereal T, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const; - //! Minimum temperature. - /*! - * If no argument is supplied, this - * method returns the minimum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the minimum - * temperature for species k in the phase. - * - * @param k Species index - */ virtual doublereal minTemp(size_t k=npos) const; - - //! Maximum temperature. - /*! - * If no argument is supplied, this - * method returns the maximum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the maximum - * temperature for parameterization k. - * - * @param k Species Index - */ virtual doublereal maxTemp(size_t k=npos) const; - - //! The reference-state pressure for species k. - /*! - * - * returns the reference state pressure in Pascals for - * species k. If k is left out of the argument list, - * it returns the reference state pressure for the first - * species. - * Note that some SpeciesThermo implementations, such - * as those for ideal gases, require that all species - * in the same phase have the same reference state pressures. - * - * @param k Species Index - */ virtual doublereal refPressure(size_t k=npos) const; - - //! This utility function reports the type of parameterization - //! used for the species with index number index. - /*! - * - * @param index Species index - */ virtual int reportType(size_t index) const; - - //! This utility function reports back the type of - //! parameterization and all of the parameters for the species, index. - /*! - * @param index Species index - * @param type Integer type of the standard type - * @param c Vector of coefficients used to set the - * parameters for the standard state. - * @param minTemp output - Minimum temperature - * @param maxTemp output - Maximum temperature - * @param refPressure output - reference pressure (Pa). - */ virtual void reportParams(size_t index, int& type, doublereal* const c, doublereal& minTemp, @@ -217,17 +134,13 @@ public: private: //! Provide the SpeciesthermoInterpType object /*! - * provide access to the SpeciesThermoInterpType object. - * This - * - * @param k integer parameter + * @param k species index * * @return pointer to the SpeciesThermoInterpType object. */ SpeciesThermoInterpType* provideSTIT(size_t k); protected: - /** * This is the main unknown in the object. It is * a list of pointers to type SpeciesThermoInterpType. @@ -255,15 +168,11 @@ protected: */ size_t m_kk; - //! Make the class VPSSMgr a friend because we need to access //! the function provideSTIT() friend class VPSSMgr; - - }; } #endif - diff --git a/include/cantera/thermo/SimpleThermo.h b/include/cantera/thermo/SimpleThermo.h index 71e690c78..07f4a624f 100644 --- a/include/cantera/thermo/SimpleThermo.h +++ b/include/cantera/thermo/SimpleThermo.h @@ -13,13 +13,11 @@ namespace Cantera { - /*! - * A constant-heat capacity species thermodynamic property manager class. - * This makes the - * assumption that the heat capacity is a constant. Then, the following - * relations are used to complete the specification of the thermodynamic - * functions for each species in the phase. + * A constant-heat capacity species thermodynamic property manager class. This + * makes the assumption that the heat capacity is a constant. Then, the + * following relations are used to complete the specification of the + * thermodynamic functions for each species in the phase. * * \f[ * \frac{c_p(T)}{R} = Cp0\_R @@ -47,14 +45,9 @@ namespace Cantera */ class SimpleThermo : public SpeciesThermo { - public: - - //! Initialized to the type of parameterization - /*!A - * Note, this value is used in some template functions. For this object the - * value is SIMPLE. - */ + //! The type of parameterization. Note, this value is used in some + //! template functions. For this object the value is SIMPLE. const int ID; //! Constructor @@ -113,15 +106,6 @@ public: return *this; } - //! Duplication routine for objects which inherit from - //! %SpeciesThermo - /*! - * This virtual routine can be used to duplicate %SpeciesThermo objects - * inherited from %SpeciesThermo even if the application only has - * a pointer to %SpeciesThermo to work with. - * ->commented out because we first need to add copy constructors - * and assignment operators to all of the derived classes. - */ virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const { SimpleThermo* nt = new SimpleThermo(*this); return (SpeciesThermo*) nt; @@ -130,7 +114,6 @@ public: //! Install a new species thermodynamic property //! parameterization for one species. /*! - * * @param name String name of the species * @param index Species index, k * @param type int flag specifying the type of parameterization to be @@ -146,8 +129,7 @@ public: * is valid. * @param maxTemp_ maximum temperature for which this parameterization * is valid. - * @param refPressure_ standard-state pressure for this - * parameterization. + * @param refPressure_ standard-state pressure for this parameterization. * * @see ConstCpPoly */ @@ -193,31 +175,10 @@ public: m_p0 = refPressure_; } - //! Install a new species thermodynamic property - //! parameterization for one species. - /*! - * @param stit_ptr Pointer to the SpeciesThermoInterpType object - * This will set up the thermo for one species - */ virtual void install_STIT(SpeciesThermoInterpType* stit_ptr) { throw CanteraError("install_STIT", "not implemented"); } - //! Compute the reference-state properties for all species. - /*! - * Given temperature T in K, this method updates the values of - * the non-dimensional heat capacity at constant pressure, - * enthalpy, and entropy, at the reference pressure, Pref - * of each of the standard states. - * - * @param t Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). - */ virtual void update(doublereal t, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { size_t k, ki; @@ -235,12 +196,9 @@ public: /*! * @param k species index * @param t Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). + * @param cp_R Vector of Dimensionless heat capacities. (length m_kk). + * @param h_RT Vector of Dimensionless enthalpies. (length m_kk). + * @param s_R Vector of Dimensionless entropies. (length m_kk). */ virtual void update_one(size_t k, doublereal t, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { @@ -252,16 +210,6 @@ public: s_R[k] = m_s0_R[loc] + m_cp0_R[loc] * (logt - m_logt0[loc]); } - //! Minimum temperature. - /*! - * If no argument is supplied, this - * method returns the minimum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the minimum - * temperature for species k in the phase. - * - * @param k Species index - */ virtual doublereal minTemp(size_t k=npos) const { if (k == npos) { return m_tlow_max; @@ -270,16 +218,6 @@ public: } } - //! Maximum temperature. - /*! - * If no argument is supplied, this - * method returns the maximum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the maximum - * temperature for parameterization k. - * - * @param k Species Index - */ virtual doublereal maxTemp(size_t k=npos) const { if (k == npos) { return m_thigh_min; @@ -288,37 +226,17 @@ public: } } - //! The reference-state pressure for species k. - /*! - * - * returns the reference state pressure in Pascals for - * species k. If k is left out of the argument list, - * it returns the reference state pressure for the first - * species. - * Note that some SpeciesThermo implementations, such - * as those for ideal gases, require that all species - * in the same phase have the same reference state pressures. - * - * @param k Species Index - */ virtual doublereal refPressure(size_t k=npos) const { return m_p0; } - //! This utility function reports the type of parameterization - //! used for the species with index number index. - /*! - * - * @param index Species index - */ virtual int reportType(size_t index) const { return SIMPLE; } /*! - * This utility function reports back the type of - * parameterization and all of the parameters for the - * species, index. + * This utility function reports back the type of parameterization and all + * of the parameters for the species, index. * * @param index Species index * @param type Integer type of the standard type @@ -328,7 +246,6 @@ public: * @param minTemp_ output - Minimum temperature * @param maxTemp_ output - Maximum temperature * @param refPressure_ output - reference pressure (Pa). - * */ virtual void reportParams(size_t index, int& type, doublereal* const c, @@ -349,7 +266,6 @@ public: } #ifdef H298MODIFY_CAPABILITY - virtual doublereal reportOneHf298(int k) const { throw CanteraError("reportHF298", "unimplemented"); } @@ -357,11 +273,9 @@ public: virtual void modifyOneHf298(const int k, const doublereal Hf298New) { throw CanteraError("reportHF298", "unimplemented"); } - - #endif -protected: +protected: //! Mapping between the species index and the vector index where the coefficients are kept /*! * This object doesn't have a one-to one correspondence between the species index, kspec, @@ -437,7 +351,6 @@ protected: * This is less than or equal to the number of species in the phase. */ size_t m_nspData; - }; } diff --git a/include/cantera/thermo/SpeciesThermo.h b/include/cantera/thermo/SpeciesThermo.h index 640446a40..10f8f7fb7 100644 --- a/include/cantera/thermo/SpeciesThermo.h +++ b/include/cantera/thermo/SpeciesThermo.h @@ -6,7 +6,6 @@ */ // Copyright 2001 California Institute of Technology - #ifndef CT_SPECIESTHERMO_H #define CT_SPECIESTHERMO_H @@ -14,7 +13,6 @@ namespace Cantera { - class SpeciesThermoInterpType; /** @@ -26,7 +24,6 @@ class SpeciesThermoInterpType; * significant cost, so efficiency is important. * This group describes how this is done efficiently within Cantera. * - * * To compute the thermodynamic properties of multicomponent * solutions, it is necessary to know something about the * thermodynamic properties of the individual species present in @@ -37,7 +34,6 @@ class SpeciesThermoInterpType; * the mixture temperature and at a reference pressure (almost always at * 1 bar). * - * * In defining these standard states for species in a phase, we make * the following definition. A reference state is a standard state * of a species in a phase limited to one particular pressure, the reference @@ -83,7 +79,6 @@ class SpeciesThermoInterpType; * It accepts as an argument a pointer to an already formed * SpeciesThermoInterpType object. * - * * The following classes inherit from %SpeciesThermo. Each of these classes * handle multiple species, usually all of the species in a phase. However, * there is no requirement that a %SpeciesThermo object handles all of the @@ -92,22 +87,16 @@ class SpeciesThermoInterpType; * - NasaThermo in file NasaThermo.h * - This is a two zone model, with each zone consisting of a 7 * coefficient Nasa Polynomial format. - * . * - ShomateThermo in file ShomateThermo.h * - This is a two zone model, with each zone consisting of a 7 * coefficient Shomate Polynomial format. - * . * - SimpleThermo in file SimpleThermo.h * - This is a one-zone constant heat capacity model. - * . * - GeneralSpeciesThermo in file GeneralSpeciesThermo.h * - This is a general model. Each species is handled separately * via a vector over SpeciesThermoInterpType classes. - * . * - SpeciesThermoDuo in file SpeciesThermoMgr.h * - This is a combination of two SpeciesThermo types. - * . - * . * * The class SpeciesThermoInterpType is a pure virtual base class for * calculation of thermodynamic functions for a single species @@ -117,65 +106,53 @@ class SpeciesThermoInterpType; * - NasaPoly1 in file NasaPoly1.h * - This is a one zone model, consisting of a 7 * coefficient Nasa Polynomial format. - * . * - NasaPoly2 in file NasaPoly2.h * - This is a two zone model, with each zone consisting of a 7 * coefficient Nasa Polynomial format. - * . * - ShomatePoly in file ShomatePoly.h * - This is a one zone model, consisting of a 7 * coefficient Shomate Polynomial format. - * . * - ShomatePoly2 in file ShomatePoly.h * - This is a two zone model, with each zone consisting of a 7 * coefficient Shomate Polynomial format. - * . * - ConstCpPoly in file ConstCpPoly.h * - This is a one-zone constant heat capacity model. - * . * - Mu0Poly in file Mu0Poly.h * - This is a multizoned model. The chemical potential is given * at a set number of temperatures. Between each temperature * the heat capacity is treated as a constant. - * . * - Nasa9Poly1 in file Nasa9Poly1.h * - This is a one zone model, consisting of the 9 * coefficient Nasa Polynomial format. - * . * - Nasa9PolyMultiTempRegion in file Nasa9PolyMultiTempRegion.h * - This is a multiple zone model, consisting of the 9 * coefficient Nasa Polynomial format in each zone. - * . - * .In particular the NasaThermo %SpeciesThermo-derived model has - * been optimized for execution speed. It's the main-stay of - * gas phase computations involving large numbers of species in - * a phase. It combines the calculation of each species, which - * individually have NasaPoly2 representations, to - * minimize the computational time. * - * The GeneralSpeciesThermo %SpeciesThermo object is completely - * general. It does not try to coordinate the individual species - * calculations at all and therefore is the slowest but - * most general implementation. + * In particular the NasaThermo %SpeciesThermo-derived model has been + * optimized for execution speed. It's the main-stay of gas phase computations + * involving large numbers of species in a phase. It combines the calculation + * of each species, which individually have NasaPoly2 representations, to + * minimize the computational time. + * + * The GeneralSpeciesThermo %SpeciesThermo object is completely general. It + * does not try to coordinate the individual species calculations at all and + * therefore is the slowest but most general implementation. * * @ingroup thermoprops */ //@{ - //! Pure Virtual base class for the species thermo manager classes. /*! * This class defines the interface which all subclasses must implement. * - * Class %SpeciesThermo is the base class - * for a family of classes that compute properties of a set of - * species in their reference state at a range of temperatures. - * Note, the pressure dependence of the reference state is not + * Class SpeciesThermo is the base class for a family of classes that compute + * properties of a set of species in their reference state at a range of + * temperatures. Note, the pressure dependence of the reference state is not * handled by this particular species standard state model. */ class SpeciesThermo { - public: //! Constructor @@ -193,8 +170,6 @@ public: //! Assignment operator for the %SpeciesThermo object /*! - * This is NOT a virtual function. - * * @param right Reference to %SpeciesThermo object to be copied into the * current one. */ @@ -202,20 +177,18 @@ public: return *this; } - //! Duplication routine for objects which inherit from - //! %SpeciesThermo + //! Duplication routine for objects derived from SpeciesThermo /*! - * This virtual routine can be used to duplicate %SpeciesThermo objects - * inherited from %SpeciesThermo even if the application only has - * a pointer to %SpeciesThermo to work with. - * ->commented out because we first need to add copy constructors - * and assignment operators to all of the derived classes. + * This function can be used to duplicate objects derived from + * SpeciesThermo even if the application only has a pointer to + * SpeciesThermo to work with. */ virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const = 0; //! Install a new species thermodynamic property //! parameterization for one species. /*! + * @see speciesThermoTypes.h * * @param name Name of the species * @param index The 'update' method will update the property @@ -232,7 +205,6 @@ public: * is valid. * @param refPressure standard-state pressure for this * parameterization. - * @see speciesThermoTypes.h */ virtual void install(const std::string& name, size_t index, int type, const doublereal* c, @@ -247,40 +219,30 @@ public: */ virtual void install_STIT(SpeciesThermoInterpType* stit_ptr) = 0; - //! Compute the reference-state properties for all species. /*! - * Given temperature T in K, this method updates the values of - * the non-dimensional heat capacity at constant pressure, - * enthalpy, and entropy, at the reference pressure, Pref - * of each of the standard states. + * Given temperature T in K, this method updates the values of the non- + * dimensional heat capacity at constant pressure, enthalpy, and entropy, + * at the reference pressure, Pref of each of the standard states. * * @param T Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). + * @param cp_R Vector of Dimensionless heat capacities. (length m_kk). + * @param h_RT Vector of Dimensionless enthalpies. (length m_kk). + * @param s_R Vector of Dimensionless entropies. (length m_kk). */ virtual void update(doublereal T, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const=0; - //! Like update(), but only updates the single species k. /*! - * The default treatment is to just call update() which - * means that potentially the operation takes a m_kk*m_kk - * hit. + * The default treatment is to just call update() which means that + * potentially the operation takes a m_kk*m_kk hit. * * @param k species index * @param T Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). + * @param cp_R Vector of Dimensionless heat capacities. (length m_kk). + * @param h_RT Vector of Dimensionless enthalpies. (length m_kk). + * @param s_R Vector of Dimensionless entropies. (length m_kk). */ virtual void update_one(size_t k, doublereal T, doublereal* cp_R, @@ -291,11 +253,10 @@ public: //! Minimum temperature. /*! - * If no argument is supplied, this - * method returns the minimum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the minimum - * temperature for species k in the phase. + * If no argument is supplied, this method returns the minimum temperature + * for which \e all parameterizations are valid. If an integer index k is + * supplied, then the value returned is the minimum temperature for + * species k in the phase. * * @param k Species index */ @@ -303,11 +264,10 @@ public: //! Maximum temperature. /*! - * If no argument is supplied, this - * method returns the maximum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the maximum - * temperature for parameterization k. + * If no argument is supplied, this method returns the maximum temperature + * for which \e all parameterizations are valid. If an integer index k is + * supplied, then the value returned is the maximum temperature for + * parameterization k. * * @param k Species Index */ @@ -315,30 +275,25 @@ public: //! The reference-state pressure for species k. /*! - * - * returns the reference state pressure in Pascals for - * species k. If k is left out of the argument list, - * it returns the reference state pressure for the first - * species. - * Note that some SpeciesThermo implementations, such - * as those for ideal gases, require that all species - * in the same phase have the same reference state pressures. + * Returns the reference state pressure in Pascals for species k. If k is + * left out of the argument list, it returns the reference state pressure + * for the first species. Note that some SpeciesThermo implementations, + * such as those for ideal gases, require that all species in the same + * phase have the same reference state pressures. * * @param k Species Index */ virtual doublereal refPressure(size_t k=npos) const =0; //! This utility function reports the type of parameterization - //! used for the species with index number index. + //! used for the species with index number *index*. /*! - * * @param index Species index */ virtual int reportType(size_t index=npos) const = 0; - - //! This utility function reports back the type of - //! parameterization and all of the parameters for the species, index. + //! This utility function reports back the type of parameterization and + //! all of the parameters for the species with index number *index*. /*! * @param index Species index * @param type Integer type of the standard type @@ -382,4 +337,3 @@ public: } #endif - diff --git a/include/cantera/thermo/SpeciesThermoMgr.h b/include/cantera/thermo/SpeciesThermoMgr.h index 8cfdcca21..a549eea7f 100644 --- a/include/cantera/thermo/SpeciesThermoMgr.h +++ b/include/cantera/thermo/SpeciesThermoMgr.h @@ -19,8 +19,6 @@ namespace Cantera { -/////////////////////// Exceptions ////////////////////////////// - //! Unknown species thermo manager string error /*! * @ingroup mgrsrefcalc @@ -28,7 +26,6 @@ namespace Cantera class UnknownSpeciesThermo : public CanteraError { public: - //! constructor /*! * @param proc name of the procecdure @@ -50,7 +47,6 @@ public: virtual ~UnknownSpeciesThermo() throw() {} }; - /** * This species thermo manager requires that all species have one * of two parameterizations. @@ -62,7 +58,6 @@ public: template class SpeciesThermoDuo : public SpeciesThermo { - public: //! Constructor SpeciesThermoDuo() {}; @@ -84,138 +79,34 @@ public: */ SpeciesThermoDuo& operator=(const SpeciesThermoDuo& right); - //! Duplication routine for objects which inherit from - //! %SpeciesThermo - /*! - * This virtual routine can be used to duplicate %SpeciesThermo objects - * inherited from %SpeciesThermo even if the application only has - * a pointer to %SpeciesThermo to work with. - * ->commented out because we first need to add copy constructors - * and assignment operators to all of the derived classes. - */ virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const; - /** - * install a new species thermodynamic property - * parameterization for one species. - * - * @param name Name of the species - * @param sp The 'update' method will update the property - * values for this species - * at position i index in the property arrays. - * @param type int flag specifying the type of parameterization to be - * installed. - * @param c vector of coefficients for the parameterization. - * This vector is simply passed through to the - * parameterization constructor. - * @param minTemp minimum temperature for which this parameterization - * is valid. - * @param maxTemp maximum temperature for which this parameterization - * is valid. - * @param refPressure standard-state pressure for this - * parameterization. - * @see speciesThermoTypes.h - */ virtual void install(const std::string& name, size_t sp, int type, const doublereal* c, doublereal minTemp, doublereal maxTemp, doublereal refPressure); - //! Install a new species thermodynamic property - //! parameterization for one species. - /*! - * @param stit_ptr Pointer to the SpeciesThermoInterpType object - * This will set up the thermo for one species - */ virtual void install_STIT(SpeciesThermoInterpType* stit_ptr) { throw CanteraError("install_STIT", "not implemented"); } - //! Compute the reference-state properties for all species. - /*! - * Given temperature T in K, this method updates the values of - * the non-dimensional heat capacity at constant pressure, - * enthalpy, and entropy, at the reference pressure, Pref - * of each of the standard states. - * - * @param t Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). - */ virtual void update(doublereal t, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const; - //! Minimum temperature. - /*! - * If no argument is supplied, this - * method returns the minimum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the minimum - * temperature for species k in the phase. - * - * @param k Species index - */ virtual doublereal minTemp(size_t k = npos) const { return std::max(m_thermo1.minTemp(),m_thermo2.minTemp()); } - //! Maximum temperature. - /*! - * If no argument is supplied, this - * method returns the maximum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the maximum - * temperature for parameterization k. - * - * @param k index for parameterization k - */ virtual doublereal maxTemp(size_t k = npos) const { return std::min(m_thermo1.maxTemp(), m_thermo2.maxTemp()); } - /** - * The reference-state pressure for species k. - * - * returns the reference state pressure in Pascals for - * species k. If k is left out of the argument list, - * it returns the reference state pressure for the first - * species. - * Note that some SpeciesThermo implementations, such - * as those for ideal gases, require that all species - * in the same phase have the same reference state pressures. - * - * @param k index for parameterization k - */ virtual doublereal refPressure(size_t k = npos) const { return m_p0; } - //! This utility function reports the type of parameterization - //! used for the species with index number index. - /*! - * - * @param k Species index - */ virtual int reportType(size_t k) const; - /*! - * This utility function reports back the type of - * parameterization and all of the parameters for the - * species, index. - * - * @param index Species index - * @param type Integer type of the standard type - * @param c Vector of coefficients used to set the - * parameters for the standard state. - * @param minTemp output - Minimum temperature - * @param maxTemp output - Maximum temperature - * @param refPressure output - reference pressure (Pa). - * - */ virtual void reportParams(size_t index, int& type, doublereal* const c, doublereal& minTemp, diff --git a/src/thermo/GeneralSpeciesThermo.cpp b/src/thermo/GeneralSpeciesThermo.cpp index a66fcc233..632b4d8fb 100644 --- a/src/thermo/GeneralSpeciesThermo.cpp +++ b/src/thermo/GeneralSpeciesThermo.cpp @@ -20,11 +20,6 @@ using namespace std; namespace Cantera { - - -/* - * Constructors - */ GeneralSpeciesThermo::GeneralSpeciesThermo() : SpeciesThermo(), m_tlow_max(0.0), @@ -95,14 +90,6 @@ GeneralSpeciesThermo::duplMyselfAsSpeciesThermo() const return new GeneralSpeciesThermo(*this); } - -/* - * Install parameterization for a species. - * @param index Species index - * @param type parameterization type - * @param c coefficients. The meaning of these depends on - * the parameterization. - */ void GeneralSpeciesThermo::install(const std::string& name, size_t index, int type, @@ -181,12 +168,6 @@ void GeneralSpeciesThermo::install(const std::string& name, m_thigh_min = min(maxTemp_, m_thigh_min); } -// Install a new species thermodynamic property -// parameterization for one species. -/* - * @param stit_ptr Pointer to the SpeciesThermoInterpType object - * This will set up the thermo for one species - */ void GeneralSpeciesThermo::install_STIT(SpeciesThermoInterpType* stit_ptr) { /* @@ -216,8 +197,6 @@ void GeneralSpeciesThermo::install_STIT(SpeciesThermoInterpType* stit_ptr) m_thigh_min = min(stit_ptr->maxTemp(), m_thigh_min); } - - void GeneralSpeciesThermo::installPDSShandler(size_t k, PDSS* PDSS_ptr, VPSSMgr* vpssmgr_ptr) { @@ -225,9 +204,6 @@ void GeneralSpeciesThermo::installPDSShandler(size_t k, PDSS* PDSS_ptr, install_STIT(stit_ptr); } -/** - * Update the properties for one species. - */ void GeneralSpeciesThermo:: update_one(size_t k, doublereal t, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const @@ -238,10 +214,6 @@ update_one(size_t k, doublereal t, doublereal* cp_R, } } - -/** - * Update the properties for all species. - */ void GeneralSpeciesThermo:: update(doublereal t, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const @@ -261,10 +233,6 @@ update(doublereal t, doublereal* cp_R, } } -/** - * This utility function reports the type of parameterization - * used for the species, index. - */ int GeneralSpeciesThermo::reportType(size_t index) const { SpeciesThermoInterpType* sp = m_sp[index]; @@ -274,12 +242,6 @@ int GeneralSpeciesThermo::reportType(size_t index) const return -1; } -/** - * This utility function reports back the type of - * parameterization and all of the parameters for the - * species, index. - * For the NASA object, there are 15 coefficients. - */ void GeneralSpeciesThermo:: reportParams(size_t index, int& type, doublereal* const c, doublereal& minTemp_, doublereal& maxTemp_, doublereal& refPressure_) const @@ -298,29 +260,6 @@ reportParams(size_t index, int& type, doublereal* const c, } } -// //! Modify parameters for the standard state -// /*! -// * @param index Species index -// * @param c Vector of coefficients used to set the -// * parameters for the standard state. -// */ -// void GeneralSpeciesThermo:: -// modifyParams(size_t index, doublereal* c) -// { -// SpeciesThermoInterpType* sp = m_sp[index]; -// if (sp) { -// sp->modifyParameters(c); -// } -// } - - -/** - * Return the lowest temperature at which the thermodynamic - * parameterization is valid. If no argument is supplied, the - * value is the one for which all species parameterizations - * are valid. Otherwise, if an integer argument is given, the - * value applies only to the species with that index. - */ doublereal GeneralSpeciesThermo::minTemp(size_t k) const { if (k == npos) { @@ -360,7 +299,6 @@ doublereal GeneralSpeciesThermo::refPressure(size_t k) const return m_p0; } - SpeciesThermoInterpType* GeneralSpeciesThermo::provideSTIT(size_t k) { return m_sp[k]; @@ -386,8 +324,6 @@ void GeneralSpeciesThermo::modifyOneHf298(const int k, const doublereal Hf298New } } - #endif - } diff --git a/src/thermo/NasaThermo.h b/src/thermo/NasaThermo.h index c4f064e6d..60d1b045a 100644 --- a/src/thermo/NasaThermo.h +++ b/src/thermo/NasaThermo.h @@ -18,7 +18,6 @@ namespace Cantera { - /** * A species thermodynamic property manager for the NASA * polynomial parameterization with two temperature ranges. @@ -48,9 +47,7 @@ namespace Cantera */ class NasaThermo : public SpeciesThermo { - public: - //! Initialized to the type of parameterization /*! * Note, this value is used in some template functions @@ -110,19 +107,9 @@ public: return *this; } - //! destructor virtual ~NasaThermo() {} - //! Duplication routine for objects which inherit from - //! %SpeciesThermo - /*! - * This virtual routine can be used to duplicate %SpeciesThermo objects - * inherited from %SpeciesThermo even if the application only has - * a pointer to %SpeciesThermo to work with. - * ->commented out because we first need to add copy constructors - * and assignment operators to all of the derived classes. - */ virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const { NasaThermo* nt = new NasaThermo(*this); return (SpeciesThermo*) nt; @@ -131,12 +118,11 @@ public: //! install a new species thermodynamic property //! parameterization for one species. /*! - * - * @param name Name of the species - * @param index The 'update' method will update the property - * values for this species - * at position i index in the property arrays. - * @param type int flag specifying the type of parameterization to be + * @param name Name of the species + * @param index The 'update' method will update the property values for + * this species at position i index in the property + * arrays. + * @param type int flag specifying the type of parameterization to be * installed. * @param c vector of coefficients for the parameterization. * - c[0] midpoint temperature @@ -146,8 +132,7 @@ public: * is valid. * @param maxTemp maximum temperature for which this parameterization * is valid. - * @param refPressure standard-state pressure for this - * parameterization. + * @param refPressure standard-state pressure for this parameterization. * @see speciesThermoTypes.h */ virtual void install(const std::string& name, size_t index, int type, @@ -218,32 +203,20 @@ public: m_p0 = refPressure; } - //! Install a new species thermodynamic property - //! parameterization for one species. - /*! - * @param stit_ptr Pointer to the SpeciesThermoInterpType object - * This will set up the thermo for one species - */ virtual void install_STIT(SpeciesThermoInterpType* stit_ptr) { throw CanteraError("install_STIT", "not implemented"); } - //! Like update(), but only updates the single species k. /*! * @param k species index * @param t Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). - * + * @param cp_R Vector of Dimensionless heat capacities. (length m_kk). + * @param h_RT Vector of Dimensionless enthalpies. (length m_kk). + * @param s_R Vector of Dimensionless entropies. (length m_kk). */ virtual void update_one(size_t k, doublereal t, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { - m_t[0] = t; m_t[1] = t*t; m_t[2] = m_t[1]*t; @@ -266,21 +239,6 @@ public: } } - //! Compute the reference-state properties for all species. - /*! - * Given temperature T in K, this method updates the values of - * the non-dimensional heat capacity at constant pressure, - * enthalpy, and entropy, at the reference pressure, Pref - * of each of the standard states. - * - * @param t Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). - */ virtual void update(doublereal t, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { int i; @@ -309,16 +267,6 @@ public: } } - //! Minimum temperature. - /*! - * If no argument is supplied, this - * method returns the minimum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the minimum - * temperature for species k in the phase. - * - * @param k Species index - */ virtual doublereal minTemp(size_t k=npos) const { if (k == npos) { return m_tlow_max; @@ -327,16 +275,6 @@ public: } } - //! Maximum temperature. - /*! - * If no argument is supplied, this - * method returns the maximum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the maximum - * temperature for parameterization k. - * - * @param k Species index - */ virtual doublereal maxTemp(size_t k=npos) const { if (k == npos) { return m_thigh_min; @@ -345,29 +283,10 @@ public: } } - //! The reference-state pressure for species k. - /*! - * - * returns the reference state pressure in Pascals for - * species k. If k is left out of the argument list, - * it returns the reference state pressure for the first - * species. - * Note that some SpeciesThermo implementations, such - * as those for ideal gases, require that all species - * in the same phase have the same reference state pressures. - * - * @param k Species index - */ virtual doublereal refPressure(size_t k=npos) const { return m_p0; } - //! This utility function reports the type of parameterization - //! used for the species with index number index. - /*! - * - * @param index Species index - */ virtual int reportType(size_t index) const { return NASA; } @@ -550,7 +469,6 @@ protected: mutable std::map m_name; private: - //! see SpeciesThermoFactory.cpp for the definition /*! * @param name string name of species @@ -582,12 +500,8 @@ private: + OneThird*c[3]*t*t*t + 0.25*c[4]*t*t*t*t + c[6]; } - - - }; } #endif - diff --git a/src/thermo/ShomateThermo.h b/src/thermo/ShomateThermo.h index e978d3ef1..06e6c7693 100644 --- a/src/thermo/ShomateThermo.h +++ b/src/thermo/ShomateThermo.h @@ -7,7 +7,6 @@ */ // Copyright 2001 California Institute of Technology - #ifndef CT_SHOMATETHERMO_H #define CT_SHOMATETHERMO_H @@ -17,7 +16,6 @@ namespace Cantera { - //! A species thermodynamic property manager for the Shomate polynomial parameterization. /*! * This is the parameterization used @@ -47,8 +45,7 @@ namespace Cantera * - \f$ \tilde{s}^0(T) \f$= standard Entropy (J/gmol*K) * - \f$ t \f$= temperature (K) / 1000. * - * Note, the polynomial data (i.e., A, ... , G) is entered in dimensional - * form. + * Note, the polynomial data (i.e., A, ... , G) is entered in dimensional form. * * This is in contrast to the NASA database polynomials which are entered in * nondimensional form (i.e., NASA parameterizes C_p/R, while Shomate @@ -61,9 +58,7 @@ namespace Cantera */ class ShomateThermo : public SpeciesThermo { - public: - //! Initialized to the type of parameterization /*! * Note, this value is used in some template functions @@ -122,16 +117,6 @@ public: return *this; } - - //! Duplication routine for objects which inherit from - //! %SpeciesThermo - /*! - * This virtual routine can be used to duplicate %SpeciesThermo objects - * inherited from %SpeciesThermo even if the application only has - * a pointer to %SpeciesThermo to work with. - * ->commented out because we first need to add copy constructors - * and assignment operators to all of the derived classes. - */ virtual SpeciesThermo* duplMyselfAsSpeciesThermo() const { ShomateThermo* st = new ShomateThermo(*this); return (SpeciesThermo*) st; @@ -139,7 +124,6 @@ public: //! Install a new species thermodynamic property //! parameterization for one species using Shomate polynomials - //! /*! * Two temperature regions are assumed. * @@ -218,12 +202,6 @@ public: } - //! Install a new species thermodynamic property - //! parameterization for one species. - /*! - * @param stit_ptr Pointer to the SpeciesThermoInterpType object - * This will set up the thermo for one species - */ virtual void install_STIT(SpeciesThermoInterpType* stit_ptr) { throw CanteraError("install_STIT", "not implemented"); } @@ -232,16 +210,12 @@ public: /*! * @param k species index * @param t Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). + * @param cp_R Vector of Dimensionless heat capacities. (length m_kk). + * @param h_RT Vector of Dimensionless enthalpies. (length m_kk). + * @param s_R Vector of Dimensionless entropies. (length m_kk). */ virtual void update_one(size_t k, doublereal t, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { - doublereal tt = 1.e-3*t; m_t[0] = tt; m_t[1] = tt*tt; @@ -266,21 +240,6 @@ public: } } - //! Compute the reference-state properties for all species. - /*! - * Given temperature T in K, this method updates the values of - * the non-dimensional heat capacity at constant pressure, - * enthalpy, and entropy, at the reference pressure, Pref - * of each of the standard states. - * - * @param t Temperature (Kelvin) - * @param cp_R Vector of Dimensionless heat capacities. - * (length m_kk). - * @param h_RT Vector of Dimensionless enthalpies. - * (length m_kk). - * @param s_R Vector of Dimensionless entropies. - * (length m_kk). - */ virtual void update(doublereal t, doublereal* cp_R, doublereal* h_RT, doublereal* s_R) const { int i; @@ -309,16 +268,6 @@ public: } } - //! Minimum temperature. - /*! - * If no argument is supplied, this - * method returns the minimum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the minimum - * temperature for species k in the phase. - * - * @param k Species index - */ virtual doublereal minTemp(size_t k=npos) const { if (k == npos) { return m_tlow_max; @@ -327,16 +276,6 @@ public: } } - //! Maximum temperature. - /*! - * If no argument is supplied, this - * method returns the maximum temperature for which \e all - * parameterizations are valid. If an integer index k is - * supplied, then the value returned is the maximum - * temperature for parameterization k. - * - * @param k species index - */ virtual doublereal maxTemp(size_t k=npos) const { if (k == npos) { return m_thigh_min; @@ -345,47 +284,14 @@ public: } } - //! The reference-state pressure for species k. - /*! - * - * returns the reference state pressure in Pascals for - * species k. If k is left out of the argument list, - * it returns the reference state pressure for the first - * species. - * Note that some SpeciesThermo implementations, such - * as those for ideal gases, require that all species - * in the same phase have the same reference state pressures. - * - * @param k species index - */ virtual doublereal refPressure(size_t k=npos) const { return m_p0; } - //! This utility function reports the type of parameterization - //! used for the species with index number index. - /*! - * - * @param index Species index - */ virtual int reportType(size_t index) const { return SHOMATE; } - /*! - * This utility function reports back the type of - * parameterization and all of the parameters for the - * species, index. - * - * @param index Species index - * @param type Integer type of the standard type - * @param c Vector of coefficients used to set the - * parameters for the standard state. - * - * @param minTemp output - Minimum temperature - * @param maxTemp output - Maximum temperature - * @param refPressure output - reference pressure (Pa). - */ virtual void reportParams(size_t index, int& type, doublereal* const c, doublereal& minTemp, @@ -473,25 +379,21 @@ public: } - #endif protected: - //! Vector of vector of NasaPoly1's for the high temp region. /*! - * This is the high temp region representation. - * The first Length is equal to the number of groups. - * The second vector is equal to the number of species - * in that particular group. + * This is the high temp region representation. The first Length is equal + * to the number of groups. The second vector is equal to the number of + * species in that particular group. */ std::vector > m_high; //! Vector of vector of NasaPoly1's for the low temp region. /*! - * This is the low temp region representation. - * The first Length is equal to the number of groups. - * The second vector is equal to the number of species - * in that particular group. + * This is the low temp region representation. The first Length is equal + * to the number of groups. The second vector is equal to the number of + * species in that particular group. */ std::vector > m_low;