Merge pull request #3777 from totto82/support_min_wait_glift

support none trivial item 3 in LIFTOPT.
This commit is contained in:
Tor Harald Sandve 2022-01-19 14:58:50 +01:00 committed by GitHub
commit a57f92527f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 1 deletions

View File

@ -460,6 +460,8 @@ protected:
bool glift_debug = false;
double last_glift_opt_time_ = -1.0;
private:
WellInterfaceGeneric* getGenWell(const std::string& well_name);
};

View File

@ -861,7 +861,19 @@ namespace Opm {
BlackoilWellModel<TypeTag>::
maybeDoGasLiftOptimize(DeferredLogger& deferred_logger)
{
const bool do_glift_optimization = true;
bool do_glift_optimization = false;
const double simulation_time = ebosSimulator_.time();
const double min_wait = ebosSimulator_.vanguard().schedule().glo(ebosSimulator_.episodeIndex()).min_wait();
// We only optimize if a min_wait time has past.
// If all_newton is true we still want to optimize several times pr timestep
// i.e. we also optimize if check simulation_time == last_glift_opt_time_
// that is when the last_glift_opt_time is already updated with the current time step
if ( simulation_time == last_glift_opt_time_ || simulation_time >= (last_glift_opt_time_ + min_wait)) {
do_glift_optimization = true;
last_glift_opt_time_ = simulation_time;
}
if (do_glift_optimization) {
GLiftOptWells glift_wells;
GLiftProdWells prod_wells;