mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Factor pressure (increment) assignment out of _press_flux().
The linear solution h->x is the pressure increment, not the actual pressure value, so we cannot compute fluxes based on h->x alone.
This commit is contained in:
parent
d085ddb314
commit
c3036166a9
@ -992,34 +992,48 @@ cfs_tpfa_assemble(grid_t *G,
|
|||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
void
|
void
|
||||||
cfs_tpfa_press_flux(grid_t *G,
|
cfs_tpfa_press_increment(grid_t *G,
|
||||||
flowbc_t *bc,
|
well_t *W,
|
||||||
well_t *W,
|
struct cfs_tpfa_data *h,
|
||||||
int np,
|
double *cpress_inc,
|
||||||
const double *trans,
|
double *wpress_inc)
|
||||||
const double *pmobf,
|
|
||||||
const double *gravcap_f,
|
|
||||||
struct completion_data *wdata,
|
|
||||||
struct cfs_tpfa_data *h,
|
|
||||||
double *cpress,
|
|
||||||
double *fflux,
|
|
||||||
double *wpress,
|
|
||||||
double *wflux)
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
{
|
{
|
||||||
/* Assign cell pressure directly from solution vector */
|
/* Assign cell pressure directly from solution vector */
|
||||||
memcpy(cpress, h->x, G->number_of_cells * sizeof *cpress);
|
memcpy(cpress_inc, h->x, G->number_of_cells * sizeof *cpress_inc);
|
||||||
|
|
||||||
|
if (W != NULL) {
|
||||||
|
assert (wpress_inc != NULL);
|
||||||
|
|
||||||
|
/* Assign well BHP directly from solution vector */
|
||||||
|
memcpy(wpress_inc, h->x + G->number_of_cells,
|
||||||
|
W->number_of_wells * sizeof *wpress_inc);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
void
|
||||||
|
cfs_tpfa_flux(grid_t *G,
|
||||||
|
flowbc_t *bc,
|
||||||
|
well_t *W,
|
||||||
|
int np,
|
||||||
|
const double *trans,
|
||||||
|
const double *pmobf,
|
||||||
|
const double *gravcap_f,
|
||||||
|
const double *cpress,
|
||||||
|
const double *wpress,
|
||||||
|
struct completion_data *wdata,
|
||||||
|
double *fflux,
|
||||||
|
double *wflux)
|
||||||
|
/* ---------------------------------------------------------------------- */
|
||||||
|
{
|
||||||
compute_flux(G, bc, np, trans, pmobf, gravcap_f, cpress, fflux);
|
compute_flux(G, bc, np, trans, pmobf, gravcap_f, cpress, fflux);
|
||||||
|
|
||||||
if ((W != NULL) && (wdata != NULL)) {
|
if ((W != NULL) && (wdata != NULL)) {
|
||||||
assert (wpress != NULL);
|
assert (wpress != NULL);
|
||||||
assert (wflux != NULL);
|
assert (wflux != NULL);
|
||||||
|
|
||||||
/* Assign well BHP directly from solution vector */
|
|
||||||
memcpy(wpress, h->x + G->number_of_cells,
|
|
||||||
W->number_of_wells * sizeof *wpress);
|
|
||||||
|
|
||||||
compute_wflux(W, np, wdata, cpress, wpress, wflux);
|
compute_wflux(W, np, wdata, cpress, wpress, wflux);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -60,19 +60,25 @@ cfs_tpfa_assemble(grid_t *G,
|
|||||||
struct cfs_tpfa_data *h);
|
struct cfs_tpfa_data *h);
|
||||||
|
|
||||||
void
|
void
|
||||||
cfs_tpfa_press_flux(grid_t *G,
|
cfs_tpfa_press_increment(grid_t *G,
|
||||||
flowbc_t *bc,
|
well_t *W,
|
||||||
well_t *W,
|
struct cfs_tpfa_data *h,
|
||||||
int np,
|
double *cpress_inc,
|
||||||
const double *trans,
|
double *wpress_inc);
|
||||||
const double *pmobf,
|
|
||||||
const double *gravcap_f,
|
void
|
||||||
struct completion_data *wdata,
|
cfs_tpfa_flux(grid_t *G,
|
||||||
struct cfs_tpfa_data *h,
|
flowbc_t *bc,
|
||||||
double *cpress,
|
well_t *W,
|
||||||
double *fflux,
|
int np,
|
||||||
double *wpress,
|
const double *trans,
|
||||||
double *wflux);
|
const double *pmobf,
|
||||||
|
const double *gravcap_f,
|
||||||
|
const double *cpress,
|
||||||
|
const double *wpress,
|
||||||
|
struct completion_data *wdata,
|
||||||
|
double *fflux,
|
||||||
|
double *wflux);
|
||||||
|
|
||||||
void
|
void
|
||||||
cfs_tpfa_fpress(grid_t *G,
|
cfs_tpfa_fpress(grid_t *G,
|
||||||
|
Loading…
Reference in New Issue
Block a user