version 3.10-dev
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// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
13#ifndef DUMUX_LOWREKEPSILON_VOLUME_VARIABLES_HH
14#define DUMUX_LOWREKEPSILON_VOLUME_VARIABLES_HH
15
18
19namespace Dumux {
20
25template <class Traits, class NSVolumeVariables>
27: public RANSVolumeVariables<Traits, NSVolumeVariables>
28{
30
31 using Scalar = typename Traits::PrimaryVariables::value_type;
32
33public:
35 using Indices = typename Traits::ModelTraits::Indices;
36
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 RANSParentType::updateNavierStokesVolVars(elemSol, problem, element, scv);
53 updateRANSProperties(elemSol, problem, element, scv);
54 }
55
66 template<class ElementSolution, class Problem, class Element, class SubControlVolume>
67 void updateRANSProperties(const ElementSolution &elemSol,
68 const Problem &problem,
69 const Element &element,
70 const SubControlVolume& scv)
71 {
72 RANSParentType::updateRANSProperties(elemSol, problem, element, scv);
73 turbulentKineticEnergy_ = elemSol[0][Indices::turbulentKineticEnergyIdx];
74 dissipationTilde_ = elemSol[0][Indices::dissipationIdx];
75 storedDissipationTilde_ = problem.storedDissipationTilde(RANSParentType::elementIdx());
76 storedTurbulentKineticEnergy_ = problem.storedTurbulentKineticEnergy(RANSParentType::elementIdx());
77 stressTensorScalarProduct_ = problem.stressTensorScalarProduct(RANSParentType::elementIdx());
78 if (problem.useStoredEddyViscosity())
79 RANSParentType::setDynamicEddyViscosity_(problem.storedDynamicEddyViscosity(RANSParentType::elementIdx()));
80 else
84 }
85
90 {
93 }
94
99 { return turbulentKineticEnergy_; }
100
104 Scalar dissipationTilde() const
105 { return dissipationTilde_; }
106
112
117 { return storedDissipationTilde_; }
118
124
126 const Scalar reT() const
127 {
130 }
131
133 const Scalar reY() const
134 {
135 using std::sqrt;
138 }
139
141 const Scalar cMu() const
142 { return 0.09; }
143
145 const Scalar sigmaK() const
146 { return 1.0; }
147
149 const Scalar sigmaEpsilon() const
150 { return 1.3; }
151
153 const Scalar cOneEpsilon() const
154 { return 1.35; }
155
157 const Scalar cTwoEpsilon() const
158 { return 1.8; }
159
161 const Scalar dValue() const
162 {
165 }
166
168 const Scalar fMu() const
169 {
170 using std::exp;
171 return 1.0 - exp(-0.0115 * RANSParentType::yPlus());
172 }
173
175 const Scalar fOne() const
176 { return 1.0; }
177
179 const Scalar fTwo() const
180 {
181 using std::exp;
182 return 1.0 - 0.22 * exp(-1.0 * (reT() * reT() / 6.0 / 6.0));
183 }
184
186 const Scalar eValue() const
187 {
188 using std::exp;
191 * exp(-0.5 * RANSParentType::yPlus());
192 }
193
194protected:
196 Scalar dissipationTilde_ = 0.0;
200};
201
202} // end namespace Dumux
203
204#endif
Volume variables for the isothermal single-phase low-Re k-epsilons model.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:28
Scalar storedTurbulentKineticEnergy_
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:197
const Scalar sigmaK() const
Returns the constant.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:145
Scalar turbulentKineticEnergy() const
Returns the turbulent kinetic energy .
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:98
Scalar storedTurbulentKineticEnergy() const
Returns the turbulent kinetic energy .
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:110
Scalar dissipationTilde() const
Returns an effective dissipation .
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:104
Scalar stressTensorScalarProduct_
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:199
typename Traits::ModelTraits::Indices Indices
export the indices type
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:35
const Scalar fOne() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:175
const Scalar cTwoEpsilon() const
Returns the constant.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:157
const Scalar fTwo() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:179
Scalar turbulentKineticEnergy_
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:195
Scalar stressTensorScalarProduct() const
Returns the scalar product of the stress tensor.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:122
const Scalar cMu() const
Returns the constant.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:141
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:47
Scalar storedDissipationTilde() const
Returns an effective dissipation .
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:116
const Scalar reT() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:126
Scalar storedDissipationTilde_
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:198
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:67
const Scalar eValue() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:186
Scalar calculateEddyViscosity()
Returns the dynamic eddy viscosity .
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:89
Scalar dissipationTilde_
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:196
const Scalar cOneEpsilon() const
Returns the constant.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:153
const Scalar dValue() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:161
const Scalar sigmaEpsilon() const
Returns the constant.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:149
const Scalar fMu() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:168
const Scalar reY() const
Returns the value.
Definition: freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh:133
Volume variables for the isothermal single-phase Reynolds-Averaged Navier-Stokes models.
Definition: freeflow/rans/volumevariables.hh:30
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:53
Scalar setDynamicEddyViscosity_(Scalar value)
Sets the dynamic eddy viscosity .
Definition: freeflow/rans/volumevariables.hh:254
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:73
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:108
std::string density(int phaseIdx) noexcept
I/O name of density for multiphase systems.
Definition: name.hh:53
Definition: adapt.hh:17
The infrastructure to retrieve run-time parameters from Dune::ParameterTrees.