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
23#include <opm/input/eclipse/Schedule/Well/WellProductionControls.hpp>
24
27
28#include <optional>
29#include <set>
30#include <stdexcept>
31#include <string>
32#include <tuple>
33#include <utility>
34
35namespace Opm {
36
37class DeferredLogger;
38class GasLiftWell;
39template<class Scalar> class GasLiftWellState;
40class Schedule;
41class SummaryState;
42template<typename Scalar, typename IndexTraits> class WellInterfaceGeneric;
43template<typename Scalar, typename IndexTraits> class WellState;
44template<class Scalar> class GroupState;
45
46template<typename Scalar, typename IndexTraits>
47class GasLiftSingleWellGeneric : public GasLiftCommon<Scalar, IndexTraits>
48{
49protected:
50 static constexpr int Water = IndexTraits::waterPhaseIdx;
51 static constexpr int Oil = IndexTraits::oilPhaseIdx;
52 static constexpr int Gas = IndexTraits::gasPhaseIdx;
53 static constexpr int NUM_PHASES = 3;
54 static constexpr Scalar ALQ_EPSILON = 1e-8;
55
56public:
57 using GLiftSyncGroups = std::set<int>;
60
61 struct GradInfo
62 {
63 GradInfo() = default;
64 GradInfo(Scalar grad_,
65 Scalar new_oil_rate_,
66 Scalar new_oil_pot_,
67 bool oil_is_limited_,
68 Scalar new_gas_rate_,
69 Scalar new_gas_pot_,
70 bool gas_is_limited_,
71 Scalar new_water_rate_,
72 Scalar new_water_pot_,
73 bool water_is_limited_,
74 Scalar alq_,
75 bool alq_is_limited_,
76 Scalar bhp_)
77 : grad{grad_}
78 , new_oil_rate{new_oil_rate_}
79 , new_oil_pot{new_oil_pot_}
80 , oil_is_limited{oil_is_limited_}
81 , new_gas_rate{new_gas_rate_}
82 , new_gas_pot{new_gas_pot_}
83 , gas_is_limited{gas_is_limited_}
84 , new_water_rate{new_water_rate_}
85 , new_water_pot{new_water_pot_}
86 , water_is_limited{water_is_limited_}
87 , alq{alq_}
88 , alq_is_limited{alq_is_limited_}
89 , bhp{bhp_}
90 {}
91
92 Scalar grad;
102 Scalar alq;
104 Scalar bhp;
105 };
106
107 const std::string& name() const { return well_name_; }
108
109 std::optional<GradInfo> calcIncOrDecGradient(const GasLiftWellState<Scalar>& state,
110 const std::string& gr_name_dont_limit,
111 bool increase,
112 bool debug_output = true) const;
113
114 std::unique_ptr<GasLiftWellState<Scalar>> runOptimize(const int iteration_idx);
115
116 std::pair<Scalar, bool> wellTestALQ();
117
119
120protected:
123 const GroupState<Scalar>& group_state,
124 const Well& ecl_well,
125 const SummaryState& summary_state,
127 const Schedule& schedule,
128 const int report_step_idx,
129 GLiftSyncGroups& sync_groups,
130 const Parallel::Communication& comm,
131 bool glift_debug);
132
133 struct LimitedRatesAndBhp;
135 {
136 RatesAndBhp(const RatesAndBhp& rates) :
137 oil{rates.oil},
138 gas{rates.gas},
139 water{rates.water},
140 bhp{rates.bhp},
142 {}
143
144 RatesAndBhp(Scalar oil_,
145 Scalar gas_,
146 Scalar water_,
147 Scalar bhp_,
148 bool bhp_is_limited_)
149 : oil{oil_}
150 , gas{gas_}
151 , water{water_}
152 , bhp{bhp_}
153 , bhp_is_limited{bhp_is_limited_}
154 {}
155
157 {
158 oil = rates.oil;
159 gas = rates.gas;
160 water = rates.water;
161 bhp = rates.bhp;
163 return *this;
164 }
165
166 // This copy constructor cannot be defined inline here since LimitedRatesAndBhp
167 // has not been defined yet (it is defined below). Instead it is defined in
168 // in the .cpp file
169 explicit RatesAndBhp(const LimitedRatesAndBhp& rates);
170
171 Scalar operator[](Rate rate_type) const
172 {
173 switch (rate_type) {
174 case Rate::oil:
175 return this->oil;
176 case Rate::gas:
177 return this->gas;
178 case Rate::water:
179 return this->water;
180 case Rate::liquid:
181 return this->oil + this->water;
182 default:
183 throw std::runtime_error("This should not happen");
184 }
185 }
186
187 Scalar oil, gas, water, bhp;
189 };
190
192 {
193 enum class LimitType {well, group, none};
195 Scalar oil_pot_,
196 Scalar gas_,
197 Scalar gas_pot_,
198 Scalar water_,
199 Scalar water_pot_,
200 Scalar bhp_,
201 bool oil_is_limited_,
202 bool gas_is_limited_,
203 bool water_is_limited_,
204 bool bhp_is_limited_)
205 : RatesAndBhp(oil_, gas_, water_, bhp_, bhp_is_limited_)
206 , oil_pot(oil_pot_)
207 , gas_pot(gas_pot_)
208 , water_pot(water_pot_)
209 , oil_is_limited{oil_is_limited_}
210 , gas_is_limited{gas_is_limited_}
211 , water_is_limited{water_is_limited_}
212 {
213 set_initial_limit_type_();
214 }
215
217 Scalar oil_pot_,
218 Scalar gas_pot_,
219 Scalar water_pot_,
220 bool oil_is_limited_,
221 bool gas_is_limited_,
222 bool water_is_limited_)
223 : RatesAndBhp(rates)
224 , oil_pot(oil_pot_)
225 , gas_pot(gas_pot_)
226 , water_pot(water_pot_)
227 , oil_is_limited{oil_is_limited_}
228 , gas_is_limited{gas_is_limited_}
229 , water_is_limited{water_is_limited_}
230 {
231 set_initial_limit_type_();
232 }
233
234 bool limited() const
235 {
237 }
238
239 // For a given ALQ value, were the rates limited due to group targets
240 // or due to well targets?
242 Scalar oil_pot;
243 Scalar gas_pot;
244 Scalar water_pot;
248
249 private:
250 void set_initial_limit_type_()
251 {
253 }
254 };
255
257 {
258 OptimizeState( GasLiftSingleWellGeneric& parent_, bool increase_ )
259 : parent{parent_}
260 , increase{increase_}
261 , it{0}
262 , stop_iteration{false}
263 , bhp{-1}
264 {}
265
268 int it;
270 Scalar bhp;
271
272 std::pair<std::optional<Scalar>,bool> addOrSubtractAlqIncrement(Scalar alq);
273 Scalar calcEcoGradient(Scalar oil_rate,
274 Scalar new_oil_rate,
275 Scalar gas_rate,
276 Scalar new_gas_rate);
277
278 bool checkAlqOutsideLimits(Scalar alq, Scalar oil_rate);
279 bool checkEcoGradient(Scalar gradient);
280 bool checkOilRateExceedsTarget(Scalar oil_rate);
281 bool checkRatesViolated(const LimitedRatesAndBhp& rates) const;
282
283 void debugShowIterationInfo(Scalar alq);
284
286
287 void warn_(const std::string& msg) { parent.displayWarning_(msg); }
288 };
289
290 bool checkGroupALQrateExceeded(Scalar delta_alq,
291 const std::string& gr_name_dont_limit = "") const;
292 bool checkGroupTotalRateExceeded(Scalar delta_alq,
293 Scalar delta_gas_rate,
294 const std::string& gr_name_dont_limit = "") const;
295
296 std::pair<std::optional<Scalar>, bool>
297 addOrSubtractAlqIncrement_(Scalar alq, bool increase) const;
298
299 Scalar calcEcoGradient_(Scalar oil_rate, Scalar new_oil_rate,
300 Scalar gas_rate, Scalar new_gas_rate, bool increase) const;
301
302 bool checkALQequal_(Scalar alq1, Scalar alq2) const;
303
305 const RatesAndBhp& new_rates) const;
306 bool checkInitialALQmodified_(Scalar alq, Scalar initial_alq) const;
307
308 virtual bool checkThpControl_() const = 0;
309 virtual std::optional<Scalar > computeBhpAtThpLimit_(Scalar alq, Scalar current_bhp,
310 bool debug_output = true) const = 0;
311
312 std::pair<std::optional<Scalar>,Scalar>
314
315 std::pair<std::optional<RatesAndBhp>,Scalar>
317
318 std::optional<LimitedRatesAndBhp>
319 computeLimitedWellRatesWithALQ_(Scalar alq, Scalar bhp) const;
320
321 virtual RatesAndBhp computeWellRates_(Scalar bhp,
322 bool bhp_is_limited,
323 bool debug_output = true) const = 0;
324
325 std::optional<RatesAndBhp> computeWellRatesWithALQ_(Scalar alq, Scalar bhp) const;
326
327 void debugCheckNegativeGradient_(Scalar grad, Scalar alq, Scalar new_alq,
328 Scalar oil_rate, Scalar new_oil_rate,
329 Scalar gas_rate, Scalar new_gas_rate,
330 bool increase) const;
331
337 void debugShowStartIteration_(Scalar alq, bool increase, Scalar oil_rate);
339 void displayDebugMessage_(const std::string& msg) const override;
340 void displayWarning_(const std::string& warning);
341
342 std::pair<Scalar, bool> getBhpWithLimit_(Scalar bhp) const;
343 std::pair<Scalar, bool> getGasRateWithGroupLimit_(Scalar new_gas_rate,
344 Scalar gas_rate,
345 const std::string& gr_name_dont_limit) const;
346
347 std::pair<std::optional<LimitedRatesAndBhp>,Scalar >
349
351
352
353 Scalar getProductionTarget_(Rate rate) const;
354 Scalar getRate_(Rate rate_type, const RatesAndBhp& rates) const;
355
356 std::pair<Scalar, std::optional<Rate>>
357 getRateWithLimit_(Rate rate_type, const RatesAndBhp& rates) const;
358
359 std::tuple<Scalar, const std::string*>
361 const Scalar new_rate,
362 const Scalar old_rate,
363 const std::string& gr_name_dont_limit) const;
364
366 bool hasProductionControl_(Rate rate) const;
367
368 std::pair<LimitedRatesAndBhp, Scalar>
370 const LimitedRatesAndBhp& orig_rates) const;
371
372 std::pair<LimitedRatesAndBhp, Scalar>
374 const LimitedRatesAndBhp& orig_rates) const;
375
376 void logSuccess_(Scalar alq,
377 const int iteration_idx);
378
379 std::pair<LimitedRatesAndBhp, Scalar>
381 Scalar alq,
382 bool increase) const;
383
384 std::pair<LimitedRatesAndBhp, Scalar>
386 const LimitedRatesAndBhp& rates) const;
387
388 std::pair<LimitedRatesAndBhp, Scalar>
390 const LimitedRatesAndBhp& rates) const;
391
392 std::pair<LimitedRatesAndBhp, Scalar>
394 const LimitedRatesAndBhp& rates) const;
395
396 std::unique_ptr<GasLiftWellState<Scalar>> runOptimize1_();
397 std::unique_ptr<GasLiftWellState<Scalar>> runOptimize2_();
398 std::unique_ptr<GasLiftWellState<Scalar>> runOptimizeLoop_(bool increase);
399
400 void setAlqMinRate_(const GasLiftWell& well);
401 std::unique_ptr<GasLiftWellState<Scalar>> tryIncreaseLiftGas_();
402 std::unique_ptr<GasLiftWellState<Scalar>> tryDecreaseLiftGas_();
403
405 const LimitedRatesAndBhp& new_rates,
406 Scalar delta_alq) const;
407
410 const LimitedRatesAndBhp& rates,
411 const std::string& gr_name = "") const;
412
413 void updateWellStateAlqFixedValue_(const GasLiftWell& well);
414 bool useFixedAlq_(const GasLiftWell& well);
415
417 const std::string& gr_name,
418 Scalar rate,
419 Scalar target) const;
421
422 const Well& ecl_well_;
423 const SummaryState& summary_state_;
426 const WellProductionControls controls_;
427
429 Scalar max_alq_;
430 Scalar min_alq_;
431 Scalar orig_alq_;
432
433 Scalar alpha_w_;
434 Scalar alpha_g_;
435 Scalar eco_grad_;
436
440
442
443 std::string well_name_;
444
445 const GasLiftWell* gl_well_;
446
451};
452
453} // namespace Opm
454
455#endif // OPM_GASLIFT_SINGLE_WELL_GENERIC_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Definition: GasLiftCommon.hpp:35
MessageType
Definition: GasLiftCommon.hpp:46
Definition: GasLiftGroupInfo.hpp:46
Rate
Definition: GasLiftGroupInfo.hpp:62
Definition: GasLiftSingleWellGeneric.hpp:48
bool debug_limit_increase_decrease_
Definition: GasLiftSingleWellGeneric.hpp:448
Scalar max_alq_
Definition: GasLiftSingleWellGeneric.hpp:429
bool debug_abort_if_decrease_and_oil_is_limited_
Definition: GasLiftSingleWellGeneric.hpp:449
static constexpr int NUM_PHASES
Definition: GasLiftSingleWellGeneric.hpp:53
Scalar alpha_w_
Definition: GasLiftSingleWellGeneric.hpp:433
GasLiftGroupInfo< Scalar, IndexTraits > & group_info_
Definition: GasLiftSingleWellGeneric.hpp:424
RatesAndBhp getWellStateRates_() const
std::pair< Scalar, bool > getBhpWithLimit_(Scalar bhp) const
bool checkGroupALQrateExceeded(Scalar delta_alq, const std::string &gr_name_dont_limit="") const
std::tuple< Scalar, const std::string * > getRateWithGroupLimit_(Rate rate_type, const Scalar new_rate, const Scalar old_rate, const std::string &gr_name_dont_limit) const
Scalar increment_
Definition: GasLiftSingleWellGeneric.hpp:428
std::unique_ptr< GasLiftWellState< Scalar > > runOptimizeLoop_(bool increase)
static constexpr int Water
Definition: GasLiftSingleWellGeneric.hpp:50
std::unique_ptr< GasLiftWellState< Scalar > > tryIncreaseLiftGas_()
std::unique_ptr< GasLiftWellState< Scalar > > runOptimize1_()
void debugShowStartIteration_(Scalar alq, bool increase, Scalar oil_rate)
virtual RatesAndBhp computeWellRates_(Scalar bhp, bool bhp_is_limited, bool debug_output=true) const =0
Scalar getRate_(Rate rate_type, const RatesAndBhp &rates) const
void debugInfoGroupRatesExceedTarget(Rate rate_type, const std::string &gr_name, Scalar rate, Scalar target) const
Scalar eco_grad_
Definition: GasLiftSingleWellGeneric.hpp:435
bool debug_abort_if_increase_and_gas_is_limited_
Definition: GasLiftSingleWellGeneric.hpp:450
std::set< int > GLiftSyncGroups
Definition: GasLiftSingleWellGeneric.hpp:57
bool checkGroupTotalRateExceeded(Scalar delta_alq, Scalar delta_gas_rate, const std::string &gr_name_dont_limit="") const
void debugPrintWellStateRates() const
void debugCheckNegativeGradient_(Scalar grad, Scalar alq, Scalar new_alq, Scalar oil_rate, Scalar new_oil_rate, Scalar gas_rate, Scalar new_gas_rate, bool increase) const
Scalar min_alq_
Definition: GasLiftSingleWellGeneric.hpp:430
std::pair< LimitedRatesAndBhp, Scalar > increaseALQtoMinALQ_(Scalar alq, const LimitedRatesAndBhp &orig_rates) const
void displayDebugMessage_(const std::string &msg) const override
int water_pos_
Definition: GasLiftSingleWellGeneric.hpp:439
void updateWellStateAlqFixedValue_(const GasLiftWell &well)
const WellProductionControls controls_
Definition: GasLiftSingleWellGeneric.hpp:426
Scalar getProductionTarget_(Rate rate) const
std::string well_name_
Definition: GasLiftSingleWellGeneric.hpp:443
std::pair< std::optional< Scalar >, Scalar > computeConvergedBhpAtThpLimitByMaybeIncreasingALQ_() const
int max_iterations_
Definition: GasLiftSingleWellGeneric.hpp:441
void displayWarning_(const std::string &warning)
virtual std::optional< Scalar > computeBhpAtThpLimit_(Scalar alq, Scalar current_bhp, bool debug_output=true) const =0
LimitedRatesAndBhp updateRatesToGroupLimits_(const RatesAndBhp &old_rates, const LimitedRatesAndBhp &rates, const std::string &gr_name="") const
bool optimize_
Definition: GasLiftSingleWellGeneric.hpp:447
std::unique_ptr< GasLiftWellState< Scalar > > runOptimize(const int iteration_idx)
std::pair< LimitedRatesAndBhp, Scalar > reduceALQtoGroupTarget(Scalar alq, const LimitedRatesAndBhp &rates) const
std::pair< LimitedRatesAndBhp, Scalar > reduceALQtoGroupAlqLimits_(Scalar alq, const LimitedRatesAndBhp &rates) const
int oil_pos_
Definition: GasLiftSingleWellGeneric.hpp:438
std::pair< std::optional< LimitedRatesAndBhp >, Scalar > getInitialRatesWithLimit_() const
Scalar orig_alq_
Definition: GasLiftSingleWellGeneric.hpp:431
const GasLiftWell * gl_well_
Definition: GasLiftSingleWellGeneric.hpp:445
bool useFixedAlq_(const GasLiftWell &well)
std::pair< Scalar, bool > getGasRateWithGroupLimit_(Scalar new_gas_rate, Scalar gas_rate, const std::string &gr_name_dont_limit) const
Scalar alpha_g_
Definition: GasLiftSingleWellGeneric.hpp:434
std::pair< LimitedRatesAndBhp, Scalar > increaseALQtoPositiveOilRate_(Scalar alq, const LimitedRatesAndBhp &orig_rates) const
void updateGroupRates_(const LimitedRatesAndBhp &rates, const LimitedRatesAndBhp &new_rates, Scalar delta_alq) const
static constexpr int Oil
Definition: GasLiftSingleWellGeneric.hpp:51
const std::string & name() const
Definition: GasLiftSingleWellGeneric.hpp:107
bool hasProductionControl_(Rate rate) const
virtual bool checkThpControl_() const =0
std::pair< std::optional< Scalar >, bool > addOrSubtractAlqIncrement_(Scalar alq, bool increase) const
virtual const WellInterfaceGeneric< Scalar, IndexTraits > & getWell() const =0
LimitedRatesAndBhp getLimitedRatesAndBhp_(const RatesAndBhp &rates) const
static constexpr Scalar ALQ_EPSILON
Definition: GasLiftSingleWellGeneric.hpp:54
std::optional< LimitedRatesAndBhp > computeLimitedWellRatesWithALQ_(Scalar alq, Scalar bhp) const
void debugShowProducerControlMode() const
typename GasLiftGroupInfo< Scalar, IndexTraits >::Rate Rate
Definition: GasLiftSingleWellGeneric.hpp:58
void debugShowLimitingTargets_(const LimitedRatesAndBhp &rates) const
GasLiftSingleWellGeneric(DeferredLogger &deferred_logger, WellState< Scalar, IndexTraits > &well_state, const GroupState< Scalar > &group_state, const Well &ecl_well, const SummaryState &summary_state, GasLiftGroupInfo< Scalar, IndexTraits > &group_info, const Schedule &schedule, const int report_step_idx, GLiftSyncGroups &sync_groups, const Parallel::Communication &comm, bool glift_debug)
static constexpr int Gas
Definition: GasLiftSingleWellGeneric.hpp:52
std::pair< Scalar, std::optional< Rate > > getRateWithLimit_(Rate rate_type, const RatesAndBhp &rates) const
std::pair< LimitedRatesAndBhp, Scalar > reduceALQtoWellTarget_(Scalar alq, const LimitedRatesAndBhp &rates) const
bool checkInitialALQmodified_(Scalar alq, Scalar initial_alq) const
std::pair< Scalar, bool > wellTestALQ()
void logSuccess_(Scalar alq, const int iteration_idx)
std::unique_ptr< GasLiftWellState< Scalar > > tryDecreaseLiftGas_()
Scalar calcEcoGradient_(Scalar oil_rate, Scalar new_oil_rate, Scalar gas_rate, Scalar new_gas_rate, bool increase) const
int gas_pos_
Definition: GasLiftSingleWellGeneric.hpp:437
const SummaryState & summary_state_
Definition: GasLiftSingleWellGeneric.hpp:423
std::optional< RatesAndBhp > computeWellRatesWithALQ_(Scalar alq, Scalar bhp) const
std::pair< std::optional< RatesAndBhp >, Scalar > computeInitialWellRates_() const
GLiftSyncGroups & sync_groups_
Definition: GasLiftSingleWellGeneric.hpp:425
bool checkALQequal_(Scalar alq1, Scalar alq2) const
std::unique_ptr< GasLiftWellState< Scalar > > runOptimize2_()
std::pair< LimitedRatesAndBhp, Scalar > maybeAdjustALQbeforeOptimizeLoop_(const LimitedRatesAndBhp &rates, Scalar alq, bool increase) const
bool checkGroupTargetsViolated(const RatesAndBhp &rates, const RatesAndBhp &new_rates) const
void setAlqMinRate_(const GasLiftWell &well)
const Well & ecl_well_
Definition: GasLiftSingleWellGeneric.hpp:422
std::optional< GradInfo > calcIncOrDecGradient(const GasLiftWellState< Scalar > &state, const std::string &gr_name_dont_limit, bool increase, bool debug_output=true) const
Definition: GasLiftWellState.hpp:30
Definition: GroupState.hpp:41
Definition: WellInterfaceGeneric.hpp:53
Definition: WellState.hpp:66
Dune::Communication< MPIComm > Communication
Definition: ParallelCommunication.hpp:30
Definition: blackoilbioeffectsmodules.hh:43
Definition: GasLiftSingleWellGeneric.hpp:62
Scalar new_oil_pot
Definition: GasLiftSingleWellGeneric.hpp:94
GradInfo(Scalar grad_, Scalar new_oil_rate_, Scalar new_oil_pot_, bool oil_is_limited_, Scalar new_gas_rate_, Scalar new_gas_pot_, bool gas_is_limited_, Scalar new_water_rate_, Scalar new_water_pot_, bool water_is_limited_, Scalar alq_, bool alq_is_limited_, Scalar bhp_)
Definition: GasLiftSingleWellGeneric.hpp:64
bool oil_is_limited
Definition: GasLiftSingleWellGeneric.hpp:95
Scalar new_gas_pot
Definition: GasLiftSingleWellGeneric.hpp:97
bool alq_is_limited
Definition: GasLiftSingleWellGeneric.hpp:103
Scalar new_oil_rate
Definition: GasLiftSingleWellGeneric.hpp:93
Scalar alq
Definition: GasLiftSingleWellGeneric.hpp:102
Scalar new_water_pot
Definition: GasLiftSingleWellGeneric.hpp:100
Scalar bhp
Definition: GasLiftSingleWellGeneric.hpp:104
Scalar new_water_rate
Definition: GasLiftSingleWellGeneric.hpp:99
Scalar new_gas_rate
Definition: GasLiftSingleWellGeneric.hpp:96
bool water_is_limited
Definition: GasLiftSingleWellGeneric.hpp:101
bool gas_is_limited
Definition: GasLiftSingleWellGeneric.hpp:98
Scalar grad
Definition: GasLiftSingleWellGeneric.hpp:92
Definition: GasLiftSingleWellGeneric.hpp:192
LimitType limit_type
Definition: GasLiftSingleWellGeneric.hpp:241
Scalar water_pot
Definition: GasLiftSingleWellGeneric.hpp:244
bool limited() const
Definition: GasLiftSingleWellGeneric.hpp:234
LimitType
Definition: GasLiftSingleWellGeneric.hpp:193
bool oil_is_limited
Definition: GasLiftSingleWellGeneric.hpp:245
LimitedRatesAndBhp(const RatesAndBhp &rates, Scalar oil_pot_, Scalar gas_pot_, Scalar water_pot_, bool oil_is_limited_, bool gas_is_limited_, bool water_is_limited_)
Definition: GasLiftSingleWellGeneric.hpp:216
LimitedRatesAndBhp(Scalar oil_, Scalar oil_pot_, Scalar gas_, Scalar gas_pot_, Scalar water_, Scalar water_pot_, Scalar bhp_, bool oil_is_limited_, bool gas_is_limited_, bool water_is_limited_, bool bhp_is_limited_)
Definition: GasLiftSingleWellGeneric.hpp:194
Scalar oil_pot
Definition: GasLiftSingleWellGeneric.hpp:242
Scalar gas_pot
Definition: GasLiftSingleWellGeneric.hpp:243
bool water_is_limited
Definition: GasLiftSingleWellGeneric.hpp:247
bool gas_is_limited
Definition: GasLiftSingleWellGeneric.hpp:246
Definition: GasLiftSingleWellGeneric.hpp:257
bool stop_iteration
Definition: GasLiftSingleWellGeneric.hpp:269
Scalar calcEcoGradient(Scalar oil_rate, Scalar new_oil_rate, Scalar gas_rate, Scalar new_gas_rate)
void warn_(const std::string &msg)
Definition: GasLiftSingleWellGeneric.hpp:287
bool checkAlqOutsideLimits(Scalar alq, Scalar oil_rate)
bool checkRatesViolated(const LimitedRatesAndBhp &rates) const
Scalar bhp
Definition: GasLiftSingleWellGeneric.hpp:270
std::pair< std::optional< Scalar >, bool > addOrSubtractAlqIncrement(Scalar alq)
OptimizeState(GasLiftSingleWellGeneric &parent_, bool increase_)
Definition: GasLiftSingleWellGeneric.hpp:258
GasLiftSingleWellGeneric & parent
Definition: GasLiftSingleWellGeneric.hpp:266
int it
Definition: GasLiftSingleWellGeneric.hpp:268
bool increase
Definition: GasLiftSingleWellGeneric.hpp:267
Definition: GasLiftSingleWellGeneric.hpp:135
Scalar water
Definition: GasLiftSingleWellGeneric.hpp:187
RatesAndBhp(const LimitedRatesAndBhp &rates)
Scalar bhp
Definition: GasLiftSingleWellGeneric.hpp:187
RatesAndBhp & operator=(const RatesAndBhp &rates)
Definition: GasLiftSingleWellGeneric.hpp:156
Scalar operator[](Rate rate_type) const
Definition: GasLiftSingleWellGeneric.hpp:171
Scalar oil
Definition: GasLiftSingleWellGeneric.hpp:187
RatesAndBhp(Scalar oil_, Scalar gas_, Scalar water_, Scalar bhp_, bool bhp_is_limited_)
Definition: GasLiftSingleWellGeneric.hpp:144
RatesAndBhp(const RatesAndBhp &rates)
Definition: GasLiftSingleWellGeneric.hpp:136
bool bhp_is_limited
Definition: GasLiftSingleWellGeneric.hpp:188
Scalar gas
Definition: GasLiftSingleWellGeneric.hpp:187