From dcaac93e23e1a4d308b63b7a353057820ce4d173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Fri, 4 Oct 2013 13:16:02 +0200 Subject: [PATCH] Remove unneeded term, fixing oil injecting behaviour. The 'comp_term' is supposed to be a total divergence term, which is supposed to be zero for incompressible flow. It was added for improved robustness in stagnant areas, but as implemented it would not be computed properly for oil injection scenarios, due to the convention for two-phase transport source terms (positive terms are inflow of first phase [water], negative terms are total outflow). --- .../transport/reorder/TransportSolverTwophaseReorder.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/opm/core/transport/reorder/TransportSolverTwophaseReorder.cpp b/opm/core/transport/reorder/TransportSolverTwophaseReorder.cpp index e85f89c23..a013a2b24 100644 --- a/opm/core/transport/reorder/TransportSolverTwophaseReorder.cpp +++ b/opm/core/transport/reorder/TransportSolverTwophaseReorder.cpp @@ -145,15 +145,17 @@ namespace Opm explicit Residual(const TransportSolverTwophaseReorder& tmodel, int cell_index) : tm(tmodel) { + // Initialize [in|out]flux to include effect of transport source terms. cell = cell_index; s0 = tm.saturation_[cell]; double src_flux = -tm.source_[cell]; bool src_is_inflow = src_flux < 0.0; influx = src_is_inflow ? src_flux : 0.0; outflux = !src_is_inflow ? src_flux : 0.0; - comp_term = tm.source_[cell]; // Note: this assumes that all source flux is water. dtpv = tm.dt_/tm.porevolume_[cell]; + // Compute fluxes over interior edges. Boundary flow is supposed to be + // included in the transport source term, along with well sources. for (int i = tm.grid_.cell_facepos[cell]; i < tm.grid_.cell_facepos[cell+1]; ++i) { int f = tm.grid_.cell_faces[i]; double flux; @@ -173,13 +175,13 @@ namespace Opm } else { outflux += flux; } - comp_term -= flux; } } + } double operator()(double s) const { - return s - s0 + dtpv*(outflux*tm.fracFlow(s, cell) + influx + s*comp_term); + return s - s0 + dtpv*(outflux*tm.fracFlow(s, cell) + influx); } };