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 std::size_t num_rock_tables() const;
72 Hysteresis hysteresis_mode() const;
73 bool water_compaction() const;
74 bool dispersion() const;
75
76 bool operator==(const RockConfig& other) const;
77
78 template<class Serializer>
79 void serializeOp(Serializer& serializer)
80 {
81 serializer(m_active);
82 serializer(m_comp);
83 serializer(num_property);
84 serializer(num_tables);
85 serializer(m_water_compaction);
86 serializer(hyst_mode);
87 serializer(m_dispersion);
88 }
89
90private:
91 bool m_active = false;
92 std::vector<RockComp> m_comp;
93 std::string num_property;
94 std::size_t num_tables = 0;
95 bool m_water_compaction = false;
96 Hysteresis hyst_mode = Hysteresis::REVERS;
97 bool m_dispersion = false;
98};
99
100} //namespace Opm
101
102#endif // OPM_ROCK_CONFIG_HPP
Definition Deck.hpp:49
Definition FieldPropsManager.hpp:42
Definition RockConfig.hpp:33
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:47