Opm::WellCollection Class Reference

#include <WellCollection.hpp>

Public Member Functions

void addField (const Group &fieldGroup, size_t timeStep, const PhaseUsage &phaseUsage)
 
void addWell (const Well *wellChild, size_t timeStep, const PhaseUsage &phaseUsage)
 
void addGroup (const Group &groupChild, std::string parent_name, size_t timeStep, const PhaseUsage &phaseUsage)
 
void addChild (std::shared_ptr< WellsGroupInterface > &child_node, const std::string &parent)
 
void addChild (std::shared_ptr< WellsGroupInterface > &child_node)
 Adds the node to the collection (as a root node) More...
 
bool conditionsMet (const std::vector< double > &well_bhp, const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)
 
void setWellsPointer (Wells *wells)
 Adds the well pointer to each leaf node (does not take ownership). More...
 
const std::vector< WellNode * > & getLeafNodes () const
 
WellsGroupInterfacefindNode (const std::string &name)
 
const WellsGroupInterfacefindNode (const std::string &name) const
 
WellNodefindWellNode (const std::string &name) const
 
void applyGroupControls ()
 Applies all group controls (injection and production) More...
 
void applyExplicitReinjectionControls (const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)
 
void applyVREPGroupControls (const std::vector< double > &well_voidage_rates, const std::vector< double > &conversion_coeffs)
 applying VREP group control based on calculated voidage rates More...
 
bool needUpdateWellTargets () const
 
bool needUpdateInjectionTargets () const
 Checking whether need to update the targets for the injection wells. More...
 
bool needUpdateProductionTargets () const
 Checking whehter need to update the targets for the production wells. More...
 
void updateWellTargets (const std::vector< double > &well_rates)
 Updating the well targets based on the well rates. More...
 
bool havingVREPGroups () const
 When we have VREP group, we need to update the targets based on the updated production voidage rates for each iteration. More...
 
bool groupControlActive () const
 Whether we have active group control. More...
 
bool groupControlApplied () const
 Whether we have applied the group control. More...
 
bool groupTargetConverged (const std::vector< double > &well_rates) const
 Whether the group target is converged. More...
 
void setGuideRatesWithPotentials (const Wells *wells, const PhaseUsage &phase_usage, const std::vector< double > &well_potentials) const
 Setting the guide rates with well potentials. More...
 
bool requireWellPotentials () const
 

Member Function Documentation

◆ addChild() [1/2]

void Opm::WellCollection::addChild ( std::shared_ptr< WellsGroupInterface > &  child_node)

Adds the node to the collection (as a root node)

◆ addChild() [2/2]

void Opm::WellCollection::addChild ( std::shared_ptr< WellsGroupInterface > &  child_node,
const std::string &  parent 
)

Adds the child to the collection and appends it to parent's children.

Parameters
[in]childthe child node
[in]parentname of parent node

◆ addField()

void Opm::WellCollection::addField ( const Group &  fieldGroup,
size_t  timeStep,
const PhaseUsage phaseUsage 
)

◆ addGroup()

void Opm::WellCollection::addGroup ( const Group &  groupChild,
std::string  parent_name,
size_t  timeStep,
const PhaseUsage phaseUsage 
)

◆ addWell()

void Opm::WellCollection::addWell ( const Well *  wellChild,
size_t  timeStep,
const PhaseUsage phaseUsage 
)

◆ applyExplicitReinjectionControls()

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

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.

◆ applyGroupControls()

void Opm::WellCollection::applyGroupControls ( )

Applies all group controls (injection and production)

◆ applyVREPGroupControls()

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

applying VREP group control based on calculated voidage rates

◆ conditionsMet()

bool Opm::WellCollection::conditionsMet ( const std::vector< double > &  well_bhp,
const std::vector< double > &  well_reservoirrates_phase,
const std::vector< double > &  well_surfacerates_phase 
)

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(!collection.conditionsMet(well_bhp, well_rate, summed_phases)) {
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.
Returns
true if no violations were found, false otherwise (false also implies a change).

◆ findNode() [1/2]

WellsGroupInterface * Opm::WellCollection::findNode ( const std::string &  name)

Finds the group with the given name.

Parameters
[in]thename of the group
Returns
the pointer to the group if found, NULL otherwise

◆ findNode() [2/2]

const WellsGroupInterface * Opm::WellCollection::findNode ( const std::string &  name) const

Finds the group with the given name.

Parameters
[in]thename of the group
Returns
the pointer to the group if found, NULL otherwise

◆ findWellNode()

WellNode & Opm::WellCollection::findWellNode ( const std::string &  name) const

◆ getLeafNodes()

const std::vector< WellNode * > & Opm::WellCollection::getLeafNodes ( ) const
Returns
A set of pointers to every well in the collection

◆ groupControlActive()

bool Opm::WellCollection::groupControlActive ( ) const

Whether we have active group control.

◆ groupControlApplied()

bool Opm::WellCollection::groupControlApplied ( ) const

Whether we have applied the group control.

◆ groupTargetConverged()

bool Opm::WellCollection::groupTargetConverged ( const std::vector< double > &  well_rates) const

Whether the group target is converged.

◆ havingVREPGroups()

bool Opm::WellCollection::havingVREPGroups ( ) const

When we have VREP group, we need to update the targets based on the updated production voidage rates for each iteration.

◆ needUpdateInjectionTargets()

bool Opm::WellCollection::needUpdateInjectionTargets ( ) const

Checking whether need to update the targets for the injection wells.

◆ needUpdateProductionTargets()

bool Opm::WellCollection::needUpdateProductionTargets ( ) const

Checking whehter need to update the targets for the production wells.

◆ needUpdateWellTargets()

bool Opm::WellCollection::needUpdateWellTargets ( ) const

Checking whether need to update the targets of the wells / or the groups later True need to update well targets within this iteration, no switching control within this iteration. False no need to update well targets within this iteration, continuing as usual.

◆ requireWellPotentials()

bool Opm::WellCollection::requireWellPotentials ( ) const

◆ setGuideRatesWithPotentials()

void Opm::WellCollection::setGuideRatesWithPotentials ( const Wells wells,
const PhaseUsage phase_usage,
const std::vector< double > &  well_potentials 
) const

Setting the guide rates with well potentials.

◆ setWellsPointer()

void Opm::WellCollection::setWellsPointer ( Wells wells)

Adds the well pointer to each leaf node (does not take ownership).

◆ updateWellTargets()

void Opm::WellCollection::updateWellTargets ( const std::vector< double > &  well_rates)

Updating the well targets based on the well rates.


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