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 ScheduleState;
35class UnitSystem;
36
37} // namespace Opm
38
39namespace Opm { namespace RestartIO {
40
42 {
43 public:
44 struct WellTableDim {
45 int numWells{};
46 int maxPerf{};
47 int maxWellInGroup{};
48 int maxGroupInField{};
49 int maxWellsInField{};
50 int mxwlstprwel{};
51 int mxdynwlst{};
52 };
53
54 struct WellSegDims {
55 int nsegwl{};
56 int nswlmx{};
57 int nsegmx{};
58 int nlbrmx{};
59 int nisegz{};
60 int nrsegz{};
61 int nilbrz{};
62 };
63
64 struct RegDims {
65 int ntfip{};
66 int nmfipr{};
67 int nrfreg{};
68 int ntfreg{};
69 int nplmix{};
70 };
71
72 struct RockOpts {
73 int ttyp{};
74 };
75
76 struct TimePoint {
77 int year{};
78 int month{}; // 1..12
79 int day{}; // 1..31
80
81 int hour{}; // 0..23
82 int minute{}; // 0..59
83 int second{}; // 0..59
84
85 int microseconds{}; // 0..999999
86 };
87
88 struct Phases {
89 int oil{};
90 int water{};
91 int gas{};
92 };
93
94 struct TuningPar {
95 int newtmx{};
96 int newtmn{};
97 int litmax{};
98 int litmin{};
99 int mxwsit{};
100 int mxwpit{};
101 int wseg_mx_rst{};
102 };
103
104 struct Group {
105 int ngroups{};
106 };
107
108 struct UdqParam {
109 int udqParam_1{};
110
113
116
119
122
125
128
131
134
135 int num_iuads{};
136 int num_iuaps{};
137 };
138
139 struct ActionParam {
140 int no_actions{};
141 int max_no_sched_lines_per_action{};
142 int max_no_conditions_per_action{};
143 int max_no_characters_per_line{};
144 };
145
147 int nominated_phase;
148 };
149
151 int actnetwrk;
152 };
153
154 struct NetworkDims {
155 int noactnod{};
156 int noactbr{};
157 int nodmax{};
158 int nbrmax{};
159 int nibran{};
160 int nrbran{};
161 int ninode{};
162 int nrnode{};
163 int nznode{};
164 int ninobr{};
165 };
166
168 int maxNoIterationsNBC{};
169 int maxNoIterationsTHP{};
170 };
171
172 struct AquiferDims {
173 // Number of active analytic aquifers (# unique aquifer IDs)
174 int numAquifers {0};
175
176 // Declared maximum number of analytic aquifers in model
177 // (AQUDIMS(5))
178 int maxNumAquifers {0};
179
180 // Declared maximum number of connections in any analytic
181 // aquifer (AQUDIMS(6))
182 int maxNumAquiferConn {0};
183
184 // Maximum number of *active* connections in any analytic aquifer
185 int maxNumActiveAquiferConn {0};
186
187 // Maximum aquifer ID across all of the model's analytic aquifers.
188 int maxAquiferID {0};
189
190 // Number of numeric aquifer records (lines of AQUNUM data, AQUDIMS(1))
191 int numNumericAquiferRecords {0};
192
193 // Number of data elements per aquifer in IAAQ array.
194 int numIntAquiferElem {18};
195
196 // Number of data elements per aquifer in SAAQ array.
197 int numRealAquiferElem {24};
198
199 // Number of data elements per aquifer in XAAQ array.
200 int numDoubAquiferElem {10};
201
202 // Number of data elements in IAQN array per numeric aquifer record.
203 int numNumericAquiferIntElem {10};
204
205 // Number of data elements in RAQN array per numeric aquifer record.
206 int numNumericAquiferDoubleElem {13};
207
208 // Number of data elements per coonnection in ICAQ array.
209 int numIntConnElem {7};
210
211 // Number of data elements per connecetion in SCAQ array.
212 int numRealConnElem {2};
213
214 // Number of data elements per connection in ACAQ array.
215 int numDoubConnElem {4};
216 };
217
218 InteHEAD();
219 ~InteHEAD() = default;
220
221 InteHEAD(const InteHEAD& rhs) = default;
222 InteHEAD(InteHEAD&& rhs) = default;
223
224 InteHEAD& operator=(const InteHEAD& rhs) = default;
225 InteHEAD& operator=(InteHEAD&& rhs) = default;
226
227 InteHEAD& dimensions(const int nx, const int ny, const int nz);
228 InteHEAD& dimensions(const std::array<int,3>& cartDims);
229 InteHEAD& numActive(const int nactive);
230
231 InteHEAD& unitConventions(const UnitSystem& usys);
232 InteHEAD& wellTableDimensions(const WellTableDim& wtdim);
233 InteHEAD& aquiferDimensions(const AquiferDims& aqudims);
234
235 InteHEAD& calendarDate(const TimePoint& date);
236 InteHEAD& activePhases(const Phases& phases);
237
238 InteHEAD& params_NWELZ(const int niwelz, const int nswelz, const int nxwelz, const int nzwelz);
239 InteHEAD& params_NCON(const int niconz, const int nsconz, const int nxconz);
240 InteHEAD& params_GRPZ(const std::array<int, 4>& grpz);
241 InteHEAD& params_NGCTRL(const int gct);
242
243 InteHEAD& stepParam(const int tstep, const int report_step);
244 InteHEAD& tuningParam(const TuningPar& tunpar);
245 InteHEAD& variousParam(const int version, const int iprog);
246 InteHEAD& wellSegDimensions(const WellSegDims& wsdim);
247 InteHEAD& activeNetwork(const ActiveNetwork& actntwrk);
248 InteHEAD& networkDimensions(const NetworkDims& nwdim);
249 InteHEAD& netBalanceData(const NetBalanceDims& nwbaldim);
250 InteHEAD& regionDimensions(const RegDims& rdim);
251 InteHEAD& rockOpts(const RockOpts& rckop);
252 InteHEAD& ngroups(const Group& gr);
253 InteHEAD& udqParam_1(const UdqParam& udqpar);
254 InteHEAD& actionParam(const ActionParam& act_par);
255 InteHEAD& variousUDQ_ACTIONXParam();
256 InteHEAD& nominatedPhaseGuideRate(GuideRateNominatedPhase nphase);
257 InteHEAD& whistControlMode(int mode);
258 InteHEAD& liftOptParam(int in_enc);
259
260 static int numRsegElem(const Opm::Phases& phase);
261
262 const std::vector<int>& data() const
263 {
264 return this->data_;
265 }
266
267 private:
268 std::vector<int> data_;
269 };
270
271 InteHEAD::TimePoint
272 getSimulationTimePoint(const std::time_t start,
273 const double elapsed);
274
275 InteHEAD::AquiferDims
276 inferAquiferDimensions(const EclipseState& es);
277
278 InteHEAD::AquiferDims
279 inferAquiferDimensions(const EclipseState& es,
280 const ScheduleState& sched);
281}} // Opm::RestartIO
282
283#endif // OPM_INTEHEAD_HEADER_INCLUDED
Definition EclipseState.hpp:63
Definition Runspec.hpp:46
Definition InteHEAD.hpp:42
Definition ScheduleState.hpp:91
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:139
Definition InteHEAD.hpp:150
Definition InteHEAD.hpp:172
Definition InteHEAD.hpp:104
Definition InteHEAD.hpp:167
Definition InteHEAD.hpp:154
Definition InteHEAD.hpp:88
Definition InteHEAD.hpp:64
Definition InteHEAD.hpp:72
Definition InteHEAD.hpp:76
Definition InteHEAD.hpp:94
Definition InteHEAD.hpp:108
int num_aqu_udqs
Number of aquifer-level UDQ parameters (AU*)
Definition InteHEAD.hpp:130
int num_reg_udqs
Number of region-level UDQ parameters (RU*)
Definition InteHEAD.hpp:118
int num_blk_udqs
Number of block-level UDQ parameters (BU*)
Definition InteHEAD.hpp:133
int num_seg_udqs
Number of segment-level UDQ parameters (SU*)
Definition InteHEAD.hpp:124
int num_conn_udqs
Number of connection-level UDQ parameters (CU*)
Definition InteHEAD.hpp:127
int num_field_udqs
Number of field-level UDQ parameters (FU*)
Definition InteHEAD.hpp:112
int num_group_udqs
Number of group-level UDQ parameters (GU*)
Definition InteHEAD.hpp:115
int num_well_udqs
Number of well-level UDQ parameters (WU*)
Definition InteHEAD.hpp:121
Definition InteHEAD.hpp:54
Definition InteHEAD.hpp:44