fixes to the wlift implementation

This commit is contained in:
Tor Harald Sandve 2020-11-05 13:05:01 +01:00
parent 4f1bed2890
commit bd370c6470
3 changed files with 15 additions and 6 deletions

View File

@ -67,7 +67,6 @@ namespace Opm
const Simulator &ebos_simulator,
const SummaryState &summary_state,
DeferredLogger &deferred_logger,
std::vector<double> &potentials,
const WellState &well_state,
const Well::ProductionControls &controls
);
@ -95,7 +94,7 @@ namespace Opm
const Well::ProductionControls &controls_;
DeferredLogger &deferred_logger_;
const Simulator &ebos_simulator_;
std::vector<double> &potentials_;
std::vector<double> potentials_;
const StdWell &std_well_;
const SummaryState &summary_state_;
const WellState &well_state_;

View File

@ -35,14 +35,13 @@ GasLiftRuntime(
const Simulator &ebos_simulator,
const SummaryState &summary_state,
DeferredLogger &deferred_logger,
std::vector<double> &potentials,
const WellState &well_state,
const Well::ProductionControls &controls
) :
controls_{controls},
deferred_logger_{deferred_logger},
ebos_simulator_{ebos_simulator},
potentials_{potentials},
potentials_(well_state.numPhases(),0.0),
std_well_{std_well},
summary_state_{summary_state},
well_state_{well_state},
@ -237,6 +236,15 @@ getOilRateWithLimit_(std::vector<double> &potentials)
if (new_rate > target)
new_rate = target;
}
if (this->controls_.hasControl(Well::ProducerCMode::LRAT)) {
auto target = this->controls_.liquid_rate;
auto oil_rate = -potentials[this->oil_pos_];
auto water_rate = -potentials[this->water_pos_];
auto liq_rate = oil_rate + water_rate;
if (liq_rate > target) {
new_rate = oil_rate * (target/liq_rate);
}
}
return new_rate;
}
@ -342,6 +350,9 @@ runOptimizeLoop_(bool increase)
auto gas_rate = -cur_potentials[this->gas_pos_];
bool success = false; // did we succeed to increase alq?
auto cur_alq = this->orig_alq_;
if (cur_alq == 0 && !increase) // we don't decrease alq below zero
return false;
auto alq = cur_alq;
OptimizeState state {*this, increase};
if (this->debug) debugShowStartIteration_(alq, increase);

View File

@ -2758,12 +2758,11 @@ namespace Opm
= well_state.currentProductionControls()[this->index_of_well_];
if ( this->Base::wellHasTHPConstraints(summary_state)
&& current_control != Well::ProducerCMode::BHP ) {
std::vector<double> potentials = well_state.wellPotentials();
if (doGasLiftOptimize(well_state, ebos_simulator, deferred_logger)) {
const auto& controls = well.productionControls(summary_state);
GasLiftHandler glift {
*this, ebos_simulator, summary_state,
deferred_logger, potentials, well_state, controls };
deferred_logger, well_state, controls };
glift.runOptimize();
}
}