mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-01-13 01:41:55 -06:00
Merge pull request #5350 from totto82/gpmain_reset
Reset gpmain state when rate is zero
This commit is contained in:
commit
48eb73fa80
@ -796,7 +796,12 @@ updateGpMaintTargetForGroups(const Group& group,
|
||||
// we only activate gpmaint if pressure is lower than the target regional pressure for injectors
|
||||
// (i.e. error > 0) and higher for producers.
|
||||
bool activate = (injection && error > 0) || (!injection && error < 0);
|
||||
const Scalar rate = activate? gpm->rate(gpmaint_state, current_rate, error, dt) : 0.0;
|
||||
Scalar rate = 0.0;
|
||||
if (activate) {
|
||||
rate = gpm->rate(gpmaint_state, current_rate, error, dt);
|
||||
} else {
|
||||
gpm->resetState(gpmaint_state);
|
||||
}
|
||||
group_state.update_gpmaint_target(group.name(), std::max(0.0, sign * rate));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user