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