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 <unordered_map>
25 #include <vector>
26 
27 #include <opm/io/eclipse/rst/aquifer.hpp>
28 #include <opm/io/eclipse/rst/action.hpp>
29 #include <opm/io/eclipse/rst/group.hpp>
30 #include <opm/io/eclipse/rst/header.hpp>
31 #include <opm/io/eclipse/rst/network.hpp>
32 #include <opm/io/eclipse/rst/udq.hpp>
33 #include <opm/io/eclipse/rst/well.hpp>
34 
35 #include <opm/input/eclipse/EclipseState/Runspec.hpp>
36 #include <opm/input/eclipse/Schedule/Tuning.hpp>
37 
38 #include <opm/input/eclipse/Units/UnitSystem.hpp>
39 
40 namespace Opm {
41  class EclipseGrid;
42  class Parser;
43 } // namespace Opm
44 
45 namespace Opm { namespace EclIO {
46  class RestartFileView;
47 }} // namespace Opm::EclIO
48 
49 namespace Opm { namespace RestartIO {
50 
51 struct RstState {
52  RstState(std::shared_ptr<EclIO::RestartFileView> rstView,
53  const Runspec& runspec,
54  const ::Opm::EclipseGrid* grid);
55 
56  static RstState load(std::shared_ptr<EclIO::RestartFileView> rstView,
57  const Runspec& runspec,
58  const Parser& parser,
59  const ::Opm::EclipseGrid* grid = nullptr);
60 
61  const RstWell& get_well(const std::string& wname) const;
62 
63  ::Opm::UnitSystem unit_system;
64  RstHeader header;
65  RstAquifer aquifers;
66  RstNetwork network;
67  std::vector<RstWell> wells;
68  std::vector<RstGroup> groups;
69  std::vector<RstUDQ> udqs;
70  RstUDQActive udq_active;
71  std::vector<RstAction> actions;
72  Tuning tuning;
73  std::unordered_map<std::string, std::vector<std::string>> wlists;
74 
75 private:
76  void load_tuning(const std::vector<int>& intehead,
77  const std::vector<double>& doubhead);
78 
79  void add_groups(const std::vector<std::string>& zgrp,
80  const std::vector<int>& igrp,
81  const std::vector<float>& sgrp,
82  const std::vector<double>& xgrp);
83 
84  void add_wells(const std::vector<std::string>& zwel,
85  const std::vector<int>& iwel,
86  const std::vector<float>& swel,
87  const std::vector<double>& xwel,
88  const std::vector<int>& icon,
89  const std::vector<float>& scon,
90  const std::vector<double>& xcon);
91 
92  void add_msw(const std::vector<std::string>& zwel,
93  const std::vector<int>& iwel,
94  const std::vector<float>& swel,
95  const std::vector<double>& xwel,
96  const std::vector<int>& icon,
97  const std::vector<float>& scon,
98  const std::vector<double>& xcon,
99  const std::vector<int>& iseg,
100  const std::vector<double>& rseg);
101 
102  void add_udqs(const std::vector<int>& iudq,
103  const std::vector<std::string>& zudn,
104  const std::vector<std::string>& zudl,
105  const std::vector<double>& dudw,
106  const std::vector<double>& dudg,
107  const std::vector<double>& dudf);
108 
109  void add_actions(const Parser& parser,
110  const Runspec& runspec,
111  std::time_t sim_time,
112  const std::vector<std::string>& zact,
113  const std::vector<int>& iact,
114  const std::vector<float>& sact,
115  const std::vector<std::string>& zacn,
116  const std::vector<int>& iacn,
117  const std::vector<double>& sacn,
118  const std::vector<std::string>& zlact);
119 
120  void add_wlist(const std::vector<std::string>& zwls,
121  const std::vector<int>& iwls);
122 
123 };
124 
125 }} // namespace Opm::RestartIO
126 
127 #endif
The hub of the parsing process.
Definition: Parser.hpp:59
Definition: aquifer.hpp:45
Definition: network.hpp:39
Definition: udq.hpp:87
Definition: Runspec.hpp:439
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:33
Definition: state.hpp:51
Definition: well.hpp:39
Definition: Tuning.hpp:46