version 3.10-dev
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_MATERIAL_FLUIDMATRIX_INTERACTIONS_FLUIDMATRIX_INTERACTION_HH
14#define DUMUX_MATERIAL_FLUIDMATRIX_INTERACTIONS_FLUIDMATRIX_INTERACTION_HH
15
16#include <type_traits>
17#include <utility>
18
19namespace Dumux {
20
26template<class... Laws>
27struct FluidMatrixInteraction : public Laws...
28{
29 FluidMatrixInteraction(Laws&&... laws) : Laws(std::forward<Laws>(laws))... {}
30};
31
38template<class... Laws>
39auto makeFluidMatrixInteraction(Laws&&... laws)
40{
41 return FluidMatrixInteraction(wrap(std::forward<Laws>(laws))...);
42}
43
44} // end namespace Dumux
45
46namespace Dumux::FluidMatrix {
47
53template<class A, template<class> class Wrapper>
54struct Adapter
55{
56 template<class T, std::enable_if_t<std::is_same_v<A, std::decay_t<T>>, int> = 0>
57 friend auto wrap(T&& t) { return Wrapper(std::forward<T>(t)); }
58};
59
64template<class T>
65class PcKrSw
66{
67public:
68 using Scalar = typename std::decay_t<T>::Scalar;
69
70 using PcKrSwType = T;
71
72 PcKrSw(T&& impl) : impl_(std::forward<T>(impl)) {}
73
74 Scalar pc(const Scalar sw) const { return impl_.pc(sw); }
75 Scalar dpc_dsw(const Scalar sw) const { return impl_.dpc_dsw(sw); }
76 Scalar endPointPc() const { return impl_.endPointPc(); }
77 Scalar sw(const Scalar pc) const { return impl_.sw(pc); }
78 Scalar dsw_dpc(const Scalar pc) const { return impl_.dsw_dpc(pc); }
79 Scalar krw(const Scalar sw) const { return impl_.krw(sw); }
80 Scalar dkrw_dsw(const Scalar sw) const { return impl_.dkrw_dsw(sw); }
81 Scalar krn(const Scalar sw) const { return impl_.krn(sw); }
82 Scalar dkrn_dsw(const Scalar sw) const { return impl_.dkrn_dsw(sw); }
83
84 const T& pcSwCurve() const { return impl_; }
85 const T& krSwCurve() const { return impl_; }
86
87private:
88 T impl_;
89};
90
97template<typename T>
99
104template<class T>
106{
107public:
108 using Scalar = typename std::decay_t<T>::Scalar;
109
110 MultiPhasePcKrSw(T&& impl) : impl_(std::forward<T>(impl)) {}
111
112 template<class FS>
113 auto capillaryPressures(const FS& fs, int wp) const { return impl_.capillaryPressures(fs, wp); }
114 template<class FS>
115 auto relativePermeabilities(const FS& fs, int wp) const { return impl_.relativePermeabilities(fs, wp); }
116
117 const T& multiPhasePcKrS() const { return impl_; }
118
119private:
120 T impl_;
121};
122
129template<typename T>
131
136template<class T>
138{
139 using Scalar = typename std::decay_t<T>::Scalar;
140 using value_type = T;
141
142 using PcKrSwType = T;
143
144 ThreePhasePcKrSw(T&& impl) : impl_(std::forward<T>(impl)) {}
145
146 Scalar pcgw(const Scalar sw, const Scalar sn) const { return impl_.pcgw(sw, sn); }
147 Scalar pcnw(const Scalar sw, const Scalar sn) const { return impl_.pcnw(sw, sn); }
148 Scalar pcgn(const Scalar sw, const Scalar sn) const { return impl_.pcgn(sw, sn); }
149 Scalar pcAlpha(const Scalar sw, const Scalar sn) const { return impl_.pcAlpha(sw, sn); }
150
151 Scalar krw(const Scalar sw, const Scalar sn) const { return impl_.krw(sw, sn); }
152 Scalar krn(const Scalar sw, const Scalar sn) const { return impl_.krn(sw, sn); }
153 Scalar krg(const Scalar sw, const Scalar sn) const { return impl_.krn(sw, sn); }
154 Scalar kr(const int phaseIdx, const Scalar sw, const Scalar sn) const { return impl_.kr(phaseIdx, sw, sn); }
155
156 const T& pcSwCurve() const { return impl_; }
157 const T& krSwCurve() const { return impl_; }
158private:
159 T impl_;
160};
161
168template<typename T>
170
175template<class T>
177{
178public:
179 WettingNonwettingInterfacialAreaPcSw(T&& impl) : impl_(std::forward<T>(impl)) {}
180 const T& wettingNonwettingInterface() const { return impl_; }
181private:
182 T impl_;
183};
184
191template<typename T>
193
198template<class T>
200{
201public:
202 WettingSolidInterfacialAreaPcSw(T&& impl) : impl_(std::forward<T>(impl)) {}
203 const T& wettingSolidInterface() const { return impl_; }
204private:
205 T impl_;
206};
207
214template<typename T>
216
221template<class T>
223{
224public:
225 NonwettingSolidInterfacialAreaPcSw(T&& impl) : impl_(std::forward<T>(impl)) {}
226 const T& nonwettingSolidInterface() const { return impl_; }
227private:
228 T impl_;
229};
230
237template<typename T>
239
240
245template<class T>
247{
248public:
249 using value_type = T;
250
251 Adsorption(T&& impl) : impl_(std::forward<T>(impl)) {}
252 const T& adsorptionModel() const { return impl_; }
253private:
254 T impl_;
255};
256
263template<typename T>
265
266} // end namespace Dumux::FluidMatrix
267
268#endif
Wrapper type for adsorption laws.
Definition: fluidmatrixinteraction.hh:247
T value_type
Definition: fluidmatrixinteraction.hh:249
Adsorption(T &&impl)
Definition: fluidmatrixinteraction.hh:251
const T & adsorptionModel() const
Definition: fluidmatrixinteraction.hh:252
Wrapper type for multiphase interface laws providing pc-S and kr-S rules.
Definition: fluidmatrixinteraction.hh:106
auto relativePermeabilities(const FS &fs, int wp) const
Definition: fluidmatrixinteraction.hh:115
MultiPhasePcKrSw(T &&impl)
Definition: fluidmatrixinteraction.hh:110
const T & multiPhasePcKrS() const
Definition: fluidmatrixinteraction.hh:117
auto capillaryPressures(const FS &fs, int wp) const
Definition: fluidmatrixinteraction.hh:113
typename std::decay_t< T >::Scalar Scalar
Definition: fluidmatrixinteraction.hh:108
Wrapper type for laws providing rules for the nonwetting-solid interfacial area.
Definition: fluidmatrixinteraction.hh:223
const T & nonwettingSolidInterface() const
Definition: fluidmatrixinteraction.hh:226
NonwettingSolidInterfacialAreaPcSw(T &&impl)
Definition: fluidmatrixinteraction.hh:225
Wrapper type for laws providing pc-Sw and kr-Sw rules.
Definition: fluidmatrixinteraction.hh:66
const T & krSwCurve() const
Definition: fluidmatrixinteraction.hh:85
Scalar krn(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:81
Scalar pc(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:74
PcKrSw(T &&impl)
Definition: fluidmatrixinteraction.hh:72
Scalar dsw_dpc(const Scalar pc) const
Definition: fluidmatrixinteraction.hh:78
Scalar sw(const Scalar pc) const
Definition: fluidmatrixinteraction.hh:77
Scalar dpc_dsw(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:75
Scalar krw(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:79
T PcKrSwType
Definition: fluidmatrixinteraction.hh:70
typename std::decay_t< T >::Scalar Scalar
Definition: fluidmatrixinteraction.hh:68
Scalar dkrn_dsw(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:82
const T & pcSwCurve() const
Definition: fluidmatrixinteraction.hh:84
Scalar dkrw_dsw(const Scalar sw) const
Definition: fluidmatrixinteraction.hh:80
Scalar endPointPc() const
Definition: fluidmatrixinteraction.hh:76
Wrapper type for laws providing rules for the wetting-nonwetting interfacial area.
Definition: fluidmatrixinteraction.hh:177
const T & wettingNonwettingInterface() const
Definition: fluidmatrixinteraction.hh:180
WettingNonwettingInterfacialAreaPcSw(T &&impl)
Definition: fluidmatrixinteraction.hh:179
Wrapper type for laws providing rules for the wetting-solid interfacial area.
Definition: fluidmatrixinteraction.hh:200
WettingSolidInterfacialAreaPcSw(T &&impl)
Definition: fluidmatrixinteraction.hh:202
const T & wettingSolidInterface() const
Definition: fluidmatrixinteraction.hh:203
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:39
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...
Definition: brookscorey.hh:23
Definition: adapt.hh:17
Adapter to inherit from, allowing the inheriting class to be wrapped by the makeFluidMatrixInteractio...
Definition: fluidmatrixinteraction.hh:55
friend auto wrap(T &&t)
Definition: fluidmatrixinteraction.hh:57
Wrapper type for 3p interface laws providing pc-S and kr-S rules.
Definition: fluidmatrixinteraction.hh:138
Scalar kr(const int phaseIdx, const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:154
Scalar krw(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:151
Scalar krg(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:153
const T & krSwCurve() const
Definition: fluidmatrixinteraction.hh:157
T value_type
Definition: fluidmatrixinteraction.hh:140
ThreePhasePcKrSw(T &&impl)
Definition: fluidmatrixinteraction.hh:144
T PcKrSwType
Definition: fluidmatrixinteraction.hh:142
Scalar pcgn(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:148
typename std::decay_t< T >::Scalar Scalar
Definition: fluidmatrixinteraction.hh:139
Scalar krn(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:152
Scalar pcgw(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:146
Scalar pcnw(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:147
Scalar pcAlpha(const Scalar sw, const Scalar sn) const
Definition: fluidmatrixinteraction.hh:149
const T & pcSwCurve() const
Definition: fluidmatrixinteraction.hh:156
Wrapper type to combine an arbitrary number of different laws for fluid-matrix interaction (e....
Definition: fluidmatrixinteraction.hh:28
FluidMatrixInteraction(Laws &&... laws)
Definition: fluidmatrixinteraction.hh:29