Routines to assist mimetic discretisations of the flow equation. More...
Go to the source code of this file.
Functions | |
void | mim_ip_span_nullspace (int nf, int nconn, int d, double *C, double *A, double *X, double *work, int lwork) |
Form linear operator to span the null space of the normal vectors of a grid cell. More... | |
void | mim_ip_linpress_exact (int nf, int nconn, int d, double vol, double *K, double *N, double *Binv, double *work, int lwork) |
Form (inverse) mimetic inner product that reproduces linear pressure drops (constant velocity) on general polyhedral cells. More... | |
void | mim_ip_simple (int nf, int nconn, int d, double v, double *K, double *C, double *A, double *N, double *Binv, double *work, int lwork) |
Convenience wrapper around the function pair mim_ip_span_nullspace() and mim_ip_linpress_exact(). More... | |
void | mim_ip_simple_all (int ncells, int d, int max_ncf, int *pconn, int *conn, int *fneighbour, double *fcentroid, double *fnormal, double *farea, double *ccentroid, double *cvol, double *perm, double *Binv) |
Compute the mimetic inner products given a grid and cell-wise permeability tensors. More... | |
void | mim_ip_compute_gpress (int nc, int d, const double *grav, const int *pconn, const int *conn, const double *fcentroid, const double *ccentroid, double *gpress) |
Compute local, static gravity pressure contributions to Darcy flow equation discretised using a mimetic finite-difference method. More... | |
void | mim_ip_mobility_update (int nc, const int *pconn, const double *totmob, const double *Binv0, double *Binv) |
Incorporate effects of multiple phases in mimetic discretisation of flow equations. More... | |
void | mim_ip_density_update (int nc, const int *pconn, const double *omega, const double *gpress0, double *gpress) |
Incorporate effects of multiple fluid phases into existing, local, static mimetic discretisations of gravity pressure. More... | |
Routines to assist mimetic discretisations of the flow equation.
void mim_ip_compute_gpress | ( | int | nc, |
int | d, | ||
const double * | grav, | ||
const int * | pconn, | ||
const int * | conn, | ||
const double * | fcentroid, | ||
const double * | ccentroid, | ||
double * | gpress | ||
) |
Compute local, static gravity pressure contributions to Darcy flow equation discretised using a mimetic finite-difference method.
The pressure contribution of local face in cell
is
[in] | nc | Number of cells. |
[in] | d | Number of physcial dimensions. |
[in] | grav | Gravity vector. Array of size d . |
[in] | pconn | Start pointers of cell-to-face topology mapping. |
[in] | conn | Actual cell-to-face topology mapping. |
[in] | fcentroid | Face centroids. |
[in] | ccentroid | Cell centroids. |
[out] | gpress | Gravity pressure result. Array of size at least pconn[nc] . |
void mim_ip_density_update | ( | int | nc, |
const int * | pconn, | ||
const double * | omega, | ||
const double * | gpress0, | ||
double * | gpress | ||
) |
Incorporate effects of multiple fluid phases into existing, local, static mimetic discretisations of gravity pressure.
Specifically, update the result of mim_ip_compute_gpress() according to the rule
in which and
denotes the result of function mim_ip_compute_gpress().
[in] | nc | Number of cells. |
[in] | pconn | Start pointers of cell-to-face topology mapping. |
[in] | omega | Sum of phase densities weighted by fractional flow. |
[in] | gpress0 | Result of mim_ip_compute_gpress(). |
[out] | gpress | Gravity pressure incorporating effects of multiple fluid phases. |
void mim_ip_linpress_exact | ( | int | nf, |
int | nconn, | ||
int | d, | ||
double | vol, | ||
double * | K, | ||
double * | N, | ||
double * | Binv, | ||
double * | work, | ||
int | lwork | ||
) |
Form (inverse) mimetic inner product that reproduces linear pressure drops (constant velocity) on general polyhedral cells.
Specifically
in which is the trace of
and
is the result of function mim_ip_span_nullspace().
[in] | nf | Number of faces connected to single grid cell. |
[in] | nconn | Total number of grid cell connections. Typically equal to nf . |
[in] | d | Number of physical dimensions. Assumed less than four. |
[in] | vol | Cell volume. |
[in] | K | Permeability. A ![]() |
[in] | N | Normal vectors. An ![]() |
[in,out] | Binv | Inverse inner product result. An ![]() ![]() ![]() |
[in,out] | work | Scratch array of size at least nf * d . |
[in] | lwork | Actual size of scratch array. |
void mim_ip_mobility_update | ( | int | nc, |
const int * | pconn, | ||
const double * | totmob, | ||
const double * | Binv0, | ||
double * | Binv | ||
) |
Incorporate effects of multiple phases in mimetic discretisation of flow equations.
Specifically, update the (inverse) inner products previously computed using function mim_ip_linpress_exact() according to the rule
in which denotes the result of mim_ip_linpress_exact() for cell
and
denotes the total mobility of cell
.
[in] | nc | Number of cells. |
[in] | pconn | Start pointers of cell-to-face topology mapping. |
[in] | totmob | Total mobility for all cells. Array of size nc . |
[in] | Binv0 | Inverse inner product results for all cells. |
[out] | Binv | Inverse inner product results incorporating effects of multiple fluid phases. |
void mim_ip_simple | ( | int | nf, |
int | nconn, | ||
int | d, | ||
double | v, | ||
double * | K, | ||
double * | C, | ||
double * | A, | ||
double * | N, | ||
double * | Binv, | ||
double * | work, | ||
int | lwork | ||
) |
Convenience wrapper around the function pair mim_ip_span_nullspace() and mim_ip_linpress_exact().
[in] | nf | Number of faces connected to single grid cell. |
[in] | nconn | Total number of grid cell connections. Typically equal to nf . |
[in] | d | Number of physical dimensions. Assumed less than four. |
[in] | v | Cell volume. |
[in] | K | Permeability. A ![]() |
[in,out] | C | Centroid vectors. Specifically, ![]() ![]() |
[in] | A | Interface areas. |
[in] | N | Outward normal vectors. An ![]() |
[out] | Binv | Inverse inner product result. An ![]() ![]() ![]() |
[in,out] | work | Scratch array of size at least nf * d . |
[in] | lwork | Actual size of scratch array. |
void mim_ip_simple_all | ( | int | ncells, |
int | d, | ||
int | max_ncf, | ||
int * | pconn, | ||
int * | conn, | ||
int * | fneighbour, | ||
double * | fcentroid, | ||
double * | fnormal, | ||
double * | farea, | ||
double * | ccentroid, | ||
double * | cvol, | ||
double * | perm, | ||
double * | Binv | ||
) |
Compute the mimetic inner products given a grid and cell-wise permeability tensors.
This function applies mim_ip_simple() to all specified cells.
[in] | ncells | Number of cells. |
[in] | d | Number of physical dimensions. |
[in] | max_ncf | Maximum number of connections (faces) of any individual cell. |
[in] | pconn | Start pointers of cell-to-face topology mapping. |
[in] | conn | Actual cell-to-face topology mapping. |
[in] | fneighbour | Face-to-cell mapping. |
[in] | fcentroid | Face centroids. |
[in] | fnormal | Face normals. |
[in] | farea | Face areas. |
[in] | ccentroid | Cell centroids. |
[in] | cvol | Cell volumes. |
[in] | perm | Cell permeability. |
[out] | Binv | Inverse inner product result. Must point to an array of size at least ![]() ![]() ![]() |
void mim_ip_span_nullspace | ( | int | nf, |
int | nconn, | ||
int | d, | ||
double * | C, | ||
double * | A, | ||
double * | X, | ||
double * | work, | ||
int | lwork | ||
) |
Form linear operator to span the null space of the normal vectors of a grid cell.
Specifically,
in which denotes an orthonormal basis for the colum space (range) of the matrix
, represented as a matrix.
[in] | nf | Number of faces connected to single grid cell. |
[in] | nconn | Total number of grid cell connections. Typically equal to nf . |
[in] | d | Number of physical dimensions. Assumed less than four. |
[in,out] | C | Centroid vectors. Specifically, ![]() ![]() |
[in] | A | Interface areas. |
[out] | X | Null space linear operator. Array of size ![]() ![]() |
[out] | work | Scratch array of size at least nconn . |
[in] | lwork | Actual size of scratch array. |