From c6c447dc94aaa1e20f3637c191444f8de60a701e Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Fri, 3 May 2024 12:32:13 +0200 Subject: [PATCH] initialize the input temperature in restart run without temperature in the restart file --- opm/simulators/flow/FlowProblem.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/opm/simulators/flow/FlowProblem.hpp b/opm/simulators/flow/FlowProblem.hpp index 4c229e1a4..5c83abfa6 100644 --- a/opm/simulators/flow/FlowProblem.hpp +++ b/opm/simulators/flow/FlowProblem.hpp @@ -2221,6 +2221,14 @@ protected: } } + // For CO2STORE and H2STORE we need to set the initial temperature for isothermal simulations + bool isThermal = eclState.getSimulationConfig().isThermal(); + bool needTemperature = (eclState.runspec().co2Storage() || eclState.runspec().h2Storage()); + if (!isThermal && needTemperature) { + const auto& fp = simulator.vanguard().eclState().fieldProps(); + elemFluidState.setTemperature(fp.get_double("TEMPI")[elemIdx]); + } + this->mixControls_.updateLastValues(elemIdx, elemFluidState.Rs(), elemFluidState.Rv()); if constexpr (enablePolymer)