Support TUNING in schdule section.

This commit is contained in:
Tor Harald Sandve
2017-11-21 11:12:16 +01:00
parent f2a51d29e7
commit c03dbc1693
2 changed files with 20 additions and 5 deletions

View File

@@ -1,6 +1,7 @@
/*
Copyright 2013, 2015 SINTEF ICT, Applied Mathematics.
Copyright 2015 Andreas Lauser
Copyright 2017 IRIS
This file is part of the Open Porous Media project (OPM).
@@ -282,6 +283,10 @@ public:
// \Note: The report steps are met in any case
// \Note: The sub stepping will require a copy of the state variables
if( adaptiveTimeStepping ) {
if (param_.getDefault("use_TUNING", false)) {
adaptiveTimeStepping->updateTUNING(schedule().getTuning(), timer.currentStepNum());
}
bool event = events.hasEvent(ScheduleEvents::NEW_WELL, timer.currentStepNum()) ||
events.hasEvent(ScheduleEvents::PRODUCTION_UPDATE, timer.currentStepNum()) ||
events.hasEvent(ScheduleEvents::INJECTION_UPDATE, timer.currentStepNum()) ||

View File

@@ -97,6 +97,16 @@ namespace Opm {
void setSuggestedNextStep(const double x) { suggested_next_timestep_ = x; }
void updateTUNING(const Tuning& tuning, size_t time_step) {
restart_factor_ = tuning.getTSFCNV(time_step);
growth_factor_ = tuning.getTFDIFF(time_step);
max_growth_ = tuning.getTSFMAX(time_step);
max_time_step_ = tuning.getTSMAXZ(time_step);
suggested_next_timestep_ = tuning.getTSINIT(time_step);
timestep_after_event_ = tuning.getTMAXWC(time_step);
}
protected:
template <class Solver, class State, class WellState, class Output>
SimulatorReport stepImpl( const SimulatorTimer& timer,
@@ -111,16 +121,16 @@ namespace Opm {
SimulatorReport failureReport_; //!< statistics for the failed substeps of the last timestep
TimeStepControlType timeStepControl_; //!< time step control object
const double restart_factor_; //!< factor to multiply time step with when solver fails to converge
const double growth_factor_; //!< factor to multiply time step when solver recovered from failed convergence
const double max_growth_; //!< factor that limits the maximum growth of a time step
const double max_time_step_; //!< maximal allowed time step size
double restart_factor_; //!< factor to multiply time step with when solver fails to converge
double growth_factor_; //!< factor to multiply time step when solver recovered from failed convergence
double max_growth_; //!< factor that limits the maximum growth of a time step
double max_time_step_; //!< maximal allowed time step size
const int solver_restart_max_; //!< how many restart of solver are allowed
const bool solver_verbose_; //!< solver verbosity
const bool timestep_verbose_; //!< timestep verbosity
double suggested_next_timestep_; //!< suggested size of next timestep
bool full_timestep_initially_; //!< beginning with the size of the time step from data file
const double timestep_after_event_; //!< suggested size of timestep after an event
double timestep_after_event_; //!< suggested size of timestep after an event
bool use_newton_iteration_; //!< use newton iteration count for adaptive time step control
};
}