diff --git a/SConstruct b/SConstruct index ee682b9a8..625dfe3a7 100644 --- a/SConstruct +++ b/SConstruct @@ -377,11 +377,6 @@ config_options = [ 'sphinx_cmd', """Command to use for building the Sphinx documentation.""", 'sphinx-build', PathVariable.PathAccept), - BoolVariable( - 'with_h298modify_capability', - """Enable changing the 298K heats of formation directly via - the C++ layer.""", - False), EnumVariable( 'use_sundials', """Cantera uses the CVODE or CVODES ODE integrator to time-integrate @@ -1144,8 +1139,6 @@ if env.get('has_sundials_lapack') and not env['BUILD_BLAS_LAPACK']: else: configh['SUNDIALS_USE_LAPACK'] = 0 -cdefine('H298MODIFY_CAPABILITY', 'with_h298modify_capability') - cdefine('LAPACK_FTN_STRING_LEN_AT_END', 'lapack_ftn_string_len_at_end') cdefine('LAPACK_FTN_TRAILING_UNDERSCORE', 'lapack_ftn_trailing_underscore') cdefine('FTN_TRAILING_UNDERSCORE', 'lapack_ftn_trailing_underscore') diff --git a/include/cantera/base/config.h.in b/include/cantera/base/config.h.in index a14c5810d..afbf13b8d 100644 --- a/include/cantera/base/config.h.in +++ b/include/cantera/base/config.h.in @@ -104,10 +104,6 @@ typedef int ftnlen; // Fortran hidden string length type //-------------- Optional Cantera Capabilities ---------------------- -// Enable sensitivity analysis via changing H298 directly -// for species -%(H298MODIFY_CAPABILITY)s - // Enable Sundials to use an external BLAS/LAPACK library if it was // built to use this option %(SUNDIALS_USE_LAPACK)s diff --git a/include/cantera/thermo/GeneralSpeciesThermo.h b/include/cantera/thermo/GeneralSpeciesThermo.h index 68c36ab99..df51e4ece 100644 --- a/include/cantera/thermo/GeneralSpeciesThermo.h +++ b/include/cantera/thermo/GeneralSpeciesThermo.h @@ -123,14 +123,10 @@ public: doublereal& maxTemp, doublereal& refPressure) const; -#ifdef H298MODIFY_CAPABILITY - virtual doublereal reportOneHf298(int k) const; virtual void modifyOneHf298(const int k, const doublereal Hf298New); -#endif - private: //! Provide the SpeciesthermoInterpType object /*! diff --git a/include/cantera/thermo/IdealGasPhase.h b/include/cantera/thermo/IdealGasPhase.h index e65150225..0d0523a3e 100644 --- a/include/cantera/thermo/IdealGasPhase.h +++ b/include/cantera/thermo/IdealGasPhase.h @@ -768,13 +768,10 @@ public: */ virtual void getEnthalpy_RT_ref(doublereal* hrt) const; -#ifdef H298MODIFY_CAPABILITY - virtual void modifyOneHf298SS(const size_t& k, const doublereal Hf298New) { m_spthermo->modifyOneHf298(k, Hf298New); m_tlast += 0.0001234; } -#endif //! Returns the vector of nondimensional //! Gibbs Free Energies of the reference state at the current temperature //! of the solution and the reference pressure for the species. diff --git a/include/cantera/thermo/LatticePhase.h b/include/cantera/thermo/LatticePhase.h index 56e6744aa..8818446e8 100644 --- a/include/cantera/thermo/LatticePhase.h +++ b/include/cantera/thermo/LatticePhase.h @@ -733,8 +733,6 @@ public: /// @name Thermodynamic Values for the Species Reference States //@{ -#ifdef H298MODIFY_CAPABILITY - //! Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) /*! * The 298K heat of formation is defined as the enthalpy change to create the standard state @@ -747,7 +745,6 @@ public: m_spthermo->modifyOneHf298(k, Hf298New); m_tlast += 0.0001234; } -#endif //! Returns the vector of nondimensional //! Enthalpies of the reference state at the current temperature diff --git a/include/cantera/thermo/LatticeSolidPhase.h b/include/cantera/thermo/LatticeSolidPhase.h index 387308e87..d8d380604 100644 --- a/include/cantera/thermo/LatticeSolidPhase.h +++ b/include/cantera/thermo/LatticeSolidPhase.h @@ -624,8 +624,6 @@ public: */ void setLatticeMoleFractionsByName(int n, const std::string& x); -#ifdef H298MODIFY_CAPABILITY - //! Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) /*! * The 298K heat of formation is defined as the enthalpy change to create the standard state @@ -635,7 +633,6 @@ public: * @param Hf298New Specify the new value of the Heat of Formation at 298K and 1 bar */ virtual void modifyOneHf298SS(const size_t& k, const doublereal Hf298New); -#endif private: //! error routine diff --git a/include/cantera/thermo/MixtureFugacityTP.h b/include/cantera/thermo/MixtureFugacityTP.h index 4f1fc2ae7..f149927ce 100644 --- a/include/cantera/thermo/MixtureFugacityTP.h +++ b/include/cantera/thermo/MixtureFugacityTP.h @@ -476,7 +476,6 @@ public: */ virtual void getEnthalpy_RT_ref(doublereal* hrt) const; -#ifdef H298MODIFY_CAPABILITY //! Modify the value of the 298 K Heat of Formation of the standard state of //! one species in the phase (J kmol-1) /*! @@ -488,7 +487,6 @@ public: * units = J/kmol. */ void modifyOneHf298SS(const int k, const doublereal Hf298New); -#endif //! Returns the vector of nondimensional //! Gibbs free energies of the reference state at the current temperature diff --git a/include/cantera/thermo/NasaPoly1.h b/include/cantera/thermo/NasaPoly1.h index 9632dac10..c6e550e08 100644 --- a/include/cantera/thermo/NasaPoly1.h +++ b/include/cantera/thermo/NasaPoly1.h @@ -191,8 +191,6 @@ public: } } -#ifdef H298MODIFY_CAPABILITY - virtual doublereal reportHf298(doublereal* const h298 = 0) const { double tt[6]; double temp = 298.15; @@ -227,8 +225,6 @@ public: m_coeff[0] += (delH) / GasConstant; } -#endif - protected: //! array of polynomial coefficients vector_fp m_coeff; diff --git a/include/cantera/thermo/SimpleThermo.h b/include/cantera/thermo/SimpleThermo.h index 21431a0d2..626d6dadb 100644 --- a/include/cantera/thermo/SimpleThermo.h +++ b/include/cantera/thermo/SimpleThermo.h @@ -263,7 +263,6 @@ public: } } -#ifdef H298MODIFY_CAPABILITY virtual doublereal reportOneHf298(int k) const { throw CanteraError("reportHF298", "unimplemented"); } @@ -271,7 +270,6 @@ public: virtual void modifyOneHf298(const int k, const doublereal Hf298New) { throw CanteraError("reportHF298", "unimplemented"); } -#endif protected: //! Mapping between the species index and the vector index where the coefficients are kept diff --git a/include/cantera/thermo/SingleSpeciesTP.h b/include/cantera/thermo/SingleSpeciesTP.h index 5311bfaf8..1cee0413b 100644 --- a/include/cantera/thermo/SingleSpeciesTP.h +++ b/include/cantera/thermo/SingleSpeciesTP.h @@ -326,8 +326,6 @@ public: /// equation of state. //@{ -#ifdef H298MODIFY_CAPABILITY - //! Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) /*! * The 298K heat of formation is defined as the enthalpy change to create the standard state @@ -340,7 +338,6 @@ public: m_spthermo->modifyOneHf298(k, Hf298New); m_tlast += 0.0001234; } -#endif /*! * Returns the vector of nondimensional diff --git a/include/cantera/thermo/SpeciesThermo.h b/include/cantera/thermo/SpeciesThermo.h index 9b400e177..05a39a8fe 100644 --- a/include/cantera/thermo/SpeciesThermo.h +++ b/include/cantera/thermo/SpeciesThermo.h @@ -309,7 +309,6 @@ public: doublereal& maxTemp, doublereal& refPressure) const =0; -#ifdef H298MODIFY_CAPABILITY //! Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) /*! * The 298K Heat of Formation is defined as the enthalpy change to create the standard state @@ -331,7 +330,6 @@ public: * units = J/kmol. */ virtual void modifyOneHf298(const int k, const doublereal Hf298New) = 0; -#endif }; //@} diff --git a/include/cantera/thermo/SpeciesThermoInterpType.h b/include/cantera/thermo/SpeciesThermoInterpType.h index 707b5b99d..090f40400 100644 --- a/include/cantera/thermo/SpeciesThermoInterpType.h +++ b/include/cantera/thermo/SpeciesThermoInterpType.h @@ -266,8 +266,6 @@ public: */ virtual void modifyParameters(doublereal* coeffs) {} -#ifdef H298MODIFY_CAPABILITY - //! Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) /*! * The 298K Heat of Formation is defined as the enthalpy change to create the standard state @@ -290,8 +288,6 @@ public: */ virtual void modifyOneHf298(const int k, const doublereal Hf298New); -#endif - protected: //! lowest valid temperature doublereal m_lowT; diff --git a/include/cantera/thermo/SpeciesThermoMgr.h b/include/cantera/thermo/SpeciesThermoMgr.h index e9aa42580..cbd262ba0 100644 --- a/include/cantera/thermo/SpeciesThermoMgr.h +++ b/include/cantera/thermo/SpeciesThermoMgr.h @@ -107,8 +107,6 @@ public: doublereal& maxTemp, doublereal& refPressure) const; -#ifdef H298MODIFY_CAPABILITY - virtual doublereal reportOneHf298(int k) const { throw CanteraError("reportHF298", "unimplemented"); } @@ -117,8 +115,6 @@ public: throw CanteraError("reportHF298", "unimplemented"); } -#endif - private: //! Thermo Type 1 diff --git a/include/cantera/thermo/StoichSubstance.h b/include/cantera/thermo/StoichSubstance.h index d141ccfa1..4e0fdf0e8 100644 --- a/include/cantera/thermo/StoichSubstance.h +++ b/include/cantera/thermo/StoichSubstance.h @@ -297,13 +297,11 @@ public: */ virtual void getEnthalpy_RT_ref(doublereal* hrt) const; -#ifdef H298MODIFY_CAPABILITY - virtual void modifyOneHf298SS(const size_t& k, const doublereal Hf298New) { m_spthermo->modifyOneHf298(k, Hf298New); m_tlast += 0.0001234; } -#endif + /** * Returns the vector of nondimensional * enthalpies of the reference state at the current temperature diff --git a/include/cantera/thermo/SurfPhase.h b/include/cantera/thermo/SurfPhase.h index 04e26c267..3a80a3f1c 100644 --- a/include/cantera/thermo/SurfPhase.h +++ b/include/cantera/thermo/SurfPhase.h @@ -511,8 +511,6 @@ public: */ virtual void getEnthalpy_RT_ref(doublereal* hrt) const; -#ifdef H298MODIFY_CAPABILITY - //! Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) /*! * The 298K heat of formation is defined as the enthalpy change to create the standard state @@ -525,7 +523,6 @@ public: m_spthermo->modifyOneHf298(k, Hf298New); m_tlast += 0.0001234; } -#endif //! Returns the vector of nondimensional //! entropies of the reference state at the current temperature diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index 6c7b8ff5f..97c100f73 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -176,8 +176,6 @@ public: return m_spthermo->minTemp(k); } -#ifdef H298MODIFY_CAPABILITY - //! Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) /*! * The 298K Heat of Formation is defined as the enthalpy change to create the standard state @@ -202,33 +200,6 @@ public: m_spthermo->modifyOneHf298(k, Hf298New); } -#else - - //! Report the 298 K Heat of Formation of the standard state of one species (J kmol-1) - /*! - * The 298K Heat of Formation is defined as the enthalpy change to create the standard state - * of the species from its constituent elements in their standard states at 298 K and 1 bar. - * - * @param k species index - * @return Returns the current value of the Heat of Formation at 298K and 1 bar - */ - doublereal Hf298SS(const int k) const { - return err("Hf298SS - H298MODIFY_CAPABILITY not compiled in"); - } - - //! Modify the value of the 298 K Heat of Formation of one species in the phase (J kmol-1) - /*! - * The 298K heat of formation is defined as the enthalpy change to create the standard state - * of the species from its constituent elements in their standard states at 298 K and 1 bar. - * - * @param k Species k - * @param Hf298New Specify the new value of the Heat of Formation at 298K and 1 bar - */ - virtual void modifyOneHf298SS(const int k, const doublereal Hf298New) { - (void) err("Hf298SS - H298MODIFY_CAPABILITY not compiled in"); - } -#endif - //! Maximum temperature for which the thermodynamic data for the species //! are valid. /*! diff --git a/include/cantera/thermo/VPStandardStateTP.h b/include/cantera/thermo/VPStandardStateTP.h index f7911aac4..79a7f525a 100644 --- a/include/cantera/thermo/VPStandardStateTP.h +++ b/include/cantera/thermo/VPStandardStateTP.h @@ -397,7 +397,6 @@ public: */ virtual void getEnthalpy_RT_ref(doublereal* hrt) const; -#ifdef H298MODIFY_CAPABILITY //! Modify the value of the 298 K Heat of Formation of the standard state of //! one species in the phase (J kmol-1) /*! @@ -409,7 +408,6 @@ public: * units = J/kmol. */ void modifyOneHf298SS(const size_t& k, const doublereal Hf298New); -#endif //! Returns the vector of nondimensional //! Gibbs free energies of the reference state at the current temperature diff --git a/src/thermo/ConstCpPoly.cpp b/src/thermo/ConstCpPoly.cpp index 9a8117bc9..e3c9d762d 100644 --- a/src/thermo/ConstCpPoly.cpp +++ b/src/thermo/ConstCpPoly.cpp @@ -110,8 +110,6 @@ void ConstCpPoly::modifyParameters(doublereal* coeffs) m_logt0 = log(m_t0); } -#ifdef H298MODIFY_CAPABILITY - doublereal ConstCpPoly::reportHf298(doublereal* const h298) const { double temp = 298.15; @@ -132,6 +130,4 @@ void ConstCpPoly::modifyOneHf298(const size_t& k, const doublereal Hf298New) m_h0_R += delH / GasConstant; } -#endif - } diff --git a/src/thermo/ConstCpPoly.h b/src/thermo/ConstCpPoly.h index 0691882ee..d5a7d28cd 100644 --- a/src/thermo/ConstCpPoly.h +++ b/src/thermo/ConstCpPoly.h @@ -114,10 +114,8 @@ public: */ virtual void modifyParameters(doublereal* coeffs); -#ifdef H298MODIFY_CAPABILITY virtual doublereal reportHf298(doublereal* const h298 = 0) const; virtual void modifyOneHf298(const size_t& k, const doublereal Hf298New); -#endif protected: //! Base temperature diff --git a/src/thermo/GeneralSpeciesThermo.cpp b/src/thermo/GeneralSpeciesThermo.cpp index 632b4d8fb..05b30c75a 100644 --- a/src/thermo/GeneralSpeciesThermo.cpp +++ b/src/thermo/GeneralSpeciesThermo.cpp @@ -304,8 +304,6 @@ SpeciesThermoInterpType* GeneralSpeciesThermo::provideSTIT(size_t k) return m_sp[k]; } -#ifdef H298MODIFY_CAPABILITY - doublereal GeneralSpeciesThermo::reportOneHf298(int k) const { SpeciesThermoInterpType* sp_ptr = m_sp[k]; @@ -324,6 +322,4 @@ void GeneralSpeciesThermo::modifyOneHf298(const int k, const doublereal Hf298New } } -#endif - } diff --git a/src/thermo/LatticeSolidPhase.cpp b/src/thermo/LatticeSolidPhase.cpp index e295c5874..032bff74b 100644 --- a/src/thermo/LatticeSolidPhase.cpp +++ b/src/thermo/LatticeSolidPhase.cpp @@ -512,7 +512,6 @@ void LatticeSolidPhase::setParametersFromXML(const XML_Node& eosdata) } -#ifdef H298MODIFY_CAPABILITY void LatticeSolidPhase::modifyOneHf298SS(const size_t& k, const doublereal Hf298New) { for (size_t n = 0; n < m_nlattice; n++) { @@ -525,7 +524,6 @@ void LatticeSolidPhase::modifyOneHf298SS(const size_t& k, const doublereal Hf298 m_tlast += 0.0001234; _updateThermo(); } -#endif doublereal LatticeSolidPhase::err(const std::string& msg) const { diff --git a/src/thermo/MixtureFugacityTP.cpp b/src/thermo/MixtureFugacityTP.cpp index e55750795..3916c5624 100644 --- a/src/thermo/MixtureFugacityTP.cpp +++ b/src/thermo/MixtureFugacityTP.cpp @@ -147,13 +147,11 @@ void MixtureFugacityTP::getEnthalpy_RT(doublereal* hrt) const getEnthalpy_RT_ref(hrt); } -#ifdef H298MODIFY_CAPABILITY void MixtureFugacityTP::modifyOneHf298SS(const int k, const doublereal Hf298New) { m_spthermo->modifyOneHf298(k, Hf298New); m_Tlast_ref += 0.0001234; } -#endif void MixtureFugacityTP::getEntropy_R(doublereal* sr) const { diff --git a/src/thermo/NasaPoly2.h b/src/thermo/NasaPoly2.h index 6ee448b34..68fa557a1 100644 --- a/src/thermo/NasaPoly2.h +++ b/src/thermo/NasaPoly2.h @@ -165,8 +165,6 @@ public: } } -#ifdef H298MODIFY_CAPABILITY - doublereal reportHf298(doublereal* const h298 = 0) const { double h; if (298.15 <= m_midT) { @@ -195,8 +193,6 @@ public: mnp_high.modifyOneHf298(k, hnew); } -#endif - protected: //! Midrange temperature doublereal m_midT; diff --git a/src/thermo/NasaThermo.cpp b/src/thermo/NasaThermo.cpp index fd601aea9..ea87cf185 100644 --- a/src/thermo/NasaThermo.cpp +++ b/src/thermo/NasaThermo.cpp @@ -209,7 +209,6 @@ void NasaThermo::reportParams(size_t index, int& type, } } -#ifdef H298MODIFY_CAPABILITY doublereal NasaThermo::reportOneHf298(const int k) const { int grp = m_group_map[k]; @@ -252,7 +251,6 @@ void NasaThermo::modifyOneHf298(const int k, const doublereal Hf298New) nlow->modifyOneHf298(k, hnew); } } -#endif doublereal NasaThermo::cp_R(double t, const doublereal* c) { diff --git a/src/thermo/NasaThermo.h b/src/thermo/NasaThermo.h index 037eb52b1..62ddaab2e 100644 --- a/src/thermo/NasaThermo.h +++ b/src/thermo/NasaThermo.h @@ -145,10 +145,8 @@ public: doublereal& maxTemp, doublereal& refPressure) const; -#ifdef H298MODIFY_CAPABILITY virtual doublereal reportOneHf298(const int k) const; virtual void modifyOneHf298(const int k, const doublereal Hf298New); -#endif //! Initialized to the type of parameterization /*! diff --git a/src/thermo/ShomatePoly.h b/src/thermo/ShomatePoly.h index 0fdb25738..bb0d840be 100644 --- a/src/thermo/ShomatePoly.h +++ b/src/thermo/ShomatePoly.h @@ -219,8 +219,6 @@ public: std::copy(coeffs, coeffs + 7, m_coeff.begin()); } -#ifdef H298MODIFY_CAPABILITY - virtual doublereal reportHf298(doublereal* const h298 = 0) const { double tPoly[4]; doublereal tt = 1.e-3*298.15; @@ -251,8 +249,6 @@ public: m_coeff[5] += delH / 1.0E6; } -#endif - protected: //! Array of coeffcients vector_fp m_coeff; @@ -467,8 +463,6 @@ public: msp_high = new ShomatePoly(m_index, m_midT, m_highT, m_Pref, coeffs+8); } -#ifdef H298MODIFY_CAPABILITY - virtual doublereal reportHf298(doublereal* const h298 = 0) const { doublereal h; if (298.15 <= m_midT) { @@ -497,8 +491,6 @@ public: msp_high->modifyOneHf298(k, hnew); } -#endif - protected: //! Midrange temperature (kelvin) doublereal m_midT; diff --git a/src/thermo/ShomateThermo.h b/src/thermo/ShomateThermo.h index 53c284a33..4a7942044 100644 --- a/src/thermo/ShomateThermo.h +++ b/src/thermo/ShomateThermo.h @@ -328,8 +328,6 @@ public: } } -#ifdef H298MODIFY_CAPABILITY - virtual doublereal reportOneHf298(int k) const { doublereal h; doublereal t = 298.15; @@ -376,7 +374,6 @@ public: } -#endif protected: //! Vector of vector of NasaPoly1's for the high temp region. /*! diff --git a/src/thermo/SpeciesThermoInterpType.cpp b/src/thermo/SpeciesThermoInterpType.cpp index 8382c52e8..4b8bf38cb 100644 --- a/src/thermo/SpeciesThermoInterpType.cpp +++ b/src/thermo/SpeciesThermoInterpType.cpp @@ -50,8 +50,6 @@ void SpeciesThermoInterpType::updateProperties(const doublereal* tempPoly, updatePropertiesTemp(T, cp_R, h_RT, s_R); } //==================================================================================================== -#ifdef H298MODIFY_CAPABILITY - doublereal SpeciesThermoInterpType::reportHf298(doublereal* const h298) const { throw CanteraError("SpeciesThermoInterpType::reportHf298", @@ -64,8 +62,6 @@ void SpeciesThermoInterpType::modifyOneHf298(const int k, const doublereal Hf298 throw CanteraError("SpeciesThermoInterpType::modifyOneHf298", "Not implemented"); } - -#endif //==================================================================================================== STITbyPDSS::STITbyPDSS() diff --git a/src/thermo/VPStandardStateTP.cpp b/src/thermo/VPStandardStateTP.cpp index 5b7d77945..b4c4794de 100644 --- a/src/thermo/VPStandardStateTP.cpp +++ b/src/thermo/VPStandardStateTP.cpp @@ -162,13 +162,11 @@ void VPStandardStateTP::getEnthalpy_RT(doublereal* hrt) const } //================================================================================================ -#ifdef H298MODIFY_CAPABILITY void VPStandardStateTP::modifyOneHf298SS(const size_t& k, const doublereal Hf298New) { m_spthermo->modifyOneHf298(k, Hf298New); m_Tlast_ss += 0.0001234; } -#endif //================================================================================================ void VPStandardStateTP::getEntropy_R(doublereal* srt) const {