version 3.10-dev
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// 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_VOLUME_VARIABLES_HH
14#define DUMUX_NAVIERSTOKES_MOMENTUM_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 == 1);
29
30public:
32 using PrimaryVariables = typename Traits::PrimaryVariables;
33
35 using Indices = typename Traits::ModelTraits::Indices; // TODO
36
37
47 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
48 void update(const ElementSolution& elemSol,
49 const Problem& problem,
50 const Element& element,
51 const SubControlVolume& scv)
52 {
53 priVars_ = elemSol[scv.indexInElement()];
54 extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol);
55 }
56
66 Scalar extrusionFactor() const
67 { return extrusionFactor_; }
68
69 Scalar velocity() const
70 { return priVars_[0]; }
71
77 Scalar priVar(const int pvIdx) const
78 { return priVars_[pvIdx]; }
79
84 { return priVars_; }
85
86protected:
89};
90
91} // end namespace Dumux
92
93#endif // DUMUX_NAVIERSTOKES_MOMENTUM_VOLUME_VARIABLES_HH
Volume variables for the single-phase Navier-Stokes model.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:25
PrimaryVariables priVars_
Definition: freeflow/navierstokes/momentum/volumevariables.hh:87
Scalar extrusionFactor_
Definition: freeflow/navierstokes/momentum/volumevariables.hh:88
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: freeflow/navierstokes/momentum/volumevariables.hh:32
Scalar velocity() const
Definition: freeflow/navierstokes/momentum/volumevariables.hh:69
Scalar extrusionFactor() const
Return how much the sub-control volume is extruded.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:66
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:48
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:77
const PrimaryVariables & priVars() const
Return the primary variable vector.
Definition: freeflow/navierstokes/momentum/volumevariables.hh:83
typename Traits::ModelTraits::Indices Indices
export the indices type
Definition: freeflow/navierstokes/momentum/volumevariables.hh:35
Definition: adapt.hh:17