version 3.10-dev
porousmediumflow/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//
14#ifndef DUMUX_POROUSMEDIUMFLOW_VOLUME_VARIABLES_HH
15#define DUMUX_POROUSMEDIUMFLOW_VOLUME_VARIABLES_HH
16
17namespace Dumux {
18
26template<class Traits>
28{
29 using Scalar = typename Traits::PrimaryVariables::value_type;
30
31public:
33 using PrimaryVariables = typename Traits::PrimaryVariables;
35 using Indices = typename Traits::ModelTraits::Indices;
36
38 static constexpr int numFluidPhases() { return Traits::ModelTraits::numFluidPhases(); }
40 static constexpr int numFluidComponents() { return Traits::ModelTraits::numFluidComponents(); }
41
51 template<class ElemSol, class Problem, class Element, class Scv>
52 void update(const ElemSol& elemSol,
53 const Problem& problem,
54 const Element& element,
55 const Scv& scv)
56 {
57 priVars_ = elemSol[scv.localDofIndex()];
58 extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol);
59 }
60
65 { return priVars_; }
66
72 Scalar priVar(const int pvIdx) const
73 { return priVars_[pvIdx]; }
74
84 Scalar extrusionFactor() const
85 { return extrusionFactor_; }
86
87private:
88 PrimaryVariables priVars_;
89 Scalar extrusionFactor_;
90};
91
92} // end namespace Dumux
93
94#endif
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:28
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:40
Scalar priVar(const int pvIdx) const
Returns a component of primary variable vector.
Definition: porousmediumflow/volumevariables.hh:72
Scalar extrusionFactor() const
Returns how much the sub-control volume is extruded.
Definition: porousmediumflow/volumevariables.hh:84
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:64
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition: porousmediumflow/volumevariables.hh:38
void update(const ElemSol &elemSol, const Problem &problem, const Element &element, const Scv &scv)
Updates all quantities for a given control volume.
Definition: porousmediumflow/volumevariables.hh:52
typename Traits::PrimaryVariables PrimaryVariables
Export the type used for the primary variables.
Definition: porousmediumflow/volumevariables.hh:33
typename Traits::ModelTraits::Indices Indices
Export the type encapsulating primary variable indices.
Definition: porousmediumflow/volumevariables.hh:35
Definition: adapt.hh:17