My Project
ScheduleTypes.hpp
1 /*
2  Copyright 2020 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_SCHEDULE_TYPES_HPP
21 #define OPM_SCHEDULE_TYPES_HPP
22 
23 #include <string>
24 #include <opm/parser/eclipse/EclipseState/Runspec.hpp>
25 
26 namespace Opm {
27 
28 enum class InjectorType {
29  WATER = 1,
30  GAS = 2,
31  OIL = 3,
32  MULTI = 4
33 };
34 const std::string InjectorType2String( InjectorType enumValue );
35 InjectorType InjectorTypeFromString( const std::string& stringValue );
36 
37 
38 class WellType {
39 public:
40  WellType(int ecl_wtype, int welspecs_phase);
41  WellType(bool producer, Phase welspecs_phase);
42  explicit WellType(Phase welspecs_phase);
43  WellType() = default;
44 
45  static WellType serializeObject();
46 
47  bool injector() const;
48  bool producer() const;
49  bool update(InjectorType injector_type);
50  bool update(bool producer);
51 
52  static bool oil_injector(int ecl_wtype);
53  static bool gas_injector(int ecl_wtype);
54  static bool water_injector(int ecl_wtype);
55  static bool producer(int ecl_wtype);
56 
57  int ecl_wtype() const;
58  int ecl_phase() const;
59  Phase preferred_phase() const;
60  InjectorType injector_type() const;
61  Phase injection_phase() const;
62  bool operator==(const WellType& other) const;
63 
64  template<class Serializer>
65  void serializeOp(Serializer& serializer)
66  {
67  serializer(m_producer);
68  serializer(m_injection_phase);
69  serializer(m_welspecs_phase);
70  }
71 
72 private:
73  bool m_producer;
74  /*
75  The injection_phase member is updated during the course of the simulation;
76  following each WCONINJE keyword the injection phase is updated. If an
77  producer is specified in the constructor the injection_phase is
78  initialzied to the welspecs phase. This is not wildly random - but the
79  injection_phase will not be meaningfull before an update(Phase) call has been
80  issued.
81 
82  The welspecs_phase is the preferred phase specified when the well is
83  defined with the WELSPECS keyword. This member is immutable, and it is only
84  used when initializing the well equations for a producer.
85  */
86 
87  Phase m_injection_phase;
88  Phase m_welspecs_phase;
89 };
90 
91 }
92 
93 
94 
95 #endif
Definition: Serializer.hpp:38
Definition: ScheduleTypes.hpp:38
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29