All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
Opm::WellCollection Class Reference

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)
 Adds the child to the collection and appends it to parent's children. More...
 
void addChild (std::shared_ptr< WellsGroupInterface > &child_node)
 Adds the node to the collection (as a root node)
 
bool 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). More...
 
void setWellsPointer (Wells *wells)
 Adds the well pointer to each leaf node (does not take ownership).
 
const std::vector< WellNode * > & getLeafNodes () const
 
WellsGroupInterfacefindNode (const std::string &name)
 Finds the group with the given name. More...
 
const WellsGroupInterfacefindNode (const std::string &name) const
 Finds the group with the given name. More...
 
WellNodefindWellNode (const std::string &name) const
 
void applyGroupControls ()
 Applies all group controls (injection and production)
 
void applyExplicitReinjectionControls (const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase)
 Applies explicit reinjection controls. More...
 
void applyVREPGroupControls (const std::vector< double > &well_voidage_rates, const std::vector< double > &conversion_coeffs)
 applying VREP group control based on calculated voidage rates
 
bool 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. More...
 
bool needUpdateInjectionTargets () const
 Checking whether need to update the targets for the injection wells.
 
bool needUpdateProductionTargets () const
 Checking whehter need to update the targets for the production wells.
 
void updateWellTargets (const std::vector< double > &well_rates)
 Updating the well targets based on the well rates.
 
bool havingVREPGroups () const
 When we have VREP group, we need to update the targets based on the updated production voidage rates for each iteration.
 
bool groupControlActive () const
 Whether we have active group control.
 
bool groupControlApplied () const
 Whether we have applied the group control.
 
bool groupTargetConverged (const std::vector< double > &well_rates) const
 Whether the group target is converged.
 
void setGuideRatesWithPotentials (const Wells *wells, const PhaseUsage &phase_usage, const std::vector< double > &well_potentials) const
 Setting the guide rates with well potentials.
 
bool requireWellPotentials () const
 

Member Function Documentation

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

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

Parameters
[in]childthe child node
[in]parentname of parent node
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.
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).
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
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
const std::vector< WellNode * > & Opm::WellCollection::getLeafNodes ( ) const
Returns
A set of pointers to every well in the collection
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.


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