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