3.4
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
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 * 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 *****************************************************************************/
26#ifndef DUMUX_POROUSMEDIUMFLOW_VOLUME_VARIABLES_HH
27#define DUMUX_POROUSMEDIUMFLOW_VOLUME_VARIABLES_HH
28
29namespace Dumux {
30
38template<class Traits>
40{
41 using Scalar = typename Traits::PrimaryVariables::value_type;
42
43public:
45 using PrimaryVariables = typename Traits::PrimaryVariables;
47 using Indices = typename Traits::ModelTraits::Indices;
48
50 static constexpr int numFluidPhases() { return Traits::ModelTraits::numFluidPhases(); }
52 static constexpr int numFluidComponents() { return Traits::ModelTraits::numFluidComponents(); }
53
63 template<class ElemSol, class Problem, class Element, class Scv>
64 void update(const ElemSol& elemSol,
65 const Problem& problem,
66 const Element& element,
67 const Scv& scv)
68 {
69 priVars_ = elemSol[scv.localDofIndex()];
70 extrusionFactor_ = problem.extrusionFactor(element, scv, elemSol);
71 }
72
77 { return priVars_; }
78
84 Scalar priVar(const int pvIdx) const
85 { return priVars_[pvIdx]; }
86
96 Scalar extrusionFactor() const
97 { return extrusionFactor_; }
98
99private:
100 PrimaryVariables priVars_;
101 Scalar extrusionFactor_;
102};
103
104} // end namespace Dumux
105
106#endif
Definition: adapt.hh:29
The isothermal base class.
Definition: porousmediumflow/volumevariables.hh:40
static constexpr int numFluidComponents()
Return number of components considered by the model.
Definition: porousmediumflow/volumevariables.hh:52
Scalar priVar(const int pvIdx) const
Returns a component of primary variable vector.
Definition: porousmediumflow/volumevariables.hh:84
Scalar extrusionFactor() const
Returns how much the sub-control volume is extruded.
Definition: porousmediumflow/volumevariables.hh:96
const PrimaryVariables & priVars() const
Returns the vector of primary variables.
Definition: porousmediumflow/volumevariables.hh:76
static constexpr int numFluidPhases()
Return number of phases considered by the model.
Definition: porousmediumflow/volumevariables.hh:50
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:64
typename Traits::PrimaryVariables PrimaryVariables
Export the type used for the primary variables.
Definition: porousmediumflow/volumevariables.hh:45
typename Traits::ModelTraits::Indices Indices
Export the type encapsulating primary variable indices.
Definition: porousmediumflow/volumevariables.hh:47