12#ifndef DUMUX_NAVIERSTOKES_MOMENTUM_BRINKMAN_TERM_HH
13#define DUMUX_NAVIERSTOKES_MOMENTUM_BRINKMAN_TERM_HH
16#include <dune/common/typetraits.hh>
17#include <dune/common/exceptions.hh>
45template<
class NumEqVector,
class Problem,
class FVElementGeometry,
class ElementVolumeVariables>
48 const Problem& problem,
49 const typename FVElementGeometry::Element& element,
50 const FVElementGeometry& fvGeometry,
51 const ElementVolumeVariables& elemVolVars,
52 const typename FVElementGeometry::SubControlVolume& scv
54 if (problem.spatialParams().brinkmanEpsilon(element, fvGeometry, scv) > 0.0)
56 const auto brinkmanEpsilon = problem.spatialParams().brinkmanEpsilon(element, fvGeometry, scv);
57 const auto invK = problem.spatialParams().inversePermeability(element, fvGeometry, scv);
58 const auto mu = problem.effectiveViscosity(element, fvGeometry, scv);
60 using DM =
typename FVElementGeometry::GridGeometry::DiscretizationMethod;
61 if constexpr (DiscretizationMethods::isCVFE<DM>)
63 const auto velocity = elemVolVars[scv].velocity();
64 source -= mu * brinkmanEpsilon *
mv(invK, velocity);
68 if constexpr (Dune::IsNumber<std::decay_t<
decltype(invK)>>::value)
70 const auto velocity = elemVolVars[scv].velocity();
71 source -= mu * brinkmanEpsilon * invK * velocity;
76 const auto getVelocitySCV = [&](
const auto& scv){
return elemVolVars[scv].velocity(); };
78 source -= mu * brinkmanEpsilon *
mv(invK, velocity)[scv.dofAxis()];
82 DUNE_THROW(Dune::NotImplemented,
"Brinkman term only implemented for CVFE and Staggered");
The local element solution class for control-volume finite element methods.
free functions for the evaluation of primary variables inside elements.
Dune::DenseVector< V >::derived_type mv(const Dune::DenseMatrix< MAT > &M, const Dune::DenseVector< V > &v)
Returns the result of the projection of a vector v with a Matrix M.
Definition: math.hh:829
typename NumEqVectorTraits< PrimaryVariables >::type NumEqVector
A vector with the same size as numbers of equations This is the default implementation and has to be ...
Definition: numeqvector.hh:34
Define some often used mathematical functions.
The available discretization methods in Dumux.
constexpr FCStaggered fcstaggered
Definition: method.hh:151
void addBrinkmanTerm(NumEqVector &source, const Problem &problem, const typename FVElementGeometry::Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const typename FVElementGeometry::SubControlVolume &scv)
Definition: brinkman.hh:46
static auto faceVelocity(const SubControlVolume &scv, const FVElementGeometry &fvGeometry, const VelocityHelper &getNormalVelocityDofValue)
Return the velocity vector at dof position given an scv.
Definition: velocityreconstruction.hh:52