opm-common
Loading...
Searching...
No Matches
EclMaterialLawHystParams.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
28#ifndef OPM_ECL_MATERIAL_LAW_HYST_PARAMS_HPP
29#define OPM_ECL_MATERIAL_LAW_HYST_PARAMS_HPP
30
32
33#include <functional>
34#include <memory>
35#include <tuple>
36
37namespace Opm {
39class EclipseState;
40}
41
42namespace Opm::EclMaterialLaw {
43
44template<class Traits> class Manager;
45
46template<class Traits>
47class HystParams
48{
49public:
50 using Scalar = typename Traits::Scalar;
51 using GasOilHystParams = typename TwoPhaseTypes<Traits>::GasOilHystParams;
52 using GasWaterHystParams = typename TwoPhaseTypes<Traits>::GasWaterHystParams;
53 using OilWaterHystParams = typename TwoPhaseTypes<Traits>::OilWaterHystParams;
54
55 HystParams(typename Manager<Traits>::Params& params,
56 const EclEpsGridProperties& epsGridProperties,
57 const EclEpsGridProperties* epsImbGridProperties,
58 const EclipseState& eclState,
59 const Manager<Traits>& parent);
60
61 void finalize();
62
63 std::shared_ptr<GasOilHystParams> getGasOilParams()
64 { return gasOilParams_; }
65
66 std::shared_ptr<OilWaterHystParams> getOilWaterParams()
67 { return oilWaterParams_; }
68
69 std::shared_ptr<GasWaterHystParams> getGasWaterParams()
70 { return gasWaterParams_; }
71
72 void setConfig(unsigned satRegionIdx);
73
74 // Function argument 'lookupIdxOnLevelZeroAssigner' is added to lookup, for each
75 // leaf gridview cell with index 'elemIdx', its 'lookupIdx'
76 // (index of the parent/equivalent cell on level zero).
77 using LookupFunction = std::function<unsigned(unsigned)>;
78
79 void setDrainageParamsOilGas(unsigned elemIdx, unsigned satRegionIdx,
80 const LookupFunction& lookupIdxOnLevelZeroAssigner);
81
82 void setDrainageParamsOilWater(unsigned elemIdx, unsigned satRegionIdx,
83 const LookupFunction& lookupIdxOnLevelZeroAssigner);
84
85 void setDrainageParamsGasWater(unsigned elemIdx, unsigned satRegionIdx,
86 const LookupFunction& lookupIdxOnLevelZeroAssigner);
87
88 void setImbibitionParamsOilGas(unsigned elemIdx, unsigned satRegionIdx,
89 const LookupFunction& lookupIdxOnLevelZeroAssigner);
90
91 void setImbibitionParamsOilWater(unsigned elemIdx, unsigned satRegionIdx,
92 const LookupFunction& lookupIdxOnLevelZeroAssigner);
93 void setImbibitionParamsGasWater(unsigned elemIdx, unsigned satRegionIdx,
94 const LookupFunction& lookupIdxOnLevelZeroAssigner);
95
96private:
97 bool hasGasWater_();
98 bool hasGasOil_();
99 bool hasOilWater_();
100
101 // Function argument 'lookupIdxOnLevelZeroAssigner' is added to lookup, for each
102 // leaf gridview cell with index 'elemIdx', its 'lookupIdx'
103 // (index of the parent/equivalent cell on level zero).
104 std::tuple<EclEpsScalingPointsInfo<Scalar>, EclEpsScalingPoints<Scalar>>
105 readScaledEpsPoints_(const EclEpsGridProperties& epsGridProperties,
106 unsigned elemIdx,
108 const LookupFunction& lookupIdxOnLevelZeroAssigner);
109
110 std::tuple<EclEpsScalingPointsInfo<Scalar>, EclEpsScalingPoints<Scalar>>
111 readScaledEpsPointsDrainage_(unsigned elemIdx,
113 const LookupFunction& lookupIdxOnLevelZeroAssigner);
114
115 std::tuple<EclEpsScalingPointsInfo<Scalar>, EclEpsScalingPoints<Scalar>>
116 readScaledEpsPointsImbibition_(unsigned elemIdx,
118 const LookupFunction& lookupIdxOnLevelZeroAssigner);
119
120 std::shared_ptr<GasOilHystParams> gasOilParams_;
121 std::shared_ptr<OilWaterHystParams> oilWaterParams_;
122 std::shared_ptr<GasWaterHystParams> gasWaterParams_;
123
124 typename Manager<Traits>::Params& params_;
125 const EclEpsGridProperties& epsGridProperties_;
126 const EclEpsGridProperties* epsImbGridProperties_;
127 const EclipseState& eclState_;
128 const Manager<Traits>& parent_;
129};
130
131} // namespace Opm::EclMaterialLaw
132
133#endif
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
Provides an simple way to create and manage the material law objects for a complete ECL deck.
Definition EclMaterialLawManager.hpp:80
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
Definition EclMaterialLawManager.hpp:109