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