opm-common
WellEnums.hpp
1 /*
2  Copyright 2019 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 WELL_ENUMS_HPP
21 #define WELL_ENUMS_HPP
22 
23 #include <cstdint>
24 #include <iosfwd>
25 #include <string>
26 
27 namespace Opm {
28 
29 enum class WellStatus : std::uint8_t {
30  OPEN = 1,
31  STOP = 2,
32  SHUT = 3,
33  AUTO = 4
34 };
35 
36 /*
37  The elements in this enum are used as bitmasks to keep track
38  of which controls are present, i.e. the 2^n structure must
39  be intact.
40 */
41 enum class WellInjectorCMode : std::uint16_t {
42  RATE = 1 ,
43  RESV = 2 ,
44  BHP = 4 ,
45  THP = 8 ,
46  GRUP = 16 ,
47  CMODE_UNDEFINED = 512
48 };
49 
50 /*
51  The items BHP, THP and GRUP only apply in prediction mode:
52  WCONPROD. The elements in this enum are used as bitmasks to
53  keep track of which controls are present, i.e. the 2^n
54  structure must be intact. The NONE item is only used in
55  WHISTCTL to cancel its effect.
56 */
57 
58 enum class WellProducerCMode : std::uint16_t {
59  NONE = 0,
60  ORAT = 1,
61  WRAT = 2,
62  GRAT = 4,
63  LRAT = 8,
64  CRAT = 16,
65  RESV = 32,
66  BHP = 64,
67  THP = 128,
68  GRUP = 256,
69  CMODE_UNDEFINED = 1024
70 };
71 
72 enum class WellWELTARGCMode : std::uint8_t {
73  ORAT = 1,
74  WRAT = 2,
75  GRAT = 3,
76  LRAT = 4,
77  CRAT = 5, // Not supported
78  RESV = 6,
79  BHP = 7,
80  THP = 8,
81  VFP = 9,
82  LIFT = 10, // Not supported
83  GUID = 11
84 };
85 
86 enum class WellGuideRateTarget : std::uint8_t {
87  OIL = 0,
88  WAT = 1,
89  GAS = 2,
90  LIQ = 3,
91  COMB = 4,
92  WGA = 5,
93  CVAL = 6,
94  RAT = 7,
95  RES = 8,
96  UNDEFINED = 9
97 };
98 
99 enum class WellGasInflowEquation : std::uint8_t {
100  STD = 0,
101  R_G = 1,
102  P_P = 2,
103  GPP = 3
104 };
105 
106 std::string WellStatus2String(WellStatus enumValue);
107 WellStatus WellStatusFromString(const std::string& stringValue);
108 std::ostream& operator<<(std::ostream& os, const WellStatus& st);
109 
110 std::string WellInjectorCMode2String(WellInjectorCMode enumValue);
111 WellInjectorCMode WellInjectorCModeFromString(const std::string& stringValue);
112 std::ostream& operator<<(std::ostream& os, const WellInjectorCMode& cm);
113 
114 std::string WellProducerCMode2String(WellProducerCMode enumValue);
115 WellProducerCMode WellProducerCModeFromString(const std::string& stringValue);
116 WellProducerCMode WellProducerCModeFromInt(const int intValue);
117 std::ostream& operator<<(std::ostream& os, const WellProducerCMode& cm);
118 
119 std::string WellWELTARGCMode2String(WellWELTARGCMode cmode);
120 WellWELTARGCMode WellWELTARGCModeFromString(const std::string& stringValue);
121 
122 std::string WellGuideRateTarget2String(WellGuideRateTarget enumValue);
123 WellGuideRateTarget WellGuideRateTargetFromString(const std::string& stringValue);
124 
125 std::string WellGasInflowEquation2String(WellGasInflowEquation enumValue);
126 WellGasInflowEquation WellGasInflowEquationFromString(const std::string& stringValue);
127 
128 } // Namespace Opm
129 
130 #endif
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30