RockConfig.hpp
Go to the documentation of this file.
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>
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;
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() = default;
63 RockConfig(const Deck& deck, const FieldPropsManager& fp);
64
66
67 bool active() const;
68 const std::vector<RockConfig::RockComp>& comp() const;
70 std::size_t num_rock_tables() 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.vector(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;
92 bool m_water_compaction;
93 Hysteresis hyst_mode;
94};
95
96} //namespace Opm
97
98#endif
const char *const string
Definition: cJSON.h:170
Definition: Deck.hpp:115
Definition: FieldPropsManager.hpp:33
static const int defaultValue
Definition: R.hpp:821
static const std::string defaultValue
Definition: R.hpp:879
Definition: RockConfig.hpp:31
const std::string & rocknum_property() const
const std::vector< RockConfig::RockComp > & comp() const
bool active() const
Hysteresis hysteresis_mode() const
bool operator==(const RockConfig &other) const
RockConfig(const Deck &deck, const FieldPropsManager &fp)
void serializeOp(Serializer &serializer)
Definition: RockConfig.hpp:77
bool water_compaction() const
RockConfig()=default
std::size_t num_rock_tables() const
Hysteresis
Definition: RockConfig.hpp:34
static RockConfig serializeObject()
Definition: Serializer.hpp:38
Definition: A.hpp:4
Definition: RockConfig.hpp:45
double compressibility
Definition: RockConfig.hpp:47
void serializeOp(Serializer &serializer)
Definition: RockConfig.hpp:54
double pref
Definition: RockConfig.hpp:46
bool operator==(const RockComp &other) const
RockComp(double pref_arg, double comp_arg)