Merge pull request #3049 from joakim-hove/wellpi-no-scaling

Pass unscaled newWellPI to Schedule::applyWellProdIndexScaling()
This commit is contained in:
Bård Skaflestad
2021-02-08 23:30:15 +01:00
committed by GitHub

View File

@@ -2600,21 +2600,15 @@ namespace Opm {
}
};
auto getWellPIScalingFactor = [this](const int well_index,
const double newWellPI) -> double
{
return this->wells_ecl_[well_index].getWellPIScalingFactor(newWellPI);
};
auto rescaleWellPI =
[this, timeStepIdx](const int well_index,
const double scalingFactor) -> void
const double newWellPI) -> void
{
{
const auto& wname = this->wells_ecl_[well_index].name();
auto& schedule = this->ebosSimulator_.vanguard().schedule(); // Mutable
schedule.applyWellProdIndexScaling(wname, timeStepIdx, scalingFactor);
schedule.applyWellProdIndexScaling(wname, timeStepIdx, newWellPI);
this->wells_ecl_[well_index] = schedule.getWell(wname, timeStepIdx);
}
@@ -2659,8 +2653,7 @@ namespace Opm {
for (auto wellID = 0*nw; wellID < nw; ++wellID) {
if (hasWellPIEvent(wellID)) {
const auto newWellPI = getWellPI(wellID);
const auto scalingFactor = getWellPIScalingFactor(wellID, newWellPI);
rescaleWellPI(wellID, scalingFactor);
rescaleWellPI(wellID, newWellPI);
}
}