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 bool oil_is_limited,
34 Scalar gas_rate,
35 bool gas_is_limited,
36 Scalar alq,
37 bool alq_is_limited,
38 Scalar water_rate,
39 bool water_is_limited,
40 std::optional<bool> increase)
41 : oil_rate_{oil_rate}
42 , oil_is_limited_{oil_is_limited}
43 , gas_rate_{gas_rate}
44 , gas_is_limited_{gas_is_limited}
45 , alq_{alq}
46 , alq_is_limited_{alq_is_limited}
47 , water_rate_{water_rate}
48 , water_is_limited_{water_is_limited}
49 , increase_{increase}
50 {}
51
52 Scalar alq() const { return alq_; }
53 bool alqChanged() { return increase_.has_value(); }
54 bool alqIsLimited() const { return alq_is_limited_; }
55 bool gasIsLimited() const { return gas_is_limited_; }
56 Scalar gasRate() const { return gas_rate_; }
57 std::pair<Scalar, Scalar> getRates() { return {oil_rate_, gas_rate_}; }
58 std::optional<bool> increase() const { return increase_; }
59 bool oilIsLimited() const { return oil_is_limited_; }
60 Scalar oilRate() const { return oil_rate_; }
61 Scalar waterRate() const { return water_rate_; }
62 bool waterIsLimited() const { return water_is_limited_; }
63 void update(Scalar oil_rate,
64 bool oil_is_limited,
65 Scalar gas_rate,
66 bool gas_is_limited,
67 Scalar alq,
68 bool alq_is_limited,
69 Scalar water_rate,
70 Scalar water_is_limited,
71 bool increase)
72 {
73 oil_rate_ = oil_rate;
74 oil_is_limited_ = oil_is_limited;
75 gas_rate_ = gas_rate;
76 gas_is_limited_ = gas_is_limited;
77 alq_ = alq;
78 alq_is_limited_ = alq_is_limited;
79 water_rate_ = water_rate;
80 water_is_limited_ = water_is_limited;
81 increase_ = increase;
82 }
83
84private:
85 Scalar oil_rate_;
86 bool oil_is_limited_;
87 Scalar gas_rate_;
88 bool gas_is_limited_;
89 Scalar alq_;
90 bool alq_is_limited_;
91 Scalar water_rate_;
92 bool water_is_limited_;
93 std::optional<bool> increase_;
94};
95
96} // namespace Opm
97
98#endif // OPM_GASLIFT_WELL_STATE_HEADER_INCLUDED
Definition: GasLiftWellState.hpp:30
void update(Scalar oil_rate, bool oil_is_limited, Scalar gas_rate, bool gas_is_limited, Scalar alq, bool alq_is_limited, Scalar water_rate, Scalar water_is_limited, bool increase)
Definition: GasLiftWellState.hpp:63
Scalar waterRate() const
Definition: GasLiftWellState.hpp:61
std::optional< bool > increase() const
Definition: GasLiftWellState.hpp:58
bool alqIsLimited() const
Definition: GasLiftWellState.hpp:54
Scalar gasRate() const
Definition: GasLiftWellState.hpp:56
bool waterIsLimited() const
Definition: GasLiftWellState.hpp:62
std::pair< Scalar, Scalar > getRates()
Definition: GasLiftWellState.hpp:57
bool gasIsLimited() const
Definition: GasLiftWellState.hpp:55
bool alqChanged()
Definition: GasLiftWellState.hpp:53
bool oilIsLimited() const
Definition: GasLiftWellState.hpp:59
GasLiftWellState(Scalar oil_rate, bool oil_is_limited, Scalar gas_rate, bool gas_is_limited, Scalar alq, bool alq_is_limited, Scalar water_rate, bool water_is_limited, std::optional< bool > increase)
Definition: GasLiftWellState.hpp:32
Scalar oilRate() const
Definition: GasLiftWellState.hpp:60
Scalar alq() const
Definition: GasLiftWellState.hpp:52
Definition: BlackoilPhases.hpp:27