Skip to content

Commit 0b2c396

Browse files
authored
Merge pull request #4961 from vkip/network_restart_use_node_pressures
Use network pressures from restart
2 parents ae97b00 + 4ce9c41 commit 0b2c396

3 files changed

Lines changed: 42 additions & 14 deletions

File tree

opm/simulators/utils/readDeck.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ namespace {
154154
std::move(python), outputInterval, init_state);
155155
}
156156

157+
// Read network pressures from restart
158+
if (rst_state.network.isActive()) {
159+
eclipseState.loadRestartNetworkPressures(rst_state.network);
160+
}
161+
157162
udqState = std::make_unique<Opm::UDQState>
158163
((*schedule)[0].udq().params().undefinedValue());
159164
udqState->load_rst(rst_state);

opm/simulators/wells/BlackoilWellModelGeneric.cpp

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,25 @@ BlackoilWellModelGeneric(Schedule& schedule,
9494
, nupcol_wgstate_(phase_usage)
9595
{
9696

97-
const auto numProcs = comm_.size();
98-
this->not_on_process_ = [this, numProcs](const Well& well) {
99-
if (numProcs == decltype(numProcs){1})
100-
return false;
101-
102-
// Recall: false indicates NOT active!
103-
const auto value = std::make_pair(well.name(), true);
104-
auto candidate = std::lower_bound(this->parallel_well_info_.begin(),
105-
this->parallel_well_info_.end(),
106-
value);
107-
108-
return (candidate == this->parallel_well_info_.end())
109-
|| (*candidate != value);
110-
};
97+
const auto numProcs = comm_.size();
98+
this->not_on_process_ = [this, numProcs](const Well& well) {
99+
if (numProcs == decltype(numProcs){1})
100+
return false;
101+
102+
// Recall: false indicates NOT active!
103+
const auto value = std::make_pair(well.name(), true);
104+
auto candidate = std::lower_bound(this->parallel_well_info_.begin(),
105+
this->parallel_well_info_.end(),
106+
value);
107+
108+
return (candidate == this->parallel_well_info_.end())
109+
|| (*candidate != value);
110+
};
111+
112+
const auto& node_pressures = eclState.getRestartNetworkPressures();
113+
if (node_pressures.has_value()) {
114+
this->node_pressures_ = node_pressures.value();
115+
}
111116
}
112117

113118
int

restartTests.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,24 @@ add_test_compare_restarted_simulation(CASENAME aquflux_02
7474
DIR aquifers
7575
TEST_ARGS --enable-tuning=true)
7676

77+
add_test_compare_restarted_simulation(CASENAME network_01_restart
78+
FILENAME NETWORK-01-RESTART
79+
SIMULATOR flow
80+
ABS_TOL ${abs_tol_restart}
81+
REL_TOL ${rel_tol_restart}
82+
RESTART_STEP 5
83+
DIR network
84+
TEST_ARGS --enable-tuning=true --local-well-solve-control-switching=true)
85+
86+
add_test_compare_restarted_simulation(CASENAME network_01_reroute_restart
87+
FILENAME NETWORK-01-REROUTE-RESTART
88+
SIMULATOR flow
89+
ABS_TOL ${abs_tol_restart}
90+
REL_TOL ${rel_tol_restart}
91+
RESTART_STEP 5
92+
DIR network
93+
TEST_ARGS --enable-tuning=true --local-well-solve-control-switching=true)
94+
7795
# The dynamic MSW data is not written to /read from the restart file
7896
# We therefore accept significant deviation in the results.
7997
# Note also that we use --sched-restart=true since some necessary

0 commit comments

Comments
 (0)