From 1d4af250acba160c1c08890ee49bf46c03859975 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Sun, 26 May 2013 09:52:58 +0200 Subject: [PATCH] Add well contributions to mass balance residuals. --- opm/autodiff/FullyImplicitBlackoilSolver.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/opm/autodiff/FullyImplicitBlackoilSolver.cpp b/opm/autodiff/FullyImplicitBlackoilSolver.cpp index f60d53617..cd6548614 100644 --- a/opm/autodiff/FullyImplicitBlackoilSolver.cpp +++ b/opm/autodiff/FullyImplicitBlackoilSolver.cpp @@ -490,6 +490,9 @@ namespace Opm { const ADB perf_flux = perf_mob * (nkgradp_well); // No gravity term for perforations. const ADB well_rates = wops_.p2w * (perf_flux*perf_b); qs = qs + superset(well_rates, Span(nw, 1, phase*nw), nw*np); + + const ADB well_contrib = superset(perf_flux*perf_b, well_cells, nc); + residual_.mass_balance[phase] += well_contrib; } // Handling BHP and SURFACE_RATE wells. V bhp_targets(nw);