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 NavierStokesModel | ||
10 | * \copydoc Dumux::NavierStokesVolumeVariables | ||
11 | */ | ||
12 | #ifndef DUMUX_NAVIERSTOKES_SCALAR_CONSERVATION_MODEL_VOLUME_VARIABLES_HH | ||
13 | #define DUMUX_NAVIERSTOKES_SCALAR_CONSERVATION_MODEL_VOLUME_VARIABLES_HH | ||
14 | |||
15 | |||
16 | namespace Dumux { | ||
17 | |||
18 | /*! | ||
19 | * \ingroup NavierStokesModel | ||
20 | * \brief Volume variables for the single-phase Navier-Stokes model. | ||
21 | */ | ||
22 | template <class Traits> | ||
23 |
2/6✗ Branch 0 not taken.
✓ Branch 1 taken 26308 times.
✓ Branch 4 taken 6474 times.
✗ Branch 5 not taken.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
2367818 | class NavierStokesScalarConservationModelVolumeVariables |
24 | { | ||
25 | using Scalar = typename Traits::PrimaryVariables::value_type; | ||
26 | |||
27 | public: | ||
28 | //! export the type used for the primary variables | ||
29 | using PrimaryVariables = typename Traits::PrimaryVariables; | ||
30 | //! export the indices type | ||
31 | using Indices = typename Traits::ModelTraits::Indices; | ||
32 | //! Export the underlying fluid system | ||
33 | using FluidSystem = typename Traits::FluidSystem; | ||
34 | //! Export the fluid state type | ||
35 | using FluidState = typename Traits::FluidState; | ||
36 | |||
37 | //! Return number of phases considered by the model | ||
38 | static constexpr int numFluidPhases() { return Traits::ModelTraits::numFluidPhases(); } | ||
39 | //! Return number of components considered by the model | ||
40 | static constexpr int numFluidComponents() { return Traits::ModelTraits::numFluidComponents(); } | ||
41 | |||
42 | /*! | ||
43 | * \brief Update all quantities for a given control volume | ||
44 | * | ||
45 | * \param elemSol A vector containing all primary variables connected to the element | ||
46 | * \param problem The object specifying the problem which ought to | ||
47 | * be simulated | ||
48 | * \param element An element which contains part of the control volume | ||
49 | * \param scv The sub-control volume | ||
50 | */ | ||
51 | template<class ElementSolution, class Problem, class Element, class SubControlVolume> | ||
52 | 44224583 | void update(const ElementSolution& elemSol, | |
53 | const Problem& problem, | ||
54 | const Element& element, | ||
55 | const SubControlVolume& scv) | ||
56 | { | ||
57 |
2/4✓ Branch 1 taken 124800 times.
✗ Branch 2 not taken.
✓ Branch 6 taken 93600 times.
✗ Branch 7 not taken.
|
44224583 | priVars_ = elemSol[scv.indexInElement()]; |
58 |
6/12✓ Branch 1 taken 181470 times.
✗ Branch 2 not taken.
✓ Branch 6 taken 584273 times.
✗ Branch 7 not taken.
✓ Branch 3 taken 8707 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 42 times.
✓ Branch 8 taken 5304 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 54 times.
✗ Branch 12 not taken.
|
44224583 | extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol); |
59 | } | ||
60 | |||
61 | /*! | ||
62 | * \brief Return how much the sub-control volume is extruded. | ||
63 | * | ||
64 | * This means the factor by which a lower-dimensional (1D or 2D) | ||
65 | * entity needs to be expanded to get a full dimensional cell. The | ||
66 | * default is 1.0 which means that 1D problems are actually | ||
67 | * thought as pipes with a cross section of 1 m^2 and 2D problems | ||
68 | * are assumed to extend 1 m to the back. | ||
69 | */ | ||
70 | 256992631 | Scalar extrusionFactor() const | |
71 |
12/13✓ Branch 0 taken 150284930 times.
✓ Branch 1 taken 8163240 times.
✓ Branch 3 taken 10637573 times.
✓ Branch 4 taken 1249421 times.
✓ Branch 5 taken 11407272 times.
✓ Branch 6 taken 1375762 times.
✓ Branch 7 taken 2967396 times.
✓ Branch 8 taken 349120 times.
✓ Branch 9 taken 2959386 times.
✓ Branch 10 taken 20296 times.
✓ Branch 2 taken 3995940 times.
✓ Branch 11 taken 743696 times.
✗ Branch 12 not taken.
|
220510606 | { return extrusionFactor_; } |
72 | |||
73 | /*! | ||
74 | * \brief Return a component of primary variable vector | ||
75 | * | ||
76 | * \param pvIdx The index of the primary variable of interest | ||
77 | */ | ||
78 | Scalar priVar(const int pvIdx) const | ||
79 | { return priVars_[pvIdx]; } | ||
80 | |||
81 | /*! | ||
82 | * \brief Return the primary variable vector | ||
83 | */ | ||
84 | 16 | const PrimaryVariables& priVars() const | |
85 | 110 | { return priVars_; } | |
86 | |||
87 | protected: | ||
88 | PrimaryVariables priVars_; | ||
89 | Scalar extrusionFactor_; | ||
90 | }; | ||
91 | |||
92 | } // end namespace Dumux | ||
93 | |||
94 | #endif // DUMUX_NAVIERSTOKES_MOMENTUM_VOLUME_VARIABLES_HH | ||
95 |