Merge pull request #4359 from totto82/fixGPMAINT2

Fix GPMAINT for groups without control
This commit is contained in:
Markus Blatt
2023-01-23 14:12:00 +01:00
committed by GitHub
12 changed files with 140 additions and 48 deletions

View File

@@ -208,9 +208,8 @@ namespace Opm {
// Compute regional average pressures used by gpmaint
if (schedule_[timeStepIdx].has_gpmaint()) {
const auto& fp = this->eclState_.fieldProps();
const auto& fipnum = fp.get_int("FIPNUM");
regionalAveragePressureCalculator_.reset(new AverageRegionalPressureType (phase_usage_,fipnum));
WellGroupHelpers::setRegionAveragePressureCalculator(fieldGroup, schedule(),
timeStepIdx, this->eclState_.fieldProps(), phase_usage_, regionalAveragePressureCalculator_);
}
{
@@ -330,10 +329,12 @@ namespace Opm {
auto exc_type = ExceptionType::NONE;
// update gpmaint targets
if (schedule_[reportStepIdx].has_gpmaint()) {
regionalAveragePressureCalculator_->template defineState<ElementContext>(ebosSimulator_);
for (auto& calculator : regionalAveragePressureCalculator_) {
calculator.second->template defineState<ElementContext>(ebosSimulator_);
}
const double dt = ebosSimulator_.timeStepSize();
WellGroupHelpers::updateGpMaintTargetForGroups(fieldGroup,
schedule_, *regionalAveragePressureCalculator_, reportStepIdx, dt, this->wellState(), this->groupState());
schedule_, regionalAveragePressureCalculator_, reportStepIdx, dt, this->wellState(), this->groupState());
}
try {
// Compute initial well solution for new wells and injectors that change injection type i.e. WAG.