My Project
InteHEAD.hpp
1/*
2 Copyright 2021 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}
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 int no_wudqs;
111 int no_gudqs;
112 int no_fudqs;
113 int no_iuads;
114 int no_iuaps;
115 };
116
117 struct ActionParam {
118 int no_actions;
119 int max_no_sched_lines_per_action;
120 int max_no_conditions_per_action;
121 int max_no_characters_per_line;
122 };
123
125 int nominated_phase;
126 };
127
128
130 int actnetwrk;
131 };
132
133 struct NetworkDims {
134 int noactnod;
135 int noactbr;
136 int nodmax;
137 int nbrmax;
138 int nibran;
139 int nrbran;
140 int ninode;
141 int nrnode;
142 int nznode;
143 int ninobr;
144 };
145
147 int maxNoIterationsNBC;
148 int maxNoIterationsTHP;
149 };
150
151 struct AquiferDims {
152 // Number of active analytic aquifers (# unique aquifer IDs)
153 int numAquifers {0};
154
155 // Declared maximum number of analytic aquifers in model
156 // (AQUDIMS(5))
157 int maxNumAquifers {0};
158
159 // Declared maximum number of connections in any analytic
160 // aquifer (AQUDIMS(6))
161 int maxNumAquiferConn {0};
162
163 // Maximum number of *active* connections in any analytic aquifer
164 int maxNumActiveAquiferConn {0};
165
166 // Maximum aquifer ID across all of the model's analytic aquifers.
167 int maxAquiferID {0};
168
169 // Number of numeric aquifer records (lines of AQUNUM data, AQUDIMS(1))
170 int numNumericAquiferRecords {0};
171
172 // Number of data elements per aquifer in IAAQ array.
173 int numIntAquiferElem {18};
174
175 // Number of data elements per aquifer in SAAQ array.
176 int numRealAquiferElem {24};
177
178 // Number of data elements per aquifer in XAAQ array.
179 int numDoubAquiferElem {10};
180
181 // Number of data elements in IAQN array per numeric aquifer record.
182 int numNumericAquiferIntElem {10};
183
184 // Number of data elements in RAQN array per numeric aquifer record.
185 int numNumericAquiferDoubleElem {13};
186
187 // Number of data elements per coonnection in ICAQ array.
188 int numIntConnElem {7};
189
190 // Number of data elements per connecetion in SCAQ array.
191 int numRealConnElem {2};
192
193 // Number of data elements per connection in ACAQ array.
194 int numDoubConnElem {4};
195 };
196
197 InteHEAD();
198 ~InteHEAD() = default;
199
200 InteHEAD(const InteHEAD& rhs) = default;
201 InteHEAD(InteHEAD&& rhs) = default;
202
203 InteHEAD& operator=(const InteHEAD& rhs) = default;
204 InteHEAD& operator=(InteHEAD&& rhs) = default;
205
206 InteHEAD& dimensions(const int nx, const int ny, const int nz);
207 InteHEAD& dimensions(const std::array<int,3>& cartDims);
208 InteHEAD& numActive(const int nactive);
209
210 InteHEAD& unitConventions(const UnitSystem& usys);
211 InteHEAD& wellTableDimensions(const WellTableDim& wtdim);
212 InteHEAD& aquiferDimensions(const AquiferDims& aqudims);
213
214 InteHEAD& calendarDate(const TimePoint& date);
215 InteHEAD& activePhases(const Phases& phases);
216
217 InteHEAD& params_NWELZ(const int niwelz, const int nswelz, const int nxwelz, const int nzwelz);
218 InteHEAD& params_NCON(const int niconz, const int nsconz, const int nxconz);
219 InteHEAD& params_GRPZ(const std::array<int, 4>& grpz);
220 InteHEAD& params_NGCTRL(const int gct);
221
222 InteHEAD& stepParam(const int tstep, const int report_step);
223 InteHEAD& tuningParam(const TuningPar& tunpar);
224 InteHEAD& variousParam(const int version, const int iprog);
225 InteHEAD& wellSegDimensions(const WellSegDims& wsdim);
226 InteHEAD& activeNetwork(const ActiveNetwork& actntwrk);
227 InteHEAD& networkDimensions(const NetworkDims& nwdim);
228 InteHEAD& netBalanceData(const NetBalanceDims& nwbaldim);
229 InteHEAD& regionDimensions(const RegDims& rdim);
230 InteHEAD& rockOpts(const RockOpts& rckop);
231 InteHEAD& ngroups(const Group& gr);
232 InteHEAD& udqParam_1(const UdqParam& udqpar);
233 InteHEAD& actionParam(const ActionParam& act_par);
234 InteHEAD& variousUDQ_ACTIONXParam();
235 InteHEAD& nominatedPhaseGuideRate(GuideRateNominatedPhase nphase);
236 InteHEAD& whistControlMode(int mode);
237 InteHEAD& liftOptParam(int in_enc);
238
239 static int numRsegElem(const Opm::Phases& phase);
240 const std::vector<int>& data() const
241 {
242 return this->data_;
243 }
244
245 private:
246 std::vector<int> data_;
247 };
248
249 InteHEAD::TimePoint
250 getSimulationTimePoint(const std::time_t start,
251 const double elapsed);
252
253 InteHEAD::AquiferDims
254 inferAquiferDimensions(const EclipseState& es);
255
256 InteHEAD::AquiferDims
257 inferAquiferDimensions(const EclipseState& es,
258 const ScheduleState& sched);
259}} // Opm::RestartIO
260
261#endif // OPM_INTEHEAD_HEADER_INCLUDED
Definition: EclipseState.hpp:55
Definition: Runspec.hpp:37
Definition: InteHEAD.hpp:42
Definition: ScheduleState.hpp:88
Definition: UnitSystem.hpp:33
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: InteHEAD.hpp:117
Definition: InteHEAD.hpp:129
Definition: InteHEAD.hpp:151
Definition: InteHEAD.hpp:104
Definition: InteHEAD.hpp:146
Definition: InteHEAD.hpp:133
Definition: InteHEAD.hpp:88
Definition: InteHEAD.hpp:64
Definition: InteHEAD.hpp:72
Definition: InteHEAD.hpp:76
Definition: InteHEAD.hpp:94
Definition: InteHEAD.hpp:108
Definition: InteHEAD.hpp:54
Definition: InteHEAD.hpp:44