diff --git a/opm/simulators/flow/FlowProblem.hpp b/opm/simulators/flow/FlowProblem.hpp index e47a760db..e697752f2 100644 --- a/opm/simulators/flow/FlowProblem.hpp +++ b/opm/simulators/flow/FlowProblem.hpp @@ -601,9 +601,7 @@ public: // update maximum water saturation and minimum pressure // used when ROCKCOMP is activated - // Do not update max RS first step after a restart - asImp_().updateExplicitQuantities_(episodeIdx, timeStepSize, first_step_ && (episodeIdx > 0)); - first_step_ = false; + asImp_().updateExplicitQuantities_(episodeIdx, timeStepSize); if (nonTrivialBoundaryConditions()) { this->model().linearizer().updateBoundaryConditionData(); @@ -1873,7 +1871,7 @@ private: Implementation& asImp_() { return *static_cast(this); } protected: - void updateExplicitQuantities_(int episodeIdx, int timeStepSize, const bool first_step_after_restart = false) + void updateExplicitQuantities_(int episodeIdx, int timeStepSize) { OPM_TIMEBLOCK(updateExplicitQuantities); const bool invalidateFromMaxWaterSat = updateMaxWaterSaturation_(); @@ -1884,8 +1882,8 @@ protected: const bool invalidateFromMaxOilSat = updateMaxOilSaturation_(); - // deal with DRSDT and DRVDT (do not update first step after a restart) - const bool invalidateDRDT = !first_step_after_restart && this->asImp_().updateCompositionChangeLimits_(); + // deal with DRSDT and DRVDT + const bool invalidateDRDT = this->asImp_().updateCompositionChangeLimits_(); // the derivatives may have change bool invalidateIntensiveQuantities @@ -2890,9 +2888,10 @@ private: BCData bcindex_; bool nonTrivialBoundaryConditions_ = false; bool explicitRockCompaction_ = false; - bool first_step_ = true; + ModuleParams moduleParams_; + }; } // namespace Opm diff --git a/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp b/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp index 7a9b7a5c9..3f25e15be 100644 --- a/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp +++ b/opm/simulators/flow/SimulatorFullyImplicitBlackoil.hpp @@ -195,6 +195,8 @@ public: { init(timer); // Make cache up to date. No need for updating it in elementCtx. + // NB! Need to be at the correct step in case of restart + simulator_.setEpisodeIndex(timer.currentStepNum()); simulator_.model().invalidateAndUpdateIntensiveQuantities(/*timeIdx=*/0); // Main simulation loop. while (!timer.done()) {