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
28template<class Scalar>
30{
31public:
32 GasLiftWellState(Scalar oil_rate,
33 Scalar oil_pot,
34 bool oil_is_limited,
35 Scalar gas_rate,
36 Scalar gas_pot,
37 bool gas_is_limited,
38 Scalar alq,
39 bool alq_is_limited,
40 Scalar water_rate,
41 Scalar water_pot,
42 bool water_is_limited,
43 Scalar bhp,
44 std::optional<bool> increase)
45 : oil_rate_{oil_rate}
46 , oil_pot_{oil_pot}
47 , oil_is_limited_{oil_is_limited}
48 , gas_rate_{gas_rate}
49 , gas_pot_{gas_pot}
50 , gas_is_limited_{gas_is_limited}
51 , alq_{alq}
52 , alq_is_limited_{alq_is_limited}
53 , water_rate_{water_rate}
54 , water_pot_{water_pot}
55 , water_is_limited_{water_is_limited}
56 , bhp_{bhp}
57 , increase_{increase}
58 {}
59
60 Scalar alq() const { return alq_; }
61 Scalar bhp() const { return bhp_; }
62 bool alqChanged() { return increase_.has_value(); }
63 bool alqIsLimited() const { return alq_is_limited_; }
64 bool gasIsLimited() const { return gas_is_limited_; }
65 Scalar gasRate() const { return gas_rate_; }
66 Scalar gasPot() const { return gas_pot_; }
67 std::pair<Scalar, Scalar> getRates() { return {oil_rate_, gas_rate_}; }
68 std::optional<bool> increase() const { return increase_; }
69 bool oilIsLimited() const { return oil_is_limited_; }
70 Scalar oilRate() const { return oil_rate_; }
71 Scalar waterRate() const { return water_rate_; }
72 Scalar oilPot() const { return oil_pot_; }
73 Scalar waterPot() const { return water_pot_; }
74 bool waterIsLimited() const { return water_is_limited_; }
75 void update(Scalar oil_rate,
76 Scalar oil_pot,
77 bool oil_is_limited,
78 Scalar gas_rate,
79 Scalar gas_pot,
80 bool gas_is_limited,
81 Scalar alq,
82 bool alq_is_limited,
83 Scalar water_rate,
84 Scalar water_pot,
85 Scalar water_is_limited,
86 Scalar bhp,
87 bool increase)
88 {
89 oil_rate_ = oil_rate;
90 oil_pot_ = oil_pot;
91 oil_is_limited_ = oil_is_limited;
92 gas_rate_ = gas_rate;
93 gas_pot_ = gas_pot;
94 gas_is_limited_ = gas_is_limited;
95 alq_ = alq;
96 alq_is_limited_ = alq_is_limited;
97 water_rate_ = water_rate;
98 water_pot_ = water_pot;
99 water_is_limited_ = water_is_limited;
100 bhp_ = bhp;
101 increase_ = increase;
102 }
103
104private:
105 Scalar oil_rate_;
106 Scalar oil_pot_;
107 bool oil_is_limited_;
108 Scalar gas_rate_;
109 Scalar gas_pot_;
110 bool gas_is_limited_;
111 Scalar alq_;
112 bool alq_is_limited_;
113 Scalar water_rate_;
114 Scalar water_pot_;
115 bool water_is_limited_;
116 Scalar bhp_;
117 std::optional<bool> increase_;
118};
119
120} // namespace Opm
121
122#endif // OPM_GASLIFT_WELL_STATE_HEADER_INCLUDED
Definition: GasLiftWellState.hpp:30
Scalar waterRate() const
Definition: GasLiftWellState.hpp:71
GasLiftWellState(Scalar oil_rate, Scalar oil_pot, bool oil_is_limited, Scalar gas_rate, Scalar gas_pot, bool gas_is_limited, Scalar alq, bool alq_is_limited, Scalar water_rate, Scalar water_pot, bool water_is_limited, Scalar bhp, std::optional< bool > increase)
Definition: GasLiftWellState.hpp:32
std::optional< bool > increase() const
Definition: GasLiftWellState.hpp:68
bool alqIsLimited() const
Definition: GasLiftWellState.hpp:63
Scalar gasRate() const
Definition: GasLiftWellState.hpp:65
void update(Scalar oil_rate, Scalar oil_pot, bool oil_is_limited, Scalar gas_rate, Scalar gas_pot, bool gas_is_limited, Scalar alq, bool alq_is_limited, Scalar water_rate, Scalar water_pot, Scalar water_is_limited, Scalar bhp, bool increase)
Definition: GasLiftWellState.hpp:75
Scalar oilPot() const
Definition: GasLiftWellState.hpp:72
bool waterIsLimited() const
Definition: GasLiftWellState.hpp:74
Scalar bhp() const
Definition: GasLiftWellState.hpp:61
std::pair< Scalar, Scalar > getRates()
Definition: GasLiftWellState.hpp:67
Scalar gasPot() const
Definition: GasLiftWellState.hpp:66
bool gasIsLimited() const
Definition: GasLiftWellState.hpp:64
bool alqChanged()
Definition: GasLiftWellState.hpp:62
bool oilIsLimited() const
Definition: GasLiftWellState.hpp:69
Scalar waterPot() const
Definition: GasLiftWellState.hpp:73
Scalar oilRate() const
Definition: GasLiftWellState.hpp:70
Scalar alq() const
Definition: GasLiftWellState.hpp:60
Definition: blackoilbioeffectsmodules.hh:43