3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
freeflow/navierstokes/mass/1p/localresidual.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_LOCAL_RESIDUAL_HH
25#define DUMUX_FREEFLOW_NAVIERSTOKES_MASS_1P_LOCAL_RESIDUAL_HH
26
29
30namespace Dumux {
31
36template<class TypeTag>
37class NavierStokesMassOnePLocalResidual : public GetPropType<TypeTag, Properties::BaseLocalResidual>
38{
41 using GridVolumeVariables = typename GridVariables::GridVolumeVariables;
42 using ElementVolumeVariables = typename GridVolumeVariables::LocalView;
43 using VolumeVariables = typename GridVolumeVariables::VolumeVariables;
44
45 using GridFluxVariablesCache = typename GridVariables::GridFluxVariablesCache;
46 using ElementFluxVariablesCache = typename GridFluxVariablesCache::LocalView;
47
51 using FVElementGeometry = typename GridGeometry::LocalView;
52 using SubControlVolume = typename FVElementGeometry::SubControlVolume;
53 using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
54 using GridView = typename GridGeometry::GridView;
55 using Element = typename GridView::template Codim<0>::Entity;
59
60public:
62 using ParentType::ParentType;
63
67 NumEqVector computeStorage(const Problem& problem,
68 const SubControlVolume& scv,
69 const VolumeVariables& volVars) const
70 {
71 NumEqVector storage(0.0);
72 storage[ModelTraits::Indices::conti0EqIdx] = volVars.density();
73
74 // consider energy storage for non-isothermal models
75 if constexpr (ModelTraits::enableEnergyBalance())
76 storage[ModelTraits::Indices::energyEqIdx] = volVars.density() * volVars.internalEnergy();
77
78 return storage;
79 }
80
91 NumEqVector computeFlux(const Problem& problem,
92 const Element& element,
93 const FVElementGeometry& fvGeometry,
94 const ElementVolumeVariables& elemVolVars,
95 const SubControlVolumeFace& scvf,
96 const ElementFluxVariablesCache& elemFluxVarsCache) const
97 {
98 FluxVariables fluxVars;
99 fluxVars.init(problem, element, fvGeometry, elemVolVars, scvf, elemFluxVarsCache);
100 return fluxVars.flux(0);
101 }
102};
103
104} // end namespace Dumux
105
106#endif
A helper to deduce a vector with the same size as numbers of equations.
typename NumEqVectorTraits< PrimaryVariables >::type NumEqVector
A vector with the same size as numbers of equations This is the default implementation and has to be ...
Definition: numeqvector.hh:46
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property
Definition: propertysystem.hh:150
Element-wise calculation of the Navier-Stokes residual for single-phase flow.
Definition: freeflow/navierstokes/mass/1p/localresidual.hh:38
NumEqVector computeFlux(const Problem &problem, const Element &element, const FVElementGeometry &fvGeometry, const ElementVolumeVariables &elemVolVars, const SubControlVolumeFace &scvf, const ElementFluxVariablesCache &elemFluxVarsCache) const
Evaluatex the mass flux over a face of a sub control volume.
Definition: freeflow/navierstokes/mass/1p/localresidual.hh:91
NumEqVector computeStorage(const Problem &problem, const SubControlVolume &scv, const VolumeVariables &volVars) const
Calculate the storage term of the equation.
Definition: freeflow/navierstokes/mass/1p/localresidual.hh:67
Declares all properties used in Dumux.