My Project
Loading...
Searching...
No Matches
network.hpp
1/*
2 Copyright 2021 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_NETWORK_HPP
21#define RST_NETWORK_HPP
22
23#include <memory>
24#include <optional>
25#include <string>
26#include <vector>
27
28namespace Opm {
29 class UnitSystem;
30} // namespace Opm
31
32namespace Opm { namespace EclIO {
33 class RestartFileView;
34}} // namespace Opm::EclIO
35
36namespace Opm { namespace RestartIO {
37
39 {
40 public:
42 struct Branch
43 {
45 int down{-1};
46
48 int up{-1};
49
51 int vfp{-1};
52 };
53
55 struct Node
56 {
58 std::string name{};
59
61 std::optional<double> terminal_pressure{};
62
66 std::optional<std::string> as_choke{};
67
70 bool add_lift_gas{false};
71
73 double pressure{};
74 };
75
76 explicit RstNetwork(std::shared_ptr<EclIO::RestartFileView> rstView,
77 const UnitSystem& usys);
78
79 bool isActive() const;
80
81 const std::vector<Branch>& branches() const
82 {
83 return this->branches_;
84 }
85
86 const std::vector<Node>& nodes() const
87 {
88 return this->nodes_;
89 }
90
91 private:
92 std::vector<Branch> branches_{};
93 std::vector<Node> nodes_{};
94 };
95
96}} // namespace Opm::RestartIO
97
98#endif // RST_NETWORK_HPP
Definition network.hpp:39
Definition UnitSystem.hpp:34
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Single branch in extended network model.
Definition network.hpp:43
int down
Downtree node. Index into 'nodes' array.
Definition network.hpp:45
int up
Uptree node. Index into 'nodes' array.
Definition network.hpp:48
int vfp
One-based VFP table ID.
Definition network.hpp:51
Single node in extended network model.
Definition network.hpp:56
double pressure
Node pressure.
Definition network.hpp:73
bool add_lift_gas
Whether or not to include lift gas of subordinate wells as part of the produced gas entering the netw...
Definition network.hpp:70
std::optional< std::string > as_choke
Group whose rate target the choking mechanism attempts to match.
Definition network.hpp:66
std::optional< double > terminal_pressure
Fixed pressure for terminal node. Nullopt if not terminal.
Definition network.hpp:61
std::string name
Name of network node.
Definition network.hpp:58