3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_FLUXVARIABLES_HH
25#define DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_FLUXVARIABLES_HH
26
29
30#include "advectiveflux.hh"
31
32namespace Dumux {
33
38template<class Problem,
39 class ModelTraits,
40 class FluxTs,
41 class ElementVolumeVariables,
42 class ElementFluxVariablesCache,
43 class UpwindScheme = UpwindScheme<typename ProblemTraits<Problem>::GridGeometry>>
46 ModelTraits,
47 FluxTs,
48 ElementVolumeVariables,
49 ElementFluxVariablesCache,
50 UpwindScheme>
51{
53 ModelTraits,
54 FluxTs,
55 ElementVolumeVariables,
56 ElementFluxVariablesCache,
58
59 using VolumeVariables = typename ElementVolumeVariables::VolumeVariables;
60 using NumEqVector = typename VolumeVariables::PrimaryVariables;
61
62public:
63
67 NumEqVector advectiveFlux(int phaseIdx = 0) const
68 {
69 NumEqVector result(0.0);
70 // g++ requires to capture 'this' by value
71 const auto upwinding = [this](const auto& term) { return this->getAdvectiveFlux(term); };
72 AdvectiveFlux<ModelTraits>::addAdvectiveFlux(result, upwinding);
73 return result;
74 }
75
80 NumEqVector flux(int phaseIdx = 0) const
81 {
82 NumEqVector flux = advectiveFlux(phaseIdx);
84 return flux;
85 }
86};
87
88} // end namespace Dumux
89
90#endif
Helper struct defining the advective fluxes of the single-phase flow Navier-Stokes mass model.
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:42
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
Forward declaration of the upwind scheme implementation.
Definition: flux/upwindscheme.hh:34
The flux variables class for the single-phase flow Navier-Stokes model.
Definition: freeflow/navierstokes/mass/1p/fluxvariables.hh:51
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:80
NumEqVector advectiveFlux(int phaseIdx=0) const
Returns the advective mass flux in kg/s.
Definition: freeflow/navierstokes/mass/1p/fluxvariables.hh:67
The flux variables base class for scalar quantities balanced in the Navier-Stokes model.
Definition: scalarfluxvariables.hh:51
void addHeatFlux(NumEqVector &flux) const
Adds the energy flux to a given flux vector.
Definition: scalarfluxvariables.hh:139
Scalar getAdvectiveFlux(const FunctionType &upwindTerm) const
Returns the advective flux computed by the respective law.
Definition: scalarfluxvariables.hh:81
Base class for the upwind scheme.