24#ifndef DUMUX_NAVIERSTOKES_MOMENTUM_DIAMOND_LOCAL_RESIDUAL_HH
25#define DUMUX_NAVIERSTOKES_MOMENTUM_DIAMOND_LOCAL_RESIDUAL_HH
27#include <dune/common/hybridutilities.hh>
44template<
class TypeTag>
52 using GridVolumeVariables =
typename GridVariables::GridVolumeVariables;
53 using ElementVolumeVariables =
typename GridVolumeVariables::LocalView;
54 using VolumeVariables =
typename GridVolumeVariables::VolumeVariables;
56 using GridFluxVariablesCache =
typename GridVariables::GridFluxVariablesCache;
57 using ElementFluxVariablesCache =
typename GridFluxVariablesCache::LocalView;
63 using FVElementGeometry =
typename GridGeometry::LocalView;
64 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
65 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
66 using GridView =
typename GridGeometry::GridView;
67 using Element =
typename GridView::template Codim<0>::Entity;
77 static constexpr auto dim = GridView::dimension;
84 using ParentType::ParentType;
96 const FVElementGeometry& fvGeometry,
97 const SubControlVolume& scv,
98 const VolumeVariables& volVars,
99 const bool isPreviousStorage)
const
101 return problem.density(fvGeometry.element(), fvGeometry, scv, isPreviousStorage) * volVars.velocity();
116 const Element& element,
117 const FVElementGeometry& fvGeometry,
118 const ElementVolumeVariables& elemVolVars,
119 const SubControlVolume& scv)
const
124 source +=
problem.density(element, fvGeometry, scv) *
problem.gravity();
130 if constexpr (dim == 2 && isRotationalExtrusion<Extrusion>)
133 const auto r = scv.center()[Extrusion::radialAxis] - fvGeometry.gridGeometry().bBoxMin()[Extrusion::radialAxis];
137 source[Extrusion::radialAxis] += -2.0*
problem.effectiveViscosity(element, fvGeometry, scv)
138 * elemVolVars[scv].velocity(Extrusion::radialAxis) / (r*r);
143 source[Extrusion::radialAxis] +=
problem.pressure(element, fvGeometry, scv)/r;
160 const Element& element,
161 const FVElementGeometry& fvGeometry,
162 const ElementVolumeVariables& elemVolVars,
163 const SubControlVolumeFace& scvf,
164 const ElementFluxVariablesCache& elemFluxVarsCache)
const
169 NumEqVector flux(0.0);
Calculates the element-wise residual for control-volume finite element schemes.
A helper to deduce a vector with the same size as numbers of equations.
Helper classes to compute the integration elements.
The available discretization methods in Dumux.
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:46
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
typename Extrusion< T >::type Extrusion_t
Convenience alias for obtaining the extrusion type.
Definition: extrusion.hh:251
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:180
The element-wise residual for control-volume finite element schemes.
Definition: cvfelocalresidual.hh:72
The element-wise residual for finite volume schemes.
Definition: fvlocalresidual.hh:47
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:220
const Problem & problem() const
the problem
Definition: fvlocalresidual.hh:484
Context for computing fluxes.
Definition: flux.hh:51
The flux variables class for the Navier-Stokes model using control-volume finite element schemes.
Definition: flux.hh:103
NumEqVector advectiveMomentumFlux(const Context &context) const
Returns the diffusive momentum flux due to viscous forces.
Definition: flux.hh:121
NumEqVector diffusiveMomentumFlux(const Context &context) const
Returns the diffusive momentum flux due to viscous forces.
Definition: flux.hh:155
NumEqVector pressureContribution(const Context &context) const
Definition: flux.hh:194
Element-wise calculation of the Navier-Stokes residual for models using the diamond discretization.
Definition: freeflow/navierstokes/momentum/diamond/localresidual.hh:47
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/diamond/localresidual.hh:159
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/diamond/localresidual.hh:95
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/diamond/localresidual.hh:115
Declares all properties used in Dumux.