3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
fluidmatrixinteraction.hh
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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program 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 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program 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 this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
25#ifndef DUMUX_MATERIAL_FLUIDMATRIX_INTERACTIONS_FLUIDMATRIX_INTERACTION_HH
26#define DUMUX_MATERIAL_FLUIDMATRIX_INTERACTIONS_FLUIDMATRIX_INTERACTION_HH
27
28#include <type_traits>
29#include <utility>
30
31namespace Dumux {
32
38template<class... Laws>
39struct FluidMatrixInteraction : public Laws...
40{
41 FluidMatrixInteraction(Laws&&... laws) : Laws(std::forward<Laws>(laws))... {}
42};
43
50template<class... Laws>
51auto makeFluidMatrixInteraction(Laws&&... laws)
52{
53 return FluidMatrixInteraction(wrap(std::forward<Laws>(laws))...);
54}
55
56} // end namespace Dumux
57
58namespace Dumux::FluidMatrix {
59
65template<class A, template<class> class Wrapper>
66struct Adapter
67{
68 template<class T, std::enable_if_t<std::is_same_v<A, std::decay_t<T>>, int> = 0>
69 friend auto wrap(T&& t) { return Wrapper(std::forward<T>(t)); }
70};
71
76template<class T>
77class PcKrSw
78{
79public:
80 using Scalar = typename std::decay_t<T>::Scalar;
81
82 using PcKrSwType = T;
83
84 PcKrSw(T&& impl) : impl_(std::forward<T>(impl)) {}
85
86 Scalar pc(const Scalar sw) const { return impl_.pc(sw); }
87 Scalar dpc_dsw(const Scalar sw) const { return impl_.dpc_dsw(sw); }
88 Scalar endPointPc() const { return impl_.endPointPc(); }
89 Scalar sw(const Scalar pc) const { return impl_.sw(pc); }
90 Scalar dsw_dpc(const Scalar pc) const { return impl_.dsw_dpc(pc); }
91 Scalar krw(const Scalar sw) const { return impl_.krw(sw); }
92 Scalar dkrw_dsw(const Scalar sw) const { return impl_.dkrw_dsw(sw); }
93 Scalar krn(const Scalar sw) const { return impl_.krn(sw); }
94 Scalar dkrn_dsw(const Scalar sw) const { return impl_.dkrn_dsw(sw); }
95
96 const T& pcSwCurve() const { return impl_; }
97 const T& krSwCurve() const { return impl_; }
98
99private:
100 T impl_;
101};
102
109template<typename T>
111
116template<class T>
118{
119public:
120 using Scalar = typename std::decay_t<T>::Scalar;
121
122 MultiPhasePcKrSw(T&& impl) : impl_(std::forward<T>(impl)) {}
123
124 template<class FS>
125 auto capillaryPressures(const FS& fs, int wp) const { return impl_.capillaryPressures(fs, wp); }
126 template<class FS>
127 auto relativePermeabilities(const FS& fs, int wp) const { return impl_.relativePermeabilities(fs, wp); }
128
129 const T& multiPhasePcKrS() const { return impl_; }
130
131private:
132 T impl_;
133};
134
141template<typename T>
143
148template<class T>
150{
151 using Scalar = typename std::decay_t<T>::Scalar;
152 using value_type = T;
153
154 using PcKrSwType = T;
155
156 ThreePhasePcKrSw(T&& impl) : impl_(std::forward<T>(impl)) {}
157
158 Scalar pcgw(const Scalar sw, const Scalar sn) const { return impl_.pcgw(sw, sn); }
159 Scalar pcnw(const Scalar sw, const Scalar sn) const { return impl_.pcnw(sw, sn); }
160 Scalar pcgn(const Scalar sw, const Scalar sn) const { return impl_.pcgn(sw, sn); }
161 Scalar pcAlpha(const Scalar sw, const Scalar sn) const { return impl_.pcAlpha(sw, sn); }
162
163 Scalar krw(const Scalar sw, const Scalar sn) const { return impl_.krw(sw, sn); }
164 Scalar krn(const Scalar sw, const Scalar sn) const { return impl_.krn(sw, sn); }
165 Scalar krg(const Scalar sw, const Scalar sn) const { return impl_.krn(sw, sn); }
166 Scalar kr(const int phaseIdx, const Scalar sw, const Scalar sn) const { return impl_.kr(phaseIdx, sw, sn); }
167
168 const T& pcSwCurve() const { return impl_; }
169 const T& krSwCurve() const { return impl_; }
170private:
171 T impl_;
172};
173
180template<typename T>
182
187template<class T>
189{
190public:
191 WettingNonwettingInterfacialAreaPcSw(T&& impl) : impl_(std::forward<T>(impl)) {}
192 const T& wettingNonwettingInterface() const { return impl_; }
193private:
194 T impl_;
195};
196
203template<typename T>
205
210template<class T>
212{
213public:
214 WettingSolidInterfacialAreaPcSw(T&& impl) : impl_(std::forward<T>(impl)) {}
215 const T& wettingSolidInterface() const { return impl_; }
216private:
217 T impl_;
218};
219
226template<typename T>
228
233template<class T>
235{
236public:
237 NonwettingSolidInterfacialAreaPcSw(T&& impl) : impl_(std::forward<T>(impl)) {}
238 const T& nonwettingSolidInterface() const { return impl_; }
239private:
240 T impl_;
241};
242
249template<typename T>
251
252
257template<class T>
259{
260public:
261 using value_type = T;
262
263 Adsorption(T&& impl) : impl_(std::forward<T>(impl)) {}
264 const T& adsorptionModel() const { return impl_; }
265private:
266 T impl_;
267};
268
275template<typename T>
277
278} // end namespace Dumux::FluidMatrix
279
280#endif
PcKrSw(T &&) -> PcKrSw< T >
Deduction guide for the PcKrSw class. Makes sure that PcKrSw stores a copy of T if the constructor is...
NonwettingSolidInterfacialAreaPcSw(T &&) -> NonwettingSolidInterfacialAreaPcSw< T >
Deduction guide for the NonwettingSolidInterfacialAreaPcSw class. Makes sure that NonwettingSolidInte...
WettingSolidInterfacialAreaPcSw(T &&) -> WettingSolidInterfacialAreaPcSw< T >
Deduction guide for the WettingSolidInterfacialAreaPcSw class. Makes sure that WettingSolidInterfacia...
ThreePhasePcKrSw(T &&) -> ThreePhasePcKrSw< T >
Deduction guide for the ThreePhasePcKrSw class. Makes sure that ThreePhasePcKrSw stores a copy of T i...
Adsorption(T &&) -> Adsorption< T >
Deduction guide for the Adsorption class. Makes sure that Adsorption stores a copy of T if the constr...
auto makeFluidMatrixInteraction(Laws &&... laws)
Helper function to create an FluidMatrixInteraction object containing an arbitrary number of fluid ma...
Definition: fluidmatrixinteraction.hh:51
MultiPhasePcKrSw(T &&) -> MultiPhasePcKrSw< T >
Deduction guide for the MultiPhasePcKrSw class. Makes sure that MultiPhasePcKrSw stores a copy of T i...
WettingNonwettingInterfacialAreaPcSw(T &&) -> WettingNonwettingInterfacialAreaPcSw< T >
Deduction guide for the WettingNonwettingInterfacialAreaPcSw class. Makes sure that WettingNonwetting...
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
Definition: brookscorey.hh:35
Wrapper type to combine an arbitrary number of different laws for fluid-matrix interaction (e....
Definition: fluidmatrixinteraction.hh:40
FluidMatrixInteraction(Laws &&... laws)
Definition: fluidmatrixinteraction.hh:41
Adapter to inherit from, allowing the inheriting class to be wrapped by the makeFluidMatrixInteractio...
Definition: fluidmatrixinteraction.hh:67
friend auto wrap(T &&t)
Definition: fluidmatrixinteraction.hh:69
Wrapper type for laws providing pc-Sw and kr-Sw rules.
Definition: fluidmatrixinteraction.hh:78
const T & krSwCurve() const
Definition: fluidmatrixinteraction.hh:97
Scalar krn(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:93
Scalar pc(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:86
PcKrSw(T &&impl)
Definition: fluidmatrixinteraction.hh:84
Scalar dsw_dpc(const Scalar pc) const
Definition: fluidmatrixinteraction.hh:90
Scalar sw(const Scalar pc) const
Definition: fluidmatrixinteraction.hh:89
Scalar dpc_dsw(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:87
Scalar krw(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:91
T PcKrSwType
Definition: fluidmatrixinteraction.hh:82
typename std::decay_t< T >::Scalar Scalar
Definition: fluidmatrixinteraction.hh:80
Scalar dkrn_dsw(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:94
const T & pcSwCurve() const
Definition: fluidmatrixinteraction.hh:96
Scalar dkrw_dsw(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:92
Scalar endPointPc() const
Definition: fluidmatrixinteraction.hh:88
Wrapper type for multiphase interface laws providing pc-S and kr-S rules.
Definition: fluidmatrixinteraction.hh:118
auto relativePermeabilities(const FS &fs, int wp) const
Definition: fluidmatrixinteraction.hh:127
MultiPhasePcKrSw(T &&impl)
Definition: fluidmatrixinteraction.hh:122
const T & multiPhasePcKrS() const
Definition: fluidmatrixinteraction.hh:129
auto capillaryPressures(const FS &fs, int wp) const
Definition: fluidmatrixinteraction.hh:125
typename std::decay_t< T >::Scalar Scalar
Definition: fluidmatrixinteraction.hh:120
Wrapper type for 3p interface laws providing pc-S and kr-S rules.
Definition: fluidmatrixinteraction.hh:150
Scalar kr(const int phaseIdx, const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:166
Scalar krw(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:163
Scalar krg(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:165
const T & krSwCurve() const
Definition: fluidmatrixinteraction.hh:169
T value_type
Definition: fluidmatrixinteraction.hh:152
ThreePhasePcKrSw(T &&impl)
Definition: fluidmatrixinteraction.hh:156
T PcKrSwType
Definition: fluidmatrixinteraction.hh:154
Scalar pcgn(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:160
typename std::decay_t< T >::Scalar Scalar
Definition: fluidmatrixinteraction.hh:151
Scalar krn(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:164
Scalar pcgw(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:158
Scalar pcnw(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:159
Scalar pcAlpha(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:161
const T & pcSwCurve() const
Definition: fluidmatrixinteraction.hh:168
Wrapper type for laws providing rules for the wetting-nonwetting interfacial area.
Definition: fluidmatrixinteraction.hh:189
const T & wettingNonwettingInterface() const
Definition: fluidmatrixinteraction.hh:192
WettingNonwettingInterfacialAreaPcSw(T &&impl)
Definition: fluidmatrixinteraction.hh:191
Wrapper type for laws providing rules for the wetting-solid interfacial area.
Definition: fluidmatrixinteraction.hh:212
WettingSolidInterfacialAreaPcSw(T &&impl)
Definition: fluidmatrixinteraction.hh:214
const T & wettingSolidInterface() const
Definition: fluidmatrixinteraction.hh:215
Wrapper type for laws providing rules for the nonwetting-solid interfacial area.
Definition: fluidmatrixinteraction.hh:235
const T & nonwettingSolidInterface() const
Definition: fluidmatrixinteraction.hh:238
NonwettingSolidInterfacialAreaPcSw(T &&impl)
Definition: fluidmatrixinteraction.hh:237
Wrapper type for adsorption laws.
Definition: fluidmatrixinteraction.hh:259
T value_type
Definition: fluidmatrixinteraction.hh:261
Adsorption(T &&impl)
Definition: fluidmatrixinteraction.hh:263
const T & adsorptionModel() const
Definition: fluidmatrixinteraction.hh:264