Well PI: Use Appropriate Calculator for Each Well

The original code assumed that

    well_container_.size() == numLocalWells()

This assumption does not hold when wells open/shut dynamically in
the context of WECON and/or WTEST.

Switch to indexing into the 'prod_index_calc_' vector using the
well's own linear index instead of manually advancing iterators.

Pointy Hat: [at]bska
This commit is contained in:
Bård Skaflestad 2020-11-27 14:50:08 +01:00
parent 374764fc6f
commit b0dc5c0a63

View File

@ -1471,13 +1471,11 @@ namespace Opm {
return;
}
auto piCalc = this->prod_index_calc_.begin();
for (const auto& wellPtr : this->well_container_) {
wellPtr->updateProductivityIndex(this->ebosSimulator_,
*piCalc,
this->prod_index_calc_[wellPtr->indexOfWell()],
this->well_state_,
deferred_logger);
++piCalc;
}
}