mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
moved TimeStepControl to Simulator::run and make it work again.
This commit is contained in:
parent
a723a01f72
commit
9e9ef0155c
@ -300,8 +300,9 @@ namespace Opm
|
||||
|
||||
const bool subStepping = param_.getDefault("substepping", bool(false) );
|
||||
|
||||
// create time step control object, TODO introduce parameter
|
||||
std::unique_ptr< TimeStepControlInterface >
|
||||
timeStepControl( new PIDAndIterationCountTimeStepControl( 1e-3, 50 ) );
|
||||
timeStepControl( new PIDAndIterationCountTimeStepControl( 100, 1e-3 ) );
|
||||
|
||||
// Main simulation loop.
|
||||
while (!timer.done()) {
|
||||
@ -391,6 +392,8 @@ namespace Opm
|
||||
// compute new time step estimate
|
||||
const double dtEstimate =
|
||||
timeStepControl->computeTimeStepSize( subStepper.currentStepLength(), linearIterations, state );
|
||||
std::cout << "Suggested time step size = " << dtEstimate/86400.0 << " (days)" << std::endl;
|
||||
|
||||
// set new time step length
|
||||
subStepper.provideTimeStepEstimate( dtEstimate );
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ namespace Opm
|
||||
const int targetIterationCount_;
|
||||
|
||||
public:
|
||||
PIDAndIterationCountTimeStepControl( const int target_iterations = 20,
|
||||
explicit PIDAndIterationCountTimeStepControl( const int target_iterations = 20,
|
||||
const double tol = 1e-3,
|
||||
const bool verbose = false)
|
||||
: BaseType( tol, verbose )
|
||||
|
Loading…
Reference in New Issue
Block a user