From d26a9ee4c84c3cc7b6e0337c1cc27cee8096467c Mon Sep 17 00:00:00 2001 From: Ove Saevareid Date: Tue, 24 Apr 2012 12:51:24 +0200 Subject: [PATCH] Bugfix: want non-negative cell index --- opm/core/pressure/tpfa/cfs_tpfa.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opm/core/pressure/tpfa/cfs_tpfa.c b/opm/core/pressure/tpfa/cfs_tpfa.c index ea2ed01a..49502801 100644 --- a/opm/core/pressure/tpfa/cfs_tpfa.c +++ b/opm/core/pressure/tpfa/cfs_tpfa.c @@ -903,10 +903,10 @@ compute_flux(struct UnstructuredGrid *G, } if (c1 < 0) { - dp = bc->value[ i ] - cpress[c1]; + dp = bc->value[ i ] - cpress[c2]; } else { - dp = cpress[c2] - bc->value[ i ]; + dp = cpress[c1] - bc->value[ i ]; } fflux[f] = trans[f] * (t*dp + g);