Merge pull request #4961 from vkip/network_restart_use_node_pressures

Use network pressures from restart
This commit is contained in:
Bård Skaflestad 2023-11-15 09:46:35 +01:00 committed by GitHub
commit 0b2c396a01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 12 deletions

View File

@ -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<Opm::UDQState>
((*schedule)[0].udq().params().undefinedValue());
udqState->load_rst(rst_state);

View File

@ -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

View File

@ -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