12#ifndef DUMUX_FREEFLOW_SHALLOW_WATER_LOCAL_RESIDUAL_HH
13#define DUMUX_FREEFLOW_SHALLOW_WATER_LOCAL_RESIDUAL_HH
25template<
class TypeTag>
27:
public GetPropType<TypeTag, Properties::BaseLocalResidual>
37 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
38 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
39 using Element =
typename GridView::template Codim<0>::Entity;
45 using ParentType::ParentType;
59 const SubControlVolume& scv,
60 const VolumeVariables& volVars)
const
63 NumEqVector storage(0.0);
64 storage[Indices::massBalanceIdx] = volVars.waterDepth();
65 storage[Indices::momentumXBalanceIdx] = volVars.waterDepth() * volVars.velocity(0);
66 storage[Indices::momentumYBalanceIdx] = volVars.waterDepth() * volVars.velocity(1);
81 const Element& element,
82 const FVElementGeometry& fvGeometry,
83 const ElementVolumeVariables& elemVolVars,
84 const SubControlVolumeFace& scvf,
85 const ElementFluxVariablesCache& elemFluxVarsCache)
const
87 NumEqVector flux(0.0);
88 FluxVariables fluxVars;
89 flux += fluxVars.advectiveFlux(problem, element, fvGeometry, elemVolVars, scvf);
92 static const bool enableViscousFlux = getParamFromGroup<bool>(problem.paramGroup(),
"ShallowWater.EnableViscousFlux",
false);
93 if (enableViscousFlux)
94 flux += fluxVars.viscousFlux(problem, element, fvGeometry, elemVolVars, scvf);
Element-wise calculation of the residual for the shallow water equations.
Definition: freeflow/shallowwater/localresidual.hh:28
NumEqVector computeFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const
Evaluate the mass/momentum flux over a face of a sub control volume.
Definition: freeflow/shallowwater/localresidual.hh:80
NumEqVector computeStorage(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Evaluate the rate of change of all conservation quantites (e.g. mass, momentum) within a sub-control ...
Definition: freeflow/shallowwater/localresidual.hh:58
Defines all properties used 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:34
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:296
A helper to deduce a vector with the same size as numbers of equations.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.