opm-common
Node.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_NODE_HPP
22 #define NETWORK_NODE_HPP
23 
24 #include <optional>
25 #include <string>
26 
27 namespace Opm {
28 namespace Network {
29 
30 class Node {
31 public:
32  Node() = default;
33  explicit Node(const std::string& name);
34 
35  const std::string& name() const;
36  const std::optional<double>& terminal_pressure() const;
37  bool as_choke() const;
38  double efficiency() const;
39  bool add_gas_lift_gas() const;
40  const std::optional<std::string>& target_group() const;
41 
42  void terminal_pressure(double pressure);
43  void add_gas_lift_gas(bool add_gas);
44  void as_choke(const std::string& target_group);
45  void set_efficiency(const double efficiency);
46 
47  static Node serializationTestObject();
48  bool operator==(const Node& other) const;
49 
50  template<class Serializer>
51  void serializeOp(Serializer& serializer)
52  {
53  serializer(m_name);
54  serializer(m_terminal_pressure);
55  serializer(m_add_gas_lift_gas);
56  serializer(m_choke_target_group);
57  serializer(m_efficiency);
58  }
59 private:
60  std::string m_name;
61  std::optional<double> m_terminal_pressure;
62  std::optional<std::string> m_choke_target_group;
63  bool m_add_gas_lift_gas{false};
64  double m_efficiency{1.0};
65 };
66 }
67 }
68 #endif
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: Node.hpp:30
Class for (de-)serializing.
Definition: Serializer.hpp:94