From 378addd0004e1983a99fc60b10a1d886fec07cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 24 Feb 2017 16:42:32 +0100 Subject: [PATCH] Update legacy sim to also read time step from restart. --- opm/autodiff/SimulatorBase_impl.hpp | 7 +++++-- opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp | 1 + 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/SimulatorBase_impl.hpp b/opm/autodiff/SimulatorBase_impl.hpp index d3eb3e994..a82c403cd 100644 --- a/opm/autodiff/SimulatorBase_impl.hpp +++ b/opm/autodiff/SimulatorBase_impl.hpp @@ -89,10 +89,10 @@ namespace Opm { WellState prev_well_state; - + ExtraData extra; if (output_writer_.isRestart()) { // 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_); } @@ -117,6 +117,9 @@ namespace Opm } else { adaptiveTimeStepping.reset( new AdaptiveTimeStepping( param_, terminal_output_ ) ); } + if (output_writer_.isRestart()) { + adaptiveTimeStepping->setSuggestedNextStep(extra.suggested_step); + } } std::string restorefilename = param_.getDefault("restorefile", std::string("") ); diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp index a59b3e737..ad6e070d1 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp @@ -198,6 +198,7 @@ namespace Opm }; + /// Extra data to read/write for OPM restarting struct ExtraData { double suggested_step;