GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: /builds/dumux-repositories/dumux/dumux/freeflow/shallowwater/fluxvariables.hh
Date: 2024-05-04 19:09:25
Exec Total Coverage
Lines: 2 4 50.0%
Functions: 0 12 0.0%
Branches: 0 0 -%

Line Branch Exec Source
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 // SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 /*!
8 * \file
9 * \ingroup ShallowWaterModels
10 * \copydoc Dumux::ShallowWaterFluxVariables
11 */
12 #ifndef DUMUX_FREEFLOW_SHALLOW_WATER_FLUXVARIABLES_HH
13 #define DUMUX_FREEFLOW_SHALLOW_WATER_FLUXVARIABLES_HH
14
15 #include <dumux/common/properties.hh>
16 #include <dumux/common/numeqvector.hh>
17 #include <dumux/flux/fluxvariablesbase.hh>
18
19 namespace Dumux {
20
21 /*!
22 * \ingroup ShallowWaterModels
23 * \brief The flux variables class for the shallow water model.
24 *
25 */
26 template<class TypeTag>
27 class ShallowWaterFluxVariables
28 : public FluxVariablesBase<GetPropType<TypeTag, Properties::Problem>,
29 typename GetPropType<TypeTag, Properties::GridGeometry>::LocalView,
30 typename GetPropType<TypeTag, Properties::GridVolumeVariables>::LocalView,
31 typename GetPropType<TypeTag, Properties::GridFluxVariablesCache>::LocalView>
32 {
33 using Problem = GetPropType<TypeTag, Properties::Problem>;
34 using ModelTraits = GetPropType<TypeTag, Properties::ModelTraits>;
35 using NumEqVector = Dumux::NumEqVector<GetPropType<TypeTag, Properties::PrimaryVariables>>;
36 using AdvectionType = GetPropType<TypeTag, Properties::AdvectionType>;
37 using ViscousFluxType = GetPropType<TypeTag, Properties::ViscousFluxType>;
38
39 using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
40 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
41 using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
42 using FVElementGeometry = typename GridGeometry::LocalView;
43 using GridView = typename GridGeometry::GridView;
44
45 using Element = typename GridView::template Codim<0>::Entity;
46 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
47 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
48
49 static constexpr bool enableAdvection = ModelTraits::enableAdvection();
50
51 public:
52
53 /*!
54 * \brief Returns the advective flux computed by the Riemann solver
55 *
56 */
57 NumEqVector advectiveFlux(const Problem& problem,
58 const Element& element,
59 const FVElementGeometry& fvGeometry,
60 const ElementVolumeVariables& elemVolVars,
61 const SubControlVolumeFace& scvf) const
62 {
63 if (enableAdvection)
64 156514916 return AdvectionType::flux(problem, element, fvGeometry, elemVolVars, scvf);
65
66 return NumEqVector(0.0);
67 }
68
69 /*!
70 * \brief Returns the viscous momentum flux
71 *
72 */
73 NumEqVector viscousFlux(const Problem& problem,
74 const Element& element,
75 const FVElementGeometry& fvGeometry,
76 const ElementVolumeVariables& elemVolVars,
77 const SubControlVolumeFace& scvf) const
78 {
79 // Add viscous momentum flux
80 4583245 return ViscousFluxType::flux(problem, element, fvGeometry, elemVolVars, scvf);
81 }
82 };
83
84 } // end namespace Dumux
85
86 #endif
87