12#ifndef DUMUX_NAVIERSTOKES_MOMENTUM_CVFE_LOCAL_RESIDUAL_HH
13#define DUMUX_NAVIERSTOKES_MOMENTUM_CVFE_LOCAL_RESIDUAL_HH
15#include <dune/common/hybridutilities.hh>
32template<
class TypeTag>
40 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
41 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
42 using VolumeVariables =
typename GridVolumeVariables::VolumeVariables;
44 using GridFluxVariablesCache =
typename GridVariables::GridFluxVariablesCache;
45 using ElementFluxVariablesCache =
typename GridFluxVariablesCache::LocalView;
51 using FVElementGeometry =
typename GridGeometry::LocalView;
52 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
53 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
54 using GridView =
typename GridGeometry::GridView;
55 using Element =
typename GridView::template Codim<0>::Entity;
65 static constexpr auto dim = GridView::dimension;
72 using ParentType::ParentType;
85 const FVElementGeometry& fvGeometry,
86 const SubControlVolume& scv,
87 const VolumeVariables& volVars,
88 const bool isPreviousStorage)
const
90 return problem.density(fvGeometry.element(), fvGeometry, scv, isPreviousStorage) * volVars.velocity();
105 const Element& element,
106 const FVElementGeometry& fvGeometry,
107 const ElementVolumeVariables& elemVolVars,
108 const SubControlVolume& scv)
const
113 source +=
problem.density(element, fvGeometry, scv) *
problem.gravity();
119 if constexpr (dim == 2 && isRotationalExtrusion<Extrusion>)
122 const auto r = scv.center()[Extrusion::radialAxis] - fvGeometry.gridGeometry().bBoxMin()[Extrusion::radialAxis];
126 source[Extrusion::radialAxis] += -2.0*
problem.effectiveViscosity(element, fvGeometry, scv)
127 * elemVolVars[scv].velocity(Extrusion::radialAxis) / (r*r);
132 source[Extrusion::radialAxis] +=
problem.pressure(element, fvGeometry, scv)/r;
149 const Element& element,
150 const FVElementGeometry& fvGeometry,
151 const ElementVolumeVariables& elemVolVars,
152 const SubControlVolumeFace& scvf,
153 const ElementFluxVariablesCache& elemFluxVarsCache)
const
158 NumEqVector flux(0.0);
The element-wise residual for control-volume finite element schemes.
Definition: cvfelocalresidual.hh:60
The element-wise residual for finite volume schemes.
Definition: fvlocalresidual.hh:35
NumEqVector computeSource(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Calculate the source term of the equation.
Definition: fvlocalresidual.hh:208
const Problem & problem() const
the problem
Definition: fvlocalresidual.hh:472
Element-wise calculation of the Navier-Stokes residual for models using the CVFE discretizations.
Definition: freeflow/navierstokes/momentum/cvfe/localresidual.hh:35
NumEqVector computeStorage(const Problem &problem, const FVElementGeometry &fvGeometry, const SubControlVolume &scv, const VolumeVariables &volVars, const bool isPreviousStorage) const
Calculate the source term of the equation.
Definition: freeflow/navierstokes/momentum/cvfe/localresidual.hh:84
NumEqVector computeFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const
Evaluates the mass flux over a face of a sub control volume.
Definition: freeflow/navierstokes/momentum/cvfe/localresidual.hh:148
NumEqVector computeSource(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolume &scv) const
Calculate the source term of the equation.
Definition: freeflow/navierstokes/momentum/cvfe/localresidual.hh:104
The flux variables class for the Navier-Stokes model using control-volume finite element schemes.
Definition: flux.hh:91
NumEqVector advectiveMomentumFlux(const Context &context) const
Returns the diffusive momentum flux due to viscous forces.
Definition: flux.hh:109
NumEqVector diffusiveMomentumFlux(const Context &context) const
Returns the diffusive momentum flux due to viscous forces.
Definition: flux.hh:143
NumEqVector pressureContribution(const Context &context) const
Definition: flux.hh:182
Context for computing fluxes.
Definition: flux.hh:39
Defines all properties used in Dumux.
Calculates the element-wise residual for control-volume finite element schemes.
Helper classes to compute the integration elements.
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
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
The available discretization methods in Dumux.
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:166
A helper to deduce a vector with the same size as numbers of equations.