From e2e5ef8cafba0b786a1e4a7b9f024a098439230c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Mon, 18 Apr 2011 13:51:54 +0200 Subject: [PATCH] Bugfix in impes transport for well perforations, function signature change. --- src/cfs_tpfa.c | 21 +++++++++++---------- src/cfs_tpfa.h | 15 ++++++++------- 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/cfs_tpfa.c b/src/cfs_tpfa.c index 80e75fcb4..4d83e1d0a 100644 --- a/src/cfs_tpfa.c +++ b/src/cfs_tpfa.c @@ -1198,13 +1198,14 @@ cfs_tpfa_impes_maxtime(grid_t *G, /* ---------------------------------------------------------------------- */ void -cfs_tpfa_expl_mass_transport(grid_t *G, - well_t *W, - int np, - double dt, - const double *porevol, - struct cfs_tpfa_data *h, - double *surf_vol) +cfs_tpfa_expl_mass_transport(grid_t *G, + well_t *W, + struct completion_data *wdata, + int np, + double dt, + const double *porevol, + struct cfs_tpfa_data *h, + double *surf_vol) /* ---------------------------------------------------------------------- */ { int c, i, f, c2, p, w; @@ -1251,10 +1252,10 @@ cfs_tpfa_expl_mass_transport(grid_t *G, for (w = i = 0; w < W->number_of_wells; w++) { for (; i < W->well_connpos[w + 1]; i++) { c = W->well_cells[i]; - /* Get pressure difference between cell and well perforation */ - dp = wpress[i] - cpress[c]; + /* Get difference between cell pressure and well bhp */ + dp = wpress[w] - cpress[c]; for (p = 0; p < np; p++) { - dz = masstrans_p[i*np + p]* dp; + dz = masstrans_p[i*np + p] * (dp + wdata->gpot[i*np + p]); /* A positive dz means flow from the well perforation i into the cell c */ surf_vol[c*np + p] += dz * dt / porevol[c]; diff --git a/src/cfs_tpfa.h b/src/cfs_tpfa.h index 1c39bb0b8..610870e9a 100644 --- a/src/cfs_tpfa.h +++ b/src/cfs_tpfa.h @@ -108,13 +108,14 @@ cfs_tpfa_impes_maxtime(grid_t *G, const double *gravity); void -cfs_tpfa_expl_mass_transport(grid_t *G, - well_t *W, - int np, - double dt, - const double *porevol, - struct cfs_tpfa_data *h, - double *surf_vol); +cfs_tpfa_expl_mass_transport(grid_t *G, + well_t *W, + struct completion_data *wdata, + int np, + double dt, + const double *porevol, + struct cfs_tpfa_data *h, + double *surf_vol); void cfs_tpfa_destroy(struct cfs_tpfa_data *h);