GCC Code Coverage Report


Directory: ../../../builds/dumux-repositories/
File: dumux/dumux/flux/stationaryvelocityfield.hh
Date: 2025-04-12 19:19:20
Exec Total Coverage
Lines: 2 2 100.0%
Functions: 0 0 -%
Branches: 8 10 80.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-FileCopyrightText: 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 Flux
10 * \brief Constant velocity advective law for transport models.
11 * This file contains the data which is required to calculate
12 * volume and mass fluxes of fluid phases over a face of a finite volume.
13 * A stationary velocity field is given by the user for use in tracer models.
14 */
15 #ifndef DUMUX_DISCRETIZATION_STATIONARY_VELOCITY_FIELD_HH
16 #define DUMUX_DISCRETIZATION_STATIONARY_VELOCITY_FIELD_HH
17
18 #include <type_traits>
19 #include <dumux/flux/traits.hh>
20
21 #include <dumux/discretization/method.hh>
22 #include <dumux/flux/fluxvariablescaching.hh>
23
24 namespace Dumux {
25
26 /*!
27 * \ingroup Flux
28 * \brief Evaluates a user given velocity field
29 */
30 template <class Scalar>
31 class StationaryVelocityField
32 {
33 public:
34 using DiscretizationMethod = DiscretizationMethods::None;
35 //! state the discretization method this implementation belongs to
36 static constexpr DiscretizationMethod discMethod{};
37
38 //! state the type for the corresponding cache
39 using Cache = FluxVariablesCaching::EmptyAdvectionCache;
40
41 //! returns the volume flux given in the spatial params
42 template<class Problem, class Element,
43 class FVElementGeometry,
44 class ElementVolumeVariables,
45 class ElementFluxVarsCache>
46 86556243 static Scalar flux(const Problem& problem,
47 const Element& element,
48 const FVElementGeometry& fvGeometry,
49 const ElementVolumeVariables& elemVolVars,
50 const typename FVElementGeometry::SubControlVolumeFace& scvf,
51 int phaseIdx,
52 const ElementFluxVarsCache& elemFluxVarsCache)
53 {
54 //! Obtain the volume flux from the user, specified in the spatial params in m^3/s
55
8/10
✓ Branch 0 taken 11500 times.
✓ Branch 1 taken 892955 times.
✓ Branch 2 taken 71163 times.
✓ Branch 3 taken 12924544 times.
✓ Branch 4 taken 5202400 times.
✓ Branch 5 taken 3829092 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 345092 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 4696800 times.
91253043 return problem.spatialParams().volumeFlux(element, fvGeometry, elemVolVars, scvf);
56 }
57 };
58
59 //! Set stationary velocity field to true in the FluxTraits
60 template<class Scalar>
61 struct HasStationaryVelocityField<StationaryVelocityField<Scalar>>
62 : public std::true_type {};
63
64 } // end namespace Dumux
65
66 #endif
67