My Project
state.hpp
1 /*
2  Copyright 2020 Equinor 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 it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  OPM is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with OPM. If not, see <http://www.gnu.org/licenses/>.
17 */
18 
19 #ifndef RST_STATE
20 #define RST_STATE
21 
22 #include <memory>
23 #include <string>
24 #include <vector>
25 
26 #include <opm/io/eclipse/rst/header.hpp>
27 #include <opm/io/eclipse/rst/aquifer.hpp>
28 #include <opm/io/eclipse/rst/group.hpp>
29 #include <opm/io/eclipse/rst/well.hpp>
30 #include <opm/io/eclipse/rst/udq.hpp>
31 #include <opm/io/eclipse/rst/action.hpp>
32 
33 #include <opm/parser/eclipse/Units/UnitSystem.hpp>
34 
35 #include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
36 #include <opm/parser/eclipse/EclipseState/Runspec.hpp>
37 
38 namespace Opm {
39  class EclipseGrid;
40  class Parser;
41  class Parser;
42 } // namespace Opm
43 
44 namespace Opm { namespace EclIO {
45  class RestartFileView;
46 }} // namespace Opm::EclIO
47 
48 namespace Opm { namespace RestartIO {
49 
50 struct RstState {
51  RstState(std::shared_ptr<EclIO::RestartFileView> rstView,
52  const ::Opm::EclipseGrid* grid);
53 
54  static RstState load(std::shared_ptr<EclIO::RestartFileView> rstView,
55  const Runspec& runspec,
56  const Parser& parser,
57  const ::Opm::EclipseGrid* grid = nullptr);
58 
59  const RstWell& get_well(const std::string& wname) const;
60 
61  ::Opm::UnitSystem unit_system;
62  RstHeader header;
63  RstAquifer aquifers;
64  std::vector<RstWell> wells;
65  std::vector<RstGroup> groups;
66  std::vector<RstUDQ> udqs;
67  RstUDQActive udq_active;
68  std::vector<RstAction> actions;
69  Tuning tuning;
70 
71 private:
72  void load_tuning(const std::vector<int>& intehead,
73  const std::vector<double>& doubhead);
74 
75  void add_groups(const std::vector<std::string>& zgrp,
76  const std::vector<int>& igrp,
77  const std::vector<float>& sgrp,
78  const std::vector<double>& xgrp);
79 
80  void add_wells(const std::vector<std::string>& zwel,
81  const std::vector<int>& iwel,
82  const std::vector<float>& swel,
83  const std::vector<double>& xwel,
84  const std::vector<int>& icon,
85  const std::vector<float>& scon,
86  const std::vector<double>& xcon);
87 
88  void add_msw(const std::vector<std::string>& zwel,
89  const std::vector<int>& iwel,
90  const std::vector<float>& swel,
91  const std::vector<double>& xwel,
92  const std::vector<int>& icon,
93  const std::vector<float>& scon,
94  const std::vector<double>& xcon,
95  const std::vector<int>& iseg,
96  const std::vector<double>& rseg);
97 
98  void add_udqs(const std::vector<int>& iudq,
99  const std::vector<std::string>& zudn,
100  const std::vector<std::string>& zudl,
101  const std::vector<double>& dudw,
102  const std::vector<double>& dudg,
103  const std::vector<double>& dudf);
104 
105  void add_actions(const Parser& parser,
106  const Runspec& runspec,
107  std::time_t sim_time,
108  const std::vector<std::string>& zact,
109  const std::vector<int>& iact,
110  const std::vector<float>& sact,
111  const std::vector<std::string>& zacn,
112  const std::vector<int>& iacn,
113  const std::vector<double>& sacn,
114  const std::vector<std::string>& zlact);
115 
116 };
117 
118 }} // namespace Opm::RestartIO
119 
120 #endif
The hub of the parsing process.
Definition: Parser.hpp:60
Definition: aquifer.hpp:45
Definition: udq.hpp:86
Definition: Runspec.hpp:402
Definition: UnitSystem.hpp:34
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: header.hpp:31
Definition: state.hpp:50
Definition: well.hpp:39
Definition: Tuning.hpp:24