opm-simulators
Loading...
Searching...
No Matches
Opm::General3rdOrderController Class Reference

General 3rd order controller. More...

#include <TimeStepControl.hpp>

Inheritance diagram for Opm::General3rdOrderController:
Opm::TimeStepControlInterface

Public Member Functions

 General3rdOrderController (const double tolerance, const double safetyFactor, const bool rejectCompletedStep, const std::string &toleranceTestVersion, const double maxReductionTimeStep, const std::string &parameters, const bool verbose)
 constructor
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
double timeStepFactor (const std::array< double, 3 > &errors, const std::array< double, 3 > &timeSteps) const
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, and hence this method needs to be called for (after) each time step.
template<class Serializer>
void serializeOp (Serializer &serializer)
bool operator== (const General3rdOrderController &) const
Public Member Functions inherited from Opm::TimeStepControlInterface
virtual ~TimeStepControlInterface ()
 virtual destructor (empty)

Static Public Member Functions

static General3rdOrderController serializationTestObject ()

Static Public Attributes

static constexpr TimeStepControlType Type = TimeStepControlType::General3rdOrder

Protected Attributes

const double tolerance_ = 0.1
const double safetyFactor_ = 0.8
const bool rejectCompletedStep_ = false
std::array< double, 3 > errors_ {}
std::array< double, 3 > timeSteps_ {}
std::array< double, 3 > beta_ {0.125, 0.25, 0.125}
std::array< double, 2 > alpha_ {0.75, 0.25}
InternalControlVersions controllerVersion_ {InternalControlVersions::IController}
ToleranceTestVersions toleranceTestVersion_ {ToleranceTestVersions::Standard}
const double maxReductionTimeStep_ = 0.1
const bool verbose_ = false

Detailed Description

General 3rd order controller.

Constructor & Destructor Documentation

◆ General3rdOrderController()

Opm::General3rdOrderController::General3rdOrderController ( const double tolerance,
const double safetyFactor,
const bool rejectCompletedStep,
const std::string & toleranceTestVersion,
const double maxReductionTimeStep,
const std::string & parameters,
const bool verbose )

constructor

Parameters
tolerancetolerance for the relative changes of the numerical solution to be accepted in one time step
safetyFactormultiplied with tolerance to ensure that target relative change is lower than tolerance
rejectCompletedStepif true, discard the recently completed time step and try again
toleranceTestVersionthe test used to decide if a time step should be rejected
maxReductionTimeSteplimits the reduction in time step size for control error filtering
parametersparameter values for the controller formula
verboseif true, get some output

Member Function Documentation

◆ computeTimeStepSize()

double Opm::General3rdOrderController::computeTimeStepSize ( const double dt,
const int iterations,
const RelativeChangeInterface & relativeChange,
const AdaptiveSimulatorTimer & substepTimer ) const
overridevirtual

compute new time step size suggestions based on the PID controller

Parameters
dttime step size used in the current step
iterationsnumber of iterations used (linear/nonlinear)
relativeChangeRelative change handler
substepTimerSub step timer
Returns
suggested time step size for the next step

Implements Opm::TimeStepControlInterface.

◆ timeStepAccepted()

bool Opm::General3rdOrderController::timeStepAccepted ( const double error,
const double timeStepJustCompleted ) const
overridevirtual

For the general 3rd order controller, the internal shifting of errors and time steps happens here, and hence this method needs to be called for (after) each time step.

Implements Opm::TimeStepControlInterface.


The documentation for this class was generated from the following files:
  • opm/simulators/timestepping/TimeStepControl.hpp
  • opm/simulators/timestepping/TimeStepControl.cpp