From f5c31588cb94203b95dbebdff63cf5aa7f5cce5a Mon Sep 17 00:00:00 2001 From: Vegard Kippe Date: Wed, 23 Aug 2023 16:06:46 +0200 Subject: [PATCH] Quick fix.. --- ebos/eclproblem.hh | 5 +++-- opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp | 7 +++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ebos/eclproblem.hh b/ebos/eclproblem.hh index e7608f188..cecae8bcc 100644 --- a/ebos/eclproblem.hh +++ b/ebos/eclproblem.hh @@ -355,7 +355,7 @@ public: // if support for the TUNING keyword is enabled, we get the initial time // steping parameters from it instead of from command line parameters const auto& tuning = schedule[0].tuning(); - this->initialTimeStepSize_ = tuning.TSINIT; + this->initialTimeStepSize_ = tuning.TSINIT.has_value() ? tuning.TSINIT.value() : -1.0; this->maxTimeStepAfterWellEvent_ = tuning.TMAXWC; } @@ -542,7 +542,8 @@ public: // set the size of the initial time step of the episode Scalar dt = limitNextTimeStepSize_(simulator.episodeLength()); - if (episodeIdx == 0 || tuningEvent) + // negative value of initialTimeStepSize_ indicates no active limit from TSINIT or NEXTSTEP + if ( (episodeIdx == 0 || tuningEvent) && this->initialTimeStepSize_ > 0) // allow the size of the initial time step to be set via an external parameter // if TUNING is enabled, also limit the time step size after a tuning event to TSINIT dt = std::min(dt, this->initialTimeStepSize_); diff --git a/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp b/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp index 52f904e3e..bed50b1fe 100644 --- a/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp +++ b/opm/simulators/timestepping/AdaptiveTimeSteppingEbos.hpp @@ -339,7 +339,7 @@ std::set consistentlyFailingWells(const std::vector& sr , solverRestartMax_(EWOMS_GET_PARAM(TypeTag, int, SolverMaxRestarts)) // 10 , solverVerbose_(EWOMS_GET_PARAM(TypeTag, int, SolverVerbosity) > 0 && terminalOutput) // 2 , timestepVerbose_(EWOMS_GET_PARAM(TypeTag, int, TimeStepVerbosity) > 0 && terminalOutput) // 2 - , suggestedNextTimestep_(max_next_tstep) // 1.0 + , suggestedNextTimestep_(max_next_tstep <= 0 ? EWOMS_GET_PARAM(TypeTag, double, InitialTimeStepInDays)*86400 : max_next_tstep) // 1.0 , fullTimestepInitially_(EWOMS_GET_PARAM(TypeTag, bool, FullTimeStepInitially)) // false , timestepAfterEvent_(tuning.TMAXWC) // 1e30 , useNewtonIteration_(false) @@ -686,7 +686,10 @@ std::set consistentlyFailingWells(const std::vector& sr growthFactor_ = tuning.TFDIFF; maxGrowth_ = tuning.TSFMAX; maxTimeStep_ = tuning.TSMAXZ; - suggestedNextTimestep_ = max_next_tstep; + // \Note Only update next suggested step if TSINIT was explicitly set in TUNING or NEXTSTEP is active. + if (max_next_tstep > 0) { + suggestedNextTimestep_ = max_next_tstep; + } timestepAfterEvent_ = tuning.TMAXWC; }