diff --git a/include/cantera/thermo/MixtureFugacityTP.h b/include/cantera/thermo/MixtureFugacityTP.h index 6f2278b2b2..20e12f5e5c 100644 --- a/include/cantera/thermo/MixtureFugacityTP.h +++ b/include/cantera/thermo/MixtureFugacityTP.h @@ -551,6 +551,8 @@ class MixtureFugacityTP : public ThermoPhase }; protected: + virtual void invalidateCache(); + //! Current value of the pressure /*! * Because the pressure is now a calculation, we store the result of the diff --git a/include/cantera/thermo/ThermoPhase.h b/include/cantera/thermo/ThermoPhase.h index f0f22f2d67..c9290f4f43 100644 --- a/include/cantera/thermo/ThermoPhase.h +++ b/include/cantera/thermo/ThermoPhase.h @@ -175,7 +175,7 @@ class ThermoPhase : public Phase */ virtual void modifyOneHf298SS(const size_t k, const doublereal Hf298New) { m_spthermo->modifyOneHf298(k, Hf298New); - m_tlast += 0.0001234; + invalidateCache(); } //! Maximum temperature for which the thermodynamic data for the species diff --git a/include/cantera/thermo/VPStandardStateTP.h b/include/cantera/thermo/VPStandardStateTP.h index 9e1c0b1c11..34b3b448ae 100644 --- a/include/cantera/thermo/VPStandardStateTP.h +++ b/include/cantera/thermo/VPStandardStateTP.h @@ -274,6 +274,8 @@ class VPStandardStateTP : public ThermoPhase const PDSS* providePDSS(size_t k) const; protected: + virtual void invalidateCache(); + //! Current value of the pressure - state variable /*! * Because we are now using the pressure as a state variable, we need to diff --git a/src/thermo/LatticeSolidPhase.cpp b/src/thermo/LatticeSolidPhase.cpp index d91e86709c..6f4b124218 100644 --- a/src/thermo/LatticeSolidPhase.cpp +++ b/src/thermo/LatticeSolidPhase.cpp @@ -455,7 +455,7 @@ void LatticeSolidPhase::modifyOneHf298SS(const size_t k, const doublereal Hf298N l_spthermo.modifyOneHf298(kk, Hf298New); } } - m_tlast += 0.0001234; + invalidateCache(); _updateThermo(); } diff --git a/src/thermo/MixtureFugacityTP.cpp b/src/thermo/MixtureFugacityTP.cpp index c154bf750f..8ea24f6152 100644 --- a/src/thermo/MixtureFugacityTP.cpp +++ b/src/thermo/MixtureFugacityTP.cpp @@ -114,7 +114,7 @@ void MixtureFugacityTP::getEnthalpy_RT(doublereal* hrt) const void MixtureFugacityTP::modifyOneHf298SS(const size_t k, const doublereal Hf298New) { m_spthermo->modifyOneHf298(k, Hf298New); - m_Tlast_ref += 0.0001234; + invalidateCache(); } void MixtureFugacityTP::getEntropy_R(doublereal* sr) const @@ -878,4 +878,10 @@ void MixtureFugacityTP::_updateReferenceStateThermo() const } } +void MixtureFugacityTP::invalidateCache() +{ + ThermoPhase::invalidateCache(); + m_Tlast_ref += 0.001234; +} + } diff --git a/src/thermo/VPStandardStateTP.cpp b/src/thermo/VPStandardStateTP.cpp index 1826e4edbb..c9ce806479 100644 --- a/src/thermo/VPStandardStateTP.cpp +++ b/src/thermo/VPStandardStateTP.cpp @@ -132,7 +132,7 @@ void VPStandardStateTP::getEnthalpy_RT(doublereal* hrt) const void VPStandardStateTP::modifyOneHf298SS(const size_t k, const doublereal Hf298New) { m_spthermo->modifyOneHf298(k, Hf298New); - m_Tlast_ss += 0.0001234; + invalidateCache(); } void VPStandardStateTP::getEntropy_R(doublereal* srt) const @@ -302,6 +302,12 @@ const PDSS* VPStandardStateTP::providePDSS(size_t k) const return m_PDSS_storage[k]; } +void VPStandardStateTP::invalidateCache() +{ + ThermoPhase::invalidateCache(); + m_Tlast_ss += 0.0001234; +} + void VPStandardStateTP::initThermoXML(XML_Node& phaseNode, const std::string& id) { for (size_t k = 0; k < m_kk; k++) {