Merge pull request #5331 from totto82/fix_restart_co2

Bugfix: initialize the input temperature in restart run without temperature in the restart file
This commit is contained in:
Bård Skaflestad
2024-05-06 11:19:18 +02:00
committed by GitHub

View File

@@ -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()); this->mixControls_.updateLastValues(elemIdx, elemFluidState.Rs(), elemFluidState.Rv());
if constexpr (enablePolymer) if constexpr (enablePolymer)