From f466ae6a51490adc90e71102dee2185d12aac3bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?B=C3=A5rd=20Skaflestad?= Date: Thu, 1 Nov 2012 13:34:27 +0100 Subject: [PATCH] Account for gravity in well connection flux calculation We previously ignored effects of gravity in the calculation of the well connection fluxes (i.e., perforation fluxes). This commit includes those effects where appropriate. --- opm/core/pressure/tpfa/cfs_tpfa_residual.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/opm/core/pressure/tpfa/cfs_tpfa_residual.c b/opm/core/pressure/tpfa/cfs_tpfa_residual.c index 02c6d254..cb3d8173 100644 --- a/opm/core/pressure/tpfa/cfs_tpfa_residual.c +++ b/opm/core/pressure/tpfa/cfs_tpfa_residual.c @@ -1090,7 +1090,7 @@ compute_wflux(int np , { int w, c, i, p; double pw, dp, t; - const double *pmob; + const double *pmob, *wdp; struct Wells *W; struct CompletionData *cdata; @@ -1101,13 +1101,14 @@ compute_wflux(int np , W = wells->W; cdata = wells->data; + wdp = cdata->wdp; for (w = i = 0; w < W->number_of_wells; w++) { pw = wpress[w]; for (; i < W->well_connpos[w + 1]; i++) { c = W->well_cells[ i ]; - dp = pw - cpress[c]; + dp = pw + wdp[ i ] - cpress[c]; if (dp > 0) { pmob = cdata->phasemob + (i * np); } /* w->c */ else { pmob = pmobc + (c * np); } /* c->w */