This class manages a Wells struct in the sense that it encapsulates creation and destruction of the wells data structure. More...
#include <WellsManager.hpp>
Public Member Functions | |
WellsManager () | |
Default constructor – no wells. More... | |
WellsManager (struct Wells *W) | |
Construct from existing wells object. More... | |
template<class F2C , class FC > | |
WellsManager (const Opm::EclipseState &eclipseState, const size_t timeStep, int num_cells, const int *global_cell, const int *cart_dims, int dimensions, const F2C &f2c, FC begin_face_centroids, const DynamicListEconLimited &list_econ_limited, bool is_parallel_run=false, const std::unordered_set< std::string > &deactivated_wells=std::unordered_set< std::string >()) | |
Construct from input deck and grid. More... | |
WellsManager (const Opm::EclipseState &eclipseState, const size_t timeStep, const UnstructuredGrid &grid) | |
Construct wells from deck. | |
~WellsManager () | |
Destructor. | |
bool | empty () const |
Does the "deck" define any wells? | |
const Wells * | c_wells () const |
Access the managed Wells. More... | |
const WellCollection & | wellCollection () const |
Access the well group hierarchy. | |
WellCollection & | wellCollection () |
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 | applyExplicitReinjectionControls (const std::vector< double > &well_reservoirrates_phase, const std::vector< double > &well_surfacerates_phase) |
Applies explicit reinjection controls. More... | |
template<class C2F , class FC > | |
WellsManager (const Opm::EclipseState &eclipseState, const size_t timeStep, int number_of_cells, const int *global_cell, const int *cart_dims, int dimensions, const C2F &cell_to_faces, FC begin_face_centroids, const DynamicListEconLimited &list_econ_limited, bool is_parallel_run, const std::unordered_set< std::string > &deactivated_wells) | |
This class manages a Wells struct in the sense that it encapsulates creation and destruction of the wells data structure.
The resulting Wells is available through the c_wells() method.
Opm::WellsManager::WellsManager | ( | ) |
Default constructor – no wells.
Default constructor.
|
explicit |
Construct from existing wells object.
WellsManager is not properly initialised in the sense that the logic to manage control switching does not exist.
[in] | W | Existing wells object. |
Opm::WellsManager::WellsManager | ( | const Opm::EclipseState & | eclipseState, |
const size_t | timeStep, | ||
int | num_cells, | ||
const int * | global_cell, | ||
const int * | cart_dims, | ||
int | dimensions, | ||
const F2C & | f2c, | ||
FC | begin_face_centroids, | ||
const DynamicListEconLimited & | list_econ_limited, | ||
bool | is_parallel_run = false , |
||
const std::unordered_set< std::string > & | deactivated_wells = std::unordered_set< std::string >() |
||
) |
Construct from input deck and grid.
The permeability argument may be zero if the input contain well productivity indices, otherwise it must be given in order to approximate these by the Peaceman formula.
deactivated_wells | A set of wells that should be treated like shut wells. E.g. in a a parallel run these would be the wells handeled by another process. Defaults to empty set. |
void Opm::WellsManager::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.
[in] | well_reservoirrates_phase | A 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_phase | A 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. |
const Wells * Opm::WellsManager::c_wells | ( | ) | const |
Access the managed Wells.
The method is named similarly to c_str() in std::string, to make it clear that we are returning a C-compatible struct.
bool Opm::WellsManager::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
[in] | well_bhp | A vector containing the bhp for each well. Is assumed to be ordered the same way as the related Wells-struct. |
[in] | well_reservoirrates_phase | A 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_phase | A 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. |