Valve.hpp
Go to the documentation of this file.
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
29
30
31namespace Opm {
32
33 class DeckRecord;
34 class DeckKeyword;
35 class Segment;
36
37 class Valve {
38 public:
39
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
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
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
char const int length
Definition: cJSON.h:161
Definition: DeckKeyword.hpp:38
Definition: DeckRecord.hpp:32
Definition: Serializer.hpp:38
Definition: Valve.hpp:37
double pipeAdditionalLength() const
double pipeDiameter() const
double pipeRoughness() const
bool operator==(const Valve &data) const
void setPipeAdditionalLength(const double length)
double pipeCrossArea() const
void setPipeCrossArea(const double area)
void setPipeDiameter(const double dia)
double conFlowCoefficient() const
ICDStatus status() const
static Valve serializeObject()
Valve(double conFlowCoeff, double conCrossA, double conMaxCrossA, double pipeAddLength, double pipeDiam, double pipeRough, double pipeCrossA, ICDStatus stat)
double conMaxCrossArea() const
void setPipeRoughness(const double rou)
static std::map< std::string, std::vector< std::pair< int, Valve > > > fromWSEGVALV(const DeckKeyword &keyword)
Valve(const DeckRecord &record)
double conCrossArea() const
void setConMaxCrossArea(const double area)
void serializeOp(Serializer &serializer)
Definition: Valve.hpp:83
@ Segment
Definition: output/eclipse/VectorItems/connection.hpp:40
UDAKeyword keyword(UDAControl control)
constexpr const double area
Definition: custom-opm-common/opm-common/opm/parser/eclipse/Units/Units.hpp:182
Definition: A.hpp:4
ICDStatus
Definition: icd.hpp:26
static std::string data()
Definition: exprtk.hpp:40022