moved TimeStepControl to Simulator::run and make it work again.

This commit is contained in:
Robert K 2014-10-03 14:31:57 +02:00
parent a723a01f72
commit 9e9ef0155c
2 changed files with 5 additions and 2 deletions

View File

@ -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 );
}

View File

@ -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 )