19#ifndef GAS_LIFT_OPT_HPP
20#define GAS_LIFT_OPT_HPP
25#include <opm/io/eclipse/rst/well.hpp>
26#include <opm/io/eclipse/rst/group.hpp>
37 Group(
const std::string& name) :
42 if ((rst_group.glift_max_rate + rst_group.glift_max_supply) != 0)
49 : m_name(rst_group.name)
50 , m_max_lift_gas(rst_group.glift_max_supply)
51 , m_max_total_gas(rst_group.glift_max_rate)
54 const std::optional<double>& max_lift_gas()
const {
55 return this->m_max_lift_gas;
58 void max_lift_gas(
double value) {
60 this->m_max_lift_gas = value;
63 const std::optional<double>& max_total_gas()
const {
64 return this->m_max_total_gas;
67 void max_total_gas(
double value) {
69 this->m_max_total_gas = value;
72 const std::string& name()
const {
76 template<
class Serializer>
80 serializer(m_max_lift_gas);
81 serializer(m_max_total_gas);
85 static Group serializationTestObject() {
88 group.m_max_lift_gas = 100;
89 group.m_max_total_gas = 200;
94 bool operator==(
const Group& other)
const {
95 return this->m_name == other.m_name &&
96 this->m_max_lift_gas == other.m_max_lift_gas &&
97 this->m_max_total_gas == other.m_max_total_gas;
102 std::optional<double> m_max_lift_gas;
103 std::optional<double> m_max_total_gas;
116 if ((rst_well.glift_max_rate + rst_well.glift_min_rate + rst_well.glift_weight_factor == 0))
124 : m_name(rst_well.name)
125 , m_max_rate(rst_well.glift_max_rate)
126 , m_min_rate(rst_well.glift_min_rate)
127 , m_use_glo(rst_well.glift_active)
128 , m_weight(rst_well.glift_weight_factor)
129 , m_inc_weight(rst_well.glift_inc_weight_factor)
130 , m_alloc_extra_gas(rst_well.glift_alloc_extra_gas)
134 Well(
const std::string& name,
bool use_glo) :
139 const std::string& name()
const {
143 bool use_glo()
const {
144 return this->m_use_glo;
147 void max_rate(
double value) {
148 this->m_max_rate = value;
168 const std::optional<double>& max_rate()
const {
169 return this->m_max_rate;
172 void weight_factor(
double value) {
174 this->m_weight = value;
177 double weight_factor()
const {
178 return this->m_weight;
181 void inc_weight_factor(
double value) {
183 this->m_inc_weight = value;
186 double inc_weight_factor()
const {
187 return this->m_inc_weight;
190 void min_rate(
double value) {
192 this->m_min_rate = value;
195 double min_rate()
const {
196 return this->m_min_rate;
199 void alloc_extra_gas(
bool value) {
201 this->m_alloc_extra_gas = value;
204 bool alloc_extra_gas()
const {
205 return this->m_alloc_extra_gas;
208 template<
class Serializer>
212 serializer(m_use_glo);
213 serializer(m_max_rate);
214 serializer(m_min_rate);
215 serializer(m_weight);
216 serializer(m_inc_weight);
217 serializer(m_alloc_extra_gas);
220 static Well serializationTestObject() {
222 well.m_name =
"WELL";
223 well.m_max_rate = 2000;
224 well.m_min_rate = 56;
225 well.m_use_glo =
true;
226 well.m_weight = 1.25;
227 well.m_inc_weight = 0.25;
228 well.m_alloc_extra_gas =
false;
232 bool operator==(
const Well& other)
const {
233 return this->m_name == other.m_name &&
234 this->m_max_rate == other.m_max_rate &&
235 this->m_min_rate == other.m_min_rate &&
236 this->m_use_glo == other.m_use_glo &&
237 this->m_weight == other.m_weight &&
238 this->m_inc_weight == other.m_inc_weight &&
239 this->m_alloc_extra_gas == other.m_alloc_extra_gas;
244 std::optional<double> m_max_rate;
245 double m_min_rate = 0;
246 bool m_use_glo =
false;
248 double m_inc_weight = 0;
249 bool m_alloc_extra_gas =
false;
254 const Group& group(
const std::string& gname)
const;
255 const Well& well(
const std::string& wname)
const;
257 double gaslift_increment()
const;
258 void gaslift_increment(
double gaslift_increment);
259 double min_eco_gradient()
const;
260 void min_eco_gradient(
double min_eco_gradient);
261 double min_wait()
const;
262 void min_wait(
double min_wait);
263 void all_newton(
double all_newton);
264 bool all_newton()
const;
265 void add_group(
const Group& group);
266 void add_well(
const Well& well);
268 bool has_well(
const std::string& well)
const;
269 bool has_group(
const std::string& group)
const;
270 std::size_t num_wells()
const;
273 bool operator==(
const GasLiftOpt& other)
const;
275 template<
class Serializer>
278 serializer(m_increment);
279 serializer(m_min_eco_gradient);
280 serializer(m_min_wait);
281 serializer(m_all_newton);
282 serializer(m_groups);
286 double m_increment = 0;
287 double m_min_eco_gradient;
289 bool m_all_newton =
true;
291 std::map<std::string, GasLiftOpt::Group> m_groups;
292 std::map<std::string, GasLiftOpt::Well> m_wells;
Definition: GasLiftOpt.hpp:33
Definition: GasLiftOpt.hpp:107
Definition: GasLiftOpt.hpp:30
Class for (de-)serializing.
Definition: Serializer.hpp:75
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29