My Project
RockConfig.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 #ifndef OPM_ROCK_CONFIG_HPP
21 #define OPM_ROCK_CONFIG_HPP
22 
23 #include <string>
24 
25 namespace Opm {
26 
27 class Deck;
28 class FieldPropsManager;
29 
30 class RockConfig {
31 public:
32 
33 enum class Hysteresis {
34  REVERS = 1,
35  IRREVERS = 2,
36  HYSTER = 3,
37  BOBERG = 4,
38  REVLIMIT = 5,
39  PALM_MAN = 6,
40  NONE = 7
41 };
42 
43 
44 struct RockComp {
45  double pref;
46  double compressibility;
47 
48  RockComp() = default;
49  RockComp(double pref_arg, double comp_arg);
50  bool operator==(const RockComp& other) const;
51 
52  template<class Serializer>
53  void serializeOp(Serializer& serializer)
54  {
55  serializer(pref);
56  serializer(compressibility);
57  }
58 };
59 
60 
61  RockConfig();
62  RockConfig(const Deck& deck, const FieldPropsManager& fp);
63 
64  static RockConfig serializeObject();
65 
66  bool active() const;
67  const std::vector<RockConfig::RockComp>& comp() const;
68  const std::string& rocknum_property() const;
69  std::size_t num_rock_tables() const;
70  Hysteresis hysteresis_mode() const;
71  bool water_compaction() const;
72 
73  bool operator==(const RockConfig& other) const;
74 
75  template<class Serializer>
76  void serializeOp(Serializer& serializer)
77  {
78  serializer(m_active);
79  serializer.vector(m_comp);
80  serializer(num_property);
81  serializer(num_tables);
82  serializer(m_water_compaction);
83  serializer(hyst_mode);
84  }
85 
86 private:
87  bool m_active = false;
88  std::vector<RockComp> m_comp;
89  std::string num_property;
90  std::size_t num_tables = 0;
91  bool m_water_compaction = false;
92  Hysteresis hyst_mode = Hysteresis::REVERS;
93 };
94 
95 } //namespace Opm
96 
97 #endif
Definition: Deck.hpp:63
Definition: FieldPropsManager.hpp:38
Definition: RockConfig.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
Definition: RockConfig.hpp:44