19 #ifndef GAS_LIFT_OPT_HPP
20 #define GAS_LIFT_OPT_HPP
35 Group(
const std::string& name) :
39 const std::optional<double>& max_lift_gas()
const {
40 return this->m_max_lift_gas;
43 void max_lift_gas(
double value) {
45 this->m_max_lift_gas = value;
48 const std::optional<double>& max_total_gas()
const {
49 return this->m_max_total_gas;
52 void max_total_gas(
double value) {
54 this->m_max_total_gas = value;
57 const std::string& name()
const {
61 template<
class Serializer>
65 serializer(m_max_lift_gas);
66 serializer(m_max_total_gas);
70 static Group serializeObject() {
73 group.m_max_lift_gas = 100;
74 group.m_max_total_gas = 200;
79 bool operator==(
const Group& other)
const {
80 return this->m_name == other.m_name &&
81 this->m_max_lift_gas == other.m_max_lift_gas &&
82 this->m_max_total_gas == other.m_max_total_gas;
87 std::optional<double> m_max_lift_gas;
88 std::optional<double> m_max_total_gas;
95 Well(
const std::string& name,
bool use_glo) :
100 const std::string& name()
const {
104 bool use_glo()
const {
105 return this->m_use_glo;
108 void max_rate(
double value) {
109 this->m_max_rate = value;
129 const std::optional<double>& max_rate()
const {
130 return this->m_max_rate;
133 void weight_factor(
double value) {
135 this->m_weight = value;
138 double weight_factor()
const {
139 return this->m_weight;
142 void inc_weight_factor(
double value) {
144 this->m_inc_weight = value;
147 double inc_weight_factor()
const {
148 return this->m_inc_weight;
151 void min_rate(
double value) {
153 this->m_min_rate = value;
156 double min_rate()
const {
157 return this->m_min_rate;
160 void alloc_extra_gas(
bool value) {
162 this->m_alloc_extra_gas = value;
165 bool alloc_extra_gas()
const {
166 return this->m_alloc_extra_gas;
169 template<
class Serializer>
173 serializer(m_use_glo);
174 serializer(m_max_rate);
175 serializer(m_min_rate);
176 serializer(m_weight);
177 serializer(m_inc_weight);
178 serializer(m_alloc_extra_gas);
181 static Well serializeObject() {
183 well.m_name =
"WELL";
184 well.m_max_rate = 2000;
185 well.m_min_rate = 56;
186 well.m_use_glo =
true;
187 well.m_weight = 1.25;
188 well.m_inc_weight = 0.25;
189 well.m_alloc_extra_gas =
false;
193 bool operator==(
const Well& other)
const {
194 return this->m_name == other.m_name &&
195 this->m_max_rate == other.m_max_rate &&
196 this->m_min_rate == other.m_min_rate &&
197 this->m_use_glo == other.m_use_glo &&
198 this->m_weight == other.m_weight &&
199 this->m_inc_weight == other.m_inc_weight &&
200 this->m_alloc_extra_gas == other.m_alloc_extra_gas;
205 std::optional<double> m_max_rate;
206 double m_min_rate = 0;
207 bool m_use_glo =
false;
209 double m_inc_weight = 0;
210 bool m_alloc_extra_gas =
false;
215 const Group& group(
const std::string& gname)
const;
216 const Well& well(
const std::string& wname)
const;
218 double gaslift_increment()
const;
219 void gaslift_increment(
double gaslift_increment);
220 double min_eco_gradient()
const;
221 void min_eco_gradient(
double min_eco_gradient);
222 double min_wait()
const;
223 void min_wait(
double min_wait);
224 void all_newton(
double all_newton);
225 bool all_newton()
const;
226 void add_group(
const Group& group);
227 void add_well(
const Well& well);
229 bool has_well(
const std::string& well)
const;
230 bool has_group(
const std::string& group)
const;
233 bool operator==(
const GasLiftOpt& other)
const;
235 template<
class Serializer>
238 serializer(m_increment);
239 serializer(m_min_eco_gradient);
240 serializer(m_min_wait);
241 serializer(m_all_newton);
242 serializer.map(m_groups);
243 serializer.map(m_wells);
246 double m_increment = 0;
247 double m_min_eco_gradient;
249 bool m_all_newton =
true;
251 std::map<std::string, GasLiftOpt::Group> m_groups;
252 std::map<std::string, GasLiftOpt::Well> m_wells;
Definition: GasLiftOpt.hpp:31
Definition: GasLiftOpt.hpp:92
Definition: GasLiftOpt.hpp:28
Definition: Serializer.hpp:38
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29