opm-common
EclMaterialLawTwoPhaseTypes.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_MATERIAL_LAW_TYPES_HPP
28 #define OPM_ECL_MATERIAL_LAW_TYPES_HPP
29 
34 
35 #include <memory>
36 #include <type_traits>
37 #include <vector>
38 
39 namespace Opm::EclMaterialLaw {
40 
46 template <class Traits>
48 {
49 public:
50  using GasOilTraits = TwoPhaseMaterialTraits<typename Traits::Scalar,
51  Traits::nonWettingPhaseIdx,
52  Traits::gasPhaseIdx>;
53  using OilWaterTraits = TwoPhaseMaterialTraits<typename Traits::Scalar,
54  Traits::wettingPhaseIdx,
55  Traits::nonWettingPhaseIdx>;
56  using GasWaterTraits = TwoPhaseMaterialTraits<typename Traits::Scalar,
57  Traits::wettingPhaseIdx,
58  Traits::gasPhaseIdx>;
59 
60  // the two-phase material law which is defined on effective (unscaled) saturations
64 
65  using GasOilEffectiveParams = typename GasOilEffectiveLaw::Params;
66  using OilWaterEffectiveParams = typename OilWaterEffectiveLaw::Params;
67  using GasWaterEffectiveParams = typename GasWaterEffectiveLaw::Params;
68 
69  template <bool enableEPS, typename BaseLaw>
70  using SelectEPSLaw = std::conditional_t<enableEPS, EclEpsTwoPhaseLaw<BaseLaw>, BaseLaw>;
71 
72  // the two-phase material law which is defined on absolute (scaled) saturations
73  using GasOilEpsLaw = SelectEPSLaw<Traits::enableEndpointScaling, GasOilEffectiveLaw>;
74  using OilWaterEpsLaw = SelectEPSLaw<Traits::enableEndpointScaling, OilWaterEffectiveLaw>;
75  using GasWaterEpsLaw = SelectEPSLaw<Traits::enableEndpointScaling, GasWaterEffectiveLaw>;
76  using GasOilEpsParams = typename GasOilEpsLaw::Params;
77  using OilWaterEpsParams = typename OilWaterEpsLaw::Params;
78  using GasWaterEpsParams = typename GasWaterEpsLaw::Params;
79 
80  template <bool enableHyst, typename BaseLaw>
81  using SelectHystLaw = std::conditional_t<enableHyst, EclHysteresisTwoPhaseLaw<BaseLaw>, BaseLaw>;
82 
83  // the (possibly scaled) two-phase material laws with hysteresis (or not)
84  using GasOilLaw = SelectHystLaw<Traits::enableHysteresis, GasOilEpsLaw>;
85  using OilWaterLaw = SelectHystLaw<Traits::enableHysteresis, OilWaterEpsLaw>;
86  using GasWaterLaw = SelectHystLaw<Traits::enableHysteresis, GasWaterEpsLaw>;
87 
88  using GasOilHystParams = typename GasOilLaw::Params;
89  using OilWaterHystParams = typename OilWaterLaw::Params;
90  using GasWaterHystParams = typename GasWaterLaw::Params;
91 
92  using GasOilEffectiveParamVector = std::vector<std::shared_ptr<GasOilEffectiveParams>>;
93  using OilWaterEffectiveParamVector = std::vector<std::shared_ptr<OilWaterEffectiveParams>>;
94  using GasWaterEffectiveParamVector = std::vector<std::shared_ptr<GasWaterEffectiveParams>>;
95 };
96 
97 } // namespace Opm::EclMaterialLaw
98 
99 #endif
This material law implements the hysteresis model of the ECL file format.
Definition: EclMaterialLawHystParams.cpp:28
This file contains helper classes for the material laws.
Helper class defining various two-phase types used in three-phase material laws.
Definition: EclMaterialLawTwoPhaseTypes.hpp:47
This material law takes a material law defined for unscaled saturation and converts it to a material ...
Implements a multiplexer class that provides LET curves and piecewise linear saturation functions...
Implements a multiplexer class that provides LET curves and piecewise linear saturation functions...
Definition: SatCurveMultiplexer.hpp:51
A generic traits class for two-phase material laws.
Definition: MaterialTraits.hpp:60