mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add initalizer for adaptiveTimeStepper that uses values from TUNING
Some of the tuning values from the TUNING keywords is used to tune the timestepping.
This commit is contained in:
parent
815480d052
commit
e034bbc7ad
@ -45,6 +45,17 @@ namespace Opm {
|
|||||||
AdaptiveTimeStepping( const parameter::ParameterGroup& param,
|
AdaptiveTimeStepping( const parameter::ParameterGroup& param,
|
||||||
const bool terminal_output = true );
|
const bool terminal_output = true );
|
||||||
|
|
||||||
|
//! \brief contructor taking parameter object
|
||||||
|
//! \param tuning Pointer to ecl TUNING keyword
|
||||||
|
//! \param time_step current report step
|
||||||
|
//! \param param The parameter object
|
||||||
|
//! \param pinfo The information about the data distribution
|
||||||
|
//! and communication for a parallel run.
|
||||||
|
AdaptiveTimeStepping( const Tuning& tuning,
|
||||||
|
size_t time_step,
|
||||||
|
const parameter::ParameterGroup& param,
|
||||||
|
const bool terminal_output = true );
|
||||||
|
|
||||||
/** \brief step method that acts like the solver::step method
|
/** \brief step method that acts like the solver::step method
|
||||||
in a sub cycle of time steps
|
in a sub cycle of time steps
|
||||||
|
|
||||||
@ -77,6 +88,8 @@ namespace Opm {
|
|||||||
Solver& solver, State& state, WellState& well_state,
|
Solver& solver, State& state, WellState& well_state,
|
||||||
Output* outputWriter);
|
Output* outputWriter);
|
||||||
|
|
||||||
|
void init(const parameter::ParameterGroup& param);
|
||||||
|
|
||||||
typedef std::unique_ptr< TimeStepControlInterface > TimeStepControlType;
|
typedef std::unique_ptr< TimeStepControlInterface > TimeStepControlType;
|
||||||
|
|
||||||
TimeStepControlType timeStepControl_; //!< time step control object
|
TimeStepControlType timeStepControl_; //!< time step control object
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||||
#include <dune/istl/istlexception.hh>
|
#include <dune/istl/istlexception.hh>
|
||||||
#include <dune/istl/ilu.hh> // For MatrixBlockException
|
#include <dune/istl/ilu.hh> // For MatrixBlockException
|
||||||
|
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
@ -61,6 +62,26 @@ namespace Opm {
|
|||||||
// AdaptiveTimeStepping
|
// AdaptiveTimeStepping
|
||||||
//---------------------
|
//---------------------
|
||||||
|
|
||||||
|
AdaptiveTimeStepping::AdaptiveTimeStepping( const Tuning& tuning,
|
||||||
|
size_t time_step,
|
||||||
|
const parameter::ParameterGroup& param,
|
||||||
|
const bool terminal_output )
|
||||||
|
: timeStepControl_()
|
||||||
|
, restart_factor_( tuning.getTSFCNV(time_step) )
|
||||||
|
, growth_factor_(tuning.getTFDIFF(time_step) )
|
||||||
|
, max_growth_( tuning.getTSFMAX(time_step) )
|
||||||
|
// default is 1 year, convert to seconds
|
||||||
|
, max_time_step_( tuning.getTSMAXZ(time_step) )
|
||||||
|
, solver_restart_max_( param.getDefault("solver.restart", int(10) ) )
|
||||||
|
, solver_verbose_( param.getDefault("solver.verbose", bool(true) ) && terminal_output )
|
||||||
|
, timestep_verbose_( param.getDefault("timestep.verbose", bool(true) ) && terminal_output )
|
||||||
|
, suggested_next_timestep_( tuning.getTSINIT(time_step) )
|
||||||
|
, full_timestep_initially_( param.getDefault("full_timestep_initially", bool(false) ) )
|
||||||
|
{
|
||||||
|
init(param);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
AdaptiveTimeStepping::AdaptiveTimeStepping( const parameter::ParameterGroup& param,
|
AdaptiveTimeStepping::AdaptiveTimeStepping( const parameter::ParameterGroup& param,
|
||||||
const bool terminal_output )
|
const bool terminal_output )
|
||||||
: timeStepControl_()
|
: timeStepControl_()
|
||||||
@ -74,6 +95,12 @@ namespace Opm {
|
|||||||
, timestep_verbose_( param.getDefault("timestep.verbose", bool(true) ) && terminal_output )
|
, timestep_verbose_( param.getDefault("timestep.verbose", bool(true) ) && terminal_output )
|
||||||
, suggested_next_timestep_( -1.0 )
|
, suggested_next_timestep_( -1.0 )
|
||||||
, full_timestep_initially_( param.getDefault("full_timestep_initially", bool(false) ) )
|
, full_timestep_initially_( param.getDefault("full_timestep_initially", bool(false) ) )
|
||||||
|
{
|
||||||
|
init(param);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AdaptiveTimeStepping::
|
||||||
|
init(const parameter::ParameterGroup& param)
|
||||||
{
|
{
|
||||||
// valid are "pid" and "pid+iteration"
|
// valid are "pid" and "pid+iteration"
|
||||||
std::string control = param.getDefault("timestep.control", std::string("pid") );
|
std::string control = param.getDefault("timestep.control", std::string("pid") );
|
||||||
@ -108,6 +135,7 @@ namespace Opm {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template <class Solver, class State, class WellState>
|
template <class Solver, class State, class WellState>
|
||||||
void AdaptiveTimeStepping::
|
void AdaptiveTimeStepping::
|
||||||
step( const SimulatorTimer& simulatorTimer, Solver& solver, State& state, WellState& well_state )
|
step( const SimulatorTimer& simulatorTimer, Solver& solver, State& state, WellState& well_state )
|
||||||
@ -123,6 +151,7 @@ namespace Opm {
|
|||||||
stepImpl( simulatorTimer, solver, state, well_state, &outputWriter );
|
stepImpl( simulatorTimer, solver, state, well_state, &outputWriter );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// implementation of the step method
|
// implementation of the step method
|
||||||
template <class Solver, class State, class WState, class Output >
|
template <class Solver, class State, class WState, class Output >
|
||||||
void AdaptiveTimeStepping::
|
void AdaptiveTimeStepping::
|
||||||
|
Loading…
Reference in New Issue
Block a user