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 | * \copydoc Dumux::NavierStokesMassOnePFluxVariables | ||
11 | */ | ||
12 | #ifndef DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_FLUXVARIABLES_HH | ||
13 | #define DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_FLUXVARIABLES_HH | ||
14 | |||
15 | #include <dumux/flux/upwindscheme.hh> | ||
16 | #include <dumux/freeflow/navierstokes/scalarfluxvariables.hh> | ||
17 | |||
18 | #include "advectiveflux.hh" | ||
19 | |||
20 | namespace Dumux { | ||
21 | |||
22 | /*! | ||
23 | * \ingroup NavierStokesModel | ||
24 | * \brief The flux variables class for the single-phase flow Navier-Stokes model. | ||
25 | */ | ||
26 | template<class Problem, | ||
27 | class ModelTraits, | ||
28 | class FluxTs, | ||
29 | class ElementVolumeVariables, | ||
30 | class ElementFluxVariablesCache, | ||
31 | class UpwindScheme = UpwindScheme<typename ProblemTraits<Problem>::GridGeometry>> | ||
32 | class NavierStokesMassOnePFluxVariables | ||
33 | : public NavierStokesScalarConservationModelFluxVariables<Problem, | ||
34 | ModelTraits, | ||
35 | FluxTs, | ||
36 | ElementVolumeVariables, | ||
37 | ElementFluxVariablesCache, | ||
38 | UpwindScheme> | ||
39 | { | ||
40 | using ParentType = NavierStokesScalarConservationModelFluxVariables<Problem, | ||
41 | ModelTraits, | ||
42 | FluxTs, | ||
43 | ElementVolumeVariables, | ||
44 | ElementFluxVariablesCache, | ||
45 | UpwindScheme>; | ||
46 | |||
47 | using VolumeVariables = typename ElementVolumeVariables::VolumeVariables; | ||
48 | using NumEqVector = typename VolumeVariables::PrimaryVariables; | ||
49 | |||
50 | public: | ||
51 | |||
52 | /*! | ||
53 | * \brief Returns the advective mass flux in kg/s | ||
54 | * or the advective mole flux in mole/s. | ||
55 | */ | ||
56 | ✗ | NumEqVector advectiveFlux(int phaseIdx = 0) const | |
57 | { | ||
58 | ✗ | NumEqVector result(0.0); | |
59 | // g++ requires to capture 'this' by value | ||
60 |
0/6✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
|
97792518 | const auto upwinding = [this](const auto& term) { return this->getAdvectiveFlux(term); }; |
61 |
0/6✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
|
97792518 | AdvectiveFlux<ModelTraits>::addAdvectiveFlux(result, upwinding); |
62 | ✗ | return result; | |
63 | } | ||
64 | |||
65 | /*! | ||
66 | * \brief Returns all fluxes for the single-phase flow, multi-component | ||
67 | * Navier-Stokes model: the advective mass flux in kg/s | ||
68 | * or the advective mole flux in mole/s and the energy flux | ||
69 | * in J/s (for nonisothermal models). | ||
70 | */ | ||
71 | ✗ | NumEqVector flux(int phaseIdx = 0) const | |
72 | { | ||
73 |
0/4✗ Branch 1 not taken.
✗ Branch 2 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
97792518 | NumEqVector flux = advectiveFlux(phaseIdx); |
74 |
1/3✓ Branch 0 taken 249600 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
|
97792518 | ParentType::addHeatFlux(flux); |
75 | ✗ | return flux; | |
76 | } | ||
77 | }; | ||
78 | |||
79 | } // end namespace Dumux | ||
80 | |||
81 | #endif | ||
82 |