version 3.10-dev
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
56 NumEqVector advectiveFlux(int phaseIdx = 0) const
57 {
58 NumEqVector result(0.0);
59 // g++ requires to capture 'this' by value
60 const auto upwinding = [this](const auto& term) { return this->getAdvectiveFlux(term); };
61 AdvectiveFlux<ModelTraits>::addAdvectiveFlux(result, upwinding);
62 return result;
63 }
64
71 NumEqVector flux(int phaseIdx = 0) const
72 {
73 NumEqVector flux = advectiveFlux(phaseIdx);
75 return flux;
76 }
77};
78
79} // end namespace Dumux
80
81#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, multi-component Navier-Stokes model: the advective mass...
Definition: freeflow/navierstokes/mass/1p/fluxvariables.hh:71
NumEqVector advectiveFlux(int phaseIdx=0) const
Returns the advective mass flux in kg/s or the advective mole flux in mole/s.
Definition: freeflow/navierstokes/mass/1p/fluxvariables.hh:56
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