support none trivial item 3 in LIFTOPT. i.e. not optimize gaslift every timestep

This commit is contained in:
Tor Harald Sandve 2022-01-19 10:14:47 +01:00
parent 8bf6c9f2b5
commit c3571c50a3
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;