Preparations for Recording Dynamic Well State

Coalesce blocks with same conditions, split long lines, and apply
'const' where appropriate.  While here, also tighten the "rate = 0"
criterion to include denormalised numbers.
This commit is contained in:
Bård Skaflestad
2021-03-01 15:17:52 +01:00
parent cd7c4d9927
commit 65edfb702c
4 changed files with 163 additions and 114 deletions

View File

@@ -2263,9 +2263,9 @@ namespace Opm
setToZero(wellPI);
const auto preferred_phase = this->well_ecl_.getPreferredPhase();
auto subsetPerfID = 0;
auto subsetPerfID = 0;
for ( const auto& perf : *this->perf_data_){
for (const auto& perf : *this->perf_data_) {
auto allPerfID = perf.ecl_index;
auto connPICalc = [&wellPICalc, allPerfID](const double mobility) -> double
@@ -2293,13 +2293,13 @@ namespace Opm
connPI += np;
}
// Sum with communication in case of distributed well.
// Sum with communication in case of distributed well.
const auto& comm = this->parallel_well_info_.communication();
if (comm.size() > 1)
{
if (comm.size() > 1) {
comm.sum(wellPI, np);
}
assert (static_cast<int>(subsetPerfID) == this->number_of_perforations_ &&
assert ((static_cast<int>(subsetPerfID) == this->number_of_perforations_) &&
"Internal logic error in processing connections for PI/II");
}