Opm::WellsGroup Class Reference
Inheritance diagram for Opm::WellsGroup:
Opm::WellsGroupInterface

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)
 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). More...
 
virtual int numberOfLeafNodes ()
 Calculates the number of leaf nodes in the given group. More...
 
virtual std::pair< WellNode *, double > getWorstOffending (const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase, ProductionSpecification::ControlMode mode)
 Gets the worst offending well based on the input. More...
 
virtual void applyInjGroupControl (const InjectionSpecification::ControlMode control_mode, const InjectionSpecification::InjectorType injector_type, const double target, bool only_group)
 Sets the current active control to the provided one for all injectors within the group. More...
 
virtual void applyProdGroupControl (const ProductionSpecification::ControlMode control_mode, const double target, bool only_group)
 Sets the current active control to the provided one for all producers within the group. More...
 
virtual void applyProdGroupControls ()
 Applies any production group control relevant to all children nodes. More...
 
virtual void applyInjGroupControls ()
 Applies any injection group control relevant to all children nodes. More...
 
virtual double productionGuideRate (bool only_group)
 Calculates the production guide rate for the group. More...
 
virtual double injectionGuideRate (bool only_group)
 Calculates the injection guide rate for the group. More...
 
virtual double getTotalProductionFlow (const std::vector< double > &phase_flows, const BlackoilPhases::PhaseIndex phase) const
 Gets the total production flow of the given phase. More...
 
virtual void applyExplicitReinjectionControls (const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)
 Applies explicit reinjection controls. More...
 
virtual void applyVREPGroupControls (const std::vector< double > &well_voidage_rates, const std::vector< double > &conversion_coeffs)
 TODO: prototyping a VREP enforcement function.
 
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
 
- Public Member Functions inherited from Opm::WellsGroupInterface
 WellsGroupInterface (const std::string &name, const double efficiency_factor, const ProductionSpecification &prod_spec, const InjectionSpecification &inj_spec, const PhaseUsage &phase_usage)
 
const std::string & name () const
 The unique identifier for the well or well group.
 
const ProductionSpecificationprodSpec () const
 Production specifications for the well or well group.
 
const InjectionSpecificationinjSpec () const
 Injection specifications for the well or well group.
 
ProductionSpecificationprodSpec ()
 Production specifications for the well or well group.
 
InjectionSpecificationinjSpec ()
 Injection specifications for the well or well group.
 
const PhaseUsagephaseUsage () const
 Phase usage information.
 
virtual bool isLeafNode () const
 
void setParent (WellsGroupInterface *parent)
 Sets the parent. More...
 
const WellsGroupInterfacegetParent () const
 Gets the parent of the group, NULL if no parent.
 
WellsGroupInterfacegetParent ()
 
double getTarget (ProductionSpecification::ControlMode mode) const
 Gets the target rate for the given mode.
 
double getTarget (InjectionSpecification::ControlMode mode) const
 Gets the target rate for the given mode.
 
bool individualControl () const
 Return whether the well is running under group control target or under their own limit. More...
 
void setIndividualControl (const bool)
 Update the status for individual contrl.
 
double efficiencyFactor () const
 
void setEfficiencyFactor (const double efficiency_factor)
 

Additional Inherited Members

- Protected Member Functions inherited from Opm::WellsGroupInterface
double rateByMode (const double *res_rates, const double *surf_rates, const ProductionSpecification::ControlMode mode)
 Calculates the correct rate for the given ProductionSpecification::ControlMode.
 
double rateByMode (const double *res_rates, const double *surf_rates, const InjectionSpecification::ControlMode mode)
 Calculates the correct rate for the given InjectionSpecification::ControlMode.
 
- Protected Attributes inherited from Opm::WellsGroupInterface
WellsGroupInterfaceparent_
 
bool individual_control_
 
double efficiency_factor_
 

Member Function Documentation

◆ applyExplicitReinjectionControls()

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()

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.

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. otherwise, all children will be set under group control

Implements Opm::WellsGroupInterface.

◆ applyInjGroupControls()

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()

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.

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. otherwise, all children will be set under group control

Implements Opm::WellsGroupInterface.

◆ applyProdGroupControls()

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.

◆ conditionsMet()

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.

◆ findGroup()

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.

◆ getTotalProductionFlow()

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.

◆ getWorstOffending()

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.

◆ injectionGuideRate()

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.

◆ numberOfLeafNodes()

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.

◆ productionGuideRate()

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.


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