3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
freeflow/rans/twoeq/lowrekepsilon/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 *****************************************************************************/
25#ifndef DUMUX_LOWREKEPSILON_VOLUME_VARIABLES_HH
26#define DUMUX_LOWREKEPSILON_VOLUME_VARIABLES_HH
27
30
31namespace Dumux {
32
37template <class Traits, class NSVolumeVariables>
39: public RANSVolumeVariables<Traits, NSVolumeVariables>
40{
42
43 using Scalar = typename Traits::PrimaryVariables::value_type;
44
45public:
48
58 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
59 void update(const ElementSolution &elemSol,
60 const Problem &problem,
61 const Element &element,
62 const SubControlVolume& scv)
63 {
64 RANSParentType::updateNavierStokesVolVars(elemSol, problem, element, scv);
65 updateRANSProperties(elemSol, problem, element, scv);
66 }
67
78 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
79 void updateRANSProperties(const ElementSolution &elemSol,
80 const Problem &problem,
81 const Element &element,
82 const SubControlVolume& scv)
83 {
84 RANSParentType::updateRANSProperties(elemSol, problem, element, scv);
85 turbulentKineticEnergy_ = elemSol[0][Indices::turbulentKineticEnergyIdx];
86 dissipationTilde_ = elemSol[0][Indices::dissipationIdx];
87 storedDissipationTilde_ = problem.storedDissipationTilde_[RANSParentType::elementIdx()];
88 storedTurbulentKineticEnergy_ = problem.storedTurbulentKineticEnergy_[RANSParentType::elementIdx()];
89 stressTensorScalarProduct_ = problem.stressTensorScalarProduct_[RANSParentType::elementIdx()];
90 if (problem.useStoredEddyViscosity_)
91 RANSParentType::setDynamicEddyViscosity_(problem.storedDynamicEddyViscosity_[RANSParentType::elementIdx()]);
92 else
96 }
97
102 {
105 }
106
111 {
113 }
114
118 Scalar dissipationTilde() const
119 {
120 return dissipationTilde_;
121 }
122
127 {
129 }
130
135 {
137 }
138
143 {
145 }
146
148 const Scalar reT() const
149 {
152 }
153
155 const Scalar reY() const
156 {
157 using std::sqrt;
160 }
161
163 const Scalar cMu() const
164 { return 0.09; }
165
167 const Scalar sigmaK() const
168 { return 1.0; }
169
171 const Scalar sigmaEpsilon() const
172 { return 1.3; }
173
175 const Scalar cOneEpsilon() const
176 { return 1.35; }
177
179 const Scalar cTwoEpsilon() const
180 { return 1.8; }
181
183 const Scalar dValue() const
184 {
187 }
188
190 const Scalar fMu() const
191 {
192 using std::exp;
193 using std::pow;
194 return 1.0 - exp(-0.0115 * RANSParentType::yPlus());
195 }
196
198 const Scalar fOne() const
199 { return 1.0; }
200
202 const Scalar fTwo() const
203 {
204 using std::exp;
205 return 1.0 - 0.22 * exp(-1.0 * (reT() * reT() / 6.0 / 6.0));
206 }
207
209 const Scalar eValue() const
210 {
211 using std::exp;
214 * exp(-0.5 * RANSParentType::yPlus());
215 }
216
217protected:
219 Scalar dissipationTilde_ = 0.0;
223};
224
225} // end namespace Dumux
226
227#endif
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag Indices
Definition: porousmediumflow/sequential/properties.hh:59
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:65
Volume variables for the isothermal single-phase low-Re k-epsilons model.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:40
Scalar storedTurbulentKineticEnergy_
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:220
const Scalar sigmaK() const
Returns the constant.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:167
Scalar turbulentKineticEnergy() const
Returns the turbulent kinetic energy .
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:110
Scalar storedTurbulentKineticEnergy() const
Returns the turbulent kinetic energy .
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:126
Scalar dissipationTilde() const
Returns an effective dissipation .
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:118
Scalar stressTensorScalarProduct_
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:222
typename Traits::ModelTraits::Indices Indices
export the indices type
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:47
const Scalar fOne() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:198
const Scalar cTwoEpsilon() const
Returns the constant.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:179
const Scalar fTwo() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:202
Scalar turbulentKineticEnergy_
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:218
Scalar stressTensorScalarProduct() const
Returns the scalar product of the stress tensor.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:142
const Scalar cMu() const
Returns the constant.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:163
void update(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all quantities for a given control volume.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:59
Scalar storedDissipationTilde() const
Returns an effective dissipation .
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:134
const Scalar reT() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:148
Scalar storedDissipationTilde_
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:221
void updateRANSProperties(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all turbulent quantities for a given control volume.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:79
const Scalar eValue() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:209
Scalar calculateEddyViscosity()
Returns the dynamic eddy viscosity .
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:101
Scalar dissipationTilde_
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:219
const Scalar cOneEpsilon() const
Returns the constant.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:175
const Scalar dValue() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:183
const Scalar sigmaEpsilon() const
Returns the constant.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:171
const Scalar fMu() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:190
const Scalar reY() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:155
Volume variables for the isothermal single-phase Reynolds-Averaged Navier-Stokes models.
Definition: freeflow/rans/volumevariables.hh:42
void calculateEddyThermalConductivity(const Problem &problem)
Calculates the eddy thermal conductivity based on the kinematic eddy viscosity and the turbulent Pra...
Definition: freeflow/rans/volumevariables.hh:209
Scalar wallDistance() const
Return the wall distance of the control volume.
Definition: freeflow/rans/volumevariables.hh:138
Scalar yPlus() const
Return the dimensionless wall distance .
Definition: freeflow/rans/volumevariables.hh:156
void updateNavierStokesVolVars(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all quantities for a given control volume.
Definition: freeflow/rans/volumevariables.hh:65
Scalar setDynamicEddyViscosity_(Scalar value)
Sets the dynamic eddy viscosity .
Definition: freeflow/rans/volumevariables.hh:259
Scalar kinematicViscosity() const
Return the kinematic viscosity of the fluid within the control volume.
Definition: freeflow/rans/volumevariables.hh:190
void updateRANSProperties(const ElementSolution &elemSol, const Problem &problem, const Element &element, const SubControlVolume &scv)
Update all turbulent quantities for a given control volume.
Definition: freeflow/rans/volumevariables.hh:85
void calculateEddyDiffusivity(const Problem &problem)
Calculates the eddy diffusivity based on the kinematic eddy viscosity and the turbulent Schmidt numb...
Definition: freeflow/rans/volumevariables.hh:198
unsigned int elementIdx() const
Return the element Idx of the control volume.
Definition: freeflow/rans/volumevariables.hh:114