Remove option to disable 'h298modify_capability' at compile-time

This commit is contained in:
Ray Speth 2014-02-06 22:58:56 +00:00
parent 03be898300
commit 14b1bf093b
29 changed files with 1 additions and 121 deletions

View file

@ -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')

View file

@ -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

View file

@ -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
/*!

View file

@ -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.

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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
};
//@}

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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.
/*!

View file

@ -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

View file

@ -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
}

View file

@ -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

View file

@ -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
}

View file

@ -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
{

View file

@ -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
{

View file

@ -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;

View file

@ -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)
{

View file

@ -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
/*!

View file

@ -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;

View file

@ -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.
/*!

View file

@ -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()

View file

@ -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
{