opm-common
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 
33 namespace Opm {
34 
35 class EclEpsConfig;
36 enum class EclTwoPhaseSystemType;
37 
38 class EclipseState;
39 class EclEpsGridProperties;
40 
41 namespace satfunc {
42 struct RawTableEndPoints;
43 struct RawFunctionValues;
44 }
45 
53 template <class Scalar>
55 {
56  // connate saturations
57  Scalar Swl; // water
58  Scalar Sgl; // gas
59 
60  // critical saturations
61  Scalar Swcr; // water
62  Scalar Sgcr; // gas
63  Scalar Sowcr; // oil for the oil-water system
64  Scalar Sogcr; // oil for the gas-oil system
65 
66  // maximum saturations
67  Scalar Swu; // water
68  Scalar Sgu; // gas
69 
70  // maximum capillary pressures
71  Scalar maxPcow; // maximum capillary pressure of the oil-water system
72  Scalar maxPcgo; // maximum capillary pressure of the gas-oil system
73 
74  // the Leverett capillary pressure scaling factors. (those only make sense for the
75  // scaled points, for the unscaled ones they are 1.0.)
76  Scalar pcowLeverettFactor;
77  Scalar pcgoLeverettFactor;
78 
79  // Scaled relative permeabilities at residual displacing saturation
80  Scalar Krwr; // water
81  Scalar Krgr; // gas
82  Scalar Krorw; // oil in water-oil system
83  Scalar Krorg; // oil in gas-oil system
84 
85  // maximum relative permabilities
86  Scalar maxKrw; // maximum relative permability of water
87  Scalar maxKrow; // maximum relative permability of oil in the oil-water system
88  Scalar maxKrog; // maximum relative permability of oil in the gas-oil system
89  Scalar maxKrg; // maximum relative permability of gas
90 
91  bool operator==(const EclEpsScalingPointsInfo<Scalar>& data) const
92  {
93  return (Swl == data.Swl)
94  && (Sgl == data.Sgl)
95  && (Swcr == data.Swcr)
96  && (Sgcr == data.Sgcr)
97  && (Sowcr == data.Sowcr)
98  && (Sogcr == data.Sogcr)
99  && (Swu == data.Swu)
100  && (Sgu == data.Sgu)
101  && (maxPcow == data.maxPcow)
102  && (maxPcgo == data.maxPcgo)
103  && (pcowLeverettFactor == data.pcowLeverettFactor)
104  && (pcgoLeverettFactor == data.pcgoLeverettFactor)
105  && (Krwr == data.Krwr)
106  && (Krgr == data.Krgr)
107  && (Krorw == data.Krorw)
108  && (Krorg == data.Krorg)
109  && (maxKrw == data.maxKrw)
110  && (maxKrow == data.maxKrow)
111  && (maxKrog == data.maxKrog)
112  && (maxKrg == data.maxKrg)
113  ;
114  }
115 
116  void print() const;
117 
125  const satfunc::RawFunctionValues& rfunc,
126  const std::vector<double>::size_type satRegionIdx);
127 
133  void extractScaled(const EclipseState& eclState,
134  const EclEpsGridProperties& epsProperties,
135  unsigned activeIndex);
136 
137 private:
138  void calculateLeverettFactors(const EclipseState& eclState,
139  const EclEpsGridProperties& epsProperties,
140  unsigned activeIndex);
141 };
142 
149 template <class Scalar>
151 {
152 public:
156  void init(const EclEpsScalingPointsInfo<Scalar>& epsInfo,
157  const EclEpsConfig& config,
158  EclTwoPhaseSystemType epsSystemType);
159 
163  void setSaturationPcPoint(unsigned pointIdx, Scalar value)
164  { saturationPcPoints_[pointIdx] = value; }
165 
169  const std::array<Scalar, 3>& saturationPcPoints() const
170  { return saturationPcPoints_; }
171 
175  void setSaturationKrwPoint(unsigned pointIdx, Scalar value)
176  { saturationKrwPoints_[pointIdx] = value; }
177 
181  const std::array<Scalar, 3>& saturationKrwPoints() const
182  { return saturationKrwPoints_; }
183 
187  void setSaturationKrnPoint(unsigned pointIdx, Scalar value)
188  { saturationKrnPoints_[pointIdx] = value; }
189 
193  const std::array<Scalar, 3>& saturationKrnPoints() const
194  { return saturationKrnPoints_; }
195 
199  void setMaxPcnw(Scalar value)
200  { maxPcnwOrLeverettFactor_ = value; }
201 
205  Scalar maxPcnw() const
206  { return maxPcnwOrLeverettFactor_; }
207 
212  { maxPcnwOrLeverettFactor_ = value; }
213 
217  Scalar leverettFactor() const
218  { return maxPcnwOrLeverettFactor_; }
219 
224  void setKrwr(Scalar value)
225  { this->Krwr_ = value; }
226 
231  Scalar krwr() const
232  { return this->Krwr_; }
233 
237  void setMaxKrw(Scalar value)
238  { maxKrw_ = value; }
239 
243  Scalar maxKrw() const
244  { return maxKrw_; }
245 
250  void setKrnr(Scalar value)
251  { this->Krnr_ = value; }
252 
257  Scalar krnr() const
258  { return this->Krnr_; }
259 
263  void setMaxKrn(Scalar value)
264  { maxKrn_ = value; }
265 
269  Scalar maxKrn() const
270  { return maxKrn_; }
271 
272  void print() const;
273 
274 private:
275  // Points used for vertical scaling of capillary pressure
276  Scalar maxPcnwOrLeverettFactor_{};
277 
278  // Maximum wetting phase relative permability value.
279  Scalar maxKrw_{};
280 
281  // Scaled wetting phase relative permeability value at residual
282  // saturation of non-wetting phase.
283  Scalar Krwr_{};
284 
285  // Maximum non-wetting phase relative permability value
286  Scalar maxKrn_{};
287 
288  // Scaled non-wetting phase relative permeability value at residual
289  // saturation of wetting phase.
290  Scalar Krnr_{};
291 
292  // The the points used for saturation ("x-axis") scaling of capillary pressure
293  std::array<Scalar, 3> saturationPcPoints_{};
294 
295  // The the points used for saturation ("x-axis") scaling of wetting phase relative permeability
296  std::array<Scalar, 3> saturationKrwPoints_{};
297 
298  // The the points used for saturation ("x-axis") scaling of non-wetting phase relative permeability
299  std::array<Scalar, 3> saturationKrnPoints_{};
300 };
301 
302 } // namespace Opm
303 
304 #endif
Collection of unscaled/raw saturation range endpoints extracted directly from tables of tabulated sat...
Definition: SatfuncPropertyInitializers.hpp:35
void setMaxKrw(Scalar value)
Sets the maximum wetting phase relative permeability.
Definition: EclEpsScalingPoints.hpp:237
EclTwoPhaseSystemType
Specified which fluids are involved in a given twophase material law for endpoint scaling...
Definition: EclEpsConfig.hpp:40
void setSaturationPcPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for capillary pressure saturation scaling.
Definition: EclEpsScalingPoints.hpp:163
void setMaxPcnw(Scalar value)
Sets the maximum capillary pressure.
Definition: EclEpsScalingPoints.hpp:199
Scalar maxKrw() const
Returns the maximum wetting phase relative permeability.
Definition: EclEpsScalingPoints.hpp:243
void setSaturationKrnPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for non-wetting phase relperm saturation scaling.
Definition: EclEpsScalingPoints.hpp:187
Collects all grid properties which are relevant for end point scaling.
Definition: EclEpsGridProperties.hpp:44
void extractScaled(const EclipseState &eclState, const EclEpsGridProperties &epsProperties, unsigned activeIndex)
Extract the values of the scaled scaling parameters.
Definition: EclEpsScalingPoints.cpp:118
void setSaturationKrwPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for wetting-phase relperm saturation scaling.
Definition: EclEpsScalingPoints.hpp:175
Scalar krwr() const
Returns wetting-phase relative permeability at residual saturation of non-wetting phase...
Definition: EclEpsScalingPoints.hpp:231
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Specifies the configuration used by the endpoint scaling code.
Definition: EclEpsConfig.hpp:53
void setKrnr(Scalar value)
Set non-wetting phase relative permeability at residual saturation of wetting phase.
Definition: EclEpsScalingPoints.hpp:250
Collection of unscaled/raw saturation function value range endpoints extracted directly from tables o...
Definition: SatfuncPropertyInitializers.hpp:92
Scalar leverettFactor() const
Returns the Leverett scaling factor for capillary pressure.
Definition: EclEpsScalingPoints.hpp:217
const std::array< Scalar, 3 > & saturationPcPoints() const
Returns the points used for capillary pressure saturation scaling.
Definition: EclEpsScalingPoints.hpp:169
This structure represents all values which can be possibly used as scaling points in the endpoint sca...
Definition: EclEpsScalingPoints.hpp:54
Scalar maxKrn() const
Returns the maximum wetting phase relative permeability.
Definition: EclEpsScalingPoints.hpp:269
Definition: EclipseState.hpp:66
Represents the points on the X and Y axis to be scaled if endpoint scaling is used.
Definition: EclEpsScalingPoints.hpp:150
void setLeverettFactor(Scalar value)
Sets the Leverett scaling factor for capillary pressure.
Definition: EclEpsScalingPoints.hpp:211
Scalar krnr() const
Returns non-wetting phase relative permeability at residual saturation of wetting phase...
Definition: EclEpsScalingPoints.hpp:257
const std::array< Scalar, 3 > & saturationKrwPoints() const
Returns the points used for wetting phase relperm saturation scaling.
Definition: EclEpsScalingPoints.hpp:181
void setMaxKrn(Scalar value)
Sets the maximum wetting phase relative permeability.
Definition: EclEpsScalingPoints.hpp:263
void setKrwr(Scalar value)
Set wetting-phase relative permeability at residual saturation of non-wetting phase.
Definition: EclEpsScalingPoints.hpp:224
Scalar maxPcnw() const
Returns the maximum capillary pressure.
Definition: EclEpsScalingPoints.hpp:205
const std::array< Scalar, 3 > & saturationKrnPoints() const
Returns the points used for non-wetting phase relperm saturation scaling.
Definition: EclEpsScalingPoints.hpp:193
void init(const EclEpsScalingPointsInfo< Scalar > &epsInfo, const EclEpsConfig &config, EclTwoPhaseSystemType epsSystemType)
Assigns the scaling points which actually ought to be used.
Definition: EclEpsScalingPoints.cpp:234
void extractUnscaled(const satfunc::RawTableEndPoints &rtep, const satfunc::RawFunctionValues &rfunc, const std::vector< double >::size_type satRegionIdx)
Extract the values of the unscaled scaling parameters.
Definition: EclEpsScalingPoints.cpp:83