Update legacy sim to also read time step from restart.

This commit is contained in:
Atgeirr Flø Rasmussen 2017-02-24 16:42:32 +01:00
parent ffaa48295a
commit 378addd000
2 changed files with 6 additions and 2 deletions

View File

@ -89,10 +89,10 @@ namespace Opm
{ {
WellState prev_well_state; WellState prev_well_state;
ExtraData extra;
if (output_writer_.isRestart()) { if (output_writer_.isRestart()) {
// This is a restart, populate WellState and ReservoirState state objects from restart file // This is a restart, populate WellState and ReservoirState state objects from restart file
output_writer_.initFromRestartFile(props_.phaseUsage(), grid_, state, prev_well_state); output_writer_.initFromRestartFile(props_.phaseUsage(), grid_, state, prev_well_state, extra);
initHydroCarbonState(state, props_.phaseUsage(), Opm::UgGridHelpers::numCells(grid_), has_disgas_, has_vapoil_); initHydroCarbonState(state, props_.phaseUsage(), Opm::UgGridHelpers::numCells(grid_), has_disgas_, has_vapoil_);
} }
@ -117,6 +117,9 @@ namespace Opm
} else { } else {
adaptiveTimeStepping.reset( new AdaptiveTimeStepping( param_, terminal_output_ ) ); adaptiveTimeStepping.reset( new AdaptiveTimeStepping( param_, terminal_output_ ) );
} }
if (output_writer_.isRestart()) {
adaptiveTimeStepping->setSuggestedNextStep(extra.suggested_step);
}
} }
std::string restorefilename = param_.getDefault("restorefile", std::string("") ); std::string restorefilename = param_.getDefault("restorefile", std::string("") );

View File

@ -198,6 +198,7 @@ namespace Opm
}; };
/// Extra data to read/write for OPM restarting
struct ExtraData struct ExtraData
{ {
double suggested_step; double suggested_step;