My Project
Loading...
Searching...
No Matches
WagHysteresisConfig.hpp
1/*
2 Copyright 2023 Equinor.
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#ifndef OPM_PARSER_WAGHYSTERSISCONFIG_HPP
20#define OPM_PARSER_WAGHYSTERSISCONFIG_HPP
21
22namespace Opm {
23
24class Deck;
25class DeckRecord;
26
28 public:
29
31
32 private:
33 // WAG hysteresis Lands parameter
34 double wagLandsParamValue { 1.0 };
35 // WAG hysteresis reduction factor
36 double wagSecondaryDrainageReductionValue { 0.0 };
37 // WAG gas model flag
38 bool wagGasFlagValue { true };
39 // WAG residual oil model flag
40 bool wagResidualOilFlagValue { false };
41 // WAG water model flag
42 bool wagWaterFlagValue { false };
43 // WAG hysteresis linear fraction
44 double wagImbCurveLinearFractionValue { 0.1 };
45 // WAG hysteresis 3-phase threshold
46 double wagWaterThresholdSaturationValue { 0.001 };
47
48 public:
49 WagHysteresisConfigRecord() = default;
50
51 explicit WagHysteresisConfigRecord(const DeckRecord& record);
52
53 double wagLandsParam() const {
54 return wagLandsParamValue;
55 }
56
57 double wagSecondaryDrainageReduction() const {
58 return wagSecondaryDrainageReductionValue;
59 }
60
61 bool wagGasFlag() const {
62 return wagGasFlagValue;
63 }
64
65 bool wagResidualOilFlag() const {
66 return wagResidualOilFlagValue;
67 }
68
69 bool wagWaterFlag() const {
70 return wagWaterFlagValue;
71 }
72
73 double wagImbCurveLinearFraction() const {
74 return wagImbCurveLinearFractionValue;
75 }
76
77 double wagWaterThresholdSaturation() const {
78 return wagWaterThresholdSaturationValue;
79 }
80
81 bool operator==(const WagHysteresisConfigRecord& data) const
82 {
83 return this->wagLandsParam() == data.wagLandsParam() &&
84 this->wagSecondaryDrainageReduction() == data.wagSecondaryDrainageReduction() &&
85 this->wagGasFlag() == data.wagGasFlag() &&
86 this->wagResidualOilFlag() == data.wagResidualOilFlag() &&
87 this->wagWaterFlag() == data.wagWaterFlag() &&
88 this->wagImbCurveLinearFraction() == data.wagImbCurveLinearFraction() &&
89 this->wagWaterThresholdSaturation() == data.wagWaterThresholdSaturation();
90 }
91
92 template<class Serializer>
93 void serializeOp(Serializer& serializer)
94 {
95 serializer(wagLandsParamValue);
96 serializer(wagSecondaryDrainageReductionValue);
97 serializer(wagGasFlagValue);
98 serializer(wagResidualOilFlagValue);
99 serializer(wagWaterFlagValue);
100 serializer(wagImbCurveLinearFractionValue);
101 serializer(wagWaterThresholdSaturationValue);
102 }
103
104 static WagHysteresisConfigRecord serializationTestObject()
105 {
107 result.wagLandsParamValue = 0;
108 result.wagSecondaryDrainageReductionValue = 1;
109 result.wagGasFlagValue = true;
110 result.wagResidualOilFlagValue = false;
111 result.wagWaterFlagValue = false;
112 result.wagImbCurveLinearFractionValue = 2;
113 result.wagWaterThresholdSaturationValue = 3;
114
115 return result;
116 }
117 };
118
120
121 explicit WagHysteresisConfig(const Deck& deck);
122
123 size_t size() const;
124 bool empty() const;
125
126 const std::vector<WagHysteresisConfigRecord>::const_iterator begin() const;
127 const std::vector<WagHysteresisConfigRecord>::const_iterator end() const;
128
129 template<class Serializer>
130 void serializeOp(Serializer& serializer)
131 {
132 serializer(wagrecords);
133 }
134 bool operator==(const WagHysteresisConfig& other) const;
135
136 const WagHysteresisConfigRecord& operator[](std::size_t index) const;
137
138 private:
139 std::vector<WagHysteresisConfigRecord> wagrecords;
140 };
141}
142
143#endif // OPM_PARSER_WAGHYSTERSISCONFIG_HPP
Definition DeckRecord.hpp:32
Definition Deck.hpp:49
Class for (de-)serializing.
Definition Serializer.hpp:84
Definition WagHysteresisConfig.hpp:27
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition WagHysteresisConfig.hpp:30