Go to the source code of this file.
|
struct hybsys * | hybsys_allocate_symm (int max_nconn, int nc, int nconn_tot) |
|
struct hybsys * | hybsys_allocate_unsymm (int max_nconn, int nc, int nconn_tot) |
|
struct hybsys_well * | hybsys_well_allocate_symm (int max_nconn, int nc, int *cwpos) |
|
struct hybsys_well * | hybsys_well_allocate_unsymm (int max_nconn, int nc, int *cwpos) |
|
void | hybsys_free (struct hybsys *sys) |
|
void | hybsys_well_free (struct hybsys_well *wsys) |
|
void | hybsys_init (int max_nconn, struct hybsys *sys) |
|
void | hybsys_schur_comp_symm (int nc, const int *pconn, const double *Binv, struct hybsys *sys) |
|
void | hybsys_schur_comp_unsymm (int nc, const int *pconn, const double *Binv, const double *BIV, const double *P, struct hybsys *sys) |
|
void | hybsys_schur_comp_gen (int nc, const int *pconn, const double *Binv, const double *C2, const double *P, struct hybsys *sys) |
|
void | hybsys_well_schur_comp_symm (int nc, const int *cwpos, double *WI, struct hybsys *sys, struct hybsys_well *wsys) |
|
void | hybsys_cellcontrib_symm (int c, int nconn, int p1, int p2, const double *gpress, const double *src, const double *Binv, struct hybsys *sys) |
|
void | hybsys_cellcontrib_unsymm (int c, int nconn, int p1, int p2, const double *gpress, const double *src, const double *Binv, struct hybsys *sys) |
|
void | hybsys_well_cellcontrib_symm (int c, int ngconn, int p1, const int *cwpos, const double *WI, const double *wdp, struct hybsys *sys, struct hybsys_well *wsys) |
|
void | hybsys_compute_press_flux (int nc, const int *pconn, const int *conn, const double *gpress, const double *Binv, const struct hybsys *sys, const double *pi, double *press, double *flux, double *work) |
|
void | hybsys_compute_press_flux_well (int nc, const int *pgconn, int nf, int nw, const int *pwconn, const int *wconn, const double *Binv, const double *WI, const double *wdp, const struct hybsys *sys, const struct hybsys_well *wsys, const double *pi, double *cpress, double *cflux, double *wpress, double *wflux, double *work) |
|
struct hybsys* hybsys_allocate_symm |
( |
int |
max_nconn, |
|
|
int |
nc, |
|
|
int |
nconn_tot |
|
) |
| |
Allocate a hybrid system management structure suitable for discretising a symmetric (i.e., incompressible) flow problem on a grid model of given size.
- Parameters
-
[in] | max_nconn | Maximum number of single cell faces. |
[in] | nc | Total number of grid cells. |
[in] | nconn_tot | Aggregate number of cell faces for all cells. |
- Returns
- Fully formed hybrid system management structure if successful or
NULL in case of allocation failure.
struct hybsys* hybsys_allocate_unsymm |
( |
int |
max_nconn, |
|
|
int |
nc, |
|
|
int |
nconn_tot |
|
) |
| |
Allocate a hybrid system management structure suitable for discretising an unsymmetric (i.e., compressible) flow problem on a grid model of given size.
- Parameters
-
[in] | max_nconn | Maximum number of single cell faces. |
[in] | nc | Total number of grid cells. |
[in] | nconn_tot | Aggregate number of cell faces for all cells. |
- Returns
- Fully formed hybrid system management structure if successful or
NULL in case of allocation failure.
void hybsys_cellcontrib_symm |
( |
int |
c, |
|
|
int |
nconn, |
|
|
int |
p1, |
|
|
int |
p2, |
|
|
const double * |
gpress, |
|
|
const double * |
src, |
|
|
const double * |
Binv, |
|
|
struct hybsys * |
sys |
|
) |
| |
Compute final (symmetric) Schur complement contributions to global system of simultaneous linear equations.
This function forms the coefficient matrix
and similar right-hand side elemental contributions. These values must be subsequently assembled into the global system using function hybsys_global_assemble_cell() after imposing any applicable boundary conditions.
This function overwrites the fields S and r of the hybrid system structure.
- Parameters
-
[in] | c | Cell for which to compute local contributions. |
[in] | nconn | Number of connections (faces) of cell c . |
[in] | p1 | Start address (into gpress ) of the gravity contributions of cell c . |
[in] | p2 | Start address (into Binv ) of the inverse inner product of cell c . |
[in] | gpress | Gravity contributions of all cells. Must include effects of multiple phases if applicable. |
[in] | src | Explicit source terms for all cells. |
[in] | Binv | Inverse inner products for all cells. Must include effects of multiple phases if applicable. |
[in,out] | sys | Hybrid system management structure allocated using hybsys_allocate_symm() and initialised using hybsys_init() and/or filled using function hybsys_schur_comp_symm() and hybsys_well_schur_comp_symm() if applicable. |
void hybsys_cellcontrib_unsymm |
( |
int |
c, |
|
|
int |
nconn, |
|
|
int |
p1, |
|
|
int |
p2, |
|
|
const double * |
gpress, |
|
|
const double * |
src, |
|
|
const double * |
Binv, |
|
|
struct hybsys * |
sys |
|
) |
| |
Compute final (non-symmetric) Schur complement contributions to global system of simultaneous linear equations.
This function forms the coefficient matrix
and similar right-hand side elemental contributions. These values must be subsequently assembled into the global system using function hybsys_global_assemble_cell() after imposing any applicable boundary conditions.
This function overwrites the fields S and r of the hybrid system structure.
- Parameters
-
[in] | c | Cell for which to compute local contributions. |
[in] | nconn | Number of connections (faces) of cell c . |
[in] | p1 | Start address (into gpress ) of the gravity contributions of cell c . |
[in] | p2 | Start address (into Binv ) of the inverse inner product of cell c . |
[in] | gpress | Gravity contributions of all cells. Must include effects of multiple phases if applicable. |
[in] | src | Explicit source terms for all cells. |
[in] | Binv | Inverse inner products for all cells. Must include effects of multiple phases if applicable. |
[in,out] | sys | Hybrid system management structure allocated using hybsys_allocate_symm() and initialised using hybsys_init() and/or filled using functions hybsys_schur_comp_unsymm() or hybsys_schur_comp_gen(). |
void hybsys_compute_press_flux |
( |
int |
nc, |
|
|
const int * |
pconn, |
|
|
const int * |
conn, |
|
|
const double * |
gpress, |
|
|
const double * |
Binv, |
|
|
const struct hybsys * |
sys, |
|
|
const double * |
pi, |
|
|
double * |
press, |
|
|
double * |
flux, |
|
|
double * |
work |
|
) |
| |
void hybsys_compute_press_flux_well |
( |
int |
nc, |
|
|
const int * |
pgconn, |
|
|
int |
nf, |
|
|
int |
nw, |
|
|
const int * |
pwconn, |
|
|
const int * |
wconn, |
|
|
const double * |
Binv, |
|
|
const double * |
WI, |
|
|
const double * |
wdp, |
|
|
const struct hybsys * |
sys, |
|
|
const struct hybsys_well * |
wsys, |
|
|
const double * |
pi, |
|
|
double * |
cpress, |
|
|
double * |
cflux, |
|
|
double * |
wpress, |
|
|
double * |
wflux, |
|
|
double * |
work |
|
) |
| |
Recover well pressures (i.e., bottom-hole pressure values) and well connection (perforation) fluxes.
Specifically, this function performs the same role (i.e., back-substitution) for wells as function hybsys_compute_press_flux() does for grid cells and grid contacts (interfaces).
- Parameters
-
[in] | nc | Total number of grid cells. |
[in] | pgconn | Cell-to-face start pointers. |
[in] | nf | Total number of grid faces. |
[in] | nw | Total number of wells. |
[in] | pwconn | Cell-to-well start pointers. If nw > 0 , then this parameter must coincide with the cwpos array used in call to hybsys_well_schur_comp_symm(). |
[in] | wconn | Cell-to-well mapping. |
[in] | Binv | Inverse inner products for all cells. Must coincide with equally named parameter in calls to contribution functions such as hybsys_well_cellcontrib_symm(). |
[in] | WI | Peaceman well connection indices. Array of size pwconn[nc] . Must coincide with equally named parameter of contribution function hybsys_well_cellcontrib_symm(). |
[in] | wdp | Well connection gravity pressure adjustments. |
[in] | sys | Hybrid system management structure coinciding with equally named parameter in contribution functions such as hybsys_cellcontrib_symm() and hybsys_well_cellcontrib_symm(). |
[in] | wsys | Hybrid well-system management structure. Must coincide with equally named paramter of contribution function hybsys_well_cellcontrib_symm(). |
[in] | pi | Solution (interface/contact pressure and well BHPs) obtained from solving the global system . |
[in] | cpress | Cell pressures, , obtained from a previous call to function hybsys_compute_press_flux(). |
[in] | cflux | Outward fluxes, , obtained from a previous call to function hybsys_compute_press_flux(). |
[out] | wpress | Well (i.e., bottom-hole) pressures. Array of size nw . |
[out] | wflux | Well connection (perforation) fluxes. Array of size pwconn[nw] . |
[in,out] | work | Scratch array for storing intermediate results. Array of size at least . |
void hybsys_free |
( |
struct hybsys * |
sys | ) |
|
Dispose of memory resources previously obtained through one of the allocation functions, hybsys_allocate_symm() or hybsys_allocate_unsymm().
Following a call to hybsys_free(), the input pointer is no longer valid. hybsys_free(NULL) does nothing.
- Parameters
-
[in,out] | sys | Previously allocated hybrid system management structure (or NULL ). |
void hybsys_init |
( |
int |
max_nconn, |
|
|
struct hybsys * |
sys |
|
) |
| |
void hybsys_schur_comp_gen |
( |
int |
nc, |
|
|
const int * |
pconn, |
|
|
const double * |
Binv, |
|
|
const double * |
C2, |
|
|
const double * |
P, |
|
|
struct hybsys * |
sys |
|
) |
| |
Compute elemental (per-cell) contributions to unsymmetric Schur system of simultaneous linear equations.
This function assumes that the coefficient matrix of the hybrid system of linear equations is that of the introduction with no additional provisions. In other words, this function assumes that the coefficient matrix is of the form
This function fills the F1 , F2 and L fields of the management structure.
- Parameters
-
[in] | nc | Total number of grid cells. |
[in] | pconn | Cell-to-face start pointers. |
[in] | Binv | Inverse inner product results, usually computed using mim_ip_simple_all() and mim_ip_mobility_update(). |
[in] | C2 | Explicit representation of the matrix as a linear array. Assumed to only contain the (structurally) non-zero matrix elements (that correspond to the non-zero structure of ). |
[in] | P | Per cell compressible accumulation term. One scalar per cell. |
[in,out] | sys | Hybrid system management structure allocated using hybsys_allocate_symm() and initialised using hybsys_init(). |
void hybsys_schur_comp_symm |
( |
int |
nc, |
|
|
const int * |
pconn, |
|
|
const double * |
Binv, |
|
|
struct hybsys * |
sys |
|
) |
| |
Compute elemental (per-cell) contributions to symmetric Schur system of simultaneous linear equations.
This function assumes that the coefficient matrix of the hybrid system of linear equations is that of the introduction with the additional provision that and that . In other words, this function assumes that the coefficient matrix is of the form
This function fills the F1 and L fields of the management structure.
- Parameters
-
void hybsys_schur_comp_unsymm |
( |
int |
nc, |
|
|
const int * |
pconn, |
|
|
const double * |
Binv, |
|
|
const double * |
BIV, |
|
|
const double * |
P, |
|
|
struct hybsys * |
sys |
|
) |
| |
Compute elemental (per-cell) contributions to unsymmetric Schur system of simultaneous linear equations.
This function assumes that the coefficient matrix of the hybrid system of linear equations is that of the introduction with the additional provision that . In other words, this function assumes that the coefficient matrix is of the form
This matrix arises in the `` '' phase compressibility formulation of the compressible black-oil model. This function fills the F1 , F2 and L fields of the management structure.
- Parameters
-
[in] | nc | Total number of grid cells. |
[in] | pconn | Cell-to-face start pointers. |
[in] | Binv | Inverse inner product results, usually computed using mim_ip_simple_all() and mim_ip_mobility_update(). |
[in] | BIV | in which is the flux field of a previous time step or non-linear iteration. |
[in] | P | Per cell compressible accumulation term. One scalar per cell. |
[in,out] | sys | Hybrid system management structure allocated using hybsys_allocate_symm() and initialised using hybsys_init(). |
struct hybsys_well* hybsys_well_allocate_symm |
( |
int |
max_nconn, |
|
|
int |
nc, |
|
|
int * |
cwpos |
|
) |
| |
Allocate a hybrid system management structure suitable for discretising an incompressible (i.e., symmetric) well flow problem on a grid model of given size.
- Parameters
-
[in] | max_nconn | Maximum number of single cell faces. |
[in] | nc | Total number of grid cells. |
[in] | cwpos | Indirection array that defines each cell's connecting wells. Values typically computed using function derive_cell_wells(). |
- Returns
- Fully formed hybrid system management structure if successful or
NULL in case of allocation failure.
struct hybsys_well* hybsys_well_allocate_unsymm |
( |
int |
max_nconn, |
|
|
int |
nc, |
|
|
int * |
cwpos |
|
) |
| |
Allocate a hybrid system management structure suitable for discretising a compressible (i.e., unsymmetric) well flow problem on a grid model of given size.
- Parameters
-
[in] | max_nconn | Maximum number of single cell faces. |
[in] | nc | Total number of grid cells. |
[in] | cwpos | Indirection array that defines each cell's connecting wells. Values typically computed using function derive_cell_wells(). |
- Returns
- Fully formed hybrid system management structure if successful or
NULL in case of allocation failure.
void hybsys_well_cellcontrib_symm |
( |
int |
c, |
|
|
int |
ngconn, |
|
|
int |
p1, |
|
|
const int * |
cwpos, |
|
|
const double * |
WI, |
|
|
const double * |
wdp, |
|
|
struct hybsys * |
sys, |
|
|
struct hybsys_well * |
wsys |
|
) |
| |
Form elemental direct contributions to global system of simultaneous linear equations from cell<->well interactions.
Plays a role similar to function hybsys_cellcontrib_symm(), but for wells.
- Parameters
-
[in] | c | Cell for which to compute cell<->well Schur complement |
[in] | ngconn | Number of inter-cell connections (faces) of cell c . |
[in] | p1 | Start index (into sys->F1 ) of cell c . |
[in] | cwpos | Indirection array that defines each cell's connecting wells. Must coincide with equally named parameter of function hybsys_well_schur_comp_symm(). |
[in] | WI | Peaceman well connection indices. Array of size pwconn[nc] . Must coincide with equally named parameter of contribution function hybsys_well_schur_comp_symm(). |
[in] | wdp | Well connection gravity pressure adjustments. One scalar for each well connection in an array of size pwconn[nc] . |
[in,out] | sys | Hybrid system management structure filled using functions hybsys_schur_comp_unsymm() or hybsys_schur_comp_gen(). |
[in,out] | wsys | Hybrid well-system management structure filled using function hybsys_well_schur_comp_symm(). |
void hybsys_well_schur_comp_symm |
( |
int |
nc, |
|
|
const int * |
cwpos, |
|
|
double * |
WI, |
|
|
struct hybsys * |
sys, |
|
|
struct hybsys_well * |
wsys |
|
) |
| |
Compute elemental contributions to global, symmetric system of simultaneous linear equations from cell<->well connections.
Specifically, for a well w intersecting a cell c , this function computes the elemental contributions
and
and incorporates the contributions into the global system quantities as appropriate.
This function modifies sys->L and wsys->F1 .
- Parameters
-
[in] | nc | Total number of grid cells. |
[in] | cwpos | Indirection array that defines each cell's connecting wells. Values typically computed using function derive_cell_wells(). |
[in] | WI | Peaceman well connection indices. Array of size cwpos[nc] . Must incorporate effects of multiple phases (i.e., total mobility) if applicable. |
[in,out] | sys | Hybrid system management structure allocated using hybsys_allocate_symm() and initialised using hybsys_init() and/or filled using function hybsys_schur_comp_symm(). |
[in,out] | wsys | Hybrid well-system management structure obtained from function hybsys_well_allocate_symm(). |
|