mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-13 09:51:57 -06:00
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:
parent
412cf1d6cd
commit
f7dec58ee2
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user