Opm::WellsGroupInterface Class Referenceabstract

#include <WellsGroup.hpp>

Inheritance diagram for Opm::WellsGroupInterface:
Inheritance graph

Public Member Functions

 WellsGroupInterface (const std::string &name, const double efficiency_factor, const ProductionSpecification &prod_spec, const InjectionSpecification &inj_spec, const PhaseUsage &phase_usage)
 
virtual ~WellsGroupInterface ()
 
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...
 
const InjectionSpecificationinjSpec () const
 Injection specifications for the well or well group. More...
 
ProductionSpecificationprodSpec ()
 Production 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
 
virtual WellsGroupInterfacefindGroup (const std::string &name_of_node)=0
 
void setParent (WellsGroupInterface *parent)
 
const WellsGroupInterfacegetParent () const
 Gets the parent of the group, NULL if no parent. More...
 
WellsGroupInterfacegetParent ()
 
virtual int numberOfLeafNodes ()=0
 
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)=0
 
virtual void applyInjGroupControl (const InjectionSpecification::ControlMode control_mode, const InjectionSpecification::InjectorType injector_type, const double target, const bool only_group)=0
 
virtual void applyProdGroupControl (const ProductionSpecification::ControlMode control_mode, const double target, const bool only_group)=0
 
virtual std::pair< WellNode *, double > getWorstOffending (const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase, ProductionSpecification::ControlMode mode)=0
 
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...
 
virtual void applyProdGroupControls ()=0
 
virtual void applyInjGroupControls ()=0
 
virtual double productionGuideRate (bool only_group)=0
 
virtual double injectionGuideRate (bool only_group)=0
 
virtual double getTotalProductionFlow (const std::vector< double > &phase_flows, const BlackoilPhases::PhaseIndex phase) const =0
 
virtual void applyExplicitReinjectionControls (const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)=0
 
virtual void applyVREPGroupControls (const std::vector< double > &well_voidage_rates, const std::vector< double > &conversion_coeffs)=0
 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)=0
 
virtual double getTotalVoidageRate (const std::vector< double > &well_voidage_rates)=0
 
bool individualControl () const
 
void setIndividualControl (const bool)
 Update the status for individual contrl. More...
 
virtual double getProductionRate (const std::vector< double > &well_rates, const ProductionSpecification::ControlMode prod_mode) const =0
 
virtual void updateWellProductionTargets (const std::vector< double > &well_rates)=0
 
virtual void updateWellInjectionTargets (const std::vector< double > &well_rates)=0
 
virtual void setTargetUpdated (const bool flag)=0
 
virtual bool canProduceMore () const =0
 
virtual bool groupProdTargetConverged (const std::vector< double > &well_rates) const =0
 
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

◆ WellsGroupInterface()

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

◆ ~WellsGroupInterface()

virtual Opm::WellsGroupInterface::~WellsGroupInterface ( )
virtual

Member Function Documentation

◆ applyExplicitReinjectionControls()

virtual void Opm::WellsGroupInterface::applyExplicitReinjectionControls ( const std::vector< double > &  well_reservoirrates_phase,
const std::vector< double > &  well_surfacerates_phase 
)
pure 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.

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ applyInjGroupControl()

virtual void Opm::WellsGroupInterface::applyInjGroupControl ( const InjectionSpecification::ControlMode  control_mode,
const InjectionSpecification::InjectorType  injector_type,
const double  target,
const bool  only_group 
)
pure 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.

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ applyInjGroupControls()

virtual void Opm::WellsGroupInterface::applyInjGroupControls ( )
pure virtual

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ applyProdGroupControl()

virtual void Opm::WellsGroupInterface::applyProdGroupControl ( const ProductionSpecification::ControlMode  control_mode,
const double  target,
const bool  only_group 
)
pure 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.

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ applyProdGroupControls()

virtual void Opm::WellsGroupInterface::applyProdGroupControls ( )
pure virtual

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ applyVREPGroupControl()

virtual void Opm::WellsGroupInterface::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 
)
pure virtual

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ applyVREPGroupControls()

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

TODO: prototyping a VREP enforcement function.

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ canProduceMore()

virtual bool Opm::WellsGroupInterface::canProduceMore ( ) const
pure virtual

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ conditionsMet()

virtual bool Opm::WellsGroupInterface::conditionsMet ( const std::vector< double > &  well_bhp,
const std::vector< double > &  well_reservoirrates_phase,
const std::vector< double > &  well_surfacerates_phase,
WellPhasesSummed summed_phases 
)
pure 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).

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ efficiencyFactor()

double Opm::WellsGroupInterface::efficiencyFactor ( ) const

◆ findGroup()

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ getParent() [1/2]

WellsGroupInterface * Opm::WellsGroupInterface::getParent ( )

◆ getParent() [2/2]

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

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

◆ getProductionRate()

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ getTarget() [1/2]

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

Gets the target rate for the given mode.

◆ getTarget() [2/2]

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

Gets the target rate for the given mode.

◆ getTotalProductionFlow()

virtual double Opm::WellsGroupInterface::getTotalProductionFlow ( const std::vector< double > &  phase_flows,
const BlackoilPhases::PhaseIndex  phase 
) const
pure 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.

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ getTotalVoidageRate()

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ getWorstOffending()

virtual std::pair< WellNode *, double > Opm::WellsGroupInterface::getWorstOffending ( const std::vector< double > &  well_reservoirrates_phase,
const std::vector< double > &  well_surfacerates_phase,
ProductionSpecification::ControlMode  mode 
)
pure 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.

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ groupProdTargetConverged()

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ individualControl()

bool Opm::WellsGroupInterface::individualControl ( ) const

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::WellsGroupInterface::injectionGuideRate ( bool  only_group)
pure virtual

Calculates the injection guide rate for the group.

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ injSpec() [1/2]

InjectionSpecification & Opm::WellsGroupInterface::injSpec ( )

Injection specifications for the well or well group.

◆ injSpec() [2/2]

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

Injection specifications for the well or well group.

◆ isLeafNode()

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

Reimplemented in Opm::WellNode.

◆ name()

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

The unique identifier for the well or well group.

◆ numberOfLeafNodes()

virtual int Opm::WellsGroupInterface::numberOfLeafNodes ( )
pure virtual

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ phaseUsage()

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

Phase usage information.

◆ prodSpec() [1/2]

ProductionSpecification & Opm::WellsGroupInterface::prodSpec ( )

Production specifications for the well or well group.

◆ prodSpec() [2/2]

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

Production specifications for the well or well group.

◆ productionGuideRate()

virtual double Opm::WellsGroupInterface::productionGuideRate ( bool  only_group)
pure virtual

Calculates the production guide rate for the group.

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ rateByMode() [1/2]

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

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

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

◆ setEfficiencyFactor()

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

◆ setIndividualControl()

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

Update the status for individual contrl.

◆ setParent()

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

Sets the parent

Parameters
[in]parentthe pointer to the parent

◆ setTargetUpdated()

virtual void Opm::WellsGroupInterface::setTargetUpdated ( const bool  flag)
pure virtual

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ updateWellInjectionTargets()

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

◆ updateWellProductionTargets()

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

Implemented in Opm::WellsGroup, and Opm::WellNode.

Member Data Documentation

◆ efficiency_factor_

double Opm::WellsGroupInterface::efficiency_factor_
protected

◆ individual_control_

bool Opm::WellsGroupInterface::individual_control_
protected

◆ parent_

WellsGroupInterface* Opm::WellsGroupInterface::parent_
protected

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