From eb869f211f54dc1d1e04e1aae30aa6ee31ca2be5 Mon Sep 17 00:00:00 2001 From: Vegard Kippe Date: Wed, 28 Aug 2024 16:28:51 +0200 Subject: [PATCH] Avoid time step dependent jump in RS after restart --- opm/simulators/flow/FlowProblem.hpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/opm/simulators/flow/FlowProblem.hpp b/opm/simulators/flow/FlowProblem.hpp index e697752f2..d750edb0d 100644 --- a/opm/simulators/flow/FlowProblem.hpp +++ b/opm/simulators/flow/FlowProblem.hpp @@ -601,7 +601,9 @@ public: // update maximum water saturation and minimum pressure // used when ROCKCOMP is activated - asImp_().updateExplicitQuantities_(episodeIdx, timeStepSize); + // Do not update max RS first step after a restart + asImp_().updateExplicitQuantities_(episodeIdx, timeStepSize, first_step_ && (episodeIdx > 0)); + first_step_ = false; if (nonTrivialBoundaryConditions()) { this->model().linearizer().updateBoundaryConditionData(); @@ -1871,7 +1873,7 @@ private: Implementation& asImp_() { return *static_cast(this); } protected: - void updateExplicitQuantities_(int episodeIdx, int timeStepSize) + void updateExplicitQuantities_(int episodeIdx, int timeStepSize, const bool first_step_after_restart = false) { OPM_TIMEBLOCK(updateExplicitQuantities); const bool invalidateFromMaxWaterSat = updateMaxWaterSaturation_(); @@ -1883,7 +1885,7 @@ protected: // deal with DRSDT and DRVDT - const bool invalidateDRDT = this->asImp_().updateCompositionChangeLimits_(); + const bool invalidateDRDT = !first_step_after_restart && this->asImp_().updateCompositionChangeLimits_(); // the derivatives may have change bool invalidateIntensiveQuantities @@ -2888,7 +2890,7 @@ private: BCData bcindex_; bool nonTrivialBoundaryConditions_ = false; bool explicitRockCompaction_ = false; - + bool first_step_ = true; ModuleParams moduleParams_;