From 91ab0f4d93e8e321d8dc5c7a0e4dd1188045357e Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Thu, 21 Jan 2021 11:58:24 +0100 Subject: [PATCH] fix phase index for WELLPI for MSW --- opm/simulators/wells/MultisegmentWell.hpp | 1 + opm/simulators/wells/MultisegmentWell_impl.hpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/opm/simulators/wells/MultisegmentWell.hpp b/opm/simulators/wells/MultisegmentWell.hpp index 01b62c08f..96eea7ada 100644 --- a/opm/simulators/wells/MultisegmentWell.hpp +++ b/opm/simulators/wells/MultisegmentWell.hpp @@ -240,6 +240,7 @@ namespace Opm using Base::phaseUsage; using Base::name; using Base::flowPhaseToEbosCompIdx; + using Base::flowPhaseToEbosPhaseIdx; using Base::ebosCompIdxToFlowCompIdx; using Base::getAllowCrossFlow; using Base::scalingFactor; diff --git a/opm/simulators/wells/MultisegmentWell_impl.hpp b/opm/simulators/wells/MultisegmentWell_impl.hpp index 8fe543a8c..a1970d9cf 100644 --- a/opm/simulators/wells/MultisegmentWell_impl.hpp +++ b/opm/simulators/wells/MultisegmentWell_impl.hpp @@ -4336,7 +4336,7 @@ namespace Opm // the reciprocal FVF. const auto connMob = mobility[ flowPhaseToEbosCompIdx(p) ].value() - * fs.invB(p).value(); + * fs.invB(flowPhaseToEbosPhaseIdx(p)).value(); connPI[p] = connPICalc(connMob); } @@ -4393,6 +4393,6 @@ namespace Opm const auto zero = EvalWell { 0.0 }; const auto mt = std::accumulate(mobility.begin(), mobility.end(), zero); - connII[phase_pos] = connIICalc(mt.value() * fs.invB(phase_pos).value()); + connII[phase_pos] = connIICalc(mt.value() * fs.invB(flowPhaseToEbosPhaseIdx(phase_pos)).value()); } } // namespace Opm