adding canProdueMore() function to wellsGroup

to indicate whether the group can produce more to match the group target
when they are not producing enough compared with the group target.
This commit is contained in:
Kai Bao 2017-01-16 11:15:22 +01:00
parent 713c833b0a
commit 8f658a92f2
2 changed files with 33 additions and 4 deletions

View File

@ -820,6 +820,17 @@ namespace Opm
// do nothing
}
bool WellsGroup::canProduceMore() const
{
for (const std::shared_ptr<const WellsGroupInterface>& child_node : children_) {
if (child_node->canProduceMore()) {
return true;
}
}
return false;
}
double WellsGroup::getProductionRate(const std::vector<double>& well_rates,
const ProductionSpecification::ControlMode prod_mode) const
{
@ -1504,7 +1515,8 @@ namespace Opm
double WellNode::getAccumulativeEfficiencyFactor() const {
double WellNode::getAccumulativeEfficiencyFactor() const
{
// TODO: not sure whether a well can be exempted from repsponding to the efficiency factor
// for the parent group.
double efficiency_factor = efficiencyFactor();
@ -1518,18 +1530,27 @@ namespace Opm
}
int WellNode::selfIndex() const {
int WellNode::selfIndex() const
{
return self_index_;
}
bool WellNode::targetUpdated() const {
bool WellNode::targetUpdated() const
{
return target_updated_;
}
void WellNode::setTargetUpdated(const bool flag) {
void WellNode::setTargetUpdated(const bool flag)
{
target_updated_ = flag;
}
bool WellNode::canProduceMore() const
{
return (isProducer() && !individualControl());
}
}

View File

@ -235,6 +235,10 @@ namespace Opm
virtual void setTargetUpdated(const bool flag) = 0;
// bascially, for the group or wells under group control
// they have the potential to adjust their targets to produce more to match the higher level target
virtual bool canProduceMore() const = 0;
double efficiencyFactor() const;
void setEfficiencyFactor(const double efficiency_factor);
@ -369,6 +373,8 @@ namespace Opm
virtual double getProductionRate(const std::vector<double>& well_rates,
const ProductionSpecification::ControlMode prod_mode) const;
virtual bool canProduceMore() const;
private:
std::vector<std::shared_ptr<WellsGroupInterface> > children_;
};
@ -497,6 +503,8 @@ namespace Opm
virtual void setTargetUpdated(const bool flag);
virtual bool canProduceMore() const;
private:
Wells* wells_;
int self_index_;