My Project
Loading...
Searching...
No Matches
EclEpsScalingPoints.hpp
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
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 2 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 Consult the COPYING file in the top-level source directory of this
20 module for the precise wording of the license and the list of
21 copyright holders.
22*/
27#ifndef OPM_ECL_EPS_SCALING_POINTS_HPP
28#define OPM_ECL_EPS_SCALING_POINTS_HPP
29
30#include <array>
31#include <vector>
32
33namespace Opm {
34
35class EclEpsConfig;
36enum class EclTwoPhaseSystemType;
37
38#if HAVE_ECL_INPUT
39class EclipseState;
40class EclEpsGridProperties;
41
42namespace satfunc {
43struct RawTableEndPoints;
44struct RawFunctionValues;
45}
46#endif
47
55template <class Scalar>
57{
58 // connate saturations
59 Scalar Swl; // water
60 Scalar Sgl; // gas
61
62 // critical saturations
63 Scalar Swcr; // water
64 Scalar Sgcr; // gas
65 Scalar Sowcr; // oil for the oil-water system
66 Scalar Sogcr; // oil for the gas-oil system
67
68 // maximum saturations
69 Scalar Swu; // water
70 Scalar Sgu; // gas
71
72 // maximum capillary pressures
73 Scalar maxPcow; // maximum capillary pressure of the oil-water system
74 Scalar maxPcgo; // maximum capillary pressure of the gas-oil system
75
76 // the Leverett capillary pressure scaling factors. (those only make sense for the
77 // scaled points, for the unscaled ones they are 1.0.)
78 Scalar pcowLeverettFactor;
79 Scalar pcgoLeverettFactor;
80
81 // Scaled relative permeabilities at residual displacing saturation
82 Scalar Krwr; // water
83 Scalar Krgr; // gas
84 Scalar Krorw; // oil in water-oil system
85 Scalar Krorg; // oil in gas-oil system
86
87 // maximum relative permabilities
88 Scalar maxKrw; // maximum relative permability of water
89 Scalar maxKrow; // maximum relative permability of oil in the oil-water system
90 Scalar maxKrog; // maximum relative permability of oil in the gas-oil system
91 Scalar maxKrg; // maximum relative permability of gas
92
93 bool operator==(const EclEpsScalingPointsInfo<Scalar>& data) const
94 {
95 return (Swl == data.Swl)
96 && (Sgl == data.Sgl)
97 && (Swcr == data.Swcr)
98 && (Sgcr == data.Sgcr)
99 && (Sowcr == data.Sowcr)
100 && (Sogcr == data.Sogcr)
101 && (Swu == data.Swu)
102 && (Sgu == data.Sgu)
103 && (maxPcow == data.maxPcow)
104 && (maxPcgo == data.maxPcgo)
105 && (pcowLeverettFactor == data.pcowLeverettFactor)
106 && (pcgoLeverettFactor == data.pcgoLeverettFactor)
107 && (Krwr == data.Krwr)
108 && (Krgr == data.Krgr)
109 && (Krorw == data.Krorw)
110 && (Krorg == data.Krorg)
111 && (maxKrw == data.maxKrw)
112 && (maxKrow == data.maxKrow)
113 && (maxKrog == data.maxKrog)
114 && (maxKrg == data.maxKrg)
115 ;
116 }
117
118 void print() const;
119
120#if HAVE_ECL_INPUT
127 void extractUnscaled(const satfunc::RawTableEndPoints& rtep,
128 const satfunc::RawFunctionValues& rfunc,
129 const std::vector<double>::size_type satRegionIdx);
130
136 void extractScaled(const EclipseState& eclState,
137 const EclEpsGridProperties& epsProperties,
138 unsigned activeIndex);
139
140private:
141 void calculateLeverettFactors(const EclipseState& eclState,
142 const EclEpsGridProperties& epsProperties,
143 unsigned activeIndex);
144#endif // HAVE_ECL_INPUT
145};
146
153template <class Scalar>
155{
156public:
160 void init(const EclEpsScalingPointsInfo<Scalar>& epsInfo,
161 const EclEpsConfig& config,
162 EclTwoPhaseSystemType epsSystemType);
163
167 void setSaturationPcPoint(unsigned pointIdx, Scalar value)
168 { saturationPcPoints_[pointIdx] = value; }
169
173 const std::array<Scalar, 3>& saturationPcPoints() const
174 { return saturationPcPoints_; }
175
179 void setSaturationKrwPoint(unsigned pointIdx, Scalar value)
180 { saturationKrwPoints_[pointIdx] = value; }
181
185 const std::array<Scalar, 3>& saturationKrwPoints() const
186 { return saturationKrwPoints_; }
187
191 void setSaturationKrnPoint(unsigned pointIdx, Scalar value)
192 { saturationKrnPoints_[pointIdx] = value; }
193
197 const std::array<Scalar, 3>& saturationKrnPoints() const
198 { return saturationKrnPoints_; }
199
203 void setMaxPcnw(Scalar value)
204 { maxPcnwOrLeverettFactor_ = value; }
205
209 Scalar maxPcnw() const
210 { return maxPcnwOrLeverettFactor_; }
211
215 void setLeverettFactor(Scalar value)
216 { maxPcnwOrLeverettFactor_ = value; }
217
221 Scalar leverettFactor() const
222 { return maxPcnwOrLeverettFactor_; }
223
228 void setKrwr(Scalar value)
229 { this->Krwr_ = value; }
230
235 Scalar krwr() const
236 { return this->Krwr_; }
237
241 void setMaxKrw(Scalar value)
242 { maxKrw_ = value; }
243
247 Scalar maxKrw() const
248 { return maxKrw_; }
249
254 void setKrnr(Scalar value)
255 { this->Krnr_ = value; }
256
261 Scalar krnr() const
262 { return this->Krnr_; }
263
267 void setMaxKrn(Scalar value)
268 { maxKrn_ = value; }
269
273 Scalar maxKrn() const
274 { return maxKrn_; }
275
276 void print() const;
277
278private:
279 // Points used for vertical scaling of capillary pressure
280 Scalar maxPcnwOrLeverettFactor_{};
281
282 // Maximum wetting phase relative permability value.
283 Scalar maxKrw_{};
284
285 // Scaled wetting phase relative permeability value at residual
286 // saturation of non-wetting phase.
287 Scalar Krwr_{};
288
289 // Maximum non-wetting phase relative permability value
290 Scalar maxKrn_{};
291
292 // Scaled non-wetting phase relative permeability value at residual
293 // saturation of wetting phase.
294 Scalar Krnr_{};
295
296 // The the points used for saturation ("x-axis") scaling of capillary pressure
297 std::array<Scalar, 3> saturationPcPoints_{};
298
299 // The the points used for saturation ("x-axis") scaling of wetting phase relative permeability
300 std::array<Scalar, 3> saturationKrwPoints_{};
301
302 // The the points used for saturation ("x-axis") scaling of non-wetting phase relative permeability
303 std::array<Scalar, 3> saturationKrnPoints_{};
304};
305
306} // namespace Opm
307
308#endif
Specifies the configuration used by the endpoint scaling code.
Definition EclEpsConfig.hpp:56
Collects all grid properties which are relevant for end point scaling.
Definition EclEpsGridProperties.hpp:47
Represents the points on the X and Y axis to be scaled if endpoint scaling is used.
Definition EclEpsScalingPoints.hpp:155
const std::array< Scalar, 3 > & saturationKrwPoints() const
Returns the points used for wetting phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:185
void setMaxKrn(Scalar value)
Sets the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:267
Scalar krnr() const
Returns non-wetting phase relative permeability at residual saturation of wetting phase.
Definition EclEpsScalingPoints.hpp:261
Scalar maxKrn() const
Returns the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:273
void setKrnr(Scalar value)
Set non-wetting phase relative permeability at residual saturation of wetting phase.
Definition EclEpsScalingPoints.hpp:254
void setMaxKrw(Scalar value)
Sets the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:241
Scalar maxKrw() const
Returns the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:247
void setSaturationKrwPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for wetting-phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:179
void setMaxPcnw(Scalar value)
Sets the maximum capillary pressure.
Definition EclEpsScalingPoints.hpp:203
Scalar krwr() const
Returns wetting-phase relative permeability at residual saturation of non-wetting phase.
Definition EclEpsScalingPoints.hpp:235
Scalar maxPcnw() const
Returns the maximum capillary pressure.
Definition EclEpsScalingPoints.hpp:209
void setKrwr(Scalar value)
Set wetting-phase relative permeability at residual saturation of non-wetting phase.
Definition EclEpsScalingPoints.hpp:228
void setSaturationPcPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for capillary pressure saturation scaling.
Definition EclEpsScalingPoints.hpp:167
const std::array< Scalar, 3 > & saturationKrnPoints() const
Returns the points used for non-wetting phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:197
void setLeverettFactor(Scalar value)
Sets the Leverett scaling factor for capillary pressure.
Definition EclEpsScalingPoints.hpp:215
const std::array< Scalar, 3 > & saturationPcPoints() const
Returns the points used for capillary pressure saturation scaling.
Definition EclEpsScalingPoints.hpp:173
void init(const EclEpsScalingPointsInfo< Scalar > &epsInfo, const EclEpsConfig &config, EclTwoPhaseSystemType epsSystemType)
Assigns the scaling points which actually ought to be used.
Definition EclEpsScalingPoints.cpp:240
void setSaturationKrnPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for non-wetting phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:191
Scalar leverettFactor() const
Returns the Leverett scaling factor for capillary pressure.
Definition EclEpsScalingPoints.hpp:221
Definition EclipseState.hpp:62
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
EclTwoPhaseSystemType
Specified which fluids are involved in a given twophase material law for endpoint scaling.
Definition EclEpsConfig.hpp:42
This structure represents all values which can be possibly used as scaling points in the endpoint sca...
Definition EclEpsScalingPoints.hpp:57
Collection of unscaled/raw saturation function value range endpoints extracted directly from tables o...
Definition SatfuncPropertyInitializers.hpp:93
Collection of unscaled/raw saturation range endpoints extracted directly from tables of tabulated sat...
Definition SatfuncPropertyInitializers.hpp:36