WellSegments.hpp
Go to the documentation of this file.
1/*
2 Copyright 2015 SINTEF ICT, Applied Mathematics.
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 SEGMENTSET_HPP_HEADER_INCLUDED
21#define SEGMENTSET_HPP_HEADER_INCLUDED
22
23#include <vector>
24#include <map>
25
27
28namespace Opm {
29 class SpiralICD;
30 class Valve;
31}
32
33namespace Opm {
34
35 class DeckKeyword;
36
38 public:
39 enum class LengthDepth{
40 INC = 0,
41 ABS = 1
42 };
44 static LengthDepth LengthDepthFromString(const std::string& stringValue);
45
46
47 enum class CompPressureDrop {
48 HFA = 0,
49 HF_ = 1,
50 H__ = 2
51 };
54
55
56 enum class MultiPhaseModel {
57 HO = 0,
58 DF = 1
59 };
62
63
64 WellSegments() = default;
66 const std::vector<Segment>& segments);
68
70
71 std::size_t size() const;
72 double depthTopSegment() const;
73 double lengthTopSegment() const;
74 double volumeTopSegment() const;
75
77
78 // mapping the segment number to the index in the vector of segments
79 int segmentNumberToIndex(const int segment_number) const;
80
81
82
83 const Segment& getFromSegmentNumber(const int segment_number) const;
84
85 const Segment& operator[](size_t idx) const;
87
88 bool operator==( const WellSegments& ) const;
89 bool operator!=( const WellSegments& ) const;
90
91 double segmentLength(const int segment_number) const;
92 double segmentDepthChange(const int segment_number) const;
93 std::vector<Segment> branchSegments(int branch) const;
94
95 // it returns true if there is no error encountered during the update
96 bool updateWSEGSICD(const std::vector<std::pair<int, SpiralICD> >& sicd_pairs);
97
98 bool updateWSEGVALV(const std::vector<std::pair<int, Valve> >& valve_pairs);
99 const std::vector<Segment>::const_iterator begin() const;
100 const std::vector<Segment>::const_iterator end() const;
101
102 template<class Serializer>
103 void serializeOp(Serializer& serializer)
104 {
105 serializer(m_comp_pressure_drop);
106 serializer.vector(m_segments);
107 serializer(segment_number_to_index);
108 }
109
110 private:
111 void processABS();
112 void processINC(double depth_top, double length_top);
113 void process(LengthDepth length_depth, double depth_top, double length_top);
114 void addSegment(const Segment& new_segment);
115 void loadWELSEGS( const DeckKeyword& welsegsKeyword);
116 const Segment& topSegment() const;
117
118 // components of the pressure drop to be included
119 CompPressureDrop m_comp_pressure_drop;
120 // There are X and Y cooridnate of the nodal point of the top segment
121 // Since they are not used for simulations and we are not supporting plotting,
122 // we are not handling them at the moment.
123 // There are other three properties for segment related to thermal conduction,
124 // while they are not supported by the keyword at the moment.
125
126 std::vector< Segment > m_segments;
127 // the mapping from the segment number to the
128 // storage index in the vector
129 std::map<int, int> segment_number_to_index;
130 };
131}
132
133#endif
const char *const string
Definition: cJSON.h:170
Definition: DeckKeyword.hpp:38
Definition: parser/eclipse/EclipseState/Schedule/MSW/segment.hpp:37
Definition: Serializer.hpp:38
Definition: WellSegments.hpp:37
static const std::string CompPressureDropToString(CompPressureDrop enumValue)
std::vector< Segment > branchSegments(int branch) const
static CompPressureDrop CompPressureDropFromString(const std::string &stringValue)
bool updateWSEGVALV(const std::vector< std::pair< int, Valve > > &valve_pairs)
WellSegments(CompPressureDrop compDrop, const std::vector< Segment > &segments)
double lengthTopSegment() const
double segmentDepthChange(const int segment_number) const
static const std::string LengthDepthToString(LengthDepth enumValue)
MultiPhaseModel
Definition: WellSegments.hpp:56
const std::vector< Segment >::const_iterator begin() const
double depthTopSegment() const
bool operator!=(const WellSegments &) const
double segmentLength(const int segment_number) const
static WellSegments serializeObject()
CompPressureDrop
Definition: WellSegments.hpp:47
WellSegments(const DeckKeyword &keyword)
static const std::string MultiPhaseModelToString(MultiPhaseModel enumValue)
const Segment & operator[](size_t idx) const
double volumeTopSegment() const
WellSegments()=default
int segmentNumberToIndex(const int segment_number) const
static LengthDepth LengthDepthFromString(const std::string &stringValue)
const Segment & getFromSegmentNumber(const int segment_number) const
static MultiPhaseModel MultiPhaseModelFromString(const std::string &stringValue)
void serializeOp(Serializer &serializer)
Definition: WellSegments.hpp:103
const std::vector< Segment >::const_iterator end() const
std::size_t size() const
LengthDepth
Definition: WellSegments.hpp:39
bool operator==(const WellSegments &) const
bool updateWSEGSICD(const std::vector< std::pair< int, SpiralICD > > &sicd_pairs)
CompPressureDrop compPressureDrop() const
UDAKeyword keyword(UDAControl control)
Definition: A.hpp:4