My Project
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 
28 namespace Opm {
29  class UnitSystem;
30 } // namespace Opm
31 
32 namespace Opm { namespace EclIO {
33  class RestartFileView;
34 }} // namespace Opm::EclIO
35 
36 namespace Opm { namespace RestartIO {
37 
38  class RstNetwork
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  };
72 
73  explicit RstNetwork(std::shared_ptr<EclIO::RestartFileView> rstView,
74  const UnitSystem& usys);
75 
76  bool isActive() const;
77 
78  const std::vector<Branch>& branches() const
79  {
80  return this->branches_;
81  }
82 
83  const std::vector<Node>& nodes() const
84  {
85  return this->nodes_;
86  }
87 
88  private:
89  std::vector<Branch> branches_{};
90  std::vector<Node> nodes_{};
91  };
92 
93 }} // namespace Opm::RestartIO
94 
95 #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:29
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
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