GasLiftSingleWellGeneric.hpp
Go to the documentation of this file.
1/*
2 Copyright 2020 Equinor ASA.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef OPM_GASLIFT_SINGLE_WELL_GENERIC_HEADER_INCLUDED
21#define OPM_GASLIFT_SINGLE_WELL_GENERIC_HEADER_INCLUDED
22
24
25#include <opm/input/eclipse/Schedule/Well/WellProductionControls.hpp>
28
29#include <optional>
30#include <set>
31#include <stdexcept>
32#include <string>
33#include <tuple>
34#include <utility>
35
36namespace Opm
37{
38
39class DeferredLogger;
40class GasLiftWell;
41class GasLiftWellState;
42class Schedule;
43class SummaryState;
44class WellInterfaceGeneric;
45template<class Scalar> class WellState;
46template<class Scalar> class GroupState;
47
49{
50protected:
51 static constexpr int Water = BlackoilPhases::Aqua;
52 static constexpr int Oil = BlackoilPhases::Liquid;
53 static constexpr int Gas = BlackoilPhases::Vapour;
54 static constexpr int NUM_PHASES = 3;
55 static constexpr double ALQ_EPSILON = 1e-8;
56
57public:
58 using GLiftSyncGroups = std::set<int>;
60 struct GradInfo
61 {
63
64 GradInfo(double grad_, double new_oil_rate_, bool oil_is_limited_,
65 double new_gas_rate_, bool gas_is_limited_,
66 double new_water_rate_, bool water_is_limited_,
67 double alq_, bool alq_is_limited_) :
68 grad{grad_},
69 new_oil_rate{new_oil_rate_},
70 oil_is_limited{oil_is_limited_},
71 new_gas_rate{new_gas_rate_},
72 gas_is_limited{gas_is_limited_},
73 new_water_rate{new_water_rate_},
74 water_is_limited{water_is_limited_},
75 alq{alq_},
76 alq_is_limited{alq_is_limited_} {}
77 double grad;
84 double alq;
86 };
87
88 virtual ~GasLiftSingleWellGeneric() = default;
89
90 const std::string& name() const { return well_name_; }
91
92 std::optional<GradInfo> calcIncOrDecGradient(double oil_rate, double gas_rate,
93 double water_rate,
94 double alq,
95 const std::string& gr_name_dont_limit,
96 bool increase,
97 bool debug_output = true
98 ) const;
99
100 std::unique_ptr<GasLiftWellState> runOptimize(const int iteration_idx);
101
102 virtual const WellInterfaceGeneric& getWell() const = 0;
103
104protected:
106 DeferredLogger& deferred_logger,
107 WellState<double>& well_state,
108 const GroupState<double>& group_state,
109 const Well& ecl_well,
110 const SummaryState& summary_state,
111 GasLiftGroupInfo& group_info,
112 const PhaseUsage& phase_usage,
113 const Schedule& schedule,
114 const int report_step_idx,
115 GLiftSyncGroups& sync_groups,
116 const Parallel::Communication& comm,
117 bool glift_debug
118 );
119
120 struct LimitedRates;
122 {
123 BasicRates(const BasicRates& rates) :
124 oil{rates.oil},
125 gas{rates.gas},
126 water{rates.water},
128 {}
129 BasicRates(double oil_, double gas_, double water_, bool bhp_is_limited_) :
130 oil{oil_},
131 gas{gas_},
132 water{water_},
133 bhp_is_limited{bhp_is_limited_}
134 {}
136 oil = rates.oil;
137 gas = rates.gas;
138 water = rates.water;
140 return *this;
141 }
142 // This copy constructor cannot be defined inline here since LimitedRates
143 // has not been defined yet (it is defined below). Instead it is defined in
144 // in the .cpp file
146 double operator[](Rate rate_type) const {
147 switch (rate_type) {
148 case Rate::oil:
149 return this->oil;
150 case Rate::gas:
151 return this->gas;
152 case Rate::water:
153 return this->water;
154 case Rate::liquid:
155 return this->oil + this->water;
156 default:
157 throw std::runtime_error("This should not happen");
158 }
159 }
160
161 double oil, gas, water;
163 };
164
165 struct LimitedRates : public BasicRates
166 {
167 enum class LimitType {well, group, none};
169 double oil_, double gas_, double water_,
170 bool oil_is_limited_, bool gas_is_limited_,
171 bool water_is_limited_, bool bhp_is_limited_,
172 std::optional<Rate> oil_limiting_target_,
173 std::optional<Rate> water_limiting_target_
174 ) :
175 BasicRates(oil_, gas_, water_, bhp_is_limited_),
176 oil_is_limited{oil_is_limited_},
177 gas_is_limited{gas_is_limited_},
178 water_is_limited{water_is_limited_},
179 oil_limiting_target{oil_limiting_target_},
180 water_limiting_target{water_limiting_target_}
181 {
182 set_initial_limit_type_();
183 }
184
186 const BasicRates& rates,
187 bool oil_is_limited_, bool gas_is_limited_,
188 bool water_is_limited_
189 ) :
190 BasicRates(rates),
191 oil_is_limited{oil_is_limited_},
192 gas_is_limited{gas_is_limited_},
193 water_is_limited{water_is_limited_}
194 {
195 set_initial_limit_type_();
196 }
197
198 bool limited() const {
200 }
201 // For a given ALQ value, were the rates limited due to group targets
202 // or due to well targets?
207 std::optional<Rate> oil_limiting_target;
208 std::optional<Rate> water_limiting_target;
209 private:
210 void set_initial_limit_type_() {
212 }
213 };
214
216 {
217 OptimizeState( GasLiftSingleWellGeneric& parent_, bool increase_ ) :
218 parent{parent_},
219 increase{increase_},
220 it{0},
221 stop_iteration{false},
222 bhp{-1}
223 {}
224
227 int it;
229 double bhp;
230
231 std::pair<std::optional<double>,bool> addOrSubtractAlqIncrement(double alq);
232 double calcEcoGradient(double oil_rate, double new_oil_rate,
233 double gas_rate, double new_gas_rate);
234 bool checkAlqOutsideLimits(double alq, double oil_rate);
235 bool checkEcoGradient(double gradient);
236 bool checkOilRateExceedsTarget(double oil_rate);
237 bool checkRatesViolated(const LimitedRates& rates) const;
238 void debugShowIterationInfo(double alq);
240 void warn_(std::string msg) {parent.displayWarning_(msg);}
241 };
242 bool checkGroupALQrateExceeded(double delta_alq, const std::string& gr_name_dont_limit = "") const;
243 bool checkGroupTotalRateExceeded(double delta_alq, double delta_gas_rate) const;
244
245 std::pair<std::optional<double>, bool> addOrSubtractAlqIncrement_(
246 double alq, bool increase) const;
247 double calcEcoGradient_(double oil_rate, double new_oil_rate,
248 double gas_rate, double new_gas_rate, bool increase) const;
249 bool checkALQequal_(double alq1, double alq2) const;
251 const BasicRates& rates, const BasicRates& new_rates) const;
252 bool checkInitialALQmodified_(double alq, double initial_alq) const;
253 virtual bool checkThpControl_() const = 0;
254 virtual std::optional<double> computeBhpAtThpLimit_(double alq, bool debug_output = true) const = 0;
255 std::pair<std::optional<double>,double> computeConvergedBhpAtThpLimitByMaybeIncreasingALQ_() const;
256 std::pair<std::optional<BasicRates>,double> computeInitialWellRates_() const;
257 std::optional<LimitedRates> computeLimitedWellRatesWithALQ_(double alq) const;
258 virtual BasicRates computeWellRates_(double bhp, bool bhp_is_limited, bool debug_output = true) const = 0;
259 std::optional<BasicRates> computeWellRatesWithALQ_(double alq) const;
260 void debugCheckNegativeGradient_(double grad, double alq, double new_alq,
261 double oil_rate, double new_oil_rate,
262 double gas_rate, double new_gas_rate,
263 bool increase) const;
267 void debugShowLimitingTargets_(const LimitedRates& rates) const;
269 void debugShowStartIteration_(double alq, bool increase, double oil_rate);
271 void displayDebugMessage_(const std::string& msg) const override;
272 void displayWarning_(const std::string& warning);
273 std::pair<double, bool> getBhpWithLimit_(double bhp) const;
274 std::pair<double, bool> getGasRateWithLimit_(
275 const BasicRates& rates) const;
276 std::pair<double, bool> getGasRateWithGroupLimit_(
277 double new_gas_rate, double gas_rate, const std::string& gr_name_dont_limit) const;
278 std::pair<std::optional<LimitedRates>,double> getInitialRatesWithLimit_() const;
280 std::tuple<double,double,bool,bool> getLiquidRateWithGroupLimit_(
281 const double new_oil_rate, const double oil_rate,
282 const double new_water_rate, const double water_rate, const std::string& gr_name_dont_limit) const;
283 std::pair<double, bool> getOilRateWithGroupLimit_(
284 double new_oil_rate, double oil_rate, const std::string& gr_name_dont_limit) const;
285 std::pair<double, bool> getOilRateWithLimit_(const BasicRates& rates) const;
286 std::pair<double, std::optional<Rate>> getOilRateWithLimit2_(
287 const BasicRates& rates) const;
288 double getProductionTarget_(Rate rate) const;
289 double getRate_(Rate rate_type, const BasicRates& rates) const;
290 std::pair<double, std::optional<Rate>> getRateWithLimit_(
291 Rate rate_type, const BasicRates& rates) const;
292 std::tuple<double, const std::string*, double> getRateWithGroupLimit_(
293 Rate rate_type, const double new_rate, const double old_rate, const std::string& gr_name_dont_limit) const;
294 std::pair<double, bool> getWaterRateWithGroupLimit_(
295 double new_water_rate, double water_rate, const std::string& gr_name_dont_limit) const;
296 std::pair<double, bool> getWaterRateWithLimit_(const BasicRates& rates) const;
297 std::pair<double, std::optional<Rate>> getWaterRateWithLimit2_(
298 const BasicRates& rates) const;
300 bool hasProductionControl_(Rate rate) const;
301 std::pair<LimitedRates, double> increaseALQtoPositiveOilRate_(
302 double alq, const LimitedRates& orig_rates) const;
303 std::pair<LimitedRates, double> increaseALQtoMinALQ_(
304 double alq, const LimitedRates& orig_rates) const;
305 void logSuccess_(double alq,
306 const int iteration_idx);
307 std::pair<LimitedRates, double> maybeAdjustALQbeforeOptimizeLoop_(
308 const LimitedRates& rates, double alq, bool increase) const;
309 std::pair<LimitedRates, double> reduceALQtoGroupAlqLimits_(
310 double alq, const LimitedRates& rates) const;
311 std::pair<LimitedRates, double> reduceALQtoGroupTarget(
312 double alq, const LimitedRates& rates) const;
313 std::pair<LimitedRates, double> reduceALQtoWellTarget_(
314 double alq, const LimitedRates& rates) const;
315 std::unique_ptr<GasLiftWellState> runOptimize1_();
316 std::unique_ptr<GasLiftWellState> runOptimize2_();
317 std::unique_ptr<GasLiftWellState> runOptimizeLoop_(bool increase);
318 void setAlqMinRate_(const GasLiftWell& well);
319 std::unique_ptr<GasLiftWellState> tryIncreaseLiftGas_();
320 std::unique_ptr<GasLiftWellState> tryDecreaseLiftGas_();
322 const LimitedRates& rates,
323 const LimitedRates& new_rates,
324 double delta_alq) const;
326 const BasicRates& rates, const LimitedRates& new_rates, const std::string& gr_name = "") const;
327 void updateWellStateAlqFixedValue_(const GasLiftWell& well);
328 bool useFixedAlq_(const GasLiftWell& well);
330 Rate rate_type, const std::string& gr_name, double rate, double target) const;
332
333 const Well& ecl_well_;
334 const SummaryState& summary_state_;
338 const WellProductionControls controls_;
339
341 double max_alq_;
342 double min_alq_;
343 double orig_alq_;
344
345 double alpha_w_;
346 double alpha_g_;
347 double eco_grad_;
348
352
354
355 std::string well_name_;
356
357 const GasLiftWell* gl_well_;
358
363};
364
365} // namespace Opm
366
367#endif // OPM_GASLIFT_SINGLE_WELL_GENERIC_HEADER_INCLUDED
@ Liquid
Definition: BlackoilPhases.hpp:42
@ Aqua
Definition: BlackoilPhases.hpp:42
@ Vapour
Definition: BlackoilPhases.hpp:42
Definition: DeferredLogger.hpp:57
Definition: GasLiftCommon.hpp:35
Definition: GasLiftGroupInfo.hpp:45
Rate
Definition: GasLiftGroupInfo.hpp:66
Definition: GasLiftSingleWellGeneric.hpp:49
static constexpr int NUM_PHASES
Definition: GasLiftSingleWellGeneric.hpp:54
double alpha_w_
Definition: GasLiftSingleWellGeneric.hpp:345
int oil_pos_
Definition: GasLiftSingleWellGeneric.hpp:350
double min_alq_
Definition: GasLiftSingleWellGeneric.hpp:342
std::pair< LimitedRates, double > reduceALQtoGroupTarget(double alq, const LimitedRates &rates) const
double max_alq_
Definition: GasLiftSingleWellGeneric.hpp:341
int max_iterations_
Definition: GasLiftSingleWellGeneric.hpp:353
std::unique_ptr< GasLiftWellState > runOptimize2_()
std::pair< std::optional< LimitedRates >, double > getInitialRatesWithLimit_() const
bool hasProductionControl_(Rate rate) const
const Well & ecl_well_
Definition: GasLiftSingleWellGeneric.hpp:333
std::pair< double, std::optional< Rate > > getOilRateWithLimit2_(const BasicRates &rates) const
const GasLiftWell * gl_well_
Definition: GasLiftSingleWellGeneric.hpp:357
double orig_alq_
Definition: GasLiftSingleWellGeneric.hpp:343
bool checkInitialALQmodified_(double alq, double initial_alq) const
void updateGroupRates_(const LimitedRates &rates, const LimitedRates &new_rates, double delta_alq) const
static constexpr int Gas
Definition: GasLiftSingleWellGeneric.hpp:53
std::optional< LimitedRates > computeLimitedWellRatesWithALQ_(double alq) const
double eco_grad_
Definition: GasLiftSingleWellGeneric.hpp:347
std::tuple< double, const std::string *, double > getRateWithGroupLimit_(Rate rate_type, const double new_rate, const double old_rate, const std::string &gr_name_dont_limit) const
std::pair< LimitedRates, double > increaseALQtoMinALQ_(double alq, const LimitedRates &orig_rates) const
double increment_
Definition: GasLiftSingleWellGeneric.hpp:340
int gas_pos_
Definition: GasLiftSingleWellGeneric.hpp:349
static constexpr int Oil
Definition: GasLiftSingleWellGeneric.hpp:52
void setAlqMinRate_(const GasLiftWell &well)
bool debug_abort_if_decrease_and_oil_is_limited_
Definition: GasLiftSingleWellGeneric.hpp:361
void displayDebugMessage_(const std::string &msg) const override
int water_pos_
Definition: GasLiftSingleWellGeneric.hpp:351
std::pair< LimitedRates, double > reduceALQtoGroupAlqLimits_(double alq, const LimitedRates &rates) const
LimitedRates getLimitedRatesFromRates_(const BasicRates &rates) const
std::pair< double, std::optional< Rate > > getRateWithLimit_(Rate rate_type, const BasicRates &rates) const
std::unique_ptr< GasLiftWellState > tryDecreaseLiftGas_()
bool optimize_
Definition: GasLiftSingleWellGeneric.hpp:359
std::pair< double, bool > getGasRateWithGroupLimit_(double new_gas_rate, double gas_rate, const std::string &gr_name_dont_limit) const
GasLiftSingleWellGeneric(DeferredLogger &deferred_logger, WellState< double > &well_state, const GroupState< double > &group_state, const Well &ecl_well, const SummaryState &summary_state, GasLiftGroupInfo &group_info, const PhaseUsage &phase_usage, const Schedule &schedule, const int report_step_idx, GLiftSyncGroups &sync_groups, const Parallel::Communication &comm, bool glift_debug)
std::pair< double, bool > getWaterRateWithLimit_(const BasicRates &rates) const
std::pair< LimitedRates, double > reduceALQtoWellTarget_(double alq, const LimitedRates &rates) const
virtual ~GasLiftSingleWellGeneric()=default
void displayWarning_(const std::string &warning)
std::unique_ptr< GasLiftWellState > runOptimizeLoop_(bool increase)
void debugShowLimitingTargets_(const LimitedRates &rates) const
double calcEcoGradient_(double oil_rate, double new_oil_rate, double gas_rate, double new_gas_rate, bool increase) const
bool checkALQequal_(double alq1, double alq2) const
static constexpr int Water
Definition: GasLiftSingleWellGeneric.hpp:51
void debugCheckNegativeGradient_(double grad, double alq, double new_alq, double oil_rate, double new_oil_rate, double gas_rate, double new_gas_rate, bool increase) const
double alpha_g_
Definition: GasLiftSingleWellGeneric.hpp:346
const WellProductionControls controls_
Definition: GasLiftSingleWellGeneric.hpp:338
LimitedRates updateRatesToGroupLimits_(const BasicRates &rates, const LimitedRates &new_rates, const std::string &gr_name="") const
BasicRates getWellStateRates_() const
GLiftSyncGroups & sync_groups_
Definition: GasLiftSingleWellGeneric.hpp:337
std::pair< std::optional< double >, double > computeConvergedBhpAtThpLimitByMaybeIncreasingALQ_() const
std::tuple< double, double, bool, bool > getLiquidRateWithGroupLimit_(const double new_oil_rate, const double oil_rate, const double new_water_rate, const double water_rate, const std::string &gr_name_dont_limit) const
std::optional< BasicRates > computeWellRatesWithALQ_(double alq) const
void debugInfoGroupRatesExceedTarget(Rate rate_type, const std::string &gr_name, double rate, double target) const
std::pair< double, bool > getOilRateWithGroupLimit_(double new_oil_rate, double oil_rate, const std::string &gr_name_dont_limit) const
void logSuccess_(double alq, const int iteration_idx)
bool debug_limit_increase_decrease_
Definition: GasLiftSingleWellGeneric.hpp:360
bool useFixedAlq_(const GasLiftWell &well)
std::string well_name_
Definition: GasLiftSingleWellGeneric.hpp:355
virtual std::optional< double > computeBhpAtThpLimit_(double alq, bool debug_output=true) const =0
std::pair< double, bool > getBhpWithLimit_(double bhp) const
virtual BasicRates computeWellRates_(double bhp, bool bhp_is_limited, bool debug_output=true) const =0
std::pair< std::optional< BasicRates >, double > computeInitialWellRates_() const
double getRate_(Rate rate_type, const BasicRates &rates) const
std::pair< double, bool > getGasRateWithLimit_(const BasicRates &rates) const
static constexpr double ALQ_EPSILON
Definition: GasLiftSingleWellGeneric.hpp:55
GasLiftGroupInfo & group_info_
Definition: GasLiftSingleWellGeneric.hpp:335
void debugShowStartIteration_(double alq, bool increase, double oil_rate)
void debugPrintWellStateRates() const
const PhaseUsage & phase_usage_
Definition: GasLiftSingleWellGeneric.hpp:336
std::pair< LimitedRates, double > maybeAdjustALQbeforeOptimizeLoop_(const LimitedRates &rates, double alq, bool increase) const
std::pair< LimitedRates, double > increaseALQtoPositiveOilRate_(double alq, const LimitedRates &orig_rates) const
const std::string & name() const
Definition: GasLiftSingleWellGeneric.hpp:90
virtual bool checkThpControl_() const =0
std::pair< double, bool > getOilRateWithLimit_(const BasicRates &rates) const
const SummaryState & summary_state_
Definition: GasLiftSingleWellGeneric.hpp:334
bool debug_abort_if_increase_and_gas_is_limited_
Definition: GasLiftSingleWellGeneric.hpp:362
std::set< int > GLiftSyncGroups
Definition: GasLiftSingleWellGeneric.hpp:58
bool checkGroupALQrateExceeded(double delta_alq, const std::string &gr_name_dont_limit="") const
std::unique_ptr< GasLiftWellState > runOptimize(const int iteration_idx)
std::unique_ptr< GasLiftWellState > runOptimize1_()
bool checkGroupTargetsViolated(const BasicRates &rates, const BasicRates &new_rates) const
virtual const WellInterfaceGeneric & getWell() const =0
bool checkGroupTotalRateExceeded(double delta_alq, double delta_gas_rate) const
std::unique_ptr< GasLiftWellState > tryIncreaseLiftGas_()
void debugShowProducerControlMode() const
std::pair< std::optional< double >, bool > addOrSubtractAlqIncrement_(double alq, bool increase) const
std::optional< GradInfo > calcIncOrDecGradient(double oil_rate, double gas_rate, double water_rate, double alq, const std::string &gr_name_dont_limit, bool increase, bool debug_output=true) const
void updateWellStateAlqFixedValue_(const GasLiftWell &well)
double getProductionTarget_(Rate rate) const
std::pair< double, bool > getWaterRateWithGroupLimit_(double new_water_rate, double water_rate, const std::string &gr_name_dont_limit) const
std::pair< double, std::optional< Rate > > getWaterRateWithLimit2_(const BasicRates &rates) const
Definition: WellInterfaceGeneric.hpp:50
Dune::Communication< MPIComm > Communication
Definition: ParallelCommunication.hpp:30
VFPEvaluation bhp(const VFPProdTable &table, const double aqua, const double liquid, const double vapour, const double thp, const double alq, const double explicit_wfr, const double explicit_gfr, const bool use_vfpexplicit)
Definition: BlackoilPhases.hpp:27
Definition: GasLiftSingleWellGeneric.hpp:122
double oil
Definition: GasLiftSingleWellGeneric.hpp:161
bool bhp_is_limited
Definition: GasLiftSingleWellGeneric.hpp:162
double operator[](Rate rate_type) const
Definition: GasLiftSingleWellGeneric.hpp:146
BasicRates(const LimitedRates &rates)
double water
Definition: GasLiftSingleWellGeneric.hpp:161
double gas
Definition: GasLiftSingleWellGeneric.hpp:161
BasicRates(double oil_, double gas_, double water_, bool bhp_is_limited_)
Definition: GasLiftSingleWellGeneric.hpp:129
BasicRates(const BasicRates &rates)
Definition: GasLiftSingleWellGeneric.hpp:123
BasicRates & operator=(const BasicRates &rates)
Definition: GasLiftSingleWellGeneric.hpp:135
Definition: GasLiftSingleWellGeneric.hpp:61
bool water_is_limited
Definition: GasLiftSingleWellGeneric.hpp:83
double grad
Definition: GasLiftSingleWellGeneric.hpp:77
bool alq_is_limited
Definition: GasLiftSingleWellGeneric.hpp:85
double alq
Definition: GasLiftSingleWellGeneric.hpp:84
GradInfo(double grad_, double new_oil_rate_, bool oil_is_limited_, double new_gas_rate_, bool gas_is_limited_, double new_water_rate_, bool water_is_limited_, double alq_, bool alq_is_limited_)
Definition: GasLiftSingleWellGeneric.hpp:64
bool oil_is_limited
Definition: GasLiftSingleWellGeneric.hpp:79
GradInfo()
Definition: GasLiftSingleWellGeneric.hpp:62
double new_gas_rate
Definition: GasLiftSingleWellGeneric.hpp:80
double new_oil_rate
Definition: GasLiftSingleWellGeneric.hpp:78
bool gas_is_limited
Definition: GasLiftSingleWellGeneric.hpp:81
double new_water_rate
Definition: GasLiftSingleWellGeneric.hpp:82
Definition: GasLiftSingleWellGeneric.hpp:166
bool water_is_limited
Definition: GasLiftSingleWellGeneric.hpp:206
std::optional< Rate > oil_limiting_target
Definition: GasLiftSingleWellGeneric.hpp:207
LimitType limit_type
Definition: GasLiftSingleWellGeneric.hpp:203
LimitedRates(const BasicRates &rates, bool oil_is_limited_, bool gas_is_limited_, bool water_is_limited_)
Definition: GasLiftSingleWellGeneric.hpp:185
LimitType
Definition: GasLiftSingleWellGeneric.hpp:167
LimitedRates(double oil_, double gas_, double water_, bool oil_is_limited_, bool gas_is_limited_, bool water_is_limited_, bool bhp_is_limited_, std::optional< Rate > oil_limiting_target_, std::optional< Rate > water_limiting_target_)
Definition: GasLiftSingleWellGeneric.hpp:168
bool limited() const
Definition: GasLiftSingleWellGeneric.hpp:198
bool gas_is_limited
Definition: GasLiftSingleWellGeneric.hpp:205
bool oil_is_limited
Definition: GasLiftSingleWellGeneric.hpp:204
std::optional< Rate > water_limiting_target
Definition: GasLiftSingleWellGeneric.hpp:208
Definition: GasLiftSingleWellGeneric.hpp:216
int it
Definition: GasLiftSingleWellGeneric.hpp:227
GasLiftSingleWellGeneric & parent
Definition: GasLiftSingleWellGeneric.hpp:225
bool increase
Definition: GasLiftSingleWellGeneric.hpp:226
bool checkAlqOutsideLimits(double alq, double oil_rate)
OptimizeState(GasLiftSingleWellGeneric &parent_, bool increase_)
Definition: GasLiftSingleWellGeneric.hpp:217
std::pair< std::optional< double >, bool > addOrSubtractAlqIncrement(double alq)
double calcEcoGradient(double oil_rate, double new_oil_rate, double gas_rate, double new_gas_rate)
bool checkRatesViolated(const LimitedRates &rates) const
double bhp
Definition: GasLiftSingleWellGeneric.hpp:229
void warn_(std::string msg)
Definition: GasLiftSingleWellGeneric.hpp:240
bool stop_iteration
Definition: GasLiftSingleWellGeneric.hpp:228
Definition: BlackoilPhases.hpp:46