Fix deadlock for distributed wells when calculating densities/pressures

There was a check that is supposed that all rates are zero but for
distributed wells it only checked local perforations. Of course that
can lead to different outcome on processes for distributed wells.
This commit is contained in:
Markus Blatt 2022-07-15 16:50:38 +02:00
parent 412cf1d6cd
commit f7dec58ee2

View File

@ -1596,6 +1596,12 @@ namespace Opm
// approximate the perforation mixture using the mobility ratio
// and weight the perforations using the well transmissibility.
bool all_zero = std::all_of(perfRates.begin(), perfRates.end(), [](double val) { return val == 0.0; });
const auto& comm = this->parallel_well_info_.communication();
if (comm.size() > 1)
{
all_zero = (comm.min(all_zero ? 1 : 0) == 1);
}
if ( all_zero && this->isProducer() ) {
double total_tw = 0;
for (int perf = 0; perf < nperf; ++perf) {