version 3.8
freeflow/navierstokes/momentum/cvfe/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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_NAVIERSTOKES_MOMENTUM_CVFE_VOLUME_VARIABLES_HH
14#define DUMUX_NAVIERSTOKES_MOMENTUM_CVFE_VOLUME_VARIABLES_HH
15
16
17namespace Dumux {
18
23template <class Traits>
25{
26 using Scalar = typename Traits::PrimaryVariables::value_type;
27
28 static_assert(Traits::PrimaryVariables::dimension == Traits::ModelTraits::dim());
29
30public:
32 using PrimaryVariables = typename Traits::PrimaryVariables;
33
35 using Indices = typename Traits::ModelTraits::Indices;
36
46 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
47 void update(const ElementSolution& elemSol,
48 const Problem& problem,
49 const Element& element,
50 const SubControlVolume& scv)
51 {
52 priVars_ = elemSol[scv.indexInElement()];
53 extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol);
54 }
55
65 Scalar extrusionFactor() const
66 { return extrusionFactor_; }
67
69 { return priVars_; }
70
71 Scalar velocity(const int dirIdx) const
72 { return priVars_[dirIdx]; }
73
78 Scalar priVar(const int pvIdx) const
79 { return priVars_[pvIdx]; }
80
85 { return priVars_; }
86
87private:
88 PrimaryVariables priVars_;
89 Scalar extrusionFactor_;
90};
91
92} // end namespace Dumux
93
94#endif
Volume variables for the single-phase Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/cvfe/volumevariables.hh:25
const PrimaryVariables & priVars() const
Return the primary variable vector.
Definition: freeflow/navierstokes/momentum/cvfe/volumevariables.hh:84
typename Traits::ModelTraits::Indices Indices
export the indices type
Definition: freeflow/navierstokes/momentum/cvfe/volumevariables.hh:35
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/cvfe/volumevariables.hh:47
Scalar velocity(const int dirIdx) const
Definition: freeflow/navierstokes/momentum/cvfe/volumevariables.hh:71
Scalar extrusionFactor() const
Return how much the sub-control volume is extruded.
Definition: freeflow/navierstokes/momentum/cvfe/volumevariables.hh:65
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector.
Definition: freeflow/navierstokes/momentum/cvfe/volumevariables.hh:78
PrimaryVariables velocity() const
Definition: freeflow/navierstokes/momentum/cvfe/volumevariables.hh:68
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: freeflow/navierstokes/momentum/cvfe/volumevariables.hh:32
Definition: adapt.hh:17