diff --git a/opm/simulators/utils/readDeck.cpp b/opm/simulators/utils/readDeck.cpp index fc796bed1..5e11d61ac 100644 --- a/opm/simulators/utils/readDeck.cpp +++ b/opm/simulators/utils/readDeck.cpp @@ -154,6 +154,11 @@ namespace { std::move(python), outputInterval, init_state); } + // Read network pressures from restart + if (rst_state.network.isActive()) { + eclipseState.loadRestartNetworkPressures(rst_state.network); + } + udqState = std::make_unique ((*schedule)[0].udq().params().undefinedValue()); udqState->load_rst(rst_state); diff --git a/opm/simulators/wells/BlackoilWellModelGeneric.cpp b/opm/simulators/wells/BlackoilWellModelGeneric.cpp index cd443be69..e89248acf 100644 --- a/opm/simulators/wells/BlackoilWellModelGeneric.cpp +++ b/opm/simulators/wells/BlackoilWellModelGeneric.cpp @@ -94,20 +94,25 @@ BlackoilWellModelGeneric(Schedule& schedule, , nupcol_wgstate_(phase_usage) { - const auto numProcs = comm_.size(); - this->not_on_process_ = [this, numProcs](const Well& well) { - if (numProcs == decltype(numProcs){1}) - return false; + const auto numProcs = comm_.size(); + this->not_on_process_ = [this, numProcs](const Well& well) { + if (numProcs == decltype(numProcs){1}) + return false; - // Recall: false indicates NOT active! - const auto value = std::make_pair(well.name(), true); - auto candidate = std::lower_bound(this->parallel_well_info_.begin(), - this->parallel_well_info_.end(), - value); + // Recall: false indicates NOT active! + const auto value = std::make_pair(well.name(), true); + auto candidate = std::lower_bound(this->parallel_well_info_.begin(), + this->parallel_well_info_.end(), + value); - return (candidate == this->parallel_well_info_.end()) - || (*candidate != value); - }; + return (candidate == this->parallel_well_info_.end()) + || (*candidate != value); + }; + + const auto& node_pressures = eclState.getRestartNetworkPressures(); + if (node_pressures.has_value()) { + this->node_pressures_ = node_pressures.value(); + } } int diff --git a/restartTests.cmake b/restartTests.cmake index c6711f76b..d01312e80 100644 --- a/restartTests.cmake +++ b/restartTests.cmake @@ -74,6 +74,24 @@ add_test_compare_restarted_simulation(CASENAME aquflux_02 DIR aquifers TEST_ARGS --enable-tuning=true) +add_test_compare_restarted_simulation(CASENAME network_01_restart + FILENAME NETWORK-01-RESTART + SIMULATOR flow + ABS_TOL ${abs_tol_restart} + REL_TOL ${rel_tol_restart} + RESTART_STEP 5 + DIR network + TEST_ARGS --enable-tuning=true --local-well-solve-control-switching=true) + +add_test_compare_restarted_simulation(CASENAME network_01_reroute_restart + FILENAME NETWORK-01-REROUTE-RESTART + SIMULATOR flow + ABS_TOL ${abs_tol_restart} + REL_TOL ${rel_tol_restart} + RESTART_STEP 5 + DIR network + TEST_ARGS --enable-tuning=true --local-well-solve-control-switching=true) + # The dynamic MSW data is not written to /read from the restart file # We therefore accept significant deviation in the results. # Note also that we use --sched-restart=true since some necessary