mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4915 from vkip/network_multi_root
Support computation of network pressures in networks with multiple roots
This commit is contained in:
commit
bbdad520d6
@ -788,6 +788,9 @@ namespace WellGroupHelpers
|
||||
return {};
|
||||
}
|
||||
|
||||
std::map<std::string, double> node_pressures;
|
||||
auto roots = network.roots();
|
||||
for (const auto& root : roots) {
|
||||
// Fixed pressure nodes of the network are the roots of trees.
|
||||
// Leaf nodes must correspond to groups in the group structure.
|
||||
// Let us first find all leaf nodes of the network. We also
|
||||
@ -796,7 +799,8 @@ namespace WellGroupHelpers
|
||||
std::stack<std::string> children;
|
||||
std::set<std::string> leaf_nodes;
|
||||
std::vector<std::string> root_to_child_nodes;
|
||||
children.push(network.root().name());
|
||||
//children.push(network.root().name());
|
||||
children.push(root.get().name());
|
||||
while (!children.empty()) {
|
||||
const auto node = children.top();
|
||||
children.pop();
|
||||
@ -860,7 +864,7 @@ namespace WellGroupHelpers
|
||||
|
||||
// Going the other way (from roots to leafs), calculate the pressure
|
||||
// at each node using VFP tables and rates.
|
||||
std::map<std::string, double> node_pressures;
|
||||
//std::map<std::string, double> node_pressures;
|
||||
for (const auto& node : root_to_child_nodes) {
|
||||
auto press = network.node(node).terminal_pressure();
|
||||
if (press) {
|
||||
@ -901,7 +905,7 @@ namespace WellGroupHelpers
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return node_pressures;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user