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