mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Handle NEXTSTEP behavior in time stepper
This commit is contained in:
parent
d925e74b76
commit
56c7c74016
@ -171,7 +171,10 @@ public:
|
|||||||
if (enableAdaptive) {
|
if (enableAdaptive) {
|
||||||
const UnitSystem& unitSystem = this->ebosSimulator_.vanguard().eclState().getUnits();
|
const UnitSystem& unitSystem = this->ebosSimulator_.vanguard().eclState().getUnits();
|
||||||
if (enableTUNING) {
|
if (enableTUNING) {
|
||||||
adaptiveTimeStepping_ = std::make_unique<TimeStepper>(schedule()[timer.currentStepNum()].tuning(),
|
const auto& sched_state = schedule()[timer.currentStepNum()];
|
||||||
|
auto max_next_tstep = sched_state.max_next_tstep();
|
||||||
|
adaptiveTimeStepping_ = std::make_unique<TimeStepper>(max_next_tstep,
|
||||||
|
sched_state.tuning(),
|
||||||
unitSystem, terminalOutput_);
|
unitSystem, terminalOutput_);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -244,7 +247,10 @@ public:
|
|||||||
const auto& events = schedule()[timer.currentStepNum()].events();
|
const auto& events = schedule()[timer.currentStepNum()].events();
|
||||||
if (enableTUNING) {
|
if (enableTUNING) {
|
||||||
if (events.hasEvent(ScheduleEvents::TUNING_CHANGE)) {
|
if (events.hasEvent(ScheduleEvents::TUNING_CHANGE)) {
|
||||||
adaptiveTimeStepping_->updateTUNING(schedule()[timer.currentStepNum()].tuning());
|
const auto& sched_state = schedule()[timer.currentStepNum()];
|
||||||
|
const auto& tuning = sched_state.tuning();
|
||||||
|
const auto& max_next_tstep = sched_state.max_next_tstep();
|
||||||
|
adaptiveTimeStepping_->updateTUNING(max_next_tstep, tuning);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool event = events.hasEvent(ScheduleEvents::NEW_WELL) ||
|
bool event = events.hasEvent(ScheduleEvents::NEW_WELL) ||
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <opm/simulators/timestepping/TimeStepControlInterface.hpp>
|
#include <opm/simulators/timestepping/TimeStepControlInterface.hpp>
|
||||||
#include <opm/simulators/timestepping/TimeStepControl.hpp>
|
#include <opm/simulators/timestepping/TimeStepControl.hpp>
|
||||||
#include <opm/core/props/phaseUsageFromDeck.hpp>
|
#include <opm/core/props/phaseUsageFromDeck.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleState.hpp>
|
||||||
#include <opm/common/Exceptions.hpp>
|
#include <opm/common/Exceptions.hpp>
|
||||||
|
|
||||||
namespace Opm::Properties {
|
namespace Opm::Properties {
|
||||||
@ -289,7 +290,8 @@ namespace Opm {
|
|||||||
//! \brief contructor taking parameter object
|
//! \brief contructor taking parameter object
|
||||||
//! \param tuning Pointer to ecl TUNING keyword
|
//! \param tuning Pointer to ecl TUNING keyword
|
||||||
//! \param timeStep current report step
|
//! \param timeStep current report step
|
||||||
AdaptiveTimeSteppingEbos(const Tuning& tuning,
|
AdaptiveTimeSteppingEbos(double max_next_tstep,
|
||||||
|
const Tuning& tuning,
|
||||||
const UnitSystem& unitSystem,
|
const UnitSystem& unitSystem,
|
||||||
const bool terminalOutput = true)
|
const bool terminalOutput = true)
|
||||||
: timeStepControl_()
|
: timeStepControl_()
|
||||||
@ -302,7 +304,7 @@ namespace Opm {
|
|||||||
, solverRestartMax_(EWOMS_GET_PARAM(TypeTag, int, SolverMaxRestarts)) // 10
|
, solverRestartMax_(EWOMS_GET_PARAM(TypeTag, int, SolverMaxRestarts)) // 10
|
||||||
, solverVerbose_(EWOMS_GET_PARAM(TypeTag, int, SolverVerbosity) > 0 && terminalOutput) // 2
|
, solverVerbose_(EWOMS_GET_PARAM(TypeTag, int, SolverVerbosity) > 0 && terminalOutput) // 2
|
||||||
, timestepVerbose_(EWOMS_GET_PARAM(TypeTag, int, TimeStepVerbosity) > 0 && terminalOutput) // 2
|
, timestepVerbose_(EWOMS_GET_PARAM(TypeTag, int, TimeStepVerbosity) > 0 && terminalOutput) // 2
|
||||||
, suggestedNextTimestep_(tuning.TSINIT) // 1.0
|
, suggestedNextTimestep_(max_next_tstep) // 1.0
|
||||||
, fullTimestepInitially_(EWOMS_GET_PARAM(TypeTag, bool, FullTimeStepInitially)) // false
|
, fullTimestepInitially_(EWOMS_GET_PARAM(TypeTag, bool, FullTimeStepInitially)) // false
|
||||||
, timestepAfterEvent_(tuning.TMAXWC) // 1e30
|
, timestepAfterEvent_(tuning.TMAXWC) // 1e30
|
||||||
, useNewtonIteration_(false)
|
, useNewtonIteration_(false)
|
||||||
@ -637,13 +639,13 @@ namespace Opm {
|
|||||||
void setSuggestedNextStep(const double x)
|
void setSuggestedNextStep(const double x)
|
||||||
{ suggestedNextTimestep_ = x; }
|
{ suggestedNextTimestep_ = x; }
|
||||||
|
|
||||||
void updateTUNING(const Tuning& tuning)
|
void updateTUNING(double max_next_tstep, const Tuning& tuning)
|
||||||
{
|
{
|
||||||
restartFactor_ = tuning.TSFCNV;
|
restartFactor_ = tuning.TSFCNV;
|
||||||
growthFactor_ = tuning.TFDIFF;
|
growthFactor_ = tuning.TFDIFF;
|
||||||
maxGrowth_ = tuning.TSFMAX;
|
maxGrowth_ = tuning.TSFMAX;
|
||||||
maxTimeStep_ = tuning.TSMAXZ;
|
maxTimeStep_ = tuning.TSMAXZ;
|
||||||
suggestedNextTimestep_ = tuning.TSINIT;
|
suggestedNextTimestep_ = max_next_tstep;
|
||||||
timestepAfterEvent_ = tuning.TMAXWC;
|
timestepAfterEvent_ = tuning.TMAXWC;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user