WellConnections.hpp
Go to the documentation of this file.
1/*
2 Copyright 2013 Statoil 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
21#ifndef CONNECTIONSET_HPP_
22#define CONNECTIONSET_HPP_
23
25
27
28namespace Opm {
29 class EclipseGrid;
30 class FieldPropsManager;
32 public:
33
34
38 const std::vector<Connection>& connections);
39
41
42 // cppcheck-suppress noExplicitConstructor
44 void addConnection(int i, int j , int k ,
45 std::size_t global_index,
46 double depth,
47 Connection::State state ,
48 double CF,
49 double Kh,
50 double rw,
51 double r0,
52 double skin_factor,
53 const int satTableId,
56 const std::size_t seqIndex = 0,
57 const double segDistStart= 0.0,
58 const double segDistEnd= 0.0,
59 const bool defaultSatTabId = true);
60 void loadCOMPDAT(const DeckRecord& record, const EclipseGrid& grid, const FieldPropsManager& field_properties);
61
62 using const_iterator = std::vector< Connection >::const_iterator;
63
64 void add( Connection );
65 size_t size() const;
66 const Connection& operator[](size_t index) const;
67 const Connection& get(size_t index) const;
68 const Connection& getFromIJK(const int i, const int j, const int k) const;
69 const Connection& lowest() const;
70 Connection& getFromIJK(const int i, const int j, const int k);
71
72 const_iterator begin() const { return this->m_connections.begin(); }
73 const_iterator end() const { return this->m_connections.end(); }
74 void filter(const ActiveGridCells& grid);
75 bool allConnectionsShut() const;
88 void order();
89
90 bool operator==( const WellConnections& ) const;
91 bool operator!=( const WellConnections& ) const;
92
93 Connection::Order ordering() const { return this->m_ordering; }
94 std::vector<const Connection *> output(const EclipseGrid& grid) const;
95
96 template<class Serializer>
97 void serializeOp(Serializer& serializer)
98 {
99 serializer(m_ordering);
100 serializer(headI);
101 serializer(headJ);
102 serializer.vector(m_connections);
103 }
104
105 private:
106 void addConnection(int i, int j , int k ,
107 std::size_t global_index,
108 int complnum,
109 double depth,
110 Connection::State state ,
111 double CF,
112 double Kh,
113 double rw,
114 double r0,
115 double skin_factor,
116 const int satTableId,
119 const std::size_t seqIndex = 0,
120 const double segDistStart= 0.0,
121 const double segDistEnd= 0.0,
122 const bool defaultSatTabId = true);
123
124 void loadCOMPDAT(const DeckRecord& record,
125 const EclipseGrid& grid,
126 const std::vector<int>& satnum_data,
127 const std::vector<double>* permx,
128 const std::vector<double>* permy,
129 const std::vector<double>* permz,
130 const std::vector<double>& ntg);
131
132 size_t findClosestConnection(int oi, int oj, double oz, size_t start_pos);
133 void orderTRACK();
134 void orderMSW();
135
137 int headI, headJ;
138 std::vector< Connection > m_connections;
139 };
140}
141
142
143
144#endif
int index
Definition: cJSON.h:168
Simple class capturing active cells of a grid.
Definition: ActiveGridCells.hpp:35
Definition: parser/eclipse/EclipseState/Schedule/Well/connection.hpp:45
Direction
Definition: parser/eclipse/EclipseState/Schedule/Well/connection.hpp:57
CTFKind
Definition: parser/eclipse/EclipseState/Schedule/Well/connection.hpp:76
Order
Definition: parser/eclipse/EclipseState/Schedule/Well/connection.hpp:67
State
Definition: parser/eclipse/EclipseState/Schedule/Well/connection.hpp:47
Definition: DeckRecord.hpp:32
Definition: EclipseGrid.hpp:54
Definition: FieldPropsManager.hpp:33
Definition: Serializer.hpp:38
Definition: WellConnections.hpp:31
std::vector< Connection >::const_iterator const_iterator
Definition: WellConnections.hpp:62
Connection::Order ordering() const
Definition: WellConnections.hpp:93
static WellConnections serializeObject()
Connection & getFromIJK(const int i, const int j, const int k)
const Connection & operator[](size_t index) const
const Connection & get(size_t index) const
void serializeOp(Serializer &serializer)
Definition: WellConnections.hpp:97
bool operator!=(const WellConnections &) const
const_iterator end() const
Definition: WellConnections.hpp:73
const Connection & getFromIJK(const int i, const int j, const int k) const
void add(Connection)
const Connection & lowest() const
bool operator==(const WellConnections &) const
void filter(const ActiveGridCells &grid)
bool allConnectionsShut() const
void addConnection(int i, int j, int k, std::size_t global_index, double depth, Connection::State state, double CF, double Kh, double rw, double r0, double skin_factor, const int satTableId, const Connection::Direction direction=Connection::Direction::Z, const Connection::CTFKind ctf_kind=Connection::CTFKind::DeckValue, const std::size_t seqIndex=0, const double segDistStart=0.0, const double segDistEnd=0.0, const bool defaultSatTabId=true)
void loadCOMPDAT(const DeckRecord &record, const EclipseGrid &grid, const FieldPropsManager &field_properties)
WellConnections(Connection::Order ordering, int headI, int headJ)
WellConnections(Connection::Order ordering, int headI, int headJ, const std::vector< Connection > &connections)
size_t size() const
const_iterator begin() const
Definition: WellConnections.hpp:72
WellConnections(const WellConnections &src, const EclipseGrid &grid)
std::vector< const Connection * > output(const EclipseGrid &grid) const
Definition: A.hpp:4