ScheduleTypes.hpp
Go to the documentation of this file.
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>
25
26namespace Opm {
27
28enum class InjectorType {
29 WATER = 1,
30 GAS = 2,
31 OIL = 3,
32 MULTI = 4
33};
36
37
38class WellType {
39public:
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
46
47 bool injector() const;
48 bool producer() const;
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;
61 bool operator==(const WellType& other) const;
62
63 template<class Serializer>
64 void serializeOp(Serializer& serializer)
65 {
66 serializer(m_producer);
67 serializer(injection_phase);
68 serializer(m_welspecs_phase);
69 }
70
71private:
72 bool m_producer;
73 /*
74 The injection_phase member is updated during the course of the simulation;
75 following each WCONINJE keyword the injection phase is updated. If an
76 producer is specified in the constructor the injection_phase is
77 initialzied to the welspecs phase. This is not wildly random - but the
78 injection_phase will not be meaningfull before an update(Phase) call has been
79 issued.
80
81 The welspecs_phase is the preferred phase specified when the well is
82 defined with the WELSPECS keyword. This member is immutable, and it is only
83 used when initializing the well equations for a producer.
84 */
85
86 Phase injection_phase;
87 Phase m_welspecs_phase;
88};
89
90}
91
92
93
94#endif
const char *const string
Definition: cJSON.h:170
Definition: Serializer.hpp:38
Definition: ScheduleTypes.hpp:38
bool operator==(const WellType &other) const
static bool gas_injector(int ecl_wtype)
bool update(InjectorType injector_type)
int ecl_phase() const
WellType(bool producer, Phase welspecs_phase)
bool producer() const
bool injector() const
Phase preferred_phase() const
bool update(bool producer)
void serializeOp(Serializer &serializer)
Definition: ScheduleTypes.hpp:64
static bool producer(int ecl_wtype)
int ecl_wtype() const
InjectorType injector_type() const
static bool water_injector(int ecl_wtype)
static WellType serializeObject()
WellType(Phase welspecs_phase)
static bool oil_injector(int ecl_wtype)
WellType(int ecl_wtype, int welspecs_phase)
WellType()=default
Definition: A.hpp:4
InjectorType InjectorTypeFromString(const std::string &stringValue)
InjectorType
Definition: ScheduleTypes.hpp:28
Phase
Definition: Runspec.hpp:34
const std::string InjectorType2String(InjectorType enumValue)