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, 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 void set_uptree_node(const std::string& new_uptree_node);
49 std::optional<int> vfp_table() const;
50 AlqEQ alq_eq() const;
51 std::optional<double> alq_value() const;
52
53 static Branch serializationTestObject();
54 bool operator==(const Branch& other) const;
55
56 template<class Serializer>
57 void serializeOp(Serializer& serializer)
58 {
59 serializer(m_downtree_node);
60 serializer(m_uptree_node);
61 serializer(m_vfp_table);
62 serializer(m_alq_value);
63 serializer(m_alq_eq);
64 }
65private:
66 std::string m_downtree_node;
67 std::string m_uptree_node;
68 int m_vfp_table;
69 std::optional<double> m_alq_value;
70 AlqEQ m_alq_eq;
71};
72
73}
74}
75#endif
Definition Branch.hpp:30
Class for (de-)serializing.
Definition Serializer.hpp:84
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30