0% found this document useful (0 votes)
11 views

Example Six

Uploaded by

Danut Stanciu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views

Example Six

Uploaded by

Danut Stanciu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Tutorial Six

Turbulence – Steady State

6th edition, April 2023

This offering is not approved or endorsed by ESI® Group, ESI-OpenCFD® or the OpenFOAM®
Foundation, the producer of the OpenFOAM® software and owner of the OpenFOAM® trademark.
OpenFOAM® Basic Training

Tutorial Six

Editorial board: Contributors:


 Bahram Haddadi  Bahram Haddadi
 Christian Jordan  Clemens Gößnitzer
 Michael Harasek  Jozsef Nagy
Compatibility:  Vikram Natarajan
 OpenFOAM® v10  Sylvia Zibuschka
 Yitong Chen
Cover picture from:
 Bahram Haddadi

Attribution-NonCommercial-ShareAlike 3.0 Unported (CC BY-NC-SA 3.0)


This is a human-readable summary of the Legal Code (the full license).
Disclaimer
You are free:
 to Share — to copy, distribute and transmit the work
 to Remix — to adapt the work
Under the following conditions:
 Attribution — you must attribute the work in the manner specified by the author or
licensor (but not in any way that suggests that, they endorse you or your use of the
work).
 Noncommercial — you may not use this work for commercial purposes.
 Share Alike — if you alter, transform, or build upon this work, you may distribute the
resulting work only under the same or similar license to this one.
With the understanding that:
 Waiver — any of the above conditions can be waived if you get permission from the
copyright holder.
 Public Domain — where the work or any of its elements is in the public domain under
applicable law, that status is in no way affected by the license.
 Other Rights — In no way are any of the following rights affected by the license:
 Your fair dealing or fair use rights, or other applicable copyright exceptions and
limitations;
 The author's moral rights;
 Rights other persons may have either in the work itself or in how the work is used,
such as publicity or privacy rights.
 Notice — for any reuse or distribution, you must make clear to others the license
terms of this work. The best way to do this is with a link to this web page.

ISBN 978-3-903337-02-2
Publisher: chemical-engineering.at
Available from: www.fluiddynamics.at
OpenFOAM® Basic Training

Tutorial Six

Background

1. Why turbulence modeling?


Many engineering applications are turbulent. Turbulence is a highly transient
phenomenon, characterized by a wide range of eddy sizes. One can solve
these eddies numerically and obtain a full profile of the turbulent flow field.
However, this is not possible, as it requires a huge amount of computational
effort. Hence, we require a turbulence model.
An important feature in turbulence modeling is averaging, which simplifies the
solution of the governing equations of turbulence. As calculating resources are
limited, it is usually not possible to model the phenomena with desired grid and
time resolution, so to represent scales of the flow that are not resolved by the
grid models need to be applied.
There are different types of turbulence models:
 RANS-based models:
o Linear eddy-viscosity models
 Algebraic models
 One and two equation models
o Non-linear eddy viscosity models and algebraic stress models
o Reynolds stress transport models
 Large eddy simulations
 Detached eddy simulations and other hybrid models
In this tutorial, RANS-based model is explained in detail. In the next tutorial,
large eddy simulations (LES) and Smagorinsky-Lilly model will be covered.

2. RANS-based models
The governing equations for a Newtonian fluid are:
 Conservation of mass
𝜕𝜌
+ ∇ ∙ (𝜌𝒖
̃) = 0
𝜕𝑡
 Conservation of momentum (Navier-Stokes equation)
𝜕(𝜌𝑢̃𝑖 ) 𝜕𝑝̃
+ ∇ ∙ (𝜌𝑢̃𝑖 𝒖
̃) = − + ∇ ∙ (𝜇∇𝑢̃𝑖 ) + 𝑆̃𝑀𝑖
𝜕𝑡 𝜕𝑥𝑖

 Conservation of passive scalars (given a scalar 𝑒̃ )


𝜕(𝜌𝑒̃ )
̃ ) = ∇ ∙ (𝑘∇𝑇̃) + 𝑆̃𝑒
+ ∇ ∙ (𝜌𝑒̃ 𝒖
𝜕𝑡
Note: suffix notation is used in the conservation of momentum equation for
simplicity, with 𝑖 = 1 corresponding to the x-direction, 𝑖 = 2 the y-direction and
𝑖 = 3 the z-direction.
OpenFOAM® Basic Training

Tutorial Six

One of the solutions to the problem is to reduce the number of scales (from
infinity to 1 or 2) by using the Reynolds decomposition. Any property (whether
a vector or a scalar) can be written as the sum of an average and a fluctuation,
i.e. 𝜑̃ = Φ + φ where the capital letter denotes the average and the lower case
letter denotes the fluctuation of the property. Using the Reynolds decomposition
in the Navier-Stokes equations, we obtain RANS or Reynolds Averaged Navier
Stokes Equations.
 Average conservation of mass
𝜕𝜌
+ ∇ ∙ (𝜌𝐔) = 0
𝜕𝑡
 Average conservation of momentum
𝜕(𝜌U𝑖 ) 𝜕𝑃 𝜕(𝜌𝑢𝑢
̅̅̅̅̅)
𝑖 𝜕(𝜌𝑣𝑢
̅̅̅̅̅)
𝑖 𝜕(𝜌𝑤𝑢
̅̅̅̅̅)
𝑖
+ ∇ ∙ (𝜌U𝑖 𝐔) = − + ∇ ∙ (𝜇U𝑖 ) − ( + + ) + S𝑀𝑖
𝜕𝑡 𝜕𝑥𝑖 𝜕𝑥 𝜕𝑦 𝜕𝑧

 Average conservation of passive scalars (given a scalar 𝑒̃ )


𝜕(𝜌E) 𝜕(𝜌𝑢𝑒
̅̅̅) 𝜕(𝜌𝑣𝑒
̅̅̅) 𝜕(𝜌𝑤𝑒
̅̅̅̅)
+ ∇ ∙ (𝜌EU) = ∇ ∙ (𝑘∇T) − ( + + ) + S𝑒
𝜕𝑡 𝜕𝑥 𝜕𝑦 𝜕𝑧

Note: a special property of the Reynolds decomposition is that the average of


the fluctuating component is identically zero, a fact that is used in the derivation
of the above equations.
However, by using the Reynolds decomposition, there are new unknowns that
were introduced such as the turbulent stresses (𝜌𝑢𝑢 ̅̅̅̅, 𝜌𝑣𝑢
̅̅̅̅, 𝜌𝑤𝑢
̅̅̅̅, 𝜌𝑢𝑣
̅̅̅̅, 𝜌𝑣𝑣
̅̅̅, 𝜌𝑤𝑣
̅̅̅̅,
𝜌𝑢𝑤
̅̅̅̅, 𝜌𝑣𝑤
̅̅̅̅, 𝜌𝑤𝑤
̅̅̅̅̅) and turbulent fluxes (𝜌𝑢𝑒
̅̅̅, 𝜌𝑣𝑒
̅̅̅, 𝜌𝑤𝑒
̅̅̅̅) and therefore, the RANS
equations describe an open set of equations (where the over bar denotes an
average). The need for additional equations to model the new unknowns is
called Turbulence Modeling.
We now have 9 additional unknowns (6 Reynolds stresses and 3 turbulent
fluxes). In total, for the simplest turbulent flow (including the transport of a scalar
passive scalar, e.g. temperature when heat transfer is involved) there are 14
unknowns (include u, v, w, p, T)!
One possible approach to model the additional unknowns is to use the PDEs
for the turbulent stresses and fluxes as a guide to modeling. The turbulent
models are as follows, in order of increasing complexity:
 Algebraic (zero equation) models: mixing length (first order model)
 One equation models: k‐model, μt‐model (first order model)
 Two equation models: k‐ε, k‐kl, k‐ω, low Re k‐ε (first order model)
 Algebraic stress models: ASM (second order model)
 Reynolds stress models: RSM (second order model)
 Zero‐Equation Models
In OpenFOAM®, there are two simulation types for turbulence flow, RAS and
LES. As the name suggest, the RAS simulation is based on the RANS-based
models covered above and will be the sole focus of this tutorial. In the next
OpenFOAM® Basic Training

Tutorial Six

tutorial, we will move on to LES modeling and compare the results generated
from these two modeling types.
OpenFOAM® Basic Training

Tutorial Six

simpleFoam – pitzDaily

Tutorial outline
Use simpleFoam solver, run a steady state simulation with following turbulence
models:
 kEpsilon (RAS)
 kOmega (RAS)

Objectives
 Understanding turbulence modeling
 Understanding steady state simulation

Data processing
Show the results of U and the turbulent viscosity in two separate contour plots.
OpenFOAM® Basic Training

Tutorial Six

1. Pre-processing

1.1. Copying tutorial

$FOAM_TUTORIALS/incompressible/simpleFoam/pitzDaily

1.2. 0 directory
When a turbulent model is chosen, the value of its constants and its boundary
values should be set in the appropriate files. For example in kEpsilon model the
k and epsilon files should be edited. See below for the epsilon file (in the 0
folder):
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//

dimensions [0 2 -3 0 0 0 0];

internalField uniform 14.855;

boundaryField
{
inlet
{
type fixedValue;
value uniform 14.855;
}
outlet
{
type zeroGradient;
}
upperWall
{
type epsilonWallFunction;
value uniform 14.855;
}
lowerWall
{
type epsilonWallFunction;
value uniform 14.855;
}
frontAndBack
{
type empty;
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//

Note: Here is a list of files, which should be available at 0 directory and need to
be modified for each turbulence model:
 laminar: no file
 kEpsilon (RAS): k and epsilon
 kOmega (RAS): k and omega
 LRR (RAS): k, epsilon and R
 Smagorinsky (LES): s
 kEqn (LES): k and s
OpenFOAM® Basic Training

Tutorial Six

 SpalartAllmaras (LES): nuSgs and nuTilda


Some files are available, e.g. epsilon, k and nuTilda, some files should be
created by the user, e.g. R, nuSgs. Templates for these files can be also found
in the examples of older versions of OpenFOAM®, e.g. 1.7.1.

1.3. constant directory


In the momentumTransport file, the simulationType can be set as either RAS,
LES or laminar. Then the corresponding sub-dictionary of the chosen
simulation type needs to be defined. In this case, the sub-dictionary for RAS
contains information about the chosen RAS model (kEpsilon), and the status of
turbulence and printCoeffs are turned to on.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//

simulationType RAS;

RAS
{
// Tested with kEpsilon, realizableKE, kOmega, kOmegaSST, v2F,
// ShihQuadraticKE, LienCubicKE.
model kEpsilon;

turbulence on;

printCoeffs on;

viscosityModel Newtonian;
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//

Note: For the laminar model, set turbulence and printCoeffs to off.

1.4. system directory


Note: Since it is a steady state simulation, endTime in controlDict shows the
number of iterations instead of time and deltaT should be 1, because it is the
amount of increase in the iteration number.
For other models such as LRR model, discretization model for the new
variables (e.g. R) needs to be specified. It is done through the fvSchemes file,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//

ddtSchemes
{
default steadyState;
}

gradSchemes
{
default Gauss linear;
}

divSchemes
{
default none;
OpenFOAM® Basic Training

Tutorial Six

div(phi,U) bounded Gauss linearUpwind grad(U);


div(phi,k) bounded Gauss limitedLinear 1;
div(phi,epsilon) bounded Gauss limitedLinear 1;
div(phi,omega) bounded Gauss limitedLinear 1;
div(phi,v2) bounded Gauss limitedLinear 1;
div(phi,R) bounded Gauss limitedLinear 1;
div(R) Gauss linear;
div((nuEff*dev2(T(grad(U))))) Gauss linear;
div(nonlinearStress) Gauss linear;
}

laplacianSchemes
{
default Gauss linear corrected;
}

interpolationSchemes
{
default linear;
}

snGradSchemes
{
default corrected;
}

wallDist
{
Method meshWave;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//

Furthermore, fvSolution needs to be changed due to the new parameters (e.g.


for R the solver type and settings needs to be defined).
2. Running simulation

>blockMesh

>simpleFoam

Note: When the solution converges, “SIMPLE solution converged in …


iterations” message will be displayed in the Shell window. If nothing happens
and you do not see a message after a while (this is not the case in here, it
converges after a short time), then you should check the residuals which are
displayed in the Shell window manually (you should check initial residual
values, it shows the difference between this iteration and the last one), if all of
the Initial residual (see below) values are close to amounts you have set
in the fvSolution then you can stop simulation (ctrl+c).
Time = 298

smoothSolver: Solving for Ux, Initial residual = 0.00013831, Final residual =


9.28001e-06, No Iterations 6
smoothSolver: Solving for Uy, Initial residual = 0.000977894, Final residual =
6.73868e-05, No Iterations 6
GAMG: Solving for p, Initial residual = 0.00192871, Final residual =
0.000174838, No Iterations 7
time step continuity errors : sum local = 0.000840075, global = 6.13868e-05,
cumulative = -0.193739
smoothSolver: Solving for epsilon, Initial residual = 0.000175322, Final
residual = 1.138e-05, No Iterations 2
smoothSolver: Solving for k, Initial residual = 0.000404928, Final residual =
2.99083e-05, No Iterations 2
OpenFOAM® Basic Training

Tutorial Six

ExecutionTime = 56.7 s ClockTime = 57 s

SIMPLE solution converged in 298 iterations

3. Post-processing
The simulation results are as follows (all simulations scaled to the same range):

RAS
Velocity magnitude Turbulent viscosity
model

kEpsilon

kOmega

Velocity magnitude and turbulent viscosity for different RAS models


OpenFOAM® Basic Training

Tutorial Six

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy