From 06827bdd170a3ccf2ad15f2a1e58a723b189feae Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Tue, 8 Sep 2020 10:59:41 +0200 Subject: [PATCH 1/2] Apply only MULTZ+ in applyAllZMultipliers_, prepare for PINCH(5)=TOP For PINCH(5)==ALL, we take the minimum of MULTZ+ and ignore MULTZ-. We also prepare for PINCH(5)==TOP taking only the toplevel MULTZ+ value. For non-vertical directions we use both MULTZ+ and MULTZ- --- ebos/ecltransmissibility.hh | 49 +++++++++++++++++++++++++++---------- 1 file changed, 36 insertions(+), 13 deletions(-) diff --git a/ebos/ecltransmissibility.hh b/ebos/ecltransmissibility.hh index 4ea6d6093..97383908d 100644 --- a/ebos/ecltransmissibility.hh +++ b/ebos/ecltransmissibility.hh @@ -345,11 +345,19 @@ public: // for the inside ... if (useSmallestMultiplier) - applyAllZMultipliers_(trans, insideFaceIdx, insideCartElemIdx, outsideCartElemIdx, transMult, cartDims); + { + // Currently PINCH(4) is never queries and hence PINCH(4) == TOPBOT is assumed + // and in this branch PINCH(5) == ALL holds + applyAllZMultipliers_(trans, insideFaceIdx, outsideFaceIdx, insideCartElemIdx, + outsideCartElemIdx, transMult, cartDims, + /* pinchTop= */ false); + } else + { applyMultipliers_(trans, insideFaceIdx, insideCartElemIdx, transMult); - // ... and outside elements - applyMultipliers_(trans, outsideFaceIdx, outsideCartElemIdx, transMult); + // ... and outside elements + applyMultipliers_(trans, outsideFaceIdx, outsideCartElemIdx, transMult); + } // apply the region multipliers (cf. the MULTREGT keyword) Opm::FaceDir::DirEnum faceDir; @@ -465,29 +473,44 @@ private: } } + /// \brief Apply the Multipliers for the case PINCH(4)==TOPBOT + /// + /// \param pinchTop Whether PINCH(5) is TOP, otherwise ALL is assumed. void applyAllZMultipliers_(Scalar& trans, unsigned insideFaceIdx, + unsigned outsideFaceIdx, unsigned insideCartElemIdx, unsigned outsideCartElemIdx, const Opm::TransMult& transMult, - const std::array& cartDims) + const std::array& cartDims, + bool pinchTop) { if (insideFaceIdx > 3) { // top or or bottom - Scalar mult = 1e20; - unsigned cartElemIdx = insideCartElemIdx; assert(insideFaceIdx==5); // as insideCartElemIdx < outsideCartElemIdx holds for the Z column - // pick the smallest multiplier for Z+ while looking down the pillar untill reaching the other end of the connection - // While Z- is not all used here. There is a call after this function that does - // applyMultipliers_(trans, outsideFaceIdx, outsideCartElemIdx, transMult) - // and hence treats the other direction - while (cartElemIdx != outsideCartElemIdx) { - mult = std::min(mult, transMult.getMultiplier(cartElemIdx, Opm::FaceDir::ZPlus)); - cartElemIdx += cartDims[0]*cartDims[1]; + assert(outsideCartElemIdx > insideCartElemIdx); + auto lastCartElemIdx = outsideCartElemIdx - cartDims[0]*cartDims[1]; + // Last multiplier + Scalar mult = transMult.getMultiplier(lastCartElemIdx , Opm::FaceDir::ZPlus); + + if ( !pinchTop ) + { + // pick the smallest multiplier for Z+ while looking down the pillar until reaching the other end of the connection + // While Z- is not all used here. + for(auto cartElemIdx = insideCartElemIdx; cartElemIdx < lastCartElemIdx; + cartElemIdx += cartDims[0]*cartDims[1]) + { + mult = std::min(mult, transMult.getMultiplier(cartElemIdx, Opm::FaceDir::ZPlus)); + } } + trans *= mult; + //applyMultipliers_(trans, outsideFaceIdx, outsideCartElemIdx, transMult); // Uncommenting makes the tests succeed } else + { applyMultipliers_(trans, insideFaceIdx, insideCartElemIdx, transMult); + applyMultipliers_(trans, outsideFaceIdx, outsideCartElemIdx, transMult); + } } void updateFromEclState_() From c2362daae945d352a43ee687c34c448c06f6ca7a Mon Sep 17 00:00:00 2001 From: Markus Blatt Date: Thu, 10 Sep 2020 10:20:17 +0200 Subject: [PATCH 2/2] reactive applyMultipliers_(trans, outsideFaceIdx, ..) for PINCH(5)=ALL Should make the tests succeed. --- ebos/ecltransmissibility.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebos/ecltransmissibility.hh b/ebos/ecltransmissibility.hh index 97383908d..70241cbcf 100644 --- a/ebos/ecltransmissibility.hh +++ b/ebos/ecltransmissibility.hh @@ -504,7 +504,7 @@ private: } trans *= mult; - //applyMultipliers_(trans, outsideFaceIdx, outsideCartElemIdx, transMult); // Uncommenting makes the tests succeed + applyMultipliers_(trans, outsideFaceIdx, outsideCartElemIdx, transMult); } else {