My Project
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 <optional>
25 #include <string>
26 
27 namespace Opm {
28 namespace Network {
29 
30 class Branch {
31 public:
32 
33  enum class AlqEQ {
34  OIL_DENSITY,
35  GAS_DENSITY,
36  ALQ_INPUT
37  };
38 
39 
40  static AlqEQ AlqEqfromString(const std::string& input_string);
41 
42  Branch() = default;
43  Branch(const std::string& downtree_node, const std::string& uptree_node, int vfp_table, double alq);
44  Branch(const std::string& downtree_node, const std::string& uptree_node, int vfp_table, AlqEQ alq_eq);
45 
46  const std::string& downtree_node() const;
47  const std::string& uptree_node() const;
48  std::optional<int> vfp_table() const;
49  AlqEQ alq_eq() const;
50  std::optional<double> alq_value() const;
51 
52  static Branch serializeObject();
53  bool operator==(const Branch& other) const;
54 
55  template<class Serializer>
56  void serializeOp(Serializer& serializer)
57  {
58  serializer(m_downtree_node);
59  serializer(m_uptree_node);
60  serializer(m_vfp_table);
61  serializer(m_alq_value);
62  serializer(m_alq_eq);
63  }
64 private:
65  std::string m_downtree_node;
66  std::string m_uptree_node;
67  int m_vfp_table;
68  std::optional<double> m_alq_value;
69  AlqEQ m_alq_eq;
70 };
71 
72 }
73 }
74 #endif
Definition: Branch.hpp:30
Definition: Serializer.hpp:38
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29