GasLiftWellState.hpp
Go to the documentation of this file.
1/*
2 Copyright 2021 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_WELL_STATE_HEADER_INCLUDED
21#define OPM_GASLIFT_WELL_STATE_HEADER_INCLUDED
22
23#include <optional>
24#include <utility>
25
26namespace Opm
27{
29 {
30 public:
31 //GasLiftWellState() { }
32 GasLiftWellState(double oil_rate, bool oil_is_limited,
33 double gas_rate, bool gas_is_limited,
34 double alq, bool alq_is_limited, double water_rate, bool water_is_limited, std::optional<bool> increase) :
35 oil_rate_{oil_rate},
36 oil_is_limited_{oil_is_limited},
37 gas_rate_{gas_rate},
38 gas_is_limited_{gas_is_limited},
39 alq_{alq},
40 alq_is_limited_{alq_is_limited},
41 water_rate_{water_rate},
42 water_is_limited_{water_is_limited},
43 increase_{increase}
44 {}
45 double alq() const { return alq_; }
46 bool alqChanged() { return increase_.has_value(); }
47 bool alqIsLimited() const { return alq_is_limited_; }
48 bool gasIsLimited() const { return gas_is_limited_; }
49 double gasRate() const { return gas_rate_; }
50 std::pair<double, double> getRates() { return {oil_rate_, gas_rate_}; }
51 std::optional<bool> increase() const { return increase_; }
52 bool oilIsLimited() const { return oil_is_limited_; }
53 double oilRate() const { return oil_rate_; }
54 double waterRate() const { return water_rate_; }
55 bool waterIsLimited() const { return water_is_limited_; }
56 void update(double oil_rate, bool oil_is_limited,
57 double gas_rate, bool gas_is_limited,
58 double alq, bool alq_is_limited, double water_rate,
59 double water_is_limited,
60 bool increase)
61 {
62 oil_rate_ = oil_rate;
63 oil_is_limited_ = oil_is_limited;
64 gas_rate_ = gas_rate;
65 gas_is_limited_ = gas_is_limited;
66 alq_ = alq;
67 alq_is_limited_ = alq_is_limited;
68 water_rate_ = water_rate;
69 water_is_limited_ = water_is_limited;
70 increase_ = increase;
71 }
72 private:
73 double oil_rate_;
74 bool oil_is_limited_;
75 double gas_rate_;
76 bool gas_is_limited_;
77 double alq_;
78 bool alq_is_limited_;
79 double water_rate_;
80 bool water_is_limited_;
81 std::optional<bool> increase_;
82 };
83
84} // namespace Opm
85
86#endif // OPM_GASLIFT_WELL_STATE_HEADER_INCLUDED
Definition: GasLiftWellState.hpp:29
bool oilIsLimited() const
Definition: GasLiftWellState.hpp:52
void update(double oil_rate, bool oil_is_limited, double gas_rate, bool gas_is_limited, double alq, bool alq_is_limited, double water_rate, double water_is_limited, bool increase)
Definition: GasLiftWellState.hpp:56
bool gasIsLimited() const
Definition: GasLiftWellState.hpp:48
GasLiftWellState(double oil_rate, bool oil_is_limited, double gas_rate, bool gas_is_limited, double alq, bool alq_is_limited, double water_rate, bool water_is_limited, std::optional< bool > increase)
Definition: GasLiftWellState.hpp:32
std::optional< bool > increase() const
Definition: GasLiftWellState.hpp:51
double oilRate() const
Definition: GasLiftWellState.hpp:53
double gasRate() const
Definition: GasLiftWellState.hpp:49
bool alqChanged()
Definition: GasLiftWellState.hpp:46
bool waterIsLimited() const
Definition: GasLiftWellState.hpp:55
double alq() const
Definition: GasLiftWellState.hpp:45
double waterRate() const
Definition: GasLiftWellState.hpp:54
std::pair< double, double > getRates()
Definition: GasLiftWellState.hpp:50
bool alqIsLimited() const
Definition: GasLiftWellState.hpp:47
Definition: BlackoilPhases.hpp:27