My Project
Valve.hpp
1/*
2 Copyright 2019 Equinor.
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 VALVE_HPP_HEADER_INCLUDED
21#define VALVE_HPP_HEADER_INCLUDED
22
23#include <map>
24#include <utility>
25#include <vector>
26#include <string>
27
28#include <opm/input/eclipse/Schedule/MSW/icd.hpp>
29
30
31namespace Opm {
32
33 class DeckRecord;
34 class DeckKeyword;
35 class Segment;
36
37 class Valve {
38 public:
39
40 Valve();
41 explicit Valve(const DeckRecord& record);
42 Valve(double conFlowCoeff,
43 double conCrossA,
44 double conMaxCrossA,
45 double pipeAddLength,
46 double pipeDiam,
47 double pipeRough,
48 double pipeCrossA,
49 ICDStatus stat);
50
51 static Valve serializationTestObject();
52
53 // the function will return a map
54 // [
55 // "WELL1" : [<seg1, valv1>, <seg2, valv2> ...]
56 // ....
57 static std::map<std::string, std::vector<std::pair<int, Valve> > > fromWSEGVALV(const DeckKeyword& keyword);
58
59 // parameters for constriction pressure loss
60 double conFlowCoefficient() const;
61 double conCrossArea() const;
62 double conMaxCrossArea() const;
63 double pipeDiameter() const;
64 double pipeRoughness() const;
65 double pipeCrossArea() const;
66
67 // parameters for pressure loss along the pipe
68 double pipeAdditionalLength() const;
69
70 // Status: OPEN or SHUT
71 ICDStatus status() const;
72
73 void setConMaxCrossArea(const double area);
74
75 void setPipeAdditionalLength(const double length);
76 void setPipeDiameter(const double dia);
77 void setPipeRoughness(const double rou);
78 void setPipeCrossArea(const double area);
79
80 bool operator==(const Valve& data) const;
81
82 template<class Serializer>
83 void serializeOp(Serializer& serializer)
84 {
85 serializer(m_con_flow_coeff);
86 serializer(m_con_cross_area);
87 serializer(m_con_max_cross_area);
88 serializer(m_pipe_additional_length);
89 serializer(m_pipe_diameter);
90 serializer(m_pipe_roughness);
91 serializer(m_pipe_cross_area);
92 serializer(m_status);
93 }
94
95 private:
96 double m_con_flow_coeff;
97 double m_con_cross_area;
98 double m_con_max_cross_area;
99
100 double m_pipe_additional_length;
101 double m_pipe_diameter;
102 double m_pipe_roughness;
103 double m_pipe_cross_area;
104 ICDStatus m_status;
105 };
106
107}
108
109#endif
Definition: DeckKeyword.hpp:36
Definition: DeckRecord.hpp:32
Class for (de-)serializing.
Definition: Serializer.hpp:75
Definition: Valve.hpp:37
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29