Example Six
Example Six
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
ISBN 978-3-903337-02-2
Publisher: chemical-engineering.at
Available from: www.fluiddynamics.at
OpenFOAM® Basic Training
Tutorial Six
Background
2. RANS-based models
The governing equations for a Newtonian fluid are:
Conservation of mass
𝜕𝜌
+ ∇ ∙ (𝜌𝒖
̃) = 0
𝜕𝑡
Conservation of momentum (Navier-Stokes equation)
𝜕(𝜌𝑢̃𝑖 ) 𝜕𝑝̃
+ ∇ ∙ (𝜌𝑢̃𝑖 𝒖
̃) = − + ∇ ∙ (𝜇∇𝑢̃𝑖 ) + 𝑆̃𝑀𝑖
𝜕𝑡 𝜕𝑥𝑖
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𝑀𝑖
𝜕𝑡 𝜕𝑥𝑖 𝜕𝑥 𝜕𝑦 𝜕𝑧
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
$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];
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
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.
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
default none;
OpenFOAM® Basic Training
Tutorial Six
laplacianSchemes
{
default Gauss linear corrected;
}
interpolationSchemes
{
default linear;
}
snGradSchemes
{
default corrected;
}
wallDist
{
Method meshWave;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//
>blockMesh
>simpleFoam
Tutorial Six
3. Post-processing
The simulation results are as follows (all simulations scaled to the same range):
RAS
Velocity magnitude Turbulent viscosity
model
kEpsilon
kOmega
Tutorial Six