My Project
GasLiftWellState.hpp
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, 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 increase_{increase}
43 {}
44 double alq() const { return alq_; }
45 bool alqChanged() { return increase_.has_value(); }
46 bool alqIsLimited() const { return alq_is_limited_; }
47 bool gasIsLimited() const { return gas_is_limited_; }
48 double gasRate() const { return gas_rate_; }
49 std::pair<double, double> getRates() { return {oil_rate_, gas_rate_}; }
50 std::optional<bool> increase() const { return increase_; }
51 bool oilIsLimited() const { return oil_is_limited_; }
52 double oilRate() const { return oil_rate_; }
53 double waterRate() const { return water_rate_; }
54 void update(double oil_rate, bool oil_is_limited,
55 double gas_rate, bool gas_is_limited,
56 double alq, bool alq_is_limited, double water_rate,
57 bool increase)
58 {
59 oil_rate_ = oil_rate;
60 oil_is_limited_ = oil_is_limited;
61 gas_rate_ = gas_rate;
62 gas_is_limited_ = gas_is_limited;
63 alq_ = alq;
64 alq_is_limited_ = alq_is_limited;
65 water_rate_ = water_rate;
66 increase_ = increase;
67 }
68 private:
69 double oil_rate_;
70 bool oil_is_limited_;
71 double gas_rate_;
72 bool gas_is_limited_;
73 double alq_;
74 bool alq_is_limited_;
75 double water_rate_;
76 std::optional<bool> increase_;
77 };
78
79} // namespace Opm
80
81#endif // OPM_GASLIFT_WELL_STATE_HEADER_INCLUDED
Definition: GasLiftWellState.hpp:29
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27