Main OPM-Core well data structure along with functions to create, populate and destroy it. More...
Go to the source code of this file.
Classes | |
struct | Wells |
Data structure aggregating static information about all wells in a scenario. More... | |
struct | CompletionData |
Data structure aggregating dynamic information about all wells in a scenario. More... | |
Enumerations | |
enum | WellType { INJECTOR, PRODUCER } |
Well type indicates desired/expected well behaviour. More... | |
Functions | |
struct Wells * | create_wells (int nphases, int nwells, int nperf) |
Construct a Wells object initially capable of managing a given number of wells and total number of well connections (perforations). More... | |
int | add_well (enum WellType type, double depth_ref, int nperf, const double *comp_frac, const int *cells, const double *WI, const int *sat_table_id, const char *name, int allow_cf, struct Wells *W) |
Append a new well to an existing Wells object. More... | |
int | append_well_controls (enum WellControlType type, double target, double alq, int vfp, const double *distr, int well_index, struct Wells *W) |
Append operational constraint to an existing well. More... | |
void | set_current_control (int well_index, int current_control, struct Wells *W) |
Set the current/active control for a single well. More... | |
void | clear_well_controls (int well_index, struct Wells *W) |
Clear all controls from a single well. More... | |
void | destroy_wells (struct Wells *W) |
Wells object destructor. More... | |
struct Wells * | clone_wells (const struct Wells *W) |
Create a deep-copy (i.e., clone) of an existing Wells object, including its controls. More... | |
bool | wells_equal (const struct Wells *W1, const struct Wells *W2, bool verbose) |
Compare well structures for equality. More... | |
Main OPM-Core well data structure along with functions to create, populate and destroy it.
enum WellType |
int add_well | ( | enum WellType | type, |
double | depth_ref, | ||
int | nperf, | ||
const double * | comp_frac, | ||
const int * | cells, | ||
const double * | WI, | ||
const int * | sat_table_id, | ||
const char * | name, | ||
int | allow_cf, | ||
struct Wells * | W | ||
) |
Append a new well to an existing Wells object.
Increments W->number_of_wells by one if successful. The new well does not include operational constraints. Such information is specified using function append_well_controls(). The current control index is set to -1 (invalid).
[in] | type | Type of well. |
[in] | depth_ref | Reference depth for well's BHP. |
[in] | nperf | Number of perforations. |
[in] | comp_frac | Injection fraction array (size equal to W->number_of_phases) or NULL. |
[in] | cells | Grid cells in which well is perforated. Should ideally be track ordered. |
[in] | WI | Well production index per perforation, or NULL. |
[in] | name | Name of new well. NULL if no name. |
[in] | allow_cf | Flag to determine whether crossflow is allowed or not. |
[in,out] | W | Existing set of wells to which new well will be added. |
int append_well_controls | ( | enum WellControlType | type, |
double | target, | ||
double | alq, | ||
int | vfp, | ||
const double * | distr, | ||
int | well_index, | ||
struct Wells * | W | ||
) |
Append operational constraint to an existing well.
Increments ctrl->num by one if successful. Introducing a new operational constraint does not affect the well's notion of the currently active constraint represented by ctrl->current. Note that *_RATE controls now require a phase distribution array to be associated with the control, see WellControls.
[in] | type | Control type. |
[in] | target | Target value for the control. |
[in] | alq | Artificial lift quantity for control (for THP type only) |
[in] | vfp | VFP table number for control (for THP type only) |
[in] | distr | Array of size W->number_of_phases or NULL. |
[in] | well_index | Index of well to receive additional control. |
[in,out] | W | Existing set of well controls. |
void clear_well_controls | ( | int | well_index, |
struct Wells * | W | ||
) |
Clear all controls from a single well.
Does not affect the control set capacity.
[in] | well_index | Identity of particular well. Must be in [0 .. number_of_wells - 1] |
[in,out] | W | Existing set of wells. |
Create a deep-copy (i.e., clone) of an existing Wells object, including its controls.
[in] | W | Existing Wells object. |
NULL
in case of allocation failure. struct Wells* create_wells | ( | int | nphases, |
int | nwells, | ||
int | nperf | ||
) |
Construct a Wells object initially capable of managing a given number of wells and total number of well connections (perforations).
Function add_well() is used to populate the Wells object. No reallocation occurs in function add_well() as long as the initially indicated capacities are sufficient. Call function destroy_wells() to dispose of the Wells object and its allocated memory resources.
[in] | nphases | Number of active phases in simulation scenario. |
[in] | nwells | Expected number of wells in simulation scenario. Pass zero if the total number of wells is unknown. |
[in] | nperf | Expected total number of well connections (perforations) for all wells in simulation scenario. Pass zero if the total number of well connections is unknown. |
void destroy_wells | ( | struct Wells * | W | ) |
Wells object destructor.
Disposes of all resources managed by the Wells object.
The Wells object must be built using function create_wells() and subsequently populated using function add_well().
void set_current_control | ( | int | well_index, |
int | current_control, | ||
struct Wells * | W | ||
) |
Set the current/active control for a single well.
The new control ID must refer to a previously defined control mode. Total number of defined control modes available through function well_controls_get_num().
[in] | well_index | Identity of particular well. Must be in [0 .. number_of_wells - 1] |
[in] | current_control | Index of new control mode. |
[in,out] | W | Existing set of wells. |
Compare well structures for equality.
Two sets of wells are equal if all of the following conditions hold
NULL
).[in] | W1 | Existing set of wells. |
[in] | W2 | Existing set of wells. |
[in] | verbose | Flag for whether or not to report which conditions do not hold. Use verbose = true stdout . |
W1
and W2
represent the same set of wells.