Skip to content

Commit

Permalink
[Thermo] ThermoPhase::modifyOneHf298SS always invalidates cached data
Browse files Browse the repository at this point in the history
  • Loading branch information
speth committed Apr 19, 2016
1 parent 3566542 commit 51b0e46
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
2 changes: 2 additions & 0 deletions include/cantera/thermo/MixtureFugacityTP.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion include/cantera/thermo/ThermoPhase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions include/cantera/thermo/VPStandardStateTP.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/thermo/LatticeSolidPhase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
8 changes: 7 additions & 1 deletion src/thermo/MixtureFugacityTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -878,4 +878,10 @@ void MixtureFugacityTP::_updateReferenceStateThermo() const
}
}

void MixtureFugacityTP::invalidateCache()
{
ThermoPhase::invalidateCache();
m_Tlast_ref += 0.001234;
}

}
8 changes: 7 additions & 1 deletion src/thermo/VPStandardStateTP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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++) {
Expand Down

0 comments on commit 51b0e46

Please sign in to comment.