3.2-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 >
47typename Tensor::field_type computeTpfaTransmissibility(const SubControlVolumeFace& scvf,
48 const SubControlVolume& scv,
49 const Tensor& T,
50 typename SubControlVolume::Traits::Scalar extrusionFactor)
51{
52 using GlobalPosition = typename SubControlVolumeFace::Traits::GlobalPosition;
53 GlobalPosition Knormal;
54 T.mv(scvf.unitOuterNormal(), Knormal);
55
56 auto distanceVector = scvf.ipGlobal();
57 distanceVector -= scv.center();
58 distanceVector /= distanceVector.two_norm2();
59
60 return (Knormal*distanceVector) * extrusionFactor;
61}
62
75template< class SubControlVolumeFace,
76 class SubControlVolume,
77 class Tensor,
78 typename std::enable_if_t<Dune::IsNumber<Tensor>::value, int> = 0 >
79Tensor computeTpfaTransmissibility(const SubControlVolumeFace& scvf,
80 const SubControlVolume &scv,
81 Tensor t,
82 typename SubControlVolumeFace::Traits::Scalar extrusionFactor)
83{
84 auto distanceVector = scvf.ipGlobal();
85 distanceVector -= scv.center();
86 distanceVector /= distanceVector.two_norm2();
87
88 return t * extrusionFactor * (distanceVector * scvf.unitOuterNormal());
89}
90
91} // end namespace Dumux
92
93#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:47
Definition: adapt.hh:29