Opm::WellCollection Class Reference

#include <WellCollection.hpp>

Public Member Functions

void addField (GroupConstPtr fieldGroup, size_t timeStep, const PhaseUsage &phaseUsage)
 
void addWell (WellConstPtr wellChild, size_t timeStep, const PhaseUsage &phaseUsage)
 
void addGroup (GroupConstPtr 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
 
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)
 

Member Function Documentation

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
void Opm::WellCollection::addChild ( std::shared_ptr< WellsGroupInterface > &  child_node)

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

void Opm::WellCollection::addField ( GroupConstPtr  fieldGroup,
size_t  timeStep,
const PhaseUsage phaseUsage 
)
void Opm::WellCollection::addGroup ( GroupConstPtr  groupChild,
std::string  parent_name,
size_t  timeStep,
const PhaseUsage phaseUsage 
)
void Opm::WellCollection::addWell ( WellConstPtr  wellChild,
size_t  timeStep,
const PhaseUsage phaseUsage 
)
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.
void Opm::WellCollection::applyGroupControls ( )

Applies all group controls (injection and production)

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
void Opm::WellCollection::setWellsPointer ( Wells wells)

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


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