opm-common
Loading...
Searching...
No Matches
AggregateGroupData.hpp
1/*
2 Copyright (c) 2018 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#ifndef OPM_AGGREGATE_GROUP_DATA_HPP
21#define OPM_AGGREGATE_GROUP_DATA_HPP
22
24
25#include <opm/io/eclipse/PaddedOutputString.hpp>
26
27#include <cstddef>
28#include <string>
29#include <vector>
30#include <map>
31
32namespace Opm {
33class Schedule;
34class SummaryState;
35class UnitSystem;
36} // Opm
37
38namespace Opm { namespace RestartIO { namespace Helpers {
39
40class AggregateGroupData
41{
42public:
43 explicit AggregateGroupData(const std::vector<int>& inteHead);
44
45 void captureDeclaredGroupData(const Opm::Schedule& sched,
46 const Opm::UnitSystem& units,
47 const std::size_t simStep,
48 const Opm::SummaryState& sumState,
49 const std::vector<int>& inteHead);
50
51
52 void captureDeclaredGroupDataLGR(const Opm::Schedule& sched,
53 const Opm::UnitSystem& units,
54 const std::size_t simStep,
55 const Opm::SummaryState& sumState,
56 const std::string& lgr_tag);
57
58 const std::vector<int>& getIGroup() const
59 {
60 return this->iGroup_.data();
61 }
62
63 const std::vector<float>& getSGroup() const
64 {
65 return this->sGroup_.data();
66 }
67
68 const std::vector<double>& getXGroup() const
69 {
70 return this->xGroup_.data();
71 }
72
73 const std::vector<EclIO::PaddedOutputString<8>>& getZGroup() const
74 {
75 return this->zGroup_.data();
76 }
77
78 const std::vector<std::string> restart_group_keys = {"GOPP", "GWPP", "GOPR", "GWPR", "GGPR",
79 "GVPR", "GWIR", "GGIR", "GWCT", "GGOR",
80 "GOPT", "GWPT", "GGPT", "GVPT",
81 "GOPTS", "GGPTS",
82 "GWIT" , "GGIT" , "GVIT",
83 "GOPTH", "GWPTH", "GGPTH",
84 "GWITH", "GGITH",
85 "GOPGR", "GWPGR", "GGPGR", "GVPGR",
86 "GOIGR", "GWIGR", "GGIGR",
87 "GGCR", "GGIMR", "GGCT", "GGIMT",
88 };
89
90 // Note: guide rates don't exist at the FIELD level.
91 const std::vector<std::string> restart_field_keys = {"FOPP", "FWPP", "FOPR", "FWPR", "FGPR",
92 "FVPR", "FWIR", "FGIR", "FWCT", "FGOR",
93 "FOPT", "FWPT", "FGPT", "FVPT",
94 "FOPTS", "FGPTS",
95 "FWIT" , "FGIT" , "FVIT",
96 "FOPTH", "FWPTH", "FGPTH",
97 "FGCR", "FGCT", "FGIMR", "FGIMT",
98
99 "FWITH", "FGITH"};
100
101 const std::vector<std::string> restart_well_keys = {"WOPP", "WWPP", "WOPR", "WWPR", "WGPR",
102 "WVPR", "WWIR", "WGIR", "WWCT", "WGOR",
103 "WOPT", "WWPT", "WGPT", "WVPT",
104 "WOPTS", "WGPTS",
105 "WWIT" , "WGIT", "WVIT",
106 "WOPTH", "WWPTH", "WGPTH",
107 /*"WGCR",*/ /*"WGCT",*/ /*"WGIMR",*/ /*"WGIMT",*/
108 "WWITH", "WGITH"};
109
110 const std::map<std::string, size_t> groupKeyToIndex = {
111 {"GOPR", 0},
112 {"GWPR", 1},
113 {"GGPR", 2},
114 {"GVPR", 3},
115 {"GWIR", 5},
116 {"GGIR", 6},
117 {"GWCT", 8},
118 {"GGOR", 9},
119 {"GOPT", 10},
120 {"GWPT", 11},
121 {"GGPT", 12},
122 {"GVPT", 13},
123 {"GWIT", 15},
124 {"GGIT", 16},
125 {"GVIT", 17},
126 {"GGCR", 19},
127 {"GGCT", 21},
128 {"GOPP", 22},
129 {"GWPP", 23},
130 {"GGIMR", 51},
131 {"GGIMT", 52},
132 {"GOPTS", 73},
133 {"GGPTS", 74},
134 {"GOPGR", 85},
135 {"GWPGR", 86},
136 {"GGPGR", 87},
137 {"GVPGR", 88},
138 {"GOIGR", 89},
139 {"GWIGR", 91},
140 {"GGIGR", 93},
141 {"GOPTH", 135},
142 {"GWPTH", 139},
143 {"GWITH", 140},
144 {"GGPTH", 143},
145 {"GGITH", 144},
146 };
147
148 const std::map<std::string, size_t> fieldKeyToIndex = {
149 {"FOPR", 0},
150 {"FWPR", 1},
151 {"FGPR", 2},
152 {"FVPR", 3},
153 {"FWIR", 5},
154 {"FGIR", 6},
155 {"FWCT", 8},
156 {"FGOR", 9},
157 {"FOPT", 10},
158 {"FWPT", 11},
159 {"FGPT", 12},
160 {"FVPT", 13},
161 {"FWIT", 15},
162 {"FGIT", 16},
163 {"FVIT", 17},
164 {"FGCR", 19},
165 {"FGCT", 21},
166 {"FOPP", 22},
167 {"FWPP", 23},
168 {"FGIMR", 51},
169 {"FGIMT", 52},
170 {"FOPTS", 73},
171 {"FGPTS", 74},
172 {"FOPTH", 135},
173 {"FWPTH", 139},
174 {"FWITH", 140},
175 {"FGPTH", 143},
176 {"FGITH", 144},
177 };
178
179 const std::map<std::string, size_t> wellKeyToIndex = {
180 {"WOPR", 0},
181 {"WWPR", 1},
182 {"WGPR", 2},
183 {"WVPR", 3},
184 {"WWIR", 5},
185 {"WGIR", 6},
186 {"WWCT", 8},
187 {"WGOR", 9},
188 {"WOPT", 10},
189 {"WWPT", 11},
190 {"WGPT", 12},
191 {"WVPT", 13},
192 {"WWIT", 15},
193 {"WGIT", 16},
194 {"WVIT", 17},
195 //{"WGCR", 19},
196 {"WGCT", 21},
197 {"WOPP", 22},
198 {"WWPP", 23},
199 {"WGIMR", 51},
200 {"WGIMT", 52},
201 {"WOPTS", 73},
202 {"WGPTS", 74},
203 {"WOPGR", 85},
204 {"WWPGR", 86},
205 {"WGPGR", 87},
206 {"WVPGR", 88},
207 {"WOIGR", 89},
208 {"WWIGR", 91},
209 {"WGIGR", 93},
210 {"WOPTH", 135},
211 {"WWPTH", 139},
212 {"WWITH", 140},
213 {"WGPTH", 143},
214 {"WGITH", 144},
215 };
216
217private:
219 WindowedArray<int> iGroup_;
220
222 WindowedArray<float> sGroup_;
223
225 WindowedArray<double> xGroup_;
226
229
231 int nWGMax_;
232
234 int nGMaxz_;
235};
236
237}}} // Opm::RestartIO::Helpers
238
239#endif // OPM_AGGREGATE_WELL_DATA_HPP
Provide facilities to simplify constructing restart vectors such as IWEL or RSEG.
Provide read-only and read/write access to constantly sized portions/windows of a linearised buffer w...
Definition WindowedArray.hpp:50
Definition Schedule.hpp:101
Definition SummaryState.hpp:73
Definition UnitSystem.hpp:34
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30