#include <WellsGroup.hpp>

Inheritance diagram for Opm::WellsGroup:
Inheritance graph

Public Member Functions

 WellsGroup (const std::string &name, const double efficiency_factor, const ProductionSpecification &prod_spec, const InjectionSpecification &inj_spec, const PhaseUsage &phase_usage)
 
virtual WellsGroupInterfacefindGroup (const std::string &name_of_node)
 
void addChild (std::shared_ptr< WellsGroupInterface > child)
 
virtual bool conditionsMet (const std::vector< double > &well_bhp, const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase, WellPhasesSummed &summed_phases)
 
virtual int numberOfLeafNodes ()
 
virtual std::pair< WellNode *, double > getWorstOffending (const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase, ProductionSpecification::ControlMode mode)
 
virtual void applyInjGroupControl (const InjectionSpecification::ControlMode control_mode, const InjectionSpecification::InjectorType injector_type, const double target, bool only_group)
 
virtual void applyProdGroupControl (const ProductionSpecification::ControlMode control_mode, const double target, bool only_group)
 
virtual void applyProdGroupControls ()
 
virtual void applyInjGroupControls ()
 
virtual double productionGuideRate (bool only_group)
 
virtual double injectionGuideRate (bool only_group)
 
virtual double getTotalProductionFlow (const std::vector< double > &phase_flows, const BlackoilPhases::PhaseIndex phase) const
 
virtual void applyExplicitReinjectionControls (const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)
 
virtual void applyVREPGroupControls (const std::vector< double > &well_voidage_rates, const std::vector< double > &conversion_coeffs)
 TODO: prototyping a VREP enforcement function. More...
 
virtual void applyVREPGroupControl (const double target, const InjectionSpecification::InjectorType injector_type, const std::vector< double > &well_voidage_rates, const std::vector< double > &conversion_coeffs, const bool only_group)
 
virtual double getTotalVoidageRate (const std::vector< double > &well_voidage_rates)
 
virtual void updateWellProductionTargets (const std::vector< double > &well_rates)
 
virtual void updateWellInjectionTargets (const std::vector< double > &well_rates)
 
virtual void setTargetUpdated (const bool flag)
 
virtual double getProductionRate (const std::vector< double > &well_rates, const ProductionSpecification::ControlMode prod_mode) const
 
virtual bool canProduceMore () const
 
virtual bool groupProdTargetConverged (const std::vector< double > &well_rates) const
 
const std::string & name () const
 The unique identifier for the well or well group. More...
 
const ProductionSpecificationprodSpec () const
 Production specifications for the well or well group. More...
 
ProductionSpecificationprodSpec ()
 Production specifications for the well or well group. More...
 
const InjectionSpecificationinjSpec () const
 Injection specifications for the well or well group. More...
 
InjectionSpecificationinjSpec ()
 Injection specifications for the well or well group. More...
 
const PhaseUsagephaseUsage () const
 Phase usage information. More...
 
virtual bool isLeafNode () const
 
void setParent (WellsGroupInterface *parent)
 
const WellsGroupInterfacegetParent () const
 Gets the parent of the group, NULL if no parent. More...
 
WellsGroupInterfacegetParent ()
 
double getTarget (ProductionSpecification::ControlMode mode) const
 Gets the target rate for the given mode. More...
 
double getTarget (InjectionSpecification::ControlMode mode) const
 Gets the target rate for the given mode. More...
 
bool individualControl () const
 
void setIndividualControl (const bool)
 Update the status for individual contrl. More...
 
double efficiencyFactor () const
 
void setEfficiencyFactor (const double efficiency_factor)
 

Protected Member Functions

double rateByMode (const double *res_rates, const double *surf_rates, const ProductionSpecification::ControlMode mode)
 Calculates the correct rate for the given ProductionSpecification::ControlMode. More...
 
double rateByMode (const double *res_rates, const double *surf_rates, const InjectionSpecification::ControlMode mode)
 Calculates the correct rate for the given InjectionSpecification::ControlMode. More...
 

Protected Attributes

WellsGroupInterfaceparent_
 
bool individual_control_
 
double efficiency_factor_
 

Constructor & Destructor Documentation

◆ WellsGroup()

Opm::WellsGroup::WellsGroup ( const std::string &  name,
const double  efficiency_factor,
const ProductionSpecification prod_spec,
const InjectionSpecification inj_spec,
const PhaseUsage phase_usage 
)

Member Function Documentation

◆ addChild()

void Opm::WellsGroup::addChild ( std::shared_ptr< WellsGroupInterface child)

◆ applyExplicitReinjectionControls()

virtual void Opm::WellsGroup::applyExplicitReinjectionControls ( const std::vector< double > &  well_reservoirrates_phase,
const std::vector< double > &  well_surfacerates_phase 
)
virtual

Applies explicit reinjection controls. This must be called at each timestep to be correct.

Parameters
[in]well_reservoirrates_phaseA vector containing reservoir rates by phase for each well. Is assumed to be ordered the same way as the related Wells-struct, with all phase rates of a single well adjacent in the array.
[in]well_surfacerates_phaseA vector containing surface rates by phase for each well. Is assumed to be ordered the same way as the related Wells-struct, with all phase rates of a single well adjacent in the array.

Implements Opm::WellsGroupInterface.

◆ applyInjGroupControl()

virtual void Opm::WellsGroup::applyInjGroupControl ( const InjectionSpecification::ControlMode  control_mode,
const InjectionSpecification::InjectorType  injector_type,
const double  target,
bool  only_group 
)
virtual

Sets the current active control to the provided one for all injectors within the group. After this call, the combined rate (which rate depending on control_mode) of the group shall be equal to target.

Parameters
[in]only_groupif true, only children that are under group control will be changed.

Implements Opm::WellsGroupInterface.

◆ applyInjGroupControls()

virtual void Opm::WellsGroup::applyInjGroupControls ( )
virtual

Applies any injection group control relevant to all children nodes. If no group control is set, this is called recursively to the children.

Implements Opm::WellsGroupInterface.

◆ applyProdGroupControl()

virtual void Opm::WellsGroup::applyProdGroupControl ( const ProductionSpecification::ControlMode  control_mode,
const double  target,
bool  only_group 
)
virtual

Sets the current active control to the provided one for all producers within the group. After this call, the combined rate (which rate depending on control_mode) of the group shall be equal to target.

Parameters
[in]only_groupif true, only children that are under group control will be changed.

Implements Opm::WellsGroupInterface.

◆ applyProdGroupControls()

virtual void Opm::WellsGroup::applyProdGroupControls ( )
virtual

Applies any production group control relevant to all children nodes. If no group control is set, this is called recursively to the children.

Implements Opm::WellsGroupInterface.

◆ applyVREPGroupControl()

virtual void Opm::WellsGroup::applyVREPGroupControl ( const double  target,
const InjectionSpecification::InjectorType  injector_type,
const std::vector< double > &  well_voidage_rates,
const std::vector< double > &  conversion_coeffs,
const bool  only_group 
)
virtual

◆ applyVREPGroupControls()

virtual void Opm::WellsGroup::applyVREPGroupControls ( const std::vector< double > &  well_voidage_rates,
const std::vector< double > &  conversion_coeffs 
)
virtual

TODO: prototyping a VREP enforcement function.

Implements Opm::WellsGroupInterface.

◆ canProduceMore()

virtual bool Opm::WellsGroup::canProduceMore ( ) const
virtual

◆ conditionsMet()

virtual bool Opm::WellsGroup::conditionsMet ( const std::vector< double > &  well_bhp,
const std::vector< double > &  well_reservoirrates_phase,
const std::vector< double > &  well_surfacerates_phase,
WellPhasesSummed summed_phases 
)
virtual

Checks if each condition is met, applies well controls where needed (that is, it either changes the active control of violating wells, or shuts down wells). Only one change is applied per invocation. Typical use will be

solve_pressure();
while(!group.conditionsMet(...)) {
solve_pressure();
}
Note
It's highly recommended to use the conditionsMet found in WellsManager.
Parameters
[in]well_bhpA vector containing the bhp for each well. Is assumed to be ordered the same way as the related Wells-struct.
[in]well_reservoirrates_phaseA vector containing reservoir rates by phase for each well. Is assumed to be ordered the same way as the related Wells-struct, with all phase rates of a single well adjacent in the array.
[in]well_surfacerates_phaseA vector containing surface rates by phase for each well. Is assumed to be ordered the same way as the related Wells-struct, with all phase rates of a single well adjacent in the array.
[out]summed_phasesWill at end of invocation contain the summed phase rates (rate ,etc.) for the group.
Returns
true if no violations were found, false otherwise (false also implies a change).

Implements Opm::WellsGroupInterface.

◆ efficiencyFactor()

double Opm::WellsGroupInterface::efficiencyFactor ( ) const
inherited

◆ findGroup()

virtual WellsGroupInterface * Opm::WellsGroup::findGroup ( const std::string &  name_of_node)
virtual
Returns
the pointer to the WellsGroupInterface with the given name. NULL if the name is not found.a

Implements Opm::WellsGroupInterface.

◆ getParent() [1/2]

WellsGroupInterface * Opm::WellsGroupInterface::getParent ( )
inherited

◆ getParent() [2/2]

const WellsGroupInterface * Opm::WellsGroupInterface::getParent ( ) const
inherited

Gets the parent of the group, NULL if no parent.

◆ getProductionRate()

virtual double Opm::WellsGroup::getProductionRate ( const std::vector< double > &  well_rates,
const ProductionSpecification::ControlMode  prod_mode 
) const
virtual

◆ getTarget() [1/2]

double Opm::WellsGroupInterface::getTarget ( InjectionSpecification::ControlMode  mode) const
inherited

Gets the target rate for the given mode.

◆ getTarget() [2/2]

double Opm::WellsGroupInterface::getTarget ( ProductionSpecification::ControlMode  mode) const
inherited

Gets the target rate for the given mode.

◆ getTotalProductionFlow()

virtual double Opm::WellsGroup::getTotalProductionFlow ( const std::vector< double > &  phase_flows,
const BlackoilPhases::PhaseIndex  phase 
) const
virtual

Gets the total production flow of the given phase.

Parameters
[in]phase_flowsA vector containing rates by phase for each well. Is assumed to be ordered the same way as the related Wells-struct, with all phase rates of a single well adjacent in the array.
[in]phaseThe phase for which to sum up.

Implements Opm::WellsGroupInterface.

◆ getTotalVoidageRate()

virtual double Opm::WellsGroup::getTotalVoidageRate ( const std::vector< double > &  well_voidage_rates)
virtual

◆ getWorstOffending()

virtual std::pair< WellNode *, double > Opm::WellsGroup::getWorstOffending ( const std::vector< double > &  well_reservoirrates_phase,
const std::vector< double > &  well_surfacerates_phase,
ProductionSpecification::ControlMode  mode 
)
virtual

Gets the worst offending well based on the input

Parameters
[in]well_reservoirrates_phaseA vector containing reservoir rates by phase for each well. Is assumed to be ordered the same way as the related Wells-struct, with all phase rates of a single well adjacent in the array.
[in]well_surfacerates_phaseA vector containing surface rates by phase for each well. Is assumed to be ordered the same way as the related Wells-struct, with all phase rates of a single well adjacent in the array.
[in]modeThe relevant control mode to find the maximum over.
Returns
first will be a pointer to the worst offending well, second will be the obtained value at that well.

Implements Opm::WellsGroupInterface.

◆ groupProdTargetConverged()

virtual bool Opm::WellsGroup::groupProdTargetConverged ( const std::vector< double > &  well_rates) const
virtual

◆ individualControl()

bool Opm::WellsGroupInterface::individualControl ( ) const
inherited

Return whether the well is running under group control target or under their own limit. True under their own limit. False running under group control target

◆ injectionGuideRate()

virtual double Opm::WellsGroup::injectionGuideRate ( bool  only_group)
virtual

Calculates the injection guide rate for the group.

Parameters
[in]only_groupIf true, will only accumelate guide rates for wells under group control

Implements Opm::WellsGroupInterface.

◆ injSpec() [1/2]

InjectionSpecification & Opm::WellsGroupInterface::injSpec ( )
inherited

Injection specifications for the well or well group.

◆ injSpec() [2/2]

const InjectionSpecification & Opm::WellsGroupInterface::injSpec ( ) const
inherited

Injection specifications for the well or well group.

◆ isLeafNode()

virtual bool Opm::WellsGroupInterface::isLeafNode ( ) const
virtualinherited
Returns
true if the object is a leaf node (WellNode), false otherwise.

Reimplemented in Opm::WellNode.

◆ name()

const std::string & Opm::WellsGroupInterface::name ( ) const
inherited

The unique identifier for the well or well group.

◆ numberOfLeafNodes()

virtual int Opm::WellsGroup::numberOfLeafNodes ( )
virtual

Calculates the number of leaf nodes in the given group. A leaf node is defined to have one leaf node in its group.

Implements Opm::WellsGroupInterface.

◆ phaseUsage()

const PhaseUsage & Opm::WellsGroupInterface::phaseUsage ( ) const
inherited

Phase usage information.

◆ prodSpec() [1/2]

ProductionSpecification & Opm::WellsGroupInterface::prodSpec ( )
inherited

Production specifications for the well or well group.

◆ prodSpec() [2/2]

const ProductionSpecification & Opm::WellsGroupInterface::prodSpec ( ) const
inherited

Production specifications for the well or well group.

◆ productionGuideRate()

virtual double Opm::WellsGroup::productionGuideRate ( bool  only_group)
virtual

Calculates the production guide rate for the group.

Parameters
[in]only_groupIf true, will only accumelate guide rates for wells under group control

Implements Opm::WellsGroupInterface.

◆ rateByMode() [1/2]

double Opm::WellsGroupInterface::rateByMode ( const double *  res_rates,
const double *  surf_rates,
const InjectionSpecification::ControlMode  mode 
)
protectedinherited

Calculates the correct rate for the given InjectionSpecification::ControlMode.

◆ rateByMode() [2/2]

double Opm::WellsGroupInterface::rateByMode ( const double *  res_rates,
const double *  surf_rates,
const ProductionSpecification::ControlMode  mode 
)
protectedinherited

Calculates the correct rate for the given ProductionSpecification::ControlMode.

◆ setEfficiencyFactor()

void Opm::WellsGroupInterface::setEfficiencyFactor ( const double  efficiency_factor)
inherited

◆ setIndividualControl()

void Opm::WellsGroupInterface::setIndividualControl ( const bool  )
inherited

Update the status for individual contrl.

◆ setParent()

void Opm::WellsGroupInterface::setParent ( WellsGroupInterface parent)
inherited

Sets the parent

Parameters
[in]parentthe pointer to the parent

◆ setTargetUpdated()

virtual void Opm::WellsGroup::setTargetUpdated ( const bool  flag)
virtual

◆ updateWellInjectionTargets()

virtual void Opm::WellsGroup::updateWellInjectionTargets ( const std::vector< double > &  well_rates)
virtual

◆ updateWellProductionTargets()

virtual void Opm::WellsGroup::updateWellProductionTargets ( const std::vector< double > &  well_rates)
virtual

Member Data Documentation

◆ efficiency_factor_

double Opm::WellsGroupInterface::efficiency_factor_
protectedinherited

◆ individual_control_

bool Opm::WellsGroupInterface::individual_control_
protectedinherited

◆ parent_

WellsGroupInterface* Opm::WellsGroupInterface::parent_
protectedinherited

The documentation for this class was generated from the following file: