mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
functions for indicating injection and production upating.
it is for WellCollection, which is logically wrong. It should be done in the group level, while things will be different for multi-level groups. The current implementation basically works for current needs, that we only have one group.
This commit is contained in:
@@ -193,22 +193,51 @@ namespace Opm
|
|||||||
|
|
||||||
//TODO: later, it should be extended to update group targets
|
//TODO: later, it should be extended to update group targets
|
||||||
bool WellCollection::needUpdateWellTargets() const
|
bool WellCollection::needUpdateWellTargets() const
|
||||||
|
{
|
||||||
|
return needUpdateInjectionTargets() || needUpdateProductionTargets();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool WellCollection::needUpdateInjectionTargets() const
|
||||||
{
|
{
|
||||||
bool any_group_control_node = false;
|
bool any_group_control_node = false;
|
||||||
bool any_should_update_node = false;
|
bool any_should_update_node = false;
|
||||||
|
|
||||||
for (size_t i = 0; i < leaf_nodes_.size(); ++i) {
|
for (size_t i = 0; i < leaf_nodes_.size(); ++i) {
|
||||||
std::cout << " well " << leaf_nodes_[i]->name() << " under group control ? " << !leaf_nodes_[i]->individualControl() << " should update well target? " << leaf_nodes_[i]->shouldUpdateWellTargets() << std::endl;
|
if (leaf_nodes_[i]->isInjector()) {
|
||||||
if (leaf_nodes_[i]->shouldUpdateWellTargets()) {
|
if (leaf_nodes_[i]->shouldUpdateWellTargets()) {
|
||||||
any_should_update_node = true;
|
any_should_update_node = true;
|
||||||
}
|
}
|
||||||
if (!leaf_nodes_[i]->individualControl()) {
|
|
||||||
|
if (leaf_nodes_[i]->individualControl()) {
|
||||||
any_group_control_node = true;
|
any_group_control_node = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
std::cout << " any_group_control_node " << any_group_control_node << " any_should_update_node " << any_should_update_node << std::endl;
|
}
|
||||||
|
|
||||||
return (any_group_control_node && any_should_update_node);
|
return (any_group_control_node && any_should_update_node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool WellCollection::needUpdateProductionTargets() const {
|
||||||
|
bool any_group_control_node = false;
|
||||||
|
bool any_should_update_node = false;
|
||||||
|
|
||||||
|
for (size_t i = 0; i < leaf_nodes_.size(); ++i) {
|
||||||
|
if (leaf_nodes_[i]->isProducer()) {
|
||||||
|
if (leaf_nodes_[i]->shouldUpdateWellTargets()) {
|
||||||
|
any_should_update_node = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (leaf_nodes_[i]->individualControl()) {
|
||||||
|
any_group_control_node = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (any_group_control_node && any_should_update_node);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const size_t WellCollection::numNode() const
|
const size_t WellCollection::numNode() const
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -117,6 +117,9 @@ namespace Opm
|
|||||||
/// strategy might be required.
|
/// strategy might be required.
|
||||||
bool needUpdateWellTargets() const;
|
bool needUpdateWellTargets() const;
|
||||||
|
|
||||||
|
bool needUpdateInjectionTargets() const;
|
||||||
|
bool needUpdateProductionTargets() const;
|
||||||
|
|
||||||
const size_t numNode() const;
|
const size_t numNode() const;
|
||||||
|
|
||||||
WellNode* getNode(size_t i) const;
|
WellNode* getNode(size_t i) const;
|
||||||
|
|||||||
Reference in New Issue
Block a user