3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
tpfa/computetransmissibility.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 *****************************************************************************/
26#ifndef DUMUX_DISCRETIZATION_CC_TPFA_COMPUTE_TRANSMISSIBILITY_HH
27#define DUMUX_DISCRETIZATION_CC_TPFA_COMPUTE_TRANSMISSIBILITY_HH
28
29#include <dune/common/typetraits.hh>
30#include <dune/common/fmatrix.hh>
31
32namespace Dumux {
33
46template< class SubControlVolumeFace, class SubControlVolume, class Tensor >
47[[deprecated("Will be removed after release 3.6. Use interface with additional fvGeometry parameter instead.")]]
48typename Tensor::field_type computeTpfaTransmissibility(const SubControlVolumeFace& scvf,
49 const SubControlVolume& scv,
50 const Tensor& T,
51 typename SubControlVolume::Traits::Scalar extrusionFactor)
52{
53 using GlobalPosition = typename SubControlVolumeFace::Traits::GlobalPosition;
54 GlobalPosition Knormal;
55 T.mv(scvf.unitOuterNormal(), Knormal);
56
57 auto distanceVector = scvf.ipGlobal();
58 distanceVector -= scv.center();
59 distanceVector /= distanceVector.two_norm2();
60
61 return (Knormal*distanceVector) * extrusionFactor;
62}
63
77template< class FVElementGeometry, class Tensor >
78typename Tensor::field_type computeTpfaTransmissibility(const FVElementGeometry& fvGeometry,
79 const typename FVElementGeometry::SubControlVolumeFace& scvf,
80 const typename FVElementGeometry::SubControlVolume& scv,
81 const Tensor& T,
82 typename FVElementGeometry::SubControlVolume::Traits::Scalar extrusionFactor)
83{
84 using GlobalPosition = typename FVElementGeometry::SubControlVolumeFace::Traits::GlobalPosition;
85 GlobalPosition Knormal;
86 T.mv(scvf.unitOuterNormal(), Knormal);
87
88 auto distanceVector = scvf.ipGlobal();
89 distanceVector -= scv.center();
90 distanceVector /= distanceVector.two_norm2();
91
92 return (Knormal*distanceVector) * extrusionFactor;
93}
94
107template< class SubControlVolumeFace,
108 class SubControlVolume,
109 class Tensor,
110 typename std::enable_if_t<Dune::IsNumber<Tensor>::value, int> = 0 >
111[[deprecated("Will be removed after release 3.6. Use interface with additional fvGeometry parameter instead.")]]
112Tensor computeTpfaTransmissibility(const SubControlVolumeFace& scvf,
113 const SubControlVolume &scv,
114 Tensor t,
115 typename SubControlVolumeFace::Traits::Scalar extrusionFactor)
116{
117 auto distanceVector = scvf.ipGlobal();
118 distanceVector -= scv.center();
119 distanceVector /= distanceVector.two_norm2();
120
121 return t * extrusionFactor * (distanceVector * scvf.unitOuterNormal());
122}
123
137template< class FVElementGeometry,
138 class Tensor,
139 typename std::enable_if_t<Dune::IsNumber<Tensor>::value, int> = 0 >
140Tensor computeTpfaTransmissibility(const FVElementGeometry& fvGeometry,
141 const typename FVElementGeometry::SubControlVolumeFace& scvf,
142 const typename FVElementGeometry::SubControlVolume& scv,
143 Tensor t,
144 typename FVElementGeometry::SubControlVolumeFace::Traits::Scalar extrusionFactor)
145{
146 auto distanceVector = scvf.ipGlobal();
147 distanceVector -= scv.center();
148 distanceVector /= distanceVector.two_norm2();
149
150 return t * extrusionFactor * (distanceVector * scvf.unitOuterNormal());
151}
152
153} // end namespace Dumux
154
155#endif
Tensor::field_type computeTpfaTransmissibility(const SubControlVolumeFace &scvf, const SubControlVolume &scv, const Tensor &T, typename SubControlVolume::Traits::Scalar extrusionFactor)
Free function to evaluate the Tpfa transmissibility associated with the flux (in the form of flux = T...
Definition: tpfa/computetransmissibility.hh:48
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29