adding flag to tell when using well potential for guide rate
for WellNode.
This commit is contained in:
parent
29372e287c
commit
e77f726906
@ -34,7 +34,7 @@ namespace Opm
|
||||
BHP_limit_(-1e100),
|
||||
reinjection_fraction_target_(1),
|
||||
voidage_replacment_fraction_(1),
|
||||
guide_rate_(1.0),
|
||||
guide_rate_(-1.0),
|
||||
guide_rate_type_(NONE_GRT)
|
||||
{
|
||||
|
||||
|
@ -36,7 +36,7 @@ namespace Opm
|
||||
liquid_max_rate_(-1e100),
|
||||
reservoir_flow_max_rate_(-1e100),
|
||||
BHP_limit_(-1e100),
|
||||
guide_rate_(1.0),
|
||||
guide_rate_(-1.0),
|
||||
guide_rate_type_(NONE_GRT)
|
||||
{
|
||||
}
|
||||
|
@ -482,4 +482,15 @@ namespace Opm
|
||||
} // end of for (int w = 0; w < nw; ++w)
|
||||
}
|
||||
|
||||
|
||||
bool WellCollection::requireWellPotentials() const
|
||||
{
|
||||
for (const auto& well_node : leaf_nodes_) {
|
||||
if (well_node->isGuideRateWellPotential()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -155,6 +155,9 @@ namespace Opm
|
||||
const PhaseUsage& phase_usage,
|
||||
const std::vector<double>& well_potentials) const;
|
||||
|
||||
|
||||
bool requireWellPotentials() const;
|
||||
|
||||
private:
|
||||
// To account for the possibility of a forest
|
||||
std::vector<std::shared_ptr<WellsGroupInterface> > roots_;
|
||||
|
@ -921,7 +921,8 @@ namespace Opm
|
||||
self_index_(-1),
|
||||
group_control_index_(-1),
|
||||
shut_well_(true), // This is default for now
|
||||
target_updated_(false) // This is default for now, not sure whether to use the default value
|
||||
target_updated_(false), // This is default for now, not sure whether to use the default value
|
||||
is_guiderate_wellpotential_(false)
|
||||
{
|
||||
}
|
||||
|
||||
@ -1651,6 +1652,18 @@ namespace Opm
|
||||
}
|
||||
|
||||
|
||||
bool WellNode::isGuideRateWellPotential() const
|
||||
{
|
||||
return is_guiderate_wellpotential_;
|
||||
}
|
||||
|
||||
|
||||
void WellNode::setIsGuideRateWellPotential(const bool flag)
|
||||
{
|
||||
is_guiderate_wellpotential_ = flag;
|
||||
}
|
||||
|
||||
|
||||
bool WellNode::canProduceMore() const
|
||||
{
|
||||
return (isProducer() && !individualControl());
|
||||
|
@ -514,6 +514,10 @@ namespace Opm
|
||||
|
||||
bool targetUpdated() const;
|
||||
|
||||
bool isGuideRateWellPotential() const;
|
||||
|
||||
void setIsGuideRateWellPotential(const bool flag);
|
||||
|
||||
virtual void setTargetUpdated(const bool flag);
|
||||
|
||||
virtual bool canProduceMore() const;
|
||||
@ -527,6 +531,10 @@ namespace Opm
|
||||
bool shut_well_;
|
||||
// TODO: used when updating well targets
|
||||
bool target_updated_;
|
||||
// whether the guide rate is specified with well potential
|
||||
// TODO: we have never handle the guide rates for groups, maybe this
|
||||
// is something will go to WellsGroupInterface later
|
||||
bool is_guiderate_wellpotential_;
|
||||
};
|
||||
|
||||
/// Creates the WellsGroupInterface for the given well
|
||||
|
@ -748,7 +748,7 @@ namespace Opm
|
||||
WellNode& wellnode = *well_collection_.getLeafNodes()[wix];
|
||||
|
||||
// TODO: looks like only handling OIL phase guide rate for producers
|
||||
if (well->getGuideRatePhase(timeStep) != GuideRate::UNDEFINED) {
|
||||
if (well->getGuideRatePhase(timeStep) != GuideRate::UNDEFINED && well->getGuideRate(timeStep) >= 0.) {
|
||||
if (well_data[wix].type == PRODUCER) {
|
||||
wellnode.prodSpec().guide_rate_ = well->getGuideRate(timeStep);
|
||||
if (well->getGuideRatePhase(timeStep) == GuideRate::OIL) {
|
||||
@ -768,6 +768,8 @@ namespace Opm
|
||||
} else {
|
||||
OPM_THROW(std::runtime_error, "Unknown well type " << well_data[wix].type << " for well " << well->name());
|
||||
}
|
||||
} else {
|
||||
wellnode.setIsGuideRateWellPotential(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user