Merge pull request #3498 from totto82/gpmaint

Support for gpmaint
This commit is contained in:
Tor Harald Sandve
2021-09-07 12:38:48 +02:00
committed by GitHub
15 changed files with 957 additions and 392 deletions

View File

@@ -203,10 +203,15 @@ namespace Opm {
WellGroupHelpers::setCmodeGroup(fieldGroup, schedule(), summaryState, timeStepIdx, this->wellState(), this->groupState());
// Compute reservoir volumes for RESV controls.
rateConverter_.reset(new RateConverterType (phase_usage_,
std::vector<int>(local_num_cells_, 0)));
rateConverter_.reset(new RateConverterType (phase_usage_, std::vector<int>(local_num_cells_, 0)));
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_);
{
const auto& sched_state = this->schedule()[timeStepIdx];
// update VFP properties
@@ -458,6 +463,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());
// calculate the well potentials
try {
updateWellPotentials(reportStepIdx,
@@ -472,7 +483,6 @@ namespace Opm {
updateWellTestState(simulationTime, wellTestState_);
// check group sales limits at the end of the timestep
const Group& fieldGroup = schedule().getGroup("FIELD", reportStepIdx);
checkGconsaleLimits(fieldGroup, this->wellState(),
ebosSimulator_.episodeIndex(), local_deferredLogger);