3.4
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
freeflow/shallowwater/fluxvariables.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3/*****************************************************************************
4 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 2 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_FREEFLOW_SHALLOW_WATER_FLUXVARIABLES_HH
25#define DUMUX_FREEFLOW_SHALLOW_WATER_FLUXVARIABLES_HH
26
30
31namespace Dumux {
32
38template<class TypeTag>
40: public FluxVariablesBase<GetPropType<TypeTag, Properties::Problem>,
41 typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView,
42 typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView,
43 typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView>
44{
50
52 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
54 using FVElementGeometry = typename GridGeometry::LocalView;
55 using GridView = typename GridGeometry::GridView;
56
57 using Element = typename GridView::template Codim<0>::Entity;
58 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
59 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
60
61 static constexpr bool enableAdvection = ModelTraits::enableAdvection();
62
63public:
64
69 NumEqVector advectiveFlux(const Problem& problem,
70 const Element& element,
71 const FVElementGeometry& fvGeometry,
72 const ElementVolumeVariables& elemVolVars,
73 const SubControlVolumeFace& scvf) const
74 {
75 if (enableAdvection)
76 return AdvectionType::flux(problem, element, fvGeometry, elemVolVars, scvf);
77
78 return NumEqVector(0.0);
79 }
80
85 NumEqVector viscousFlux(const Problem& problem,
86 const Element& element,
87 const FVElementGeometry& fvGeometry,
88 const ElementVolumeVariables& elemVolVars,
89 const SubControlVolumeFace& scvf) const
90 {
91 // Add viscous momentum flux
92 return ViscousFluxType::flux(problem, element, fvGeometry, elemVolVars, scvf);
93 }
94};
95
96} // end namespace Dumux
97
98#endif
A helper to deduce a vector with the same size as numbers of equations.
Base class for the flux variables living on a sub control volume face.
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
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:150
Base class for the flux variables living on a sub control volume face.
Definition: fluxvariablesbase.hh:45
The flux variables class for the shallow water model.
Definition: freeflow/shallowwater/fluxvariables.hh:44
NumEqVector advectiveFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf) const
Returns the advective flux computed by the Riemann solver.
Definition: freeflow/shallowwater/fluxvariables.hh:69
NumEqVector viscousFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf) const
Returns the viscous momentum flux.
Definition: freeflow/shallowwater/fluxvariables.hh:85
Declares all properties used in Dumux.