Turbulence Openfoam PDF
Turbulence Openfoam PDF
Examensarbete 15 hp
December 2014
André Hedlund
1 Introduction 2
3 Simulation 11
3.1 Test case setup . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.1 The mesh . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.1.2 Boundary and initial conditions . . . . . . . . . . . . . 12
3.1.3 Low Re-model setup . . . . . . . . . . . . . . . . . . . 14
3.1.4 High Re-model setup . . . . . . . . . . . . . . . . . . . 14
3.2 Convergence of the residuals . . . . . . . . . . . . . . . . . . . 15
4 Results 16
4.1 RANS model investigation . . . . . . . . . . . . . . . . . . . . 16
4.1.1 Low Re-models . . . . . . . . . . . . . . . . . . . . . . 16
4.1.2 High Re-models . . . . . . . . . . . . . . . . . . . . . . 18
4.2 Grid convergence study . . . . . . . . . . . . . . . . . . . . . 20
Acknowledgment 25
1
1 Introduction
Turbulence occur in many natural flows and is of paramount importance in
many engineering applications. The Navier-Stokes equations describe the
dynamics of fluids and can rarely be solved analytically. For this reason, we
are to a large extent dependent on numerical simulation for making fluid
predictions. Flow at a sufficiently low Reynolds (Re) number is laminar and
the Navier-Stokes equations can then be numerically solved directly. For
high Re-numbers, which typically occur in applications, the flow is turbulent
and hence consists of fluid motion with a wide range of spatial and temporal
scales. To numerically solve a turbulent flow it is important resolve the
flow such that the smallest scales can be represented, therefore a direct
numerical simulation (DNS) of turbulent flow is very costly and in most
cases unfeasible, see [1]. In the Reynolds-averaged Navier-Stokes (RANS)
formulation, the velocity is decomposed into the mean velocity distribution,
and the fluctuations around this mean. The equations are then solved for the
mean velocity, and the e↵ect of the fluctuations is modelled, see [2]. With
this approach it is not necessary to resolve the smallest turbulent scales –
and the computational cost can therefore be reduced significantly.
Channel flow is the case when a fluid flows between two parallel plates,
such as a rectangular duct. Turbulent channel flow is a well investigated
case both experimentally and numerically. Early DNS results for channel
flow were presented by Kim, Moin and Moser [3], and a continuation of this
work, which includes higher Re-numbers, where presented by Moser, Kim
and Mansour [4].
The objective of this report is to evaluate the performance of several
RANS models for incompressible turbulent fully developed channel flow.
The focus is to evaluate the models with respect to the velocity profile,
turbulent kinetic energy profile and wall shear stress, and if it is possible
rank the models based on how they predict the mentioned quantities. The
results will be compared with theoretical approximations (law of the wall)
and the DNS results of Moser, Kim and Mansour [4].
The simulations are carried out with the OpenFOAM toolbox, an open
source software for solving continuum mechanics problems [5]. There are
several RANS models implemented in OpenFOAM and each model has been
developed with a di↵erent objective in mind. This report will not try to
explain in depth why a certain model fails or succeeds in approximating the
quantities investigated, it will simply state that a model failed or succeeded.
The results from the simulation and the OpenFOAM case setups are
publicly available at https://github.com/AndreHed/channelFlow.git.
2
2 Theory of turbulence modelling
This section describes the theory of turbulent flows necessary for describing
turbulence modelling for fully developed channel flow.
The continuity equation is given by
r·U=0 (1)
@ hUi i
= 0. (5)
@xi
Taking the mean of equation (2) yields
3
symmetric tensor) without introducing additional equations, thus we have
ten unknowns and only four equations – the system is therefore not closed. [2]
Half of the trace of the Reynolds stress is called the turbulent kinetic
energy
1
k ⌘ hui ui i . (7)
2
The turbulent kinetic energy can be described as the kinetic energy per
unit mass in the oscillating velocity field. It will be used frequently in the
remaining of the report and is one of the quantities that is investigated.
where ⌫e↵ = ⌫+⌫T . Comparing this result with equation (2) we can conclude
that they are of the same form, therefore, if ⌫T is specified the modified
Reynolds equation (eq. (9)) is now in closed form.
There are two concerns with the hypothesis that should be discussed,
It has been proved that, unfortunately, the accuracy of the turbulent vis-
cosity hypothesis is poor for many flows, however it still serves a purpose
since it is reasonable for some simple flows. The turbulent viscosity can be
written as
⌫ T = l ⇤ u⇤ , (10)
where di↵erent approaches for specifying the length l⇤ and the velocity u⇤
are presented in the following sections. [1]
4
y
Flow h=2
x
z
stationary and one-dimensional. Using the notation (U, V, W ) for the ve-
locity field, it is easy to conclude that hW i = 0. The Re-number for this
flow is given by
Ū · 2
Re = , (11)
⌫
where Ū is the bulk velocity defined as
Z
1
Ū ⌘ hU i dy. (12)
0
Because of the simplicity of the flow the mean continuity equation (eq. (5))
and the mean momentum equations (eq. (6)) can be greatly simplified. Using
the fact that hW i = 0 and that hU i is independent of x the mean continuity
equation reduces to
@Ui d hV i
= = 0. (13)
@xi dy
The boundary condition at the walls are hV iy=0 = hV iy=2 = 0, therefore
we obtain that hV i is zero for all y.
The lateral mean momentum equation is deduced to
⌦ ↵
1 d hpi d v 2
+ =0 (14)
⇢ dy dy
by noting that the nonlinear terms are neglectable due to the boundary-layer
approximation and that the axial derivatives of the Reynolds stresses are
small
⌦ 2 ↵ compared with the lateral derivatives. With the boundary condition
v y=0 = 0 we obtain
1 ⌦ ↵ 1
hpi + v 2 = pw (x) (15)
⇢ ⇢
where pw (x) = hp(x, 0, 0)i. Di↵erentiating equation (15) with respect to x
yields
d hpi dpw
= . (16)
dx dx
5
The axial mean momentum equation for fully developed channel flow,
obtained in the same way as the lateral analog, is
@ @ hU i @ hpi
⇢⌫ ⇢ huvi = . (17)
@y @y @x
The total shear stress consists of the viscous stress and the Reynolds stress,
viz.
d hU i
⌧ (y) = ⇢⌫ ⇢ huvi . (18)
dy
Using equation (16)-(18) we finally obtain
@⌧ @pw
= . (19)
@y @x
Introducing ⌧w = ⌧ (0) as the wall shear stress, the boundary conditions for
equation (18) are ⌧ (0) = ⌧w and ⌧ (2 ) = ⌧w , which yields [1]
d⌧ ⌧w
= . (20)
dy
Away from the wall the viscous stress is negligible compared with the Reynolds
stress and the total shear stress is therefore described by the Reynolds stress.
In the analysis of the flow close to the wall it is useful to define several
viscous scales from the viscosity ⌫, the wall shear stress ⌧w and the density
⇢, these are summarised in table 1.
Due to the reciprocal action between the viscous stress and the Reynolds
stress, di↵erent layers can be identified in the vicinity to the wall. For y + < 5
the viscous sublayer is apparent and the velocity adheres to a linear relation
u+ = y + . (22)
6
Table 1: Viscous scales.
r
⌧w
Friction velocity u⌧ =
⇢
r
⇢ ⌫
Viscous length scale ⌫ =⌫ =
⌧w u⌧
u⌧
Friction Reynolds number Re⌧ = =
⌫ ⌫
+ y u⌧ y
Wall units y = =
⌫ ⌫
hU i
Viscous velocity u+ =
u⌧
k
Turbulent kinetic energy k+ = 2
u⌧
The region between the two layers (i.e. 5 < y + < 30) is called the bu↵er
layer; in this region neither viscous nor turbulent processes dominate. These
layers are presented in figure 2, and the theoretical laws are compared with
DNS data. [1]
7
y+ = 5 y + = 30
u+ = y +
u+ = 1 ln x + B
101 DNS
u+
100
Figure 2: The linear relation of the viscous sublayer and the logarithmic relation
of the log-law region compared with the DNS data of Moser, Kim and Mansour [4].
8
where k is a model constant.
The dissipation rate is given by
⌧
@ui @ui
"=⌫ (29)
@xj @xj
2.4.2 k ! model
The k ! model use a similar approach as the k " model, but instead of "
it uses the rate of dissipation of energy in unit volume and time, or merely
the specific dissipation rate, defined as
"
!= . (32)
k
The model equation for k is slightly modified
D̄k
= r · [(⌫ + ⌫T )rk] + P ", (33)
D̄t
and the model transport equation for ! is given by
D̄! P!
= r · [(⌫ + ⌫T )r!] + ↵ !2, (34)
D̄t k
where the constants are given by
9
the mesh is not fine enough the models described above deficiently predict
the flow behaviour close to the wall.
Wall functions are introduced to mitigate the computational cost, and
in the same time enable the model to predict accurate results. The wall
function is utilised between the wall and the mesh point closest to the wall
(matching point), and it will try to match the value at the matching point
with the law of the wall described in section 2.3. Each turbulent parameter
has its own wall function which is derived from the law of the wall.
It is important to emphasise that if the mesh is very refined (i.e. the
matching point lies before y + < 1) wall functions are not necessary. [2]
10
3 Simulation
As described in section 2.2 fully developed channel flow is a one-dimensional
problem. In OpenFOAM a case setup consists of: specifying the mesh, set-
ting the boundary and initial conditions, and specifying the physical prop-
erties. The di↵erent RANS models that are investigated in this report are
listed in table 2. The OpenFOAM solver that is used is boundaryFoam,
which is a steady-state solver for one-dimensional turbulent flows.
1m
⌫ 2 ⇥ 10 5 m2 /s
Ū 0.1335 m/s
Re 13 350
11
wall
cyclic 2 cyclic
z x wall
Figure 3: OpenFOAM setup for the one-dimensional fully developed channel flow.
12
Table 4: Wall functions
Initial conditions are required for the velocity field, k, " and !. The tur-
bulent kinetic energy is given by equation (7) which for isentropic turbulence
results in
3
k = u2 (36)
2
where the fluctuating velocity can be approximated by the product of the
bulk velocity and the turbulent intensity, viz.
u = ti Ū . (37)
For this case the turbulent intensity is approximately 5 %. The initial con-
dition for " is given by
3/4
Cµ k 3/2
"= , (38)
and for ! equations (25) and (32) yield
"
!= . (39)
Cµ k
13
In OpenFOAM the boundary and initial conditions are specified in the
0/ directory for the variables that are required. The variables required are
determined by which solver and model that is used. [6]
⌫T nutLowReWallFunction
k fixedValue = 0
" fixedValue = 0
U fixedValue = 0
Ny 400
grading 100
14
Table 6: Boundary conditions and mesh settings for high Re-models.
⌫T nutUWallFunction
k kqRWallFunction
" epsilonWallFunction
! omegaWallFunction
U fixedValue = 0
Ny 400
grading 100
1
hU i
10 k
"
10 4
Residual
10 7
10 10
10 13
10 16
0 10000 20000 30000 40000 50000
Iteration
Figure 4: The convergence of the initial residuals for the Launder-Sharma k "
model with Ny = 100.
15
4 Results
In this section the RANS models are evaluated with respect to how accurate
they predict fully developed channel flow compared with the DNS data of
Moser, Kim and Mansour [4]. A grid convergence study with respect to
the wall shear stress and velocity is also presented. The friction Reynolds
number of the investigated flow is Re⌧ = 395, which correspond to the
Reynolds number, Re ⇡ 13 350. The OpenFOAM test setups for each model
and the results gathered from the simulations are available at https://
github.com/AndreHed/channelFlow.git.
Table 7: The obtained friction velocity, friction Reynolds number and first y +
value for the low Reynolds number models.
16
20 4
u+ k+
10 2
0 0
100 101 102 0 0.2 0.4 0.6 0.8 1
y+ y/
101 1
hU i
u+
Ū
0.5
100
0
100 101 102 0 0.2 0.4 0.6 0.8 1
y+ y/
DNS; Launder-Sh.; Lam-Br.; Lien cubic; Lien-Le.
Figure 5: Simulating channel flow with low Reynolds number RANS models,
where Re = 13 350.
in plus units is accurate for all models for y + < 6, but for y + > 10 the
results vary significantly. Both the Lien cubic and Lien-Leschziner model
increase too much and at the channel centreline u+ is up to 20 percent o↵.
The Launder-Sharma and Lam-Bremhorst model is much better and deviate
approximately five percent or less at the centreline.
When the velocity is normalised with the bulk velocity the profiles are
instead inaccurate in the bu↵er layer, and at the centreline the di↵erence
is significantly less than when the results are normalised with the friction
velocity.
The results for the turbulent kinetic energy are also not accurate, espe-
cially where the maximum of the profile is. Note that an accurate result
for the velocity does not imply that the result for k is accurate as well. It
is also important to note that while the Lam-Bremhorst model produced
17
the best results for both quantities, it is the model that is the most difficult
to achieve convergence for. The other models converged with initial condi-
tions as described in section 3.1.2, whereas the Lam-Bremhorst model only
converged if the solution of one of the other models where used as initial
conditions for U , k and ", and even then the convergence of " is very slow.
18
20 4
u+ k+
10 2
0 0
100 101 102 0 0.2 0.4 0.6 0.8 1
y+ y/
101 1
hU i
u+
Ū
0.5
100
0
100 101 102 0 0.2 0.4 0.6 0.8 1
y+ y/
DNS; k!; k!SST; Spalart-Al.
Figure 6: Simulating channel flow with high Reynolds number RANS models,
where Re = 13 350.
19
20 4
u+ k+
10 2
0 0
100 101 102 0 0.2 0.4 0.6 0.8 1
y+ y/
101 1
hU i
u+
Ū
0.5
100
0
100 101 102 0 0.2 0.4 0.6 0.8 1
y+ y/
Figure 7: Simulating channel flow with high Reynolds number RANS models,
where Re = 13 350.
20
3. No grading is imposed on the mesh since that would result in non-
overlapping cell centres for the di↵erent meshes. The solution is considered
to be converged when the residuals are below 1 ⇥ 10 9 .
The convergence study is performed for the Launder-Sharma and Spalart-
Allmaras models. Both of these models did produce accurate results (see
fig. 5 and 6), and are therefore reasonable models to investigate. In table 8
the results from the convergence study are presented, and equation 40 yields
for the wall shear stress
Note that the values for the wall shear stress are divided by density The
convergence rate for the velocity vary considerably across the channel it is
therefore more reasonable to plot the convergence rate, see figure 8. For
both models extrema occur, this is explained by that the velocity profiles of
the di↵erent meshes intersect each other. At the wall the no slip boundary
condition is imposed and the expected convergence rate in the vicinity of the
wall is expected to be p = 2. It is troubling that for Launder-Sharma the
convergence rate is predominantly negative, which indicates divergence. The
result for Spalart-Allmaras is approximately two across the entire channel,
which is what is to be expected for the numerical schemes that are utilised.
Ny y+ ⌧w /mm2 s 2 iterations
Launder-Sharma 200 2.07 55.5 50 000
600 0.608 56.1 300 000
1800 0.204 56.1 1 000 000
Spalart-Allmaras 200 1.92 58.8 50 000
600 0.630 57.2 500 000
1800 0.210 57.0 2 000 000
21
4 Launder-Sharma k "
Spalart-Allmaras
2
p
4
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
y
Figure 8: The convergence rate for the velocity across the channel.
22
5 Discussion and conclusions
The previous section presented the results of a simulation campaign made
with OpenFOAM for several RANS models, and the results were compared
with the DNS results of Moser, Kim and Mansour [4]. The results di↵er
significantly between the models, and while some models produce reason-
ably good results, others fail to accurately predict the investigated quanti-
ties. Apart from the flow quantities, the results of a grid convergence study
for two models were also presented. The study verified that the Spalart-
Allmaras model had second order convergence, whereas no convergence for
the Launder-Sharma k " model could be established. Now follows a discus-
sion of the results presented and statements about each models suitability
for simulating fully developed channel flow.
The results from the low Re-models agree well with the DNS data, but
there are significant di↵erences between the models. The Launder-Sharma
and Lam-Bremhorst models predicted the wall shear stress better than the
Lien cubic and Lien-Leschziner models, while for the turbulent kinetic energy
profile the Lam-Bremhorst and Lien cubic performed better than the other
two. This could be the basis of concluding that the Lam-Bremhorst model
is the superior model for this case, but as mentioned in section 4.1.1, the
model has severe convergence problems, to the point that it only converges
if the initial conditions for hU i, k and " are mapped from the solution of
another model such as Launder-Sharma.
The results from some of the high Re-models predicted the investigated
quantities well, whereas others mispredicted the profiles to the extent that
they are not acceptable. The first distinction that can be made between
the models, is that the models based on the transport equations for k and
" did not predict hU i, k and ⌧w very well, whereas the models based on the
transport equations for k and ! performed much better. The implementa-
tion of the k ! model in OpenFOAM is based on Wilcox’s (1988) k !
model (see OpenFOAM source code available at [5]). This implementation
is known to accurately predict the flow properties for wall bounded flow [2,
p. 128]. Since channel flow is a wall bounded flow, it is reasonable that the
results, for the models based on transport equations for k and !, agrees well
with the DNS results. The k " model is known to poorly predict boundary
layers with strong pressure gradients (see [1, p. 461]), which agrees with the
fact that the models based on the transport equations for k and " did not
predict the flow properties very well.
A surprising result is that the Spalart-Allmaras model performed very
well. Of the models that are investigated the Spalart-Allmaras model is
the only one-equation model and therefore the model with the simplest
turbulence description. The model predicted the velocity profile just as
accurately as the k ! and k ! SST.
The results of the “hvi2 f ” model are not good, which could be the
23
result of an incorrect setup for the model, therefore the results presented in
the report may not be representative for the model. A peculiar notion is that
the model is sensitive to the initial conditions, where a small perturbation
can produce a di↵erent solution, this has been noted before, see [7, p. 173].
The results of the models are ranked in table 9. The ranking is based
on the results presented in figures 5-7 and table 7, and only the top five
models are ranked. Based on the ranking in table 9, the RANS models that
are suitable for the simulation of fully developed channel flow are (in no
particular order): Launder-Sharma k ", k !, k ! SST and Spalart-
Allmaras.
Table 9: Ranking of the models for four di↵erent properties, the ranking is only
made for the five best models for each property. Note that ’⇤’ signifies that the
model did rank among the top five and ’-’ means that no data is available.
24
Acknowledgment
I would like to thank my supervisor Mattias Liefvendahl for providing me
with the subject of this thesis, and for his guidance in during the process of
writing this thesis. I would also like to thank Timofey Mukha for taking his
time to answer my questions and providing his insights in the subject.
25
References
[1] S. Pope, Turbulent Flows. Cambridge University Press, 2000.
26