3.6-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
28
29namespace Dumux {
30
35template <class Traits>
37{
38 using Scalar = typename Traits::PrimaryVariables::value_type;
39
40 static_assert(Traits::PrimaryVariables::dimension == 1);
41
42public:
44 using PrimaryVariables = typename Traits::PrimaryVariables;
45
47 using Indices = typename Traits::ModelTraits::Indices; // TODO
48
49
59 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
60 void update(const ElementSolution& elemSol,
61 const Problem& problem,
62 const Element& element,
63 const SubControlVolume& scv)
64 {
65 priVars_ = elemSol[scv.indexInElement()];
66 extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol);
67 }
68
78 Scalar extrusionFactor() const
79 { return extrusionFactor_; }
80
81 Scalar velocity() const
82 { return priVars_[0]; }
83
89 Scalar priVar(const int pvIdx) const
90 { return priVars_[pvIdx]; }
91
96 { return priVars_; }
97
98protected:
101};
102
103} // end namespace Dumux
104
105#endif // DUMUX_NAVIERSTOKES_MOMENTUM_VOLUME_VARIABLES_HH
Adaption of the non-isothermal two-phase two-component flow model to problems with CO2.
Definition: adapt.hh:29
Volume variables for the single-phase Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:37
PrimaryVariables priVars_
Definition: freeflow/navierstokes/momentum/volumevariables.hh:99
Scalar extrusionFactor_
Definition: freeflow/navierstokes/momentum/volumevariables.hh:100
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: freeflow/navierstokes/momentum/volumevariables.hh:44
Scalar velocity() const
Definition: freeflow/navierstokes/momentum/volumevariables.hh:81
Scalar extrusionFactor() const
Return how much the sub-control volume is extruded.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:78
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:60
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:89
const PrimaryVariables & priVars() const
Return the primary variable vector.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:95
typename Traits::ModelTraits::Indices Indices
export the indices type
Definition: freeflow/navierstokes/momentum/volumevariables.hh:47