mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
dont store history of inactive gpmaint rates
This commit is contained in:
parent
9c13992e15
commit
86edaeae77
@ -707,12 +707,12 @@ namespace WellGroupHelpers
|
|||||||
const double error = gpm->pressure_target() - regional_values.at(name)->pressure(number);
|
const double error = gpm->pressure_target() - regional_values.at(name)->pressure(number);
|
||||||
double current_rate = 0.0;
|
double current_rate = 0.0;
|
||||||
const auto& pu = well_state.phaseUsage();
|
const auto& pu = well_state.phaseUsage();
|
||||||
double sign = 1.0;
|
bool injection = true;
|
||||||
switch (gpm->flow_target()) {
|
switch (gpm->flow_target()) {
|
||||||
case GPMaint::FlowTarget::RESV_PROD:
|
case GPMaint::FlowTarget::RESV_PROD:
|
||||||
{
|
{
|
||||||
current_rate = -group_state.injection_vrep_rate(group.name());
|
current_rate = -group_state.injection_vrep_rate(group.name());
|
||||||
sign = -1.0;
|
injection = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case GPMaint::FlowTarget::RESV_OINJ:
|
case GPMaint::FlowTarget::RESV_OINJ:
|
||||||
@ -760,8 +760,11 @@ namespace WellGroupHelpers
|
|||||||
throw std::invalid_argument("Invalid Flow target type in GPMAINT");
|
throw std::invalid_argument("Invalid Flow target type in GPMAINT");
|
||||||
}
|
}
|
||||||
auto& gpmaint_state = group_state.gpmaint(group.name());
|
auto& gpmaint_state = group_state.gpmaint(group.name());
|
||||||
double rate = gpm->rate(gpmaint_state, current_rate, error, dt);
|
// we only activate gpmaint if pressure is lower than the target regional pressure for injectors
|
||||||
group_state.update_gpmaint_target(group.name(), std::max(0.0, sign * rate));
|
// (i.e. error > 0) and higher for producers.
|
||||||
|
bool activate = (injection && error > 0) || (!injection && error < 0);
|
||||||
|
double rate = activate? gpm->rate(gpmaint_state, current_rate, error, dt) : 0.0;
|
||||||
|
group_state.update_gpmaint_target(group.name(), rate);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user