From a905eade7a32b73ed816875a9d2019f78e79c8b5 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Fri, 4 Apr 2014 11:33:36 +0200 Subject: [PATCH] Use preferred phase to compute wellbore mix for dead wells The wellmore mix is set to preferred phase for dead wells, where the total volumetric rates are zero. This sets the phase of the flow out of perforations in dead wells and thus avoids zero volumerats for injecting preforations in dead wells. --- opm/autodiff/FullyImplicitBlackoilSolver.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/opm/autodiff/FullyImplicitBlackoilSolver.cpp b/opm/autodiff/FullyImplicitBlackoilSolver.cpp index e2a1cab13..873148629 100644 --- a/opm/autodiff/FullyImplicitBlackoilSolver.cpp +++ b/opm/autodiff/FullyImplicitBlackoilSolver.cpp @@ -792,9 +792,11 @@ namespace { isNotDeadWells[c] = 0; } // compute wellbore mixture at std conds + Selector notDeadWells_selector(wbqt.value(),Selector::Zero); std::vector mix_s(np, ADB::null()); for (int phase = 0; phase < np; ++phase) { - mix_s[phase] = isNotDeadWells * wbq[phase]/wbqt; + const int pos = pu.phase_pos[phase]; + mix_s[phase] = notDeadWells_selector.select(ADB::constant(compi.col(pos), state.bhp.blockPattern()),wbq[phase]/wbqt); } @@ -832,7 +834,7 @@ namespace { const int oilpos = pu.phase_pos[Oil]; tmp = tmp - subset(state.rs,well_cells) * cmix_s[oilpos] / d; } - volRat += tmp / subset(rq_[phase].b,well_cells); + volRat += tmp / subset(rq_[phase].b,well_cells); }