21#ifndef OPM_TIMESTEPCONTROL_HEADER_INCLUDED
22#define OPM_TIMESTEPCONTROL_HEADER_INCLUDED
24#include <opm/simulators/timestepping/TimeStepControlInterface.hpp>
25#include <opm/simulators/timestepping/AdaptiveSimulatorTimer.hpp>
32 enum class TimeStepControlType {
40 enum class ToleranceTestVersions {
42 ControlErrorFiltering,
45 enum class InternalControlVersions {
58 static constexpr TimeStepControlType Type = TimeStepControlType::SimpleIterationCount;
81 const double )
const override {
return true; }
83 template<
class Serializer>
92 bool operator==(
const SimpleIterationCountTimeStepControl&)
const;
95 const int target_iterations_ = 0;
96 const double decayrate_ = 0.0;
97 const double growthrate_ = 0.0;
98 const bool verbose_ =
false;
118 static constexpr TimeStepControlType Type = TimeStepControlType::PID;
140 const double )
const override {
return true; }
142 template<
class Serializer>
150 bool operator==(
const PIDTimeStepControl&)
const;
153 const double tol_ = 0.1;
154 mutable std::vector< double > errors_{};
155 const bool verbose_ =
false;
168 static constexpr TimeStepControlType Type = TimeStepControlType::PIDAndIterationCount;
194 const int iterations,
199 const double )
const override {
return true; }
201 template<
class Serializer>
212 bool operator==(
const PIDAndIterationCountTimeStepControl&)
const;
215 const int target_iterations_ = 8;
216 const double decayDampingFactor_ = 1.0;
217 const double growthDampingFactor_ = 3.2;
218 const double minTimeStepBasedOnIterations_ = 0.0;
219 const bool verbose_ =
false;
230 static constexpr TimeStepControlType Type = TimeStepControlType::General3rdOrder;
259 double timeStepFactor(
const std::array<double, 3>&
errors,
const std::array<double, 3>&
timeSteps)
const;
264 template<
class Serializer>
284 const double tolerance_ = 0.1;
285 const double safetyFactor_ = 0.8;
286 const bool rejectCompletedStep_ =
false;
287 mutable std::array<double, 3> errors_{};
288 mutable std::array<double, 3> timeSteps_{};
289 mutable std::array<double, 3> beta_{0.125, 0.25, 0.125};
290 mutable std::array<double, 2> alpha_{0.75, 0.25};
291 mutable InternalControlVersions controllerVersion_{InternalControlVersions::IController};
292 ToleranceTestVersions toleranceTestVersion_{ToleranceTestVersions::Standard};
293 const double maxReductionTimeStep_ = 0.1;
294 const bool verbose_ =
false;
309 static constexpr TimeStepControlType Type = TimeStepControlType::HardCodedTimeStep;
328 const double )
const override {
return true; }
330 template<
class Serializer>
336 bool operator==(
const HardcodedTimeStepControl&)
const;
340 std::vector<double> subStepTime_;
Simulation timer for adaptive time stepping.
Definition AdaptiveSimulatorTimer.hpp:41
General 3rd order controller.
Definition TimeStepControl.hpp:228
double computeTimeStepSize(const double dt, const int, const RelativeChangeInterface &, const AdaptiveSimulatorTimer &substepTimer) const override
compute new time step size suggestions based on the PID controller
Definition TimeStepControl.cpp:373
bool timeStepAccepted(const double error, const double timeStepJustCompleted) const override
For the general 3rd order controller, the internal shifting of errors and time steps happens here,...
Definition TimeStepControl.cpp:446
HardcodedTimeStepControl Input generated from summary file using the ert application:
Definition TimeStepControl.hpp:307
double computeTimeStepSize(const double dt, const int, const RelativeChangeInterface &, const AdaptiveSimulatorTimer &substepTimer) const override
compute new time step size suggestions based on the PID controller
Definition TimeStepControl.cpp:148
bool timeStepAccepted(const double, const double) const override
For the general 3rd order controller, the internal shifting of errors and time steps happens here,...
Definition TimeStepControl.hpp:327
PID controller based adaptive time step control as above that also takes target iterations into accou...
Definition TimeStepControl.hpp:165
bool timeStepAccepted(const double, const double) const override
For the general 3rd order controller, the internal shifting of errors and time steps happens here,...
Definition TimeStepControl.hpp:198
double computeTimeStepSize(const double dt, const int iterations, const RelativeChangeInterface &relativeChange, const AdaptiveSimulatorTimer &) const override
compute new time step size suggestions based on the PID controller
Definition TimeStepControl.cpp:274
PID controller based adaptive time step control as suggested in: Turek and Kuzmin.
Definition TimeStepControl.hpp:116
bool timeStepAccepted(const double, const double) const override
For the general 3rd order controller, the internal shifting of errors and time steps happens here,...
Definition TimeStepControl.hpp:139
double computeTimeStepSize(const double dt, const int, const RelativeChangeInterface &relativeChange, const AdaptiveSimulatorTimer &) const override
compute new time step size suggestions based on the PID controller
Definition TimeStepControl.cpp:188
RelativeChangeInterface.
Definition TimeStepControlInterface.hpp:34
A simple iteration count based adaptive time step control.
Definition TimeStepControl.hpp:56
bool timeStepAccepted(const double, const double) const override
For the general 3rd order controller, the internal shifting of errors and time steps happens here,...
Definition TimeStepControl.hpp:80
double computeTimeStepSize(const double dt, const int iterations, const RelativeChangeInterface &, const AdaptiveSimulatorTimer &) const override
compute new time step size suggestions based on the PID controller
Definition TimeStepControl.cpp:79
TimeStepControlInterface.
Definition TimeStepControlInterface.hpp:51
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilbioeffectsmodules.hh:43
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:240