From de11bb330b0c9f023b81afb23151479441e8f2cf Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Wed, 15 Jan 2025 14:48:23 +0100 Subject: [PATCH] fixup after rebase --- opm/models/blackoil/blackoilenergymodules.hh | 18 +++++------------- .../blackoil/blackoilintensivequantities.hh | 6 +++--- .../flow/BlackoilModelProperties.hpp | 2 +- opm/simulators/flow/TemperatureModel.hpp | 2 ++ 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/opm/models/blackoil/blackoilenergymodules.hh b/opm/models/blackoil/blackoilenergymodules.hh index bfce5a248e..747543b525 100644 --- a/opm/models/blackoil/blackoilenergymodules.hh +++ b/opm/models/blackoil/blackoilenergymodules.hh @@ -477,19 +477,11 @@ public: } } - void updateTemperature_([[maybe_unused]] const ElementContext& elemCtx, - [[maybe_unused]] unsigned dofIdx, - [[maybe_unused]] unsigned timeIdx) + void updateTemperature_(const ElementContext& elemCtx, + unsigned dofIdx, + unsigned timeIdx) { - auto& fs = asImp_().fluidState_; - const Scalar T = elemCtx.problem().temperature(elemCtx, dofIdx, timeIdx); - // if TEMP is used we solve for temperature seperatly - if constexpr (enableTemperature) { - const Evaluation TE = Evaluation::createVariable(T, Indices::temperatureIdx); - fs.setTemperature(TE); - } else { - fs.setTemperature(T); - } + updateTemperature_(elemCtx.problem(), elemCtx.globalSpaceIndex(dofIdx, timeIdx), timeIdx); } template @@ -500,7 +492,7 @@ public: [[maybe_unused]] const LinearizationType& lintype ) { - updateTemperature_(problem,globalDofIdx, timeIdx); + updateTemperature_(problem, globalDofIdx, timeIdx); } void updateEnergyQuantities_(const Problem& problem, unsigned globalDofIdx, unsigned timeIdx) diff --git a/opm/models/blackoil/blackoilintensivequantities.hh b/opm/models/blackoil/blackoilintensivequantities.hh index 7ce004bda1..352e25d033 100644 --- a/opm/models/blackoil/blackoilintensivequantities.hh +++ b/opm/models/blackoil/blackoilintensivequantities.hh @@ -175,9 +175,9 @@ public: void updateTempSalt(const ElementContext& elemCtx, unsigned dofIdx, unsigned timeIdx) { - if constexpr (enableTemperature || enableEnergy) { - asImp_().updateTemperature_(elemCtx, dofIdx, timeIdx); - } + // the temperature is updated even if the energy equations are not solved + // to allow for temperature dependent properites + asImp_().updateTemperature_(elemCtx, dofIdx, timeIdx); if constexpr (enableBrine) { asImp_().updateSaltConcentration_(elemCtx, dofIdx, timeIdx); diff --git a/opm/simulators/flow/BlackoilModelProperties.hpp b/opm/simulators/flow/BlackoilModelProperties.hpp index e92792b2ce..21a4e06b25 100644 --- a/opm/simulators/flow/BlackoilModelProperties.hpp +++ b/opm/simulators/flow/BlackoilModelProperties.hpp @@ -67,7 +67,7 @@ struct EnableSolvent template struct EnableTemperature -{ static constexpr bool value = true; }; +{ static constexpr bool value = false; }; template struct EnableEnergy diff --git a/opm/simulators/flow/TemperatureModel.hpp b/opm/simulators/flow/TemperatureModel.hpp index 0caeb16fbd..72d5df5fe2 100644 --- a/opm/simulators/flow/TemperatureModel.hpp +++ b/opm/simulators/flow/TemperatureModel.hpp @@ -157,6 +157,8 @@ class TemperatureModel : public GenericTemperatureModel