12#ifndef DUMUX_STAGGERED_ONEEQ_LOCAL_RESIDUAL_HH
13#define DUMUX_STAGGERED_ONEEQ_LOCAL_RESIDUAL_HH
15#include <dune/common/hybridutilities.hh>
29template<
class TypeTag,
class BaseLocalRes
idual,
class DiscretizationMethod>
30class OneEqResidualImpl;
32template<
class TypeTag,
class BaseLocalRes
idual>
34:
public BaseLocalResidual
36 using ParentType = BaseLocalResidual;
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;
48 using GridFaceVariables =
typename GridVariables::GridFaceVariables;
49 using ElementFaceVariables =
typename GridFaceVariables::LocalView;
54 using Element =
typename GridView::template Codim<0>::Entity;
56 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
61 static constexpr int viscosityTildeEqIdx = Indices::viscosityTildeEqIdx - ModelTraits::dim();
64 using ParentType::ParentType;
68 const SubControlVolume& scv,
69 const VolumeVariables& volVars)
const
71 CellCenterPrimaryVariables storage = ParentType::computeStorageForCellCenter(problem, scv, volVars);
72 storage[viscosityTildeEqIdx] = volVars.viscosityTilde() * volVars.density();
77 const Element &element,
78 const FVElementGeometry& fvGeometry,
79 const ElementVolumeVariables& elemVolVars,
80 const ElementFaceVariables& elemFaceVars,
81 const SubControlVolume &scv)
const
83 CellCenterPrimaryVariables source = ParentType::computeSourceForCellCenter(problem, element, fvGeometry,
84 elemVolVars, elemFaceVars, scv);
86 const auto& volVars = elemVolVars[scv];
88 source[viscosityTildeEqIdx] += volVars.cb1() * (1.0 - volVars.ft2())
89 * volVars.stressTensorScalarProductTilde()
90 * volVars.viscosityTilde() * volVars.density();
92 source[viscosityTildeEqIdx] -= (volVars.cw1() * volVars.fW()
93 - volVars.cb1() * volVars.ft2() / problem.karmanConstant() / problem.karmanConstant())
94 * volVars.viscosityTilde() * volVars.viscosityTilde()
95 / volVars.wallDistance() / volVars.wallDistance() * volVars.density();;
97 for (
unsigned int axisIdx = 0; axisIdx < ModelTraits::dim(); ++axisIdx)
99 source[viscosityTildeEqIdx] += volVars.cb2() / volVars.sigma()
100 * volVars.storedViscosityTildeGradient()[axisIdx]
101 * volVars.storedViscosityTildeGradient()[axisIdx]
CellCenterPrimaryVariables computeStorageForCellCenter(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Evaluate fluxes entering or leaving the cell center control volume.
Definition: freeflow/rans/oneeq/staggered/localresidual.hh:67
CellCenterPrimaryVariables computeSourceForCellCenter(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const ElementFaceVariables &elemFaceVars, const SubControlVolume &scv) const
Definition: freeflow/rans/oneeq/staggered/localresidual.hh:76
Element-wise calculation of the residual for one-equation turbulence models using the staggered discr...
Definition: freeflow/rans/oneeq/localresidual.hh:24
Defines all properties used in Dumux.
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
The available discretization methods in Dumux.