From 7dbb9b50e1a11c8a8a755a1ef4c22792d74a96f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Atgeirr=20Fl=C3=B8=20Rasmussen?= Date: Wed, 15 May 2013 09:23:15 +0200 Subject: [PATCH] Work in progress on adding wells. --- ImpesTPFAAD.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ImpesTPFAAD.hpp b/ImpesTPFAAD.hpp index eac025d7e..08922d5ec 100644 --- a/ImpesTPFAAD.hpp +++ b/ImpesTPFAAD.hpp @@ -346,8 +346,10 @@ namespace Opm { const V delta_t = dt * V::Ones(nc, 1); const V transi = subset(geo_.transmissibility(), ops_.internal_faces); + const int num_perf = wells_.well_connpos[nw]; const std::vector well_cells(wells_.well_cells, - wells_.well_cells + wells_.well_connpos[nw]); + wells_.well_cells + num_perf); + const V transw = Eigen::Map(wells_.WI, num_perf, 1); // Initialize AD variables: p (cell pressures) and bhp (well bhp). const V p0 = Eigen::Map(&state.pressure()[0], nc, 1); @@ -380,6 +382,8 @@ namespace Opm { // Finally construct well perforation pressures. const ADB p_perfwell = well_to_perf*bhp + well_perf_dp; + // const ADB nkgradp_well = transw * (p_perfcell - p_perfwell); + cell_residual_ = ADB::constant(pv, bpat); for (int phase = 0; phase < np; ++phase) { const ADB cell_B = pdepfdata_.fvf(phase, p);