3.5-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
freeflow/navierstokes/momentum/volumevariables.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 *****************************************************************************/
25#ifndef DUMUX_NAVIERSTOKES_MOMENTUM_VOLUME_VARIABLES_HH
26#define DUMUX_NAVIERSTOKES_MOMENTUM_VOLUME_VARIABLES_HH
27
29
30namespace Dumux {
31
36template <class Traits>
38{
39 using Scalar = typename Traits::PrimaryVariables::value_type;
40
41 static_assert(Traits::PrimaryVariables::dimension == 1);
42
43public:
45 using PrimaryVariables = typename Traits::PrimaryVariables;
46
48 using Indices = typename Traits::ModelTraits::Indices; // TODO
49
50
60 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
61 void update(const ElementSolution& elemSol,
62 const Problem& problem,
63 const Element& element,
64 const SubControlVolume& scv)
65 {
66 priVars_ = elemSol[scv.indexInElement()];
67 extrusionFactor_ = Deprecated::extrusionFactor(problem, element, scv, elemSol);
68 }
69
79 Scalar extrusionFactor() const
80 { return extrusionFactor_; }
81
82 Scalar velocity() const
83 { return priVars_[0]; }
84
90 Scalar priVar(const int pvIdx) const
91 { return priVars_[pvIdx]; }
92
97 { return priVars_; }
98
99protected:
102};
103
104} // end namespace Dumux
105
106#endif // DUMUX_NAVIERSTOKES_MOMENTUM_VOLUME_VARIABLES_HH
Helpers for deprecation.
Definition: adapt.hh:29
Volume variables for the single-phase Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:38
PrimaryVariables priVars_
Definition: freeflow/navierstokes/momentum/volumevariables.hh:100
Scalar extrusionFactor_
Definition: freeflow/navierstokes/momentum/volumevariables.hh:101
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: freeflow/navierstokes/momentum/volumevariables.hh:45
Scalar velocity() const
Definition: freeflow/navierstokes/momentum/volumevariables.hh:82
Scalar extrusionFactor() const
Return how much the sub-control volume is extruded.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:79
void update(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all quantities for a given control volume.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:61
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:90
const PrimaryVariables & priVars() const
Return the primary variable vector.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:96
typename Traits::ModelTraits::Indices Indices
export the indices type
Definition: freeflow/navierstokes/momentum/volumevariables.hh:48