opm-common
Branch.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
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 
21 #ifndef NETWORK_BRANCH_HPP
22 #define NETWORK_BRANCH_HPP
23 
24 #include <opm/input/eclipse/Units/Dimension.hpp>
25 
26 #include <optional>
27 #include <string>
28 
29 namespace Opm {
30 namespace Network {
31 
32 class Branch {
33 public:
34 
35  enum class AlqEQ {
36  OIL_DENSITY,
37  GAS_DENSITY,
38  ALQ_INPUT
39  };
40 
41 
42  static AlqEQ AlqEqfromString(const std::string& input_string);
43 
44  Branch() = default;
45  Branch(const std::string& downtree_node,
46  const std::string& uptree_node,
47  int vfp_table, double alq);
48  Branch(const std::string& downtree_node,
49  const std::string& uptree_node,
50  int vfp_table, AlqEQ alq_eq);
51 
52  const std::string& downtree_node() const;
53  const std::string& uptree_node() const;
54  void set_uptree_node(const std::string& new_uptree_node);
55  std::optional<int> vfp_table() const;
56  AlqEQ alq_eq() const;
63  std::optional<double> alq_value(const Dimension& alq_dimension) const;
64 
65  static Branch serializationTestObject();
66  bool operator==(const Branch& other) const;
67 
68  template<class Serializer>
69  void serializeOp(Serializer& serializer)
70  {
71  serializer(m_downtree_node);
72  serializer(m_uptree_node);
73  serializer(m_vfp_table);
74  serializer(m_alq_raw_value);
75  serializer(m_alq_eq);
76  }
77 private:
78  std::string m_downtree_node{};
79  std::string m_uptree_node{};
80  int m_vfp_table = 0;
81  std::optional<double> m_alq_raw_value{};
82  AlqEQ m_alq_eq{AlqEQ::OIL_DENSITY};
83 };
84 
85 }
86 }
87 #endif
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: Branch.hpp:32
std::optional< double > alq_value(const Dimension &alq_dimension) const
Artificial lift quantity for the branch.
Definition: Branch.cpp:116
Class for (de-)serializing.
Definition: Serializer.hpp:94
Definition: Dimension.hpp:27