Line |
Branch |
Exec |
Source |
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 |
|
|
// |
7 |
|
|
/*! |
8 |
|
|
* \file |
9 |
|
|
* \ingroup NavierStokesModel |
10 |
|
|
* |
11 |
|
|
* \copydoc Dumux::NavierStokesVolumeVariables |
12 |
|
|
*/ |
13 |
|
|
#ifndef DUMUX_NAVIERSTOKES_MOMENTUM_CVFE_VOLUME_VARIABLES_HH |
14 |
|
|
#define DUMUX_NAVIERSTOKES_MOMENTUM_CVFE_VOLUME_VARIABLES_HH |
15 |
|
|
|
16 |
|
|
|
17 |
|
|
namespace Dumux { |
18 |
|
|
|
19 |
|
|
/*! |
20 |
|
|
* \ingroup NavierStokesModel |
21 |
|
|
* \brief Volume variables for the single-phase Navier-Stokes model. |
22 |
|
|
*/ |
23 |
|
|
template <class Traits> |
24 |
|
6618104 |
class NavierStokesMomentumCVFEVolumeVariables |
25 |
|
|
{ |
26 |
|
|
using Scalar = typename Traits::PrimaryVariables::value_type; |
27 |
|
|
|
28 |
|
|
static_assert(Traits::PrimaryVariables::dimension == Traits::ModelTraits::dim()); |
29 |
|
|
|
30 |
|
|
public: |
31 |
|
|
//! export the type used for the primary variables |
32 |
|
|
using PrimaryVariables = typename Traits::PrimaryVariables; |
33 |
|
|
|
34 |
|
|
//! export the indices type |
35 |
|
|
using Indices = typename Traits::ModelTraits::Indices; |
36 |
|
|
|
37 |
|
|
/*! |
38 |
|
|
* \brief Update all quantities for a given control volume |
39 |
|
|
* |
40 |
|
|
* \param elemSol A vector containing all primary variables connected to the element |
41 |
|
|
* \param problem The object specifying the problem which ought to |
42 |
|
|
* be simulated |
43 |
|
|
* \param element An element which contains part of the control volume |
44 |
|
|
* \param scv The sub-control volume |
45 |
|
|
*/ |
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 |
|
8666906 |
priVars_ = elemSol[scv.indexInElement()]; |
53 |
|
26000718 |
extrusionFactor_ = problem.spatialParams().extrusionFactor(element, scv, elemSol); |
54 |
|
✗ |
} |
55 |
|
|
|
56 |
|
|
/*! |
57 |
|
|
* \brief Return how much the sub-control volume is extruded. |
58 |
|
|
* |
59 |
|
|
* This means the factor by which a lower-dimensional (1D or 2D) |
60 |
|
|
* entity needs to be expanded to get a full dimensional cell. The |
61 |
|
|
* default is 1.0 which means that 1D problems are actually |
62 |
|
|
* thought as pipes with a cross section of 1 m^2 and 2D problems |
63 |
|
|
* are assumed to extend 1 m to the back. |
64 |
|
|
*/ |
65 |
|
✗ |
Scalar extrusionFactor() const |
66 |
|
✗ |
{ return extrusionFactor_; } |
67 |
|
|
|
68 |
|
✗ |
PrimaryVariables velocity() const |
69 |
|
✗ |
{ return priVars_; } |
70 |
|
|
|
71 |
|
|
Scalar velocity(const int dirIdx) const |
72 |
|
781259596 |
{ return priVars_[dirIdx]; } |
73 |
|
|
|
74 |
|
|
/*! |
75 |
|
|
* \brief Return a component of primary variable vector |
76 |
|
|
* \param pvIdx The index of the primary variable of interest |
77 |
|
|
*/ |
78 |
|
|
Scalar priVar(const int pvIdx) const |
79 |
|
|
{ return priVars_[pvIdx]; } |
80 |
|
|
|
81 |
|
|
/*! |
82 |
|
|
* \brief Return the primary variable vector |
83 |
|
|
*/ |
84 |
|
|
const PrimaryVariables& priVars() const |
85 |
|
173758 |
{ return priVars_; } |
86 |
|
|
|
87 |
|
|
private: |
88 |
|
|
PrimaryVariables priVars_; |
89 |
|
|
Scalar extrusionFactor_; |
90 |
|
|
}; |
91 |
|
|
|
92 |
|
|
} // end namespace Dumux |
93 |
|
|
|
94 |
|
|
#endif |
95 |
|
|
|