My Project
Loading...
Searching...
No Matches
InteHEAD.hpp
1/*
2 Copyright 2021-2024 Equinor ASA.
3 Copyright 2016, 2017, 2018 Statoil ASA.
4
5 This file is part of the Open Porous Media Project (OPM).
6
7 OPM is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 OPM is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with OPM. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#ifndef OPM_INTEHEAD_HEADER_INCLUDED
22#define OPM_INTEHEAD_HEADER_INCLUDED
23
24#include <array>
25#include <ctime>
26#include <memory>
27#include <vector>
28
29namespace Opm {
30
31class EclipseGrid;
32class EclipseState;
33class Phases;
34class Schedule;
35class ScheduleState;
36class UnitSystem;
37
38} // namespace Opm
39
40namespace Opm { namespace RestartIO {
41
43 {
44 public:
45 struct WellTableDim {
46 int numWells{};
47 int maxPerf{};
48 int maxWellInGroup{};
49 int maxGroupInField{};
50 int maxWellsInField{};
51 int mxwlstprwel{};
52 int mxdynwlst{};
53 };
54
55 struct WellSegDims {
56 int nsegwl{};
57 int nswlmx{};
58 int nsegmx{};
59 int nlbrmx{};
60 int nisegz{};
61 int nrsegz{};
62 int nilbrz{};
63 };
64
65 struct RegDims {
66 int ntfip{};
67 int nmfipr{};
68 int nrfreg{};
69 int ntfreg{};
70 int nplmix{};
71 };
72
73 struct RockOpts {
74 int ttyp{};
75 };
76
77 struct TimePoint {
78 int year{};
79 int month{}; // 1..12
80 int day{}; // 1..31
81
82 int hour{}; // 0..23
83 int minute{}; // 0..59
84 int second{}; // 0..59
85
86 int microseconds{}; // 0..999999
87 };
88
89 struct Phases {
90 int oil{};
91 int water{};
92 int gas{};
93 };
94
95 struct TuningPar {
96 int newtmx{};
97 int newtmn{};
98 int litmax{};
99 int litmin{};
100 int mxwsit{};
101 int mxwpit{};
102 int wseg_mx_rst{};
103 };
104
105 struct Group {
106 int ngroups{};
107 };
108
109 struct UdqParam {
110 int udqParam_1{};
111
114
117
120
123
126
129
132
135
136 int num_iuads{};
137 int num_iuaps{};
138 };
139
140 struct ActionParam {
141 int no_actions{};
142 int max_no_sched_lines_per_action{};
143 int max_no_conditions_per_action{};
144 int max_no_characters_per_line{};
145 };
146
148 int nominated_phase;
149 };
150
152 int actnetwrk;
153 };
154
155 struct NetworkDims {
156 int noactnod{};
157 int noactbr{};
158 int nodmax{};
159 int nbrmax{};
160 int nibran{};
161 int nrbran{};
162 int ninode{};
163 int nrnode{};
164 int nznode{};
165 int ninobr{};
166 };
167
169 int maxNoIterationsNBC{};
170 int maxNoIterationsTHP{};
171 };
172
173 struct AquiferDims {
174 // Number of active analytic aquifers (# unique aquifer IDs)
175 int numAquifers {0};
176
177 // Declared maximum number of analytic aquifers in model
178 // (AQUDIMS(5))
179 int maxNumAquifers {0};
180
181 // Declared maximum number of connections in any analytic
182 // aquifer (AQUDIMS(6))
183 int maxNumAquiferConn {0};
184
185 // Maximum number of *active* connections in any analytic aquifer
186 int maxNumActiveAquiferConn {0};
187
188 // Maximum aquifer ID across all of the model's analytic aquifers.
189 int maxAquiferID {0};
190
191 // Number of numeric aquifer records (lines of AQUNUM data, AQUDIMS(1))
192 int numNumericAquiferRecords {0};
193
194 // Number of data elements per aquifer in IAAQ array.
195 int numIntAquiferElem {18};
196
197 // Number of data elements per aquifer in SAAQ array.
198 int numRealAquiferElem {24};
199
200 // Number of data elements per aquifer in XAAQ array.
201 int numDoubAquiferElem {10};
202
203 // Number of data elements in IAQN array per numeric aquifer record.
204 int numNumericAquiferIntElem {10};
205
206 // Number of data elements in RAQN array per numeric aquifer record.
207 int numNumericAquiferDoubleElem {13};
208
209 // Number of data elements per coonnection in ICAQ array.
210 int numIntConnElem {7};
211
212 // Number of data elements per connecetion in SCAQ array.
213 int numRealConnElem {2};
214
215 // Number of data elements per connection in ACAQ array.
216 int numDoubConnElem {4};
217 };
218
219 InteHEAD();
220 ~InteHEAD() = default;
221
222 InteHEAD(const InteHEAD& rhs) = default;
223 InteHEAD(InteHEAD&& rhs) = default;
224
225 InteHEAD& operator=(const InteHEAD& rhs) = default;
226 InteHEAD& operator=(InteHEAD&& rhs) = default;
227
228 InteHEAD& dimensions(const int nx, const int ny, const int nz);
229 InteHEAD& dimensions(const std::array<int,3>& cartDims);
230 InteHEAD& numActive(const int nactive);
231
232 InteHEAD& unitConventions(const UnitSystem& usys);
233 InteHEAD& wellTableDimensions(const WellTableDim& wtdim);
234 InteHEAD& aquiferDimensions(const AquiferDims& aqudims);
235
236 InteHEAD& calendarDate(const TimePoint& date);
237 InteHEAD& activePhases(const Phases& phases);
238
239 InteHEAD& drsdt(const Schedule& sched,
240 const std::size_t lookup_step);
241
242 InteHEAD& params_NWELZ(const int niwelz, const int nswelz, const int nxwelz, const int nzwelz);
243 InteHEAD& params_NCON(const int niconz, const int nsconz, const int nxconz);
244 InteHEAD& params_GRPZ(const std::array<int, 4>& grpz);
245 InteHEAD& params_NGCTRL(const int gct);
246
247 InteHEAD& stepParam(const int tstep, const int report_step);
248 InteHEAD& tuningParam(const TuningPar& tunpar);
249 InteHEAD& variousParam(const int version, const int iprog);
250 InteHEAD& wellSegDimensions(const WellSegDims& wsdim);
251 InteHEAD& activeNetwork(const ActiveNetwork& actntwrk);
252 InteHEAD& networkDimensions(const NetworkDims& nwdim);
253 InteHEAD& netBalanceData(const NetBalanceDims& nwbaldim);
254 InteHEAD& regionDimensions(const RegDims& rdim);
255 InteHEAD& rockOpts(const RockOpts& rckop);
256 InteHEAD& ngroups(const Group& gr);
257 InteHEAD& udqParam_1(const UdqParam& udqpar);
258 InteHEAD& actionParam(const ActionParam& act_par);
259 InteHEAD& variousUDQ_ACTIONXParam();
260 InteHEAD& nominatedPhaseGuideRate(GuideRateNominatedPhase nphase);
261 InteHEAD& whistControlMode(int mode);
262 InteHEAD& liftOptParam(int in_enc);
263
264 static int numRsegElem(const Opm::Phases& phase);
265
266 const std::vector<int>& data() const
267 {
268 return this->data_;
269 }
270
271 private:
272 std::vector<int> data_;
273 };
274
275 InteHEAD::TimePoint
276 getSimulationTimePoint(const std::time_t start,
277 const double elapsed);
278
279 InteHEAD::AquiferDims
280 inferAquiferDimensions(const EclipseState& es);
281
282 InteHEAD::AquiferDims
283 inferAquiferDimensions(const EclipseState& es,
284 const ScheduleState& sched);
285}} // Opm::RestartIO
286
287#endif // OPM_INTEHEAD_HEADER_INCLUDED
Definition EclipseState.hpp:63
Definition Runspec.hpp:46
Definition InteHEAD.hpp:43
Definition ScheduleState.hpp:94
Definition Schedule.hpp:89
Definition UnitSystem.hpp:34
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition InteHEAD.hpp:140
Definition InteHEAD.hpp:151
Definition InteHEAD.hpp:173
Definition InteHEAD.hpp:105
Definition InteHEAD.hpp:168
Definition InteHEAD.hpp:155
Definition InteHEAD.hpp:89
Definition InteHEAD.hpp:65
Definition InteHEAD.hpp:73
Definition InteHEAD.hpp:77
Definition InteHEAD.hpp:95
Definition InteHEAD.hpp:109
int num_aqu_udqs
Number of aquifer-level UDQ parameters (AU*)
Definition InteHEAD.hpp:131
int num_reg_udqs
Number of region-level UDQ parameters (RU*)
Definition InteHEAD.hpp:119
int num_blk_udqs
Number of block-level UDQ parameters (BU*)
Definition InteHEAD.hpp:134
int num_seg_udqs
Number of segment-level UDQ parameters (SU*)
Definition InteHEAD.hpp:125
int num_conn_udqs
Number of connection-level UDQ parameters (CU*)
Definition InteHEAD.hpp:128
int num_field_udqs
Number of field-level UDQ parameters (FU*)
Definition InteHEAD.hpp:113
int num_group_udqs
Number of group-level UDQ parameters (GU*)
Definition InteHEAD.hpp:116
int num_well_udqs
Number of well-level UDQ parameters (WU*)
Definition InteHEAD.hpp:122
Definition InteHEAD.hpp:55
Definition InteHEAD.hpp:45