My Project
Loading...
Searching...
No Matches
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
27namespace Opm {
28namespace Network {
29
30class Branch {
31public:
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,
44 const std::string& uptree_node,
45 int vfp_table, double alq);
46 Branch(const std::string& downtree_node,
47 const std::string& uptree_node,
48 int vfp_table, AlqEQ alq_eq);
49
50 const std::string& downtree_node() const;
51 const std::string& uptree_node() const;
52 void set_uptree_node(const std::string& new_uptree_node);
53 std::optional<int> vfp_table() const;
54 AlqEQ alq_eq() const;
55 std::optional<double> alq_value() const;
56
57 static Branch serializationTestObject();
58 bool operator==(const Branch& other) const;
59
60 template<class Serializer>
61 void serializeOp(Serializer& serializer)
62 {
63 serializer(m_downtree_node);
64 serializer(m_uptree_node);
65 serializer(m_vfp_table);
66 serializer(m_alq_value);
67 serializer(m_alq_eq);
68 }
69private:
70 std::string m_downtree_node{};
71 std::string m_uptree_node{};
72 int m_vfp_table = 0;
73 std::optional<double> m_alq_value{};
74 AlqEQ m_alq_eq{AlqEQ::OIL_DENSITY};
75};
76
77}
78}
79#endif
Definition Branch.hpp:30
Class for (de-)serializing.
Definition Serializer.hpp:94
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30