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 void print() const;
118
119#if HAVE_ECL_INPUT
126 void extractUnscaled(const satfunc::RawTableEndPoints& rtep,
127 const satfunc::RawFunctionValues& rfunc,
128 const std::vector<double>::size_type satRegionIdx);
129
130 void update(Scalar& targetValue, const double * value_ptr)
131 {
132 if (value_ptr)
133 targetValue = *value_ptr;
134 }
135
141 void extractScaled(const EclipseState& eclState,
142 const EclEpsGridProperties& epsProperties,
143 unsigned activeIndex);
144#endif
145
146private:
147 void extractGridPropertyValue_(Scalar& targetValue,
148 const std::vector<double>* propData,
149 unsigned cartesianCellIdx)
150 {
151 if (!propData)
152 return;
153
154 targetValue = (*propData)[cartesianCellIdx];
155 }
156};
157
164template <class Scalar>
166{
167public:
171 void init(const EclEpsScalingPointsInfo<Scalar>& epsInfo,
172 const EclEpsConfig& config,
173 EclTwoPhaseSystemType epsSystemType);
174
178 void setSaturationPcPoint(unsigned pointIdx, Scalar value)
179 { saturationPcPoints_[pointIdx] = value; }
180
184 const std::array<Scalar, 3>& saturationPcPoints() const
185 { return saturationPcPoints_; }
186
190 void setSaturationKrwPoint(unsigned pointIdx, Scalar value)
191 { saturationKrwPoints_[pointIdx] = value; }
192
196 const std::array<Scalar, 3>& saturationKrwPoints() const
197 { return saturationKrwPoints_; }
198
202 void setSaturationKrnPoint(unsigned pointIdx, Scalar value)
203 { saturationKrnPoints_[pointIdx] = value; }
204
208 const std::array<Scalar, 3>& saturationKrnPoints() const
209 { return saturationKrnPoints_; }
210
214 void setMaxPcnw(Scalar value)
215 { maxPcnwOrLeverettFactor_ = value; }
216
220 Scalar maxPcnw() const
221 { return maxPcnwOrLeverettFactor_; }
222
226 void setLeverettFactor(Scalar value)
227 { maxPcnwOrLeverettFactor_ = value; }
228
232 Scalar leverettFactor() const
233 { return maxPcnwOrLeverettFactor_; }
234
239 void setKrwr(Scalar value)
240 { this->Krwr_ = value; }
241
246 Scalar krwr() const
247 { return this->Krwr_; }
248
252 void setMaxKrw(Scalar value)
253 { maxKrw_ = value; }
254
258 Scalar maxKrw() const
259 { return maxKrw_; }
260
265 void setKrnr(Scalar value)
266 { this->Krnr_ = value; }
267
272 Scalar krnr() const
273 { return this->Krnr_; }
274
278 void setMaxKrn(Scalar value)
279 { maxKrn_ = value; }
280
284 Scalar maxKrn() const
285 { return maxKrn_; }
286
287 void print() const;
288
289private:
290 // Points used for vertical scaling of capillary pressure
291 Scalar maxPcnwOrLeverettFactor_;
292
293 // Maximum wetting phase relative permability value.
294 Scalar maxKrw_;
295
296 // Scaled wetting phase relative permeability value at residual
297 // saturation of non-wetting phase.
298 Scalar Krwr_;
299
300 // Maximum non-wetting phase relative permability value
301 Scalar maxKrn_;
302
303 // Scaled non-wetting phase relative permeability value at residual
304 // saturation of wetting phase.
305 Scalar Krnr_;
306
307 // The the points used for saturation ("x-axis") scaling of capillary pressure
308 std::array<Scalar, 3> saturationPcPoints_;
309
310 // The the points used for saturation ("x-axis") scaling of wetting phase relative permeability
311 std::array<Scalar, 3> saturationKrwPoints_;
312
313 // The the points used for saturation ("x-axis") scaling of non-wetting phase relative permeability
314 std::array<Scalar, 3> saturationKrnPoints_;
315};
316
317} // namespace Opm
318
319#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:166
const std::array< Scalar, 3 > & saturationKrwPoints() const
Returns the points used for wetting phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:196
void setMaxKrn(Scalar value)
Sets the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:278
Scalar krnr() const
Returns non-wetting phase relative permeability at residual saturation of wetting phase.
Definition EclEpsScalingPoints.hpp:272
Scalar maxKrn() const
Returns the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:284
void setKrnr(Scalar value)
Set non-wetting phase relative permeability at residual saturation of wetting phase.
Definition EclEpsScalingPoints.hpp:265
void setMaxKrw(Scalar value)
Sets the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:252
Scalar maxKrw() const
Returns the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:258
void setSaturationKrwPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for wetting-phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:190
void setMaxPcnw(Scalar value)
Sets the maximum capillary pressure.
Definition EclEpsScalingPoints.hpp:214
Scalar krwr() const
Returns wetting-phase relative permeability at residual saturation of non-wetting phase.
Definition EclEpsScalingPoints.hpp:246
Scalar maxPcnw() const
Returns the maximum capillary pressure.
Definition EclEpsScalingPoints.hpp:220
void setKrwr(Scalar value)
Set wetting-phase relative permeability at residual saturation of non-wetting phase.
Definition EclEpsScalingPoints.hpp:239
void setSaturationPcPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for capillary pressure saturation scaling.
Definition EclEpsScalingPoints.hpp:178
const std::array< Scalar, 3 > & saturationKrnPoints() const
Returns the points used for non-wetting phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:208
void setLeverettFactor(Scalar value)
Sets the Leverett scaling factor for capillary pressure.
Definition EclEpsScalingPoints.hpp:226
const std::array< Scalar, 3 > & saturationPcPoints() const
Returns the points used for capillary pressure saturation scaling.
Definition EclEpsScalingPoints.hpp:184
void init(const EclEpsScalingPointsInfo< Scalar > &epsInfo, const EclEpsConfig &config, EclTwoPhaseSystemType epsSystemType)
Assigns the scaling points which actually ought to be used.
Definition EclEpsScalingPoints.cpp:202
void setSaturationKrnPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for non-wetting phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:202
Scalar leverettFactor() const
Returns the Leverett scaling factor for capillary pressure.
Definition EclEpsScalingPoints.hpp:232
Definition EclipseState.hpp:63
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