Steady Openfoam
Steady Openfoam
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
Background
1. Why turbulence modeling?
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
o Conservation of mass
( ̃)
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.
( )
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.
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:
Two equation models: k‐ε, k‐kl, k‐ω, low Re k‐ε (first 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 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
Simulation
Use simpleFoam solver, run a steady state simulation with following turbulence
models:
kEpsilon (RAS)
kOmega (RAS)
LRR (RAS)
Objectives
Understanding turbulence modeling
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.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:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//
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
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.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//
simulationType RAS;
RAS
{
RASModel kEpsilon;
turbulence on;
printCoeffs on;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//
Note: For the laminar model, set turbulence and printCoeffs to off.
For the LRR model, discretization model for the new variable R needs to be specified.
It is done through the fvSchemes file,
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* * * * * *//
ddtSchemes
{
default steadyState;
}
gradSchemes
{
default Gauss linear;
}
divSchemes
{
OpenFOAM® Basic Training
Tutorial Six
default none;
div(phi,U) bounded Gauss linearUpwind gradf(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 R parameter. The solver
type for R is defined, in this case the solver used will be the same as the one for other
variables (U, k, epsilon, omega).
2. Running simulation
>blockMesh
>simpleFoam
3. Post-processing
The simulation results are as follows (all simulations scaled to the same range):
RAS
Velocity magnitude Turbulent viscosity
model
kEpsilon
kOmega
LRR