version 3.8
scalarvolumevariables.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//
12#ifndef DUMUX_NAVIERSTOKES_SCALAR_CONSERVATION_MODEL_VOLUME_VARIABLES_HH
13#define DUMUX_NAVIERSTOKES_SCALAR_CONSERVATION_MODEL_VOLUME_VARIABLES_HH
14
15
16namespace Dumux {
17
22template <class Traits>
24{
25 using Scalar = typename Traits::PrimaryVariables::value_type;
26
27public:
29 using PrimaryVariables = typename Traits::PrimaryVariables;
31 using Indices = typename Traits::ModelTraits::Indices;
33 using FluidSystem = typename Traits::FluidSystem;
35 using FluidState = typename Traits::FluidState;
36
38 static constexpr int numFluidPhases() { return Traits::ModelTraits::numFluidPhases(); }
40 static constexpr int numFluidComponents() { return Traits::ModelTraits::numFluidComponents(); }
41
51 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
52 void update(const ElementSolution& elemSol,
53 const Problem& problem,
54 const Element& element,
55 const SubControlVolume& scv)
56 {
57 priVars_ = elemSol[scv.indexInElement()];
58 extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol);
59 }
60
70 Scalar extrusionFactor() const
71 { return extrusionFactor_; }
72
78 Scalar priVar(const int pvIdx) const
79 { return priVars_[pvIdx]; }
80
85 { return priVars_; }
86
87protected:
90};
91
92} // end namespace Dumux
93
94#endif // DUMUX_NAVIERSTOKES_MOMENTUM_VOLUME_VARIABLES_HH
Volume variables for the single-phase Navier-Stokes model.
Definition: scalarvolumevariables.hh:24
typename Traits::FluidSystem FluidSystem
Export the underlying fluid system.
Definition: scalarvolumevariables.hh:33
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: scalarvolumevariables.hh:40
typename Traits::FluidState FluidState
Export the fluid state type.
Definition: scalarvolumevariables.hh:35
typename Traits::PrimaryVariables PrimaryVariables
export the type used for the primary variables
Definition: scalarvolumevariables.hh:29
Scalar extrusionFactor_
Definition: scalarvolumevariables.hh:89
typename Traits::ModelTraits::Indices Indices
export the indices type
Definition: scalarvolumevariables.hh:31
PrimaryVariables priVars_
Definition: scalarvolumevariables.hh:88
Scalar extrusionFactor() const
Return how much the sub-control volume is extruded.
Definition: scalarvolumevariables.hh:70
const PrimaryVariables & priVars() const
Return the primary variable vector.
Definition: scalarvolumevariables.hh:84
Scalar priVar(const int pvIdx) const
Return a component of primary variable vector.
Definition: scalarvolumevariables.hh:78
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition: scalarvolumevariables.hh:38
void update(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all quantities for a given control volume.
Definition: scalarvolumevariables.hh:52
Definition: adapt.hh:17