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 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 | ✗ | 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 |
15/18✓ Branch 0 taken 11500 times.
✓ Branch 1 taken 421248 times.
✓ Branch 2 taken 11500 times.
✓ Branch 3 taken 421248 times.
✓ Branch 4 taken 11500 times.
✓ Branch 5 taken 5118048 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 13570800 times.
✗ Branch 8 not taken.
✓ Branch 9 taken 8874000 times.
✓ Branch 10 taken 5202400 times.
✓ Branch 11 taken 8874000 times.
✓ Branch 12 taken 5202400 times.
✓ Branch 13 taken 192000 times.
✓ Branch 14 taken 5202400 times.
✓ Branch 15 taken 192000 times.
✗ Branch 16 not taken.
✓ Branch 17 taken 192000 times.
|
197214330 | 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 |