## Large Eddy Simulation of Pipe flow using FLUENT 14.0

Hello,

This post describes the methodology of setting up and running a LES simulation  in ANSYS-FLUENT, a very brief description about the meshing and solution procedure is presented here. Compared to RANS, LES simulations require finer grids since it aims in resolving the large scales of turbulent motion thus providing a better insight of the flow physics however LES is a transient simulation and the computation cost of LES much higher than that of RANS, for a detailed review please see :

1.) Piomelli, A primer on DNS/LES.

2.) Grid-point requirements for large eddy simulation: Chapman's estimates revisited. H. Choi and P. Moin. Physics of Fluids, 24(1), 2012

(also see the original Chapman's paper in the late '70s ~78-79)

3.) Turbulent flows, Pope (2006).

I am not describing the theory of LES here as there are several good books available and I would recommend reading, chapters 1-7 in Pope, and chapter 13 on LES. Chapters 6 and 7 in Pope's book explains about turbulence in free shear turbulent flows (jets, self-similarity) and chapter 7 describes about stable attached turbulent flows (pipes, channels). I would highly recommend reading these as they explain the significance of certain parameters like y+, u_tau, law of the wall, the regimes in a turbulent velocity profile and so on.

The present tutorial is based on pipe flow at Re = 24,580 (experimental data of Toonder & Nieuwstadt, and DNS data of X. Wu and Moin is available) .

1.) Create a pipe geometry in ICEM-CFD,

The dimensions of the pipe are : 2.5m in length, 0.2m in diameter.

2.) Create a 3D bounding block :

associate the edges around the circle to the circle at both the faces.

3.) split the block in the form of an o-grid : for this select the the single block and the faces on the circles

4.) For better mesh quality, set an offset of 0.65

5.) Input the number of nodes and ratios (the near wall spacing, y+ here is 0.25 ) and the wall paralle spacing of 25.0 (x+ ), this is achieved by inputting the correct number of nodes in each of the directions.

I had input 65 nodes in the wall normal spacing, and 55 nodes in the z-direction.

6.) The boundary conditions play an important role in LES simulations, in the present study periodic boundary conditions with a pressure-gradient is used, the pressure gradient is calculated based on the u_friction velocity (u_tau), in case of pipe flow :

dp/dx = (-4u_fric^2/rho) , for channel :  dp/dx = (-2u_fric^2/rho)

u_fric = sqrt(tau_w/rho)

(Refer pope for the derivations and explanations)

Periodicity can be defined in icem or in fluent, in the present case periodicity is defined in icem :
go to the mesh button in mesh, click on set up periodicity :

set translational periodicity, and in this case the periodicity is in the x-direction based on the length of the pipe, therefore : 2.5 0.0 0.0

select the vertices on the periodic faces (circles)

Once selected, you can view the periodic faces by selecting faces : view periodic faces :

Now you can create the parts : inlet, wall etc. and save the mesh and translate it to fluent

Alternatively you can set up periodicity in fluent, but sometimes you may end up with errors such as ''segmentation-violation'' especially in the case of large meshes.

7.) Setting up LES in fluent :

I would suggest running a RANS simulation in a similar coarser mesh with pbc in fluent and then interpolating the RANS solution in the present case.  After interpolation, you can add fluctuating components to the RANS velocity profile by :

/solve/init/init-instantaneous-vel

Once done, change the viscous model as Large Eddy Simulation, start with the standard Smagorinsky-Lily model. The default values of Cs (0.1) is  good enough for simple attached flows, for flows involving large separations and instabilities the dynamic subgrid model can be used or the value of Cs can be set from available  literature.

Set the periodic boundary condition of pressure-gradient in the boundary conditions, mass-flow could also be used but the pressure-gradient seems to be more stable and provide better convergence.

For the pressure-velocity coupling, SIMPLEC algorithm is used and the bounded central differencing scheme is used for the velocity and in case of the time advancement the 2nd order backward euler implicit is used.  (bounded 2nd order implicit)

You can define a small iso-curve near the wall for monitoring statistical convergence of velcocity (defined under surface monitor)

Define the timestep of the simulation such that your CFL number is less than 1.0

CFL = U*delta_x/delta_T where delta_x is your wall parallel spacing, I would recommend a CFL of 0.50 and the number of inner iterations around 15-20.

You can run the simulation now!

Some points to be noted :

Make sure that in each time step your residuals drop down by the order of 2. You may achieve a statistically stationary state in 2-3 flow through times (FTT) , 1 FTT is defined as the time taken by a particle to cross the entire domain. Do not collect any unsteady data statistics until statistical stationary state has been reached. Once you have reached statistical convergence, you can switch on the sampling interval and unsteady data collection .. meanwhile you could monitor your CFL number, plot q-criterion for the evolution of turbulence.

You can check for the convergence of your solution by comparing the wall shear stress of the CFD with the momentum-balance equation, which reads as :

-dp/dx (pi*r^2*L)=tau_wall(2*pi*r*L)

or alternatively you could check for the skin friction coefficient (Cf) and friction factor (f) (f=4Cf), and compare with correlations..

Questions welcome...

Thanks and Regards,
Deepak

## Unstructured grid generation methods - Lecture

Please watch the entire module 7 for Unstructured grid generation methods.

## Some compressible CFD codes for learning (Godunov methods)

Collection of Computation Fluid Dynamics (CFD) source codes, freely downloadable and intended to be useful for educational purposes.

• Hyperbolic and parabolic model equations
Schemes for model equations
C codes that implement conservative difference schemes, explicit and implicit, for hyperbolic and parabolic model equations in 1D - modeq.tar.gz

FCT-schemes
Sample C/C++ codes that implement some FCT schemes for hyperbolic model equations in 1D - fct.tar.gz

• One-dimensional conservation laws of gas dynamics

First order Godunov schemes
Piecewise-constant approximation to the solution within computational cells, single step advancing in time. Several source codes in ANSI C with different solvers of the Riemann problem are available:
•  exact procedure of Godunov - godunov.tar.gz
• approximate flux-difference splitting (FDS) of Roe - roe_fds.tar.gz
• approximate linearized characteristic-based Riemann solver (LCS): lcs.tar.gz - (Fortran 77 and C sources available). Description of LCS solver downloadable as gzipped PS file - solver.ps.gz
Higher order Godunov-type schemes
Piecewise-parabolic spatial reconstruction, minmod() limiter function, LCS solver, three- and two- step Runge-Kutta in time. Sources in C are available for:
• Two- and three-step schemes that use non-iterative (LCS), iterative (LCSS), and weakly linearized (WLCS) versions of characteristic-based Riemann solver and a program for exact solution of Riemann problem: lcs3.tar.gz
• Two-step scheme for variable composition mixture of gases: lcs2mix.tar.gz
A set of different 1D schemes; demo package
Four different schemes solving "subsonic" and "supersonic" Riemann problems, with numerical and exact solutions
compared - sch1d.tar.gz. This package contains:
1) a non-conservative characteristic-based scheme,
2) Godunov scheme (as in godunov.tar.gz),
3) three step higher-order scheme (as in lcs3.tar.gz),
4) one-step higher-order scheme.

• Two-dimensional conservation laws of gas dynamics

Higher order Godunov-type "generic" 2D scheme
Rectangular mesh, piecewise-parabolic spatial reconstruction, minmod() limiter function, characteristic-based solver LCS, three step Runge-Kutta in time. C source - lcs2d3.tar.gz

Higher order scheme for 2D equations in axisymmetrical form
Higher order Godunov-type scheme applied to aeroacoustical problem: a finite-amplitude wave issuing from 1D duct into the 2D atmosphere. Standard C source code - noise.tar.gz

• Large Eddy Simulation

Cartesian grid compressible LES
Piecewise-parabolic distribution within computational cells, two-step time integration, 3D, unsteady filtered Navier-Stokes equations.
Description of LES numerical scheme downloadable as gzipped PS file - les.ps.gz.
Test examples in C are available for:
High performance LES
Parallel implementation of LES of turbulent flows (uses MPI):

• Combustion
Propagation of 1D pre-mixed laminar (normal) flame
Numerical scheme for 1D normal premixed combustion based on above listed high-resolution Godunov scheme lcs2mix. C source code - normal.tar.gz

• Flow Visualization
WinField 1.07
Visualization of scalar flowfield given by rectangular table. Win32 binary and C source - winfield.zip

source : http://www.reocities.com/MotorCity/pit/9939/freecfd.htm

## Essential Startup kit for Parallel Development

Essential Startup kit for Parallel Development

Got a new laptop with some serious horse-power, and here are the tolls that I am setting up for some CFD (some scientific computing) development stuff. Apart from some compilers, libraries, dependencies, etc I adding some post-processors and CFD related tools to make our lives easier. So here's the list (I am on Ubuntu by the way). Feel free to comment on adding more stuff.

The keywords for Ubuntu's sudo apt-get install * are presented in brackets, wherever applicable.

Compilers
gcc / g++ (gcc / g++)
gfortran (gfortran)
openmpi (openmpi)
opencl / cuda
octave

IDE
kate (kate)
vim (vim)
ECLIPSE Parallel (get from eclipse website)

Version-Control
Github (git-core)

Pre-Processors

Debuggers
valgrind (valgrind)
gprof (comes with gcc)

Post-Processors
ParaView (paraview)
ViSiT
MayaVi
gnuplot
engauge-digitizer

Documentation
Doxygen (doxygen)
LaTeX (texlive-full)