From dbcfb7af24295d9e998aff300c2406e1e6542ed2 Mon Sep 17 00:00:00 2001 From: Tor Harald Sandve Date: Fri, 7 Sep 2018 09:09:03 +0200 Subject: [PATCH] Return modified ntg's only when minpv mode is OPMFIL --- ebos/ecltransmissibility.hh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/ebos/ecltransmissibility.hh b/ebos/ecltransmissibility.hh index a3ca2c9a3..9b11f61ca 100644 --- a/ebos/ecltransmissibility.hh +++ b/ebos/ecltransmissibility.hh @@ -567,22 +567,29 @@ private: void minPvFillNtg_(std::vector& averageNtg) const { + // compute volume weighted arithmetic average of NTG for // cells merged as an result of minpv. const auto& eclState = vanguard_.eclState(); const auto& eclGrid = eclState.getInputGrid(); - const auto& porv = eclState.get3DProperties().getDoubleGridProperty("PORV").getData(); - const auto& actnum = eclState.get3DProperties().getIntGridProperty("ACTNUM").getData(); + const std::vector& ntg = eclState.get3DProperties().getDoubleGridProperty("NTG").getData(); + averageNtg = ntg; + + bool opmfil = eclGrid.getMinpvMode() == Opm::MinpvMode::OpmFIL; + + // just return the unmodified ntg if opmfil is not used + if (!opmfil) + return; + + const auto& porv = eclState.get3DProperties().getDoubleGridProperty("PORV").getData(); + const auto& actnum = eclState.get3DProperties().getIntGridProperty("ACTNUM").getData(); const auto& cartMapper = vanguard_.cartesianIndexMapper(); const auto& cartDims = cartMapper.cartesianDimensions(); assert(dimWorld > 1); const size_t nxny = cartDims[0] * cartDims[1]; - - averageNtg = ntg; - for (size_t cartesianCellIdx = 0; cartesianCellIdx < ntg.size(); ++cartesianCellIdx) { // use the original ntg values for the inactive cells