AdaptiveTimeStepping.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2014 IRIS AS
3  Copyright 2015 Dr. Blatt - HPC-Simulation-Software & Services
4  Copyright 2015 Statoil AS
5 
6  This file is part of the Open Porous Media project (OPM).
7 
8  OPM is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  OPM is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OPM. If not, see <http://www.gnu.org/licenses/>.
20 */
21 #ifndef OPM_SUBSTEPPING_HEADER_INCLUDED
22 #define OPM_SUBSTEPPING_HEADER_INCLUDED
23 
24 #include <iostream>
25 #include <utility>
26 
28 #include <opm/common/ErrorMacros.hpp>
31 
32 namespace Opm {
33 
34 
35  // AdaptiveTimeStepping
36  //---------------------
37 
39  {
40  public:
46  const boost::any& pinfo=boost::any(),
47  const bool terminal_output = true );
48 
57  template <class Solver, class State, class WellState>
58  void step( const SimulatorTimer& timer,
59  Solver& solver, State& state, WellState& well_state );
60 
70  template <class Solver, class State, class WellState>
71  void step( const SimulatorTimer& timer,
72  Solver& solver, State& state, WellState& well_state,
73  OutputWriter& outputWriter );
74 
75  protected:
76  template <class Solver, class State, class WellState>
77  void stepImpl( const SimulatorTimer& timer,
78  Solver& solver, State& state, WellState& well_state,
79  OutputWriter* outputWriter);
80 
81  typedef std::unique_ptr< TimeStepControlInterface > TimeStepControlType;
82 
83  TimeStepControlType timeStepControl_;
84  const double restart_factor_;
85  const double growth_factor_;
86  const double max_growth_;
87  const double max_time_step_;
88  const int solver_restart_max_;
89  const bool solver_verbose_;
90  const bool timestep_verbose_;
93  };
94 }
95 
97 #endif
const double growth_factor_
factor to multiply time step when solver recovered from failed convergence
Definition: AdaptiveTimeStepping.hpp:85
Definition: AnisotropicEikonal.hpp:43
Definition: ParameterGroup.hpp:109
double suggested_next_timestep_
suggested size of next timestep
Definition: AdaptiveTimeStepping.hpp:91
const bool solver_verbose_
solver verbosity
Definition: AdaptiveTimeStepping.hpp:89
const double max_time_step_
maximal allowed time step size
Definition: AdaptiveTimeStepping.hpp:87
TimeStepControlType timeStepControl_
time step control object
Definition: AdaptiveTimeStepping.hpp:83
const double max_growth_
factor that limits the maximum growth of a time step
Definition: AdaptiveTimeStepping.hpp:86
Definition: AdaptiveTimeStepping.hpp:38
Definition: OutputWriter.hpp:61
const bool timestep_verbose_
timestep verbosity
Definition: AdaptiveTimeStepping.hpp:90
std::unique_ptr< TimeStepControlInterface > TimeStepControlType
Definition: AdaptiveTimeStepping.hpp:81
The state of a set of wells.
Definition: WellState.hpp:36
const int solver_restart_max_
how many restart of solver are allowed
Definition: AdaptiveTimeStepping.hpp:88
void stepImpl(const SimulatorTimer &timer, Solver &solver, State &state, WellState &well_state, OutputWriter *outputWriter)
const double restart_factor_
factor to multiply time step with when solver fails to converge
Definition: AdaptiveTimeStepping.hpp:84
Definition: SimulatorTimer.hpp:34
AdaptiveTimeStepping(const parameter::ParameterGroup &param, const boost::any &pinfo=boost::any(), const bool terminal_output=true)
contructor taking parameter object
Definition: AdaptiveTimeStepping_impl.hpp:37
bool full_timestep_initially_
beginning with the size of the time step from data file
Definition: AdaptiveTimeStepping.hpp:92
void step(const SimulatorTimer &timer, Solver &solver, State &state, WellState &well_state)
step method that acts like the solver::step method in a sub cycle of time steps
Definition: AdaptiveTimeStepping_impl.hpp:83