mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4945 from vkip/network_reroute
Network reroute - avoid looking up nonexisting nodes
This commit is contained in:
commit
25b007c46e
@ -1118,8 +1118,14 @@ updateNetworkPressures(const int reportStepIdx)
|
|||||||
return network_imbalance;
|
return network_imbalance;
|
||||||
|
|
||||||
if (!previous_node_pressures.empty()) {
|
if (!previous_node_pressures.empty()) {
|
||||||
for (const auto& [name, pressure]: previous_node_pressures) {
|
for (const auto& [name, new_pressure]: node_pressures_) {
|
||||||
const auto new_pressure = node_pressures_.at(name);
|
if (previous_node_pressures.count(name) <= 0) {
|
||||||
|
if (std::abs(new_pressure) > network_imbalance) {
|
||||||
|
network_imbalance = std::abs(new_pressure);
|
||||||
|
}
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
const auto pressure = previous_node_pressures.at(name);
|
||||||
const double change = (new_pressure - pressure);
|
const double change = (new_pressure - pressure);
|
||||||
if (std::abs(change) > network_imbalance) {
|
if (std::abs(change) > network_imbalance) {
|
||||||
network_imbalance = std::abs(change);
|
network_imbalance = std::abs(change);
|
||||||
|
@ -108,6 +108,22 @@ add_test_compareECLFiles(CASENAME network_standard
|
|||||||
DIR network
|
DIR network
|
||||||
TEST_ARGS --enable-tuning=true)
|
TEST_ARGS --enable-tuning=true)
|
||||||
|
|
||||||
|
add_test_compareECLFiles(CASENAME network_01_reroute
|
||||||
|
FILENAME NETWORK-01-REROUTE
|
||||||
|
SIMULATOR flow
|
||||||
|
ABS_TOL ${abs_tol}
|
||||||
|
REL_TOL ${rel_tol}
|
||||||
|
DIR network
|
||||||
|
TEST_ARGS --enable-tuning=true --local-well-solve-control-switching=true)
|
||||||
|
|
||||||
|
add_test_compareECLFiles(CASENAME network_01_reroute_std
|
||||||
|
FILENAME NETWORK-01-REROUTE_STD
|
||||||
|
SIMULATOR flow
|
||||||
|
ABS_TOL ${abs_tol}
|
||||||
|
REL_TOL ${rel_tol}
|
||||||
|
DIR network
|
||||||
|
TEST_ARGS --enable-tuning=true --local-well-solve-control-switching=true)
|
||||||
|
|
||||||
add_test_compareECLFiles(CASENAME gas_precsalt
|
add_test_compareECLFiles(CASENAME gas_precsalt
|
||||||
FILENAME GASWATER_VAPWAT_PRECSALT
|
FILENAME GASWATER_VAPWAT_PRECSALT
|
||||||
SIMULATOR flow
|
SIMULATOR flow
|
||||||
|
Loading…
Reference in New Issue
Block a user