flow: fix the time held by the simulator object

This commit is contained in:
Andreas Lauser 2018-06-27 12:13:49 +02:00
parent 01c830656d
commit c794028bcf
2 changed files with 12 additions and 8 deletions

View File

@ -189,12 +189,16 @@ namespace Opm {
ebosSimulator_.model().advanceTimeLevel();
}
// set the timestep size and index in ebos explicitly
// we use our own time stepper.
ebosSimulator_.startNextEpisode( timer.currentStepLength() );
ebosSimulator_.setEpisodeIndex( timer.reportStepNum() );
ebosSimulator_.setTimeStepSize( timer.currentStepLength() );
ebosSimulator_.setTimeStepIndex( timer.reportStepNum() );
// set the timestep size and episode index for ebos explicitly. ebos needs to
// know the report step/episode index because of timing dependend data
// despide the fact that flow uses its own time stepper. (The length of the
// episode does not matter, though.)
Scalar t = timer.simulationTimeElapsed();
ebosSimulator_.startNextEpisode(/*episodeStartTime=*/t, /*episodeLength=*/1e30);
ebosSimulator_.setEpisodeIndex(timer.reportStepNum());
ebosSimulator_.setTime(t);
ebosSimulator_.setTimeStepSize(timer.currentStepLength());
ebosSimulator_.setTimeStepIndex(ebosSimulator_.timeStepIndex() + 1);
ebosSimulator_.problem().beginTimeStep();
@ -354,7 +358,7 @@ namespace Opm {
ebosSimulator_.problem().beginIteration();
ebosSimulator_.model().linearizer().linearize();
ebosSimulator_.problem().endIteration();
// -------- Aquifer models ----------
try
{

View File

@ -77,7 +77,7 @@ AdaptiveSimulatorTimer& AdaptiveSimulatorTimer::operator++ ()
// set new time step (depending on remaining time)
if( 1.05 * dt_ > remaining ) {
dt_ = remaining;
// check max time step again and use half remaining if to large
// check max time step again and use half remaining if too large
if( dt_ > max_time_step_ ) {
dt_ = 0.5 * remaining;
}