Fix bug in parallel case.

Since computeAverageFormationFactor() involves communication to reduce
values across the whole reservoir, it must be called by all processes,
also those with no wells to reopen.
This commit is contained in:
Atgeirr Flø Rasmussen
2018-11-23 21:14:39 +01:00
parent cc1d22b35c
commit 09405ce6f5

View File

@@ -313,15 +313,13 @@ namespace Opm {
return;
}
const auto& wellsForTesting = wellTestState_.updateWell(wtest_config, simulationTime);
if (wellsForTesting.size() == 0) { // there is no well available for WTEST at the moment
return;
}
// average B factors are required for the convergence checking of well equations
// Note: this must be done on all processes, even those with
// no wells needing testing, otherwise we will have locking.
std::vector< Scalar > B_avg(numComponents(), Scalar() );
computeAverageFormationFactor(B_avg);
const auto& wellsForTesting = wellTestState_.updateWell(wtest_config, simulationTime);
for (const auto& testWell : wellsForTesting) {
const std::string& well_name = testWell.first;