mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #3541 from totto82/updateGPmaint
update gpmain before not after timestep
This commit is contained in:
commit
a18e3f4136
@ -452,7 +452,7 @@ checkGroupInjectionConstraints(const Group& group,
|
|||||||
const auto& controls = group.injectionControls(phase, this->summaryState_);
|
const auto& controls = group.injectionControls(phase, this->summaryState_);
|
||||||
double target = controls.surface_max_rate;
|
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());
|
target = this->groupState().gpmaint_target(group.name());
|
||||||
|
|
||||||
if (target < current_rate) {
|
if (target < current_rate) {
|
||||||
@ -475,7 +475,7 @@ checkGroupInjectionConstraints(const Group& group,
|
|||||||
const auto& controls = group.injectionControls(phase, this->summaryState_);
|
const auto& controls = group.injectionControls(phase, this->summaryState_);
|
||||||
double target = controls.resv_max_rate;
|
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());
|
target = this->groupState().gpmaint_target(group.name());
|
||||||
|
|
||||||
if (target < current_rate) {
|
if (target < current_rate) {
|
||||||
@ -648,7 +648,7 @@ checkGroupProductionConstraints(const Group& group,
|
|||||||
current_rate = comm_.sum(current_rate);
|
current_rate = comm_.sum(current_rate);
|
||||||
|
|
||||||
double target = controls.resv_target;
|
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());
|
target = this->groupState().gpmaint_target(group.name());
|
||||||
|
|
||||||
if ( target < current_rate ) {
|
if ( target < current_rate ) {
|
||||||
|
@ -221,7 +221,6 @@ namespace Opm {
|
|||||||
const auto& fp = this->eclState_.fieldProps();
|
const auto& fp = this->eclState_.fieldProps();
|
||||||
const auto& fipnum = fp.get_int("FIPNUM");
|
const auto& fipnum = fp.get_int("FIPNUM");
|
||||||
regionalAveragePressureCalculator_.reset(new AverageRegionalPressureType (phase_usage_,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);
|
const Group& fieldGroup = schedule().getGroup("FIELD", reportStepIdx);
|
||||||
WellGroupHelpers::updateGuideRates(fieldGroup, schedule(), summaryState, this->phase_usage_, reportStepIdx, simulationTime,
|
WellGroupHelpers::updateGuideRates(fieldGroup, schedule(), summaryState, this->phase_usage_, reportStepIdx, simulationTime,
|
||||||
this->wellState(), this->groupState(), comm, &this->guideRate_, pot, local_deferredLogger);
|
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 {
|
try {
|
||||||
// Compute initial well solution for new wells and injectors that change injection type i.e. WAG.
|
// Compute initial well solution for new wells and injectors that change injection type i.e. WAG.
|
||||||
for (auto& well : well_container_) {
|
for (auto& well : well_container_) {
|
||||||
@ -496,13 +504,6 @@ namespace Opm {
|
|||||||
// update the rate converter with current averages pressures etc in
|
// update the rate converter with current averages pressures etc in
|
||||||
rateConverter_->template defineState<ElementContext>(ebosSimulator_);
|
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
|
// calculate the well potentials
|
||||||
try {
|
try {
|
||||||
updateWellPotentials(reportStepIdx,
|
updateWellPotentials(reportStepIdx,
|
||||||
@ -517,6 +518,7 @@ namespace Opm {
|
|||||||
updateWellTestState(simulationTime, wellTestState());
|
updateWellTestState(simulationTime, wellTestState());
|
||||||
|
|
||||||
// check group sales limits at the end of the timestep
|
// check group sales limits at the end of the timestep
|
||||||
|
const Group& fieldGroup = schedule_.getGroup("FIELD", reportStepIdx);
|
||||||
checkGconsaleLimits(fieldGroup, this->wellState(),
|
checkGconsaleLimits(fieldGroup, this->wellState(),
|
||||||
ebosSimulator_.episodeIndex(), local_deferredLogger);
|
ebosSimulator_.episodeIndex(), local_deferredLogger);
|
||||||
|
|
||||||
|
@ -114,7 +114,7 @@ double TargetCalculator::groupTarget(const Group::ProductionControls ctrl) const
|
|||||||
return ctrl.liquid_target;
|
return ctrl.liquid_target;
|
||||||
case Group::ProductionCMode::RESV:
|
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 this->group_state_.gpmaint_target(this->group_name_);
|
||||||
|
|
||||||
return ctrl.resv_target;
|
return ctrl.resv_target;
|
||||||
|
Loading…
Reference in New Issue
Block a user