mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-11-29 20:43:49 -06:00
update gpmain before not after timestep
This commit is contained in:
parent
b2ac3eaa59
commit
eb4997a011
@ -452,7 +452,7 @@ checkGroupInjectionConstraints(const Group& group,
|
||||
const auto& controls = group.injectionControls(phase, this->summaryState_);
|
||||
double target = controls.surface_max_rate;
|
||||
|
||||
if (group.has_gpmaint_control(phase, Group::InjectionCMode::RATE) && this->groupState().has_gpmaint_target(group.name()))
|
||||
if (group.has_gpmaint_control(phase, Group::InjectionCMode::RATE))
|
||||
target = this->groupState().gpmaint_target(group.name());
|
||||
|
||||
if (target < current_rate) {
|
||||
@ -475,7 +475,7 @@ checkGroupInjectionConstraints(const Group& group,
|
||||
const auto& controls = group.injectionControls(phase, this->summaryState_);
|
||||
double target = controls.resv_max_rate;
|
||||
|
||||
if (group.has_gpmaint_control(phase, Group::InjectionCMode::RESV) && this->groupState().has_gpmaint_target(group.name()))
|
||||
if (group.has_gpmaint_control(phase, Group::InjectionCMode::RESV))
|
||||
target = this->groupState().gpmaint_target(group.name());
|
||||
|
||||
if (target < current_rate) {
|
||||
@ -648,7 +648,7 @@ checkGroupProductionConstraints(const Group& group,
|
||||
current_rate = comm_.sum(current_rate);
|
||||
|
||||
double target = controls.resv_target;
|
||||
if (group.has_gpmaint_control(Group::ProductionCMode::RESV) && this->groupState().has_gpmaint_target(group.name()))
|
||||
if (group.has_gpmaint_control(Group::ProductionCMode::RESV))
|
||||
target = this->groupState().gpmaint_target(group.name());
|
||||
|
||||
if ( target < current_rate ) {
|
||||
|
@ -221,7 +221,6 @@ namespace Opm {
|
||||
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_);
|
||||
}
|
||||
|
||||
{
|
||||
@ -359,6 +358,15 @@ namespace Opm {
|
||||
const Group& fieldGroup = schedule().getGroup("FIELD", reportStepIdx);
|
||||
WellGroupHelpers::updateGuideRates(fieldGroup, schedule(), summaryState, this->phase_usage_, reportStepIdx, simulationTime,
|
||||
this->wellState(), this->groupState(), comm, &this->guideRate_, pot, local_deferredLogger);
|
||||
|
||||
|
||||
// update gpmaint targets
|
||||
if (schedule_[reportStepIdx].has_gpmaint()) {
|
||||
regionalAveragePressureCalculator_->template defineState<ElementContext>(ebosSimulator_);
|
||||
const double dt = ebosSimulator_.timeStepSize();
|
||||
WellGroupHelpers::updateGpMaintTargetForGroups(fieldGroup,
|
||||
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.
|
||||
for (auto& well : well_container_) {
|
||||
@ -496,13 +504,6 @@ namespace Opm {
|
||||
// update the rate converter with current averages pressures etc in
|
||||
rateConverter_->template defineState<ElementContext>(ebosSimulator_);
|
||||
|
||||
const Group& fieldGroup = schedule_.getGroup("FIELD", reportStepIdx);
|
||||
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 {
|
||||
updateWellPotentials(reportStepIdx,
|
||||
@ -517,6 +518,7 @@ 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);
|
||||
|
||||
|
@ -114,7 +114,7 @@ double TargetCalculator::groupTarget(const Group::ProductionControls ctrl) const
|
||||
return ctrl.liquid_target;
|
||||
case Group::ProductionCMode::RESV:
|
||||
{
|
||||
if(use_gpmaint_ && this->group_state_.has_gpmaint_target(this->group_name_))
|
||||
if(use_gpmaint_)
|
||||
return this->group_state_.gpmaint_target(this->group_name_);
|
||||
|
||||
return ctrl.resv_target;
|
||||
|
Loading…
Reference in New Issue
Block a user