12#ifndef DUMUX_FREEFLOW_SHALLOW_WATER_LOCAL_RESIDUAL_HH
13#define DUMUX_FREEFLOW_SHALLOW_WATER_LOCAL_RESIDUAL_HH
26template<
class TypeTag>
33 using GridView =
typename GridGeometry::GridView;
38 using FVElementGeometry =
typename GridGeometry::LocalView;
39 using SubControlVolume =
typename FVElementGeometry::SubControlVolume;
40 using SubControlVolumeFace =
typename FVElementGeometry::SubControlVolumeFace;
41 using Element =
typename GridView::template Codim<0>::Entity;
47 using ParentType::ParentType;
61 const SubControlVolume& scv,
62 const VolumeVariables& volVars)
const
65 NumEqVector storage(0.0);
66 storage[Indices::massBalanceIdx] = volVars.waterDepth();
67 storage[Indices::momentumXBalanceIdx] = volVars.waterDepth() * volVars.velocity(0);
68 storage[Indices::momentumYBalanceIdx] = volVars.waterDepth() * volVars.velocity(1);
83 const Element& element,
84 const FVElementGeometry& fvGeometry,
85 const ElementVolumeVariables& elemVolVars,
86 const SubControlVolumeFace& scvf,
87 const ElementFluxVariablesCache& elemFluxVarsCache)
const
89 NumEqVector flux(0.0);
90 FluxVariables fluxVars;
91 flux += fluxVars.advectiveFlux(problem, element, fvGeometry, elemVolVars, scvf);
94 static const bool enableViscousFlux =
getParamFromGroup<bool>(problem.paramGroup(),
"ShallowWater.EnableViscousFlux",
false);
95 if (enableViscousFlux)
96 flux += fluxVars.viscousFlux(problem, element, fvGeometry, elemVolVars, scvf);
Element-wise calculation of the residual for the shallow water equations.
Definition freeflow/shallowwater/localresidual.hh:29
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:82
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:60
Defines all properties used in Dumux.
The default local operator than can be specialized for each discretization scheme.
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
T getParamFromGroup(Args &&... args)
A free function to get a parameter from the parameter tree singleton with a model group.
Definition parameters.hh:149
typename GetProp< TypeTag, Property >::type GetPropType
get the type alias defined in the property
Definition propertysystem.hh:296
typename Detail::DiscretizationDefaultLocalOperator< TypeTag >::type DiscretizationDefaultLocalOperator
Definition defaultlocaloperator.hh:26
A helper to deduce a vector with the same size as numbers of equations.
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.