From 0ea2b9afe22de08cb86e39655a8b94ce66e4ccfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Petter=20=C3=98ren=20Hauge?= Date: Mon, 16 Apr 2018 09:34:40 +0200 Subject: [PATCH] Only load wells that have simulated data Wells that are added at the same time step as RESTART is initiated will not be present in a restart file. Use the previous time step to retrieve wells --- opm/autodiff/BlackoilOutputEbos.hpp | 6 +++++- opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/BlackoilOutputEbos.hpp b/opm/autodiff/BlackoilOutputEbos.hpp index 7f6dbe0df..9a7d9990e 100644 --- a/opm/autodiff/BlackoilOutputEbos.hpp +++ b/opm/autodiff/BlackoilOutputEbos.hpp @@ -133,7 +133,11 @@ namespace Opm const auto& defunct_well_names = ebosSimulator_.vanguard().defunctWellNames(); WellsManager wellsmanager(eclState(), schedule(), - eclState().getInitConfig().getRestartStep(), + // The restart step value is used to identify wells present at the given + // time step. Wells that are added at the same time step as RESTART is initiated + // will not be present in a restart file. Use the previous time step to retrieve + // wells that have information written to the restart file. + std::max(eclState().getInitConfig().getRestartStep() - 1, 0), Opm::UgGridHelpers::numCells(grid()), Opm::UgGridHelpers::globalCell(grid()), Opm::UgGridHelpers::cartDims(grid()), diff --git a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp index 27f87a8ba..3e3aa2a52 100644 --- a/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp +++ b/opm/autodiff/SimulatorFullyImplicitBlackoilOutput.hpp @@ -439,7 +439,11 @@ namespace Opm DynamicListEconLimited dummy_list_econ_limited; WellsManager wellsmanager(eclipseState_, schedule_, - eclipseState_.getInitConfig().getRestartStep(), + // The restart step value is used to identify wells present at the given time step. + // Wells that are added at the same time step as RESTART is initiated will not be + // present in a restart file. Use the previous time step to retrieve wells + // that have information written to the restart file. + std::max(eclipseState_.getInitConfig().getRestartStep() - 1, 0), Opm::UgGridHelpers::numCells(grid), Opm::UgGridHelpers::globalCell(grid), Opm::UgGridHelpers::cartDims(grid),