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 NavierStokesModel | ||
10 | * | ||
11 | * \copydoc Dumux::NavierStokesVolumeVariables | ||
12 | */ | ||
13 | #ifndef DUMUX_NAVIERSTOKES_VOLUME_VARIABLES_HH | ||
14 | #define DUMUX_NAVIERSTOKES_VOLUME_VARIABLES_HH | ||
15 | |||
16 | #include <dumux/freeflow/volumevariables.hh> | ||
17 | |||
18 | namespace Dumux { | ||
19 | |||
20 | /*! | ||
21 | * \ingroup NavierStokesModel | ||
22 | * \brief Volume variables for the single-phase Navier-Stokes model. | ||
23 | */ | ||
24 | template <class Traits> | ||
25 |
3/6✓ Branch 1 taken 51340 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 51340 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 51340 times.
✗ Branch 8 not taken.
|
170706 | class NavierStokesVolumeVariables : public FreeFlowVolumeVariables< Traits, NavierStokesVolumeVariables<Traits> > |
26 | { | ||
27 | using ThisType = NavierStokesVolumeVariables<Traits>; | ||
28 | using ParentType = FreeFlowVolumeVariables<Traits, ThisType>; | ||
29 | |||
30 | using Scalar = typename Traits::PrimaryVariables::value_type; | ||
31 | |||
32 | public: | ||
33 | //! export the underlying fluid system | ||
34 | using FluidSystem = typename Traits::FluidSystem; | ||
35 | //! export the fluid state type | ||
36 | using FluidState = typename Traits::FluidState; | ||
37 | //! export the indices type | ||
38 | using Indices = typename Traits::ModelTraits::Indices; | ||
39 | |||
40 | /*! | ||
41 | * \brief Update all quantities for a given control volume | ||
42 | * | ||
43 | * \param elemSol A vector containing all primary variables connected to the element | ||
44 | * \param problem The object specifying the problem which ought to | ||
45 | * be simulated | ||
46 | * \param element An element which contains part of the control volume | ||
47 | * \param scv The sub-control volume | ||
48 | */ | ||
49 | template<class ElementSolution, class Problem, class Element, class SubControlVolume> | ||
50 | ✗ | void update(const ElementSolution& elemSol, | |
51 | const Problem& problem, | ||
52 | const Element& element, | ||
53 | const SubControlVolume& scv) | ||
54 | { | ||
55 |
8/14✓ Branch 1 taken 735280 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 307780 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3186485 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1319840 times.
✓ Branch 11 taken 73500 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 37140 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 105 times.
✓ Branch 17 taken 334400 times.
✗ Branch 18 not taken.
|
68988754 | ParentType::update(elemSol, problem, element, scv); |
56 |
8/14✓ Branch 1 taken 735280 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 307780 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 3186485 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 1319840 times.
✓ Branch 11 taken 73500 times.
✗ Branch 12 not taken.
✓ Branch 13 taken 37140 times.
✗ Branch 14 not taken.
✓ Branch 16 taken 105 times.
✓ Branch 17 taken 334400 times.
✗ Branch 18 not taken.
|
68988754 | completeFluidState(elemSol, problem, element, scv, fluidState_); |
57 | ✗ | } | |
58 | |||
59 | /*! | ||
60 | * \brief Update the fluid state | ||
61 | */ | ||
62 | template<class ElementSolution, class Problem, class Element, class SubControlVolume> | ||
63 | ✗ | static void completeFluidState(const ElementSolution& elemSol, | |
64 | const Problem& problem, | ||
65 | const Element& element, | ||
66 | const SubControlVolume& scv, | ||
67 | FluidState& fluidState) | ||
68 | { | ||
69 | ✗ | const Scalar t = ParentType::temperature(elemSol, problem, element, scv); | |
70 | ✗ | fluidState.setTemperature(t); | |
71 | |||
72 | ✗ | fluidState.setPressure(0, elemSol[0][Indices::pressureIdx]); | |
73 | |||
74 | // saturation in a single phase is always 1 and thus redundant | ||
75 | // to set. But since we use the fluid state shared by the | ||
76 | // immiscible multi-phase models, so we have to set it here... | ||
77 | ✗ | fluidState.setSaturation(0, 1.0); | |
78 | |||
79 | typename FluidSystem::ParameterCache paramCache; | ||
80 | ✗ | paramCache.updateAll(fluidState); | |
81 | |||
82 | ✗ | Scalar value = FluidSystem::density(fluidState, paramCache, 0); | |
83 | ✗ | fluidState.setDensity(0, value); | |
84 | |||
85 | ✗ | value = FluidSystem::viscosity(fluidState, paramCache, 0); | |
86 | ✗ | fluidState.setViscosity(0, value); | |
87 | |||
88 | // compute and set the enthalpy | ||
89 | ✗ | value = ParentType::enthalpy(fluidState, paramCache); | |
90 | ✗ | fluidState.setEnthalpy(0, value); | |
91 | ✗ | } | |
92 | |||
93 | /*! | ||
94 | * \brief Return the effective pressure \f$\mathrm{[Pa]}\f$ of a given phase within | ||
95 | * the control volume. | ||
96 | */ | ||
97 | ✗ | Scalar pressure(int phaseIdx = 0) const | |
98 | 97038920 | { return fluidState_.pressure(0); } | |
99 | |||
100 | /*! | ||
101 | * \brief Return the mass density \f$\mathrm{[kg/m^3]}\f$ of a given phase within the | ||
102 | * control volume. | ||
103 | */ | ||
104 | ✗ | Scalar density(int phaseIdx = 0) const | |
105 |
53/79✓ Branch 1 taken 2216760 times.
✓ Branch 2 taken 1678432 times.
✓ Branch 4 taken 71757 times.
✓ Branch 5 taken 14039 times.
✓ Branch 6 taken 222656 times.
✓ Branch 7 taken 3848768 times.
✓ Branch 8 taken 16907456 times.
✓ Branch 9 taken 83252480 times.
✓ Branch 10 taken 50834088 times.
✓ Branch 11 taken 120334612 times.
✓ Branch 12 taken 43173202 times.
✓ Branch 13 taken 60803898 times.
✓ Branch 14 taken 2134010 times.
✓ Branch 15 taken 46661579 times.
✓ Branch 16 taken 1437854 times.
✓ Branch 17 taken 35034034 times.
✓ Branch 18 taken 932479 times.
✓ Branch 19 taken 28272874 times.
✓ Branch 20 taken 932454 times.
✓ Branch 21 taken 28272899 times.
✓ Branch 22 taken 970854 times.
✓ Branch 23 taken 28259434 times.
✓ Branch 24 taken 532063 times.
✓ Branch 25 taken 21210250 times.
✓ Branch 26 taken 167846 times.
✓ Branch 27 taken 8975299 times.
✗ Branch 28 not taken.
✓ Branch 30 taken 11545 times.
✗ Branch 31 not taken.
✓ Branch 32 taken 25344 times.
✓ Branch 33 taken 25 times.
✓ Branch 34 taken 20032 times.
✗ Branch 35 not taken.
✓ Branch 36 taken 27897 times.
✗ Branch 37 not taken.
✓ Branch 38 taken 20057 times.
✗ Branch 39 not taken.
✓ Branch 40 taken 20057 times.
✗ Branch 41 not taken.
✓ Branch 42 taken 20032 times.
✗ Branch 43 not taken.
✓ Branch 44 taken 20032 times.
✗ Branch 45 not taken.
✓ Branch 46 taken 8512 times.
✗ Branch 47 not taken.
✓ Branch 48 taken 8512 times.
✗ Branch 49 not taken.
✓ Branch 50 taken 25 times.
✗ Branch 51 not taken.
✓ Branch 52 taken 25 times.
✗ Branch 53 not taken.
✓ Branch 54 taken 25 times.
✗ Branch 55 not taken.
✓ Branch 56 taken 25 times.
✗ Branch 57 not taken.
✓ Branch 58 taken 25 times.
✗ Branch 59 not taken.
✓ Branch 60 taken 25 times.
✗ Branch 61 not taken.
✓ Branch 62 taken 25 times.
✗ Branch 63 not taken.
✓ Branch 64 taken 25 times.
✗ Branch 65 not taken.
✓ Branch 66 taken 25 times.
✗ Branch 67 not taken.
✓ Branch 68 taken 25 times.
✗ Branch 69 not taken.
✓ Branch 70 taken 25 times.
✗ Branch 71 not taken.
✓ Branch 72 taken 25 times.
✗ Branch 73 not taken.
✓ Branch 74 taken 25 times.
✗ Branch 75 not taken.
✓ Branch 76 taken 25 times.
✗ Branch 77 not taken.
✓ Branch 78 taken 25 times.
✗ Branch 79 not taken.
✓ Branch 80 taken 25 times.
✗ Branch 81 not taken.
|
1970942710 | { return fluidState_.density(0); } |
106 | |||
107 | /*! | ||
108 | * \brief Return temperature \f$\mathrm{[K]}\f$ inside the sub-control volume. | ||
109 | * | ||
110 | * Note that we assume thermodynamic equilibrium, i.e. the | ||
111 | * temperatures of the rock matrix and of all fluid phases are | ||
112 | * identical. | ||
113 | */ | ||
114 | Scalar temperature() const | ||
115 | 70152054 | { return fluidState_.temperature(); } | |
116 | |||
117 | /*! | ||
118 | * \brief Returns the molar mass of a given phase within the | ||
119 | * control volume. | ||
120 | */ | ||
121 | Scalar molarMass(int phaseIdx = 0) const | ||
122 | { | ||
123 | return fluidState_.averageMolarMass(0); | ||
124 | } | ||
125 | |||
126 | /*! | ||
127 | * \brief Return the dynamic viscosity \f$\mathrm{[Pa s]}\f$ of the fluid within the | ||
128 | * control volume. | ||
129 | */ | ||
130 | ✗ | Scalar viscosity(int phaseIdx = 0) const | |
131 |
39/53✓ Branch 1 taken 3700630 times.
✓ Branch 2 taken 64006543 times.
✓ Branch 3 taken 12504490 times.
✓ Branch 4 taken 63989711 times.
✓ Branch 5 taken 12067160 times.
✓ Branch 6 taken 71391793 times.
✓ Branch 7 taken 12067160 times.
✓ Branch 8 taken 71391793 times.
✓ Branch 9 taken 9045782 times.
✓ Branch 10 taken 16135395 times.
✓ Branch 11 taken 150822 times.
✓ Branch 12 taken 16100291 times.
✓ Branch 13 taken 150822 times.
✓ Branch 14 taken 16100291 times.
✓ Branch 15 taken 150822 times.
✓ Branch 16 taken 16100291 times.
✓ Branch 17 taken 150822 times.
✓ Branch 18 taken 16100291 times.
✓ Branch 19 taken 150822 times.
✓ Branch 20 taken 16100291 times.
✓ Branch 21 taken 20032 times.
✗ Branch 22 not taken.
✓ Branch 23 taken 20032 times.
✗ Branch 24 not taken.
✓ Branch 25 taken 20032 times.
✗ Branch 26 not taken.
✓ Branch 27 taken 20032 times.
✗ Branch 28 not taken.
✓ Branch 29 taken 20032 times.
✓ Branch 30 taken 25 times.
✓ Branch 31 taken 20032 times.
✓ Branch 32 taken 25 times.
✓ Branch 33 taken 20032 times.
✓ Branch 34 taken 25 times.
✗ Branch 35 not taken.
✓ Branch 36 taken 25 times.
✗ Branch 37 not taken.
✓ Branch 38 taken 25 times.
✗ Branch 39 not taken.
✓ Branch 40 taken 25 times.
✗ Branch 41 not taken.
✓ Branch 42 taken 25 times.
✗ Branch 43 not taken.
✓ Branch 44 taken 25 times.
✗ Branch 45 not taken.
✓ Branch 46 taken 25 times.
✗ Branch 47 not taken.
✓ Branch 48 taken 25 times.
✗ Branch 49 not taken.
✓ Branch 50 taken 25 times.
✗ Branch 51 not taken.
✓ Branch 52 taken 25 times.
✗ Branch 53 not taken.
|
947852948 | { return fluidState_.viscosity(0); } |
132 | |||
133 | /*! | ||
134 | * \brief Return the effective dynamic viscosity \f$\mathrm{[Pa s]}\f$ of the fluid within the | ||
135 | * control volume. | ||
136 | */ | ||
137 | Scalar effectiveViscosity() const | ||
138 | 79879758 | { return viscosity(); } | |
139 | |||
140 | /*! | ||
141 | * \brief Return the fluid state of the control volume. | ||
142 | */ | ||
143 | const FluidState& fluidState() const | ||
144 | 183581242 | { return fluidState_; } | |
145 | |||
146 | protected: | ||
147 | FluidState fluidState_; | ||
148 | }; | ||
149 | |||
150 | } // end namespace Dumux | ||
151 | |||
152 | #endif | ||
153 |