Merge pull request #3521 from totto82/avoidAvg

only compute fip avg pressure when gpmaint
This commit is contained in:
Tor Harald Sandve 2021-09-13 11:32:24 +02:00 committed by GitHub
commit 09cf878649
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -207,10 +207,12 @@ namespace Opm {
rateConverter_->template defineState<ElementContext>(ebosSimulator_);
// Compute regional average pressures used by gpmaint
const auto& fp = this->eclState_.fieldProps();
const auto& fipnum = fp.get_int("FIPNUM");
regionalAveragePressureCalculator_.reset(new AverageRegionalPressureType (phase_usage_,fipnum));
regionalAveragePressureCalculator_->template defineState<ElementContext>(ebosSimulator_);
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));
regionalAveragePressureCalculator_->template defineState<ElementContext>(ebosSimulator_);
}
{
const auto& sched_state = this->schedule()[timeStepIdx];
@ -463,11 +465,12 @@ namespace Opm {
// update the rate converter with current averages pressures etc in
rateConverter_->template defineState<ElementContext>(ebosSimulator_);
regionalAveragePressureCalculator_->template defineState<ElementContext>(ebosSimulator_);
const Group& fieldGroup = schedule_.getGroup("FIELD", reportStepIdx);
WellGroupHelpers::updateGpMaintTargetForGroups(fieldGroup,
schedule_, *regionalAveragePressureCalculator_, reportStepIdx, dt, this->wellState(), this->groupState());
if (schedule_[reportStepIdx].has_gpmaint()) {
regionalAveragePressureCalculator_->template defineState<ElementContext>(ebosSimulator_);
WellGroupHelpers::updateGpMaintTargetForGroups(fieldGroup,
schedule_, *regionalAveragePressureCalculator_, reportStepIdx, dt, this->wellState(), this->groupState());
}
// calculate the well potentials
try {