3.6-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
freeflow/navierstokes/momentum/diamond/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_DIAMOND_VOLUME_VARIABLES_HH
26#define DUMUX_NAVIERSTOKES_MOMENTUM_DIAMOND_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 == Traits::ModelTraits::dim());
41
42public:
44 using PrimaryVariables = typename Traits::PrimaryVariables;
45
47 using Indices = typename Traits::ModelTraits::Indices;
48
58 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
59 void update(const ElementSolution& elemSol,
60 const Problem& problem,
61 const Element& element,
62 const SubControlVolume& scv)
63 {
64 priVars_ = elemSol[scv.indexInElement()];
65 extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol);
66 }
67
77 Scalar extrusionFactor() const
78 { return extrusionFactor_; }
79
81 { return priVars_; }
82
83 Scalar velocity(const int dirIdx) const
84 { return priVars_[dirIdx]; }
85
90 Scalar priVar(const int pvIdx) const
91 { return priVars_[pvIdx]; }
92
97 { return priVars_; }
98
99private:
100 PrimaryVariables priVars_;
101 Scalar extrusionFactor_;
102};
103
104} // end namespace Dumux
105
106#endif
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/diamond/volumevariables.hh:37
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: freeflow/navierstokes/momentum/diamond/volumevariables.hh:44
const PrimaryVariables & priVars() const
Return the primary variable vector.
Definition: freeflow/navierstokes/momentum/diamond/volumevariables.hh:96
Scalar extrusionFactor() const
Return how much the sub-control volume is extruded.
Definition: freeflow/navierstokes/momentum/diamond/volumevariables.hh:77
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/diamond/volumevariables.hh:59
PrimaryVariables velocity() const
Definition: freeflow/navierstokes/momentum/diamond/volumevariables.hh:80
typename Traits::ModelTraits::Indices Indices
export the indices type
Definition: freeflow/navierstokes/momentum/diamond/volumevariables.hh:47
Scalar velocity(const int dirIdx) const
Definition: freeflow/navierstokes/momentum/diamond/volumevariables.hh:83
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector.
Definition: freeflow/navierstokes/momentum/diamond/volumevariables.hh:90