diff --git a/opm/simulators/flow/GenericCpGridVanguard.cpp b/opm/simulators/flow/GenericCpGridVanguard.cpp index 39f523fb9..45d85de5e 100644 --- a/opm/simulators/flow/GenericCpGridVanguard.cpp +++ b/opm/simulators/flow/GenericCpGridVanguard.cpp @@ -390,7 +390,7 @@ void GenericCpGridVanguard::doCreateGrids_(Eclips #endif // Note: removed_cells is guaranteed to be empty on ranks other than 0. - auto removed_cells = + auto [removed_cells, pinchedNncData] = this->grid_->processEclipseFormat(input_grid, &eclState, /*isPeriodic=*/false, @@ -440,7 +440,7 @@ void GenericCpGridVanguard::doCreateGrids_(Eclips // when there is numerical aquifers, new NNC are generated during // grid processing we need to pass the NNC from root process to // other processes - if (has_numerical_aquifer && mpiSize > 1) { + if ((has_numerical_aquifer || !pinchedNncData.empty()) && mpiSize > 1) { auto nnc_input = eclState.getInputNNC(); Parallel::MpiSerializer ser(grid_->comm()); ser.broadcast(nnc_input); diff --git a/opm/simulators/flow/Transmissibility.hpp b/opm/simulators/flow/Transmissibility.hpp index dab92cae2..f052398f5 100644 --- a/opm/simulators/flow/Transmissibility.hpp +++ b/opm/simulators/flow/Transmissibility.hpp @@ -221,9 +221,12 @@ protected: * * \param cartesianToCompressed Vector containing the compressed index (or -1 for inactive * cells) as the element at the cartesian index. + * \param pinchOption4ALL Whether option 4 of PINCH is set to ALL. In this cases transmissibilities + * from the NNCs created by PINCH will overwrite. * \return Nothing. */ - void applyNncToGridTrans_(const std::unordered_map& cartesianToCompressed); + void applyNncToGridTrans_(const std::unordered_map& cartesianToCompressed, + bool pinchOption4ALL); /// \brief Multiplies the grid transmissibilities according to EDITNNC. void applyEditNncToGridTrans_(const std::unordered_map& globalToLocal); diff --git a/opm/simulators/flow/Transmissibility_impl.hpp b/opm/simulators/flow/Transmissibility_impl.hpp index ad753d875..ae1a276b2 100644 --- a/opm/simulators/flow/Transmissibility_impl.hpp +++ b/opm/simulators/flow/Transmissibility_impl.hpp @@ -217,14 +217,22 @@ update(bool global, const TransUpdateQuantities update_quantities, // Then the smallest multiplier is applied. // Default is to apply the top and bottom multiplier bool useSmallestMultiplier; + bool pinchOption4ALL; bool pinchActive; if (comm.rank() == 0) { const auto& eclGrid = eclState_.getInputGrid(); pinchActive = eclGrid.isPinchActive(); + auto pinchTransCalcMode = eclGrid.getPinchOption(); useSmallestMultiplier = eclGrid.getMultzOption() == PinchMode::ALL; + pinchOption4ALL = (pinchTransCalcMode == PinchMode::ALL); + if (pinchOption4ALL) + { + useSmallestMultiplier = false; + } } if (global && comm.size() > 1) { comm.broadcast(&useSmallestMultiplier, 1, 0); + comm.broadcast(&pinchOption4ALL, 1, 0); comm.broadcast(&pinchActive, 1, 0); } @@ -541,7 +549,7 @@ update(bool global, const TransUpdateQuantities update_quantities, // be seen in a parallel. Unfortunately, when we do not use transmissibilities // we will only see warnings for the partition of process 0 and also false positives. this->applyEditNncToGridTrans_(globalToLocal); - this->applyNncToGridTrans_(globalToLocal); + this->applyNncToGridTrans_(globalToLocal, pinchOption4ALL); this->applyEditNncrToGridTrans_(globalToLocal); if (applyNncMultregT) { this->applyNncMultreg_(globalToLocal); @@ -1023,7 +1031,8 @@ computeFaceProperties(const Intersection& intersection, template void Transmissibility:: -applyNncToGridTrans_(const std::unordered_map& cartesianToCompressed) +applyNncToGridTrans_(const std::unordered_map& cartesianToCompressed, + bool pinchOption4ALL) { // First scale NNCs with EDITNNC. const auto& nnc_input = eclState_.getInputNNC().input(); @@ -1055,10 +1064,19 @@ applyNncToGridTrans_(const std::unordered_map& cartesianToCompr { auto candidate = trans_.find(details::isId(low, high)); if (candidate != trans_.end()) { - // NNC is represented by the grid and might be a neighboring connection - // In this case the transmissibilty is added to the value already - // set or computed. - candidate->second += nncEntry.trans; + if (!pinchOption4ALL || nncEntry.notFromPinch) + // NNC is represented by the grid and might be a neighboring connection + // In this case the transmissibilty is added to the value already + // set or computed. + candidate->second += nncEntry.trans; + else + // Overwrite transmissibility in this special case. + // Note that the NNC is represented by a normal vertical intersectionin CpGrid + // that has a normal and an area (but maybe two different centers?). + //. Hence we have calculated a transmissibilty for it. + // That one might be correct if the option is TOPBOT but should be overwitten if + // it is ALL + candidate->second = nncEntry.trans; } } // if (enableEnergy_) {