version 3.10-dev
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
14#ifndef DUMUX_DISCRETIZATION_CC_TPFA_COMPUTE_TRANSMISSIBILITY_HH
15#define DUMUX_DISCRETIZATION_CC_TPFA_COMPUTE_TRANSMISSIBILITY_HH
16
17#include <dune/common/typetraits.hh>
18#include <dune/common/fmatrix.hh>
19
20namespace Dumux {
21
35template< class FVElementGeometry, class Tensor >
36typename Tensor::field_type computeTpfaTransmissibility(const FVElementGeometry& fvGeometry,
37 const typename FVElementGeometry::SubControlVolumeFace& scvf,
38 const typename FVElementGeometry::SubControlVolume& scv,
39 const Tensor& T,
40 typename FVElementGeometry::SubControlVolume::Traits::Scalar extrusionFactor)
41{
42 using GlobalPosition = typename FVElementGeometry::SubControlVolumeFace::Traits::GlobalPosition;
43 GlobalPosition Knormal;
44 T.mv(scvf.unitOuterNormal(), Knormal);
45
46 auto distanceVector = scvf.ipGlobal();
47 distanceVector -= scv.center();
48 distanceVector /= distanceVector.two_norm2();
49
50 return (Knormal*distanceVector) * extrusionFactor;
51}
52
66template< class FVElementGeometry,
67 class Tensor,
68 typename std::enable_if_t<Dune::IsNumber<Tensor>::value, int> = 0 >
69Tensor computeTpfaTransmissibility(const FVElementGeometry& fvGeometry,
70 const typename FVElementGeometry::SubControlVolumeFace& scvf,
71 const typename FVElementGeometry::SubControlVolume& scv,
72 Tensor t,
73 typename FVElementGeometry::SubControlVolumeFace::Traits::Scalar extrusionFactor)
74{
75 auto distanceVector = scvf.ipGlobal();
76 distanceVector -= scv.center();
77 distanceVector /= distanceVector.two_norm2();
78
79 return t * extrusionFactor * (distanceVector * scvf.unitOuterNormal());
80}
81
82} // end namespace Dumux
83
84#endif
Tensor::field_type computeTpfaTransmissibility(const FVElementGeometry &fvGeometry, const typename FVElementGeometry::SubControlVolumeFace &scvf, const typename FVElementGeometry::SubControlVolume &scv, const Tensor &T, typename FVElementGeometry::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:36
Definition: adapt.hh:17