version 3.9
mpfa/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_MPFA_COMPUTE_TRANSMISSIBILITY_HH
15#define DUMUX_DISCRETIZATION_CC_MPFA_COMPUTE_TRANSMISSIBILITY_HH
16
17#include <dune/common/typetraits.hh>
18#include <dune/common/fvector.hh>
19
20#include <dumux/common/math.hh>
22
23namespace Dumux {
24
38template<class EG, class IVSubControlVolume, class Tensor>
39Dune::FieldVector<typename Tensor::field_type, IVSubControlVolume::myDimension>
40computeMpfaTransmissibility(const EG& fvGeometry,
41 const IVSubControlVolume& scv,
42 const typename EG::SubControlVolumeFace& scvf,
43 const Tensor& t,
44 typename IVSubControlVolume::ctype extrusionFactor)
45{
46 Dune::FieldVector<typename Tensor::field_type, IVSubControlVolume::myDimension> wijk;
47 for (unsigned int dir = 0; dir < IVSubControlVolume::myDimension; ++dir)
48 wijk[dir] = vtmv(scvf.unitOuterNormal(), t, scv.nu(dir));
49
51 wijk *= Extrusion::area(fvGeometry, scvf)*extrusionFactor;
52 wijk /= scv.detX();
53
54 return wijk;
55}
56
70template< class EG, class IVSubControlVolume, class Tensor, std::enable_if_t< Dune::IsNumber<Tensor>::value, int > = 1 >
71Dune::FieldVector<Tensor, IVSubControlVolume::myDimension>
72computeMpfaTransmissibility(const EG& fvGeometry,
73 const IVSubControlVolume& scv,
74 const typename EG::SubControlVolumeFace& scvf,
75 const Tensor& t,
76 typename IVSubControlVolume::ctype extrusionFactor)
77{
78 Dune::FieldVector<Tensor, IVSubControlVolume::myDimension> wijk;
79 for (unsigned int dir = 0; dir < IVSubControlVolume::myDimension; ++dir)
80 wijk[dir] = vtmv(scvf.unitOuterNormal(), t, scv.nu(dir));
81
83 wijk *= Extrusion::area(fvGeometry, scvf)*extrusionFactor;
84 wijk /= scv.detX();
85
86 return wijk;
87}
88
89} // end namespace Dumux
90
91#endif
Traits extracting the public Extrusion type from T Defaults to NoExtrusion if no such type is found.
Definition: extrusion.hh:155
Helper classes to compute the integration elements.
Dune::FieldVector< typename Tensor::field_type, IVSubControlVolume::myDimension > computeMpfaTransmissibility(const EG &fvGeometry, const IVSubControlVolume &scv, const typename EG::SubControlVolumeFace &scvf, const Tensor &t, typename IVSubControlVolume::ctype extrusionFactor)
Free function to evaluate the Mpfa transmissibility associated with the flux (in the form of flux = t...
Definition: mpfa/computetransmissibility.hh:40
Dune::DenseMatrix< MAT >::value_type vtmv(const Dune::DenseVector< V1 > &v1, const Dune::DenseMatrix< MAT > &M, const Dune::DenseVector< V2 > &v2)
Evaluates the scalar product of a vector v2, projected by a matrix M, with a vector v1.
Definition: math.hh:880
Define some often used mathematical functions.
Definition: adapt.hh:17
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:166