mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #4134 from totto82/avoidOscLratOrat
avoid oscilation between ORAT and LRAT when they are equal
This commit is contained in:
commit
ab41b06917
@ -996,7 +996,17 @@ checkGroupProductionConstraints(const Group& group,
|
|||||||
// sum over all nodes
|
// sum over all nodes
|
||||||
current_rate = comm_.sum(current_rate);
|
current_rate = comm_.sum(current_rate);
|
||||||
|
|
||||||
if (controls.liquid_target < current_rate ) {
|
bool skip = false;
|
||||||
|
if (controls.liquid_target == controls.oil_target) {
|
||||||
|
double current_water_rate = WellGroupHelpers::sumWellSurfaceRates(group, schedule(), well_state, reportStepIdx, phase_usage_.phase_pos[BlackoilPhases::Aqua], false);
|
||||||
|
current_water_rate = comm_.sum(current_water_rate);
|
||||||
|
if (std::abs(current_water_rate) < 1e-12) {
|
||||||
|
skip = true;
|
||||||
|
deferred_logger.debug("LRAT_ORAT_GROUP", "GROUP " + group.name() + " The LRAT target is equal the ORAT target and the water rate is zero, skip checking LRAT");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!skip && controls.liquid_target < current_rate ) {
|
||||||
double scale = 1.0;
|
double scale = 1.0;
|
||||||
if (current_rate > 1e-12)
|
if (current_rate > 1e-12)
|
||||||
scale = controls.liquid_target / current_rate;
|
scale = controls.liquid_target / current_rate;
|
||||||
|
@ -118,7 +118,16 @@ activeProductionConstraint(const SingleWellState& ws,
|
|||||||
if (controls.hasControl(Well::ProducerCMode::LRAT) && currentControl != Well::ProducerCMode::LRAT) {
|
if (controls.hasControl(Well::ProducerCMode::LRAT) && currentControl != Well::ProducerCMode::LRAT) {
|
||||||
double current_rate = -ws.surface_rates[pu.phase_pos[BlackoilPhases::Liquid]];
|
double current_rate = -ws.surface_rates[pu.phase_pos[BlackoilPhases::Liquid]];
|
||||||
current_rate -= ws.surface_rates[pu.phase_pos[BlackoilPhases::Aqua]];
|
current_rate -= ws.surface_rates[pu.phase_pos[BlackoilPhases::Aqua]];
|
||||||
if (controls.liquid_rate < current_rate)
|
|
||||||
|
bool skip = false;
|
||||||
|
if (controls.liquid_rate == controls.oil_rate) {
|
||||||
|
const double current_water_rate = ws.surface_rates[pu.phase_pos[BlackoilPhases::Aqua]];
|
||||||
|
if (std::abs(current_water_rate) < 1e-12) {
|
||||||
|
skip = true;
|
||||||
|
deferred_logger.debug("LRAT_ORAT_WELL", "Well " + this->name() + " The LRAT target is equal the ORAT target and the water rate is zero, skip checking LRAT");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!skip && controls.liquid_rate < current_rate)
|
||||||
return Well::ProducerCMode::LRAT;
|
return Well::ProducerCMode::LRAT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user