version 3.8
freeflow/navierstokes/mass/1p/fluxvariables.hh
Go to the documentation of this file.
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//
12#ifndef DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_FLUXVARIABLES_HH
13#define DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_FLUXVARIABLES_HH
14
17
18#include "advectiveflux.hh"
19
20namespace Dumux {
21
26template<class Problem,
27 class ModelTraits,
28 class FluxTs,
29 class ElementVolumeVariables,
30 class ElementFluxVariablesCache,
31 class UpwindScheme = UpwindScheme<typename ProblemTraits<Problem>::GridGeometry>>
34 ModelTraits,
35 FluxTs,
36 ElementVolumeVariables,
37 ElementFluxVariablesCache,
38 UpwindScheme>
39{
41 ModelTraits,
42 FluxTs,
43 ElementVolumeVariables,
44 ElementFluxVariablesCache,
46
47 using VolumeVariables = typename ElementVolumeVariables::VolumeVariables;
48 using NumEqVector = typename VolumeVariables::PrimaryVariables;
49
50public:
51
55 NumEqVector advectiveFlux(int phaseIdx = 0) const
56 {
57 NumEqVector result(0.0);
58 // g++ requires to capture 'this' by value
59 const auto upwinding = [this](const auto& term) { return this->getAdvectiveFlux(term); };
60 AdvectiveFlux<ModelTraits>::addAdvectiveFlux(result, upwinding);
61 return result;
62 }
63
68 NumEqVector flux(int phaseIdx = 0) const
69 {
70 NumEqVector flux = advectiveFlux(phaseIdx);
72 return flux;
73 }
74};
75
76} // end namespace Dumux
77
78#endif
Helper struct defining the advective fluxes of the single-phase flow multicomponent Navier-Stokes mas...
The flux variables class for the single-phase flow Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1p/fluxvariables.hh:39
NumEqVector flux(int phaseIdx=0) const
Returns all fluxes for the single-phase flow Navier-Stokes model: the advective mass flux in kg/s and...
Definition: freeflow/navierstokes/mass/1p/fluxvariables.hh:68
NumEqVector advectiveFlux(int phaseIdx=0) const
Returns the advective mass flux in kg/s.
Definition: freeflow/navierstokes/mass/1p/fluxvariables.hh:55
The flux variables base class for scalar quantities balanced in the Navier-Stokes model.
Definition: scalarfluxvariables.hh:39
void addHeatFlux(NumEqVector &flux) const
Adds the energy flux to a given flux vector.
Definition: scalarfluxvariables.hh:127
Scalar getAdvectiveFlux(const FunctionType &upwindTerm) const
Returns the advective flux computed by the respective law.
Definition: scalarfluxvariables.hh:69
Forward declaration of the upwind scheme implementation.
Definition: flux/upwindscheme.hh:22
Base class for the upwind scheme.
UpwindSchemeImpl< GridGeometry, typename GridGeometry::DiscretizationMethod > UpwindScheme
The upwind scheme used for the advective fluxes. This depends on the chosen discretization method.
Definition: flux/upwindscheme.hh:30
Definition: adapt.hh:17