Introduction To Computational Fluid Dynamics
Introduction To Computational Fluid Dynamics
Introduction To Computational Fluid Dynamics
Computational Fluid Dynamics (CFD) provides a qualitative (and sometimes even quantitative)
prediction of fluid flows by means of
• mathematical modeling (partial differential equations)
• numerical methods (discretization and solution techniques)
• software tools (solvers, pre- and post-processing utilities)
CFD enables scientists and engineers to perform ‘numerical experiments’ (i.e. computer
simulations) in a ‘virtual flow laboratory.’
CFD: A methodology for obtaining a discrete solution of real world fluid flow problems. It is a
branch of fluid mechanics that uses numerical analysis and algorithms to solve and analyze
problems that involve fluid flows.
Discrete Solution: Solution is obtained at a finite collection of space points and at discrete time
levels.
ICEM CFD- ICEM CFD is a meshing software. It allows for the use of CAD geometries or to
build the geometry using a number of geometry tools. In ICEM CFD a block-structured meshing
approach is employed, allowing for hexahedral meshes also in rather complex geometries. Both
structured and unstructured meshes can be created using ICEM CFD.
Fluent- CFD software used to model flow, turbulence, heat transfer etc.
Computational Domain - Form of physical domain both in terms of geometrical representation
and boundary condition imposition.
Turbulence- Flow regime is characterized by chaotic changes in pressure and flow velocity.
–Insight
•Better Details
–Foresight
–Efficiency
•Design better and faster, economical, meet environmental regulations and ensure industry
compliance.
•CFD analysis leads to shorter design cycles and your products get to market faster.
•In addition, equipment improvements are built and installed with minimal downtime.
•CFD is a tool for compressing the design and development cycle allowing for rapid prototyping.
APPLICATIONS OF CFD
•Aerospace
•Automotive
•Biomedical
•Chemical Processing
•HVAC
•Hydraulics
•Marine
•Oil & Gas
•Power Generation
•Sports
•Pollutant Monitoring
EXPERIMENTS VS SIMULATIONS
CFD gives an insight into flow patterns that are difficult, expensive or impossible to study using
traditional (experimental) techniques
EXPERIMENTS SIMULATIONS
Quantitative description of flow phenomena Quantitative prediction of flow phenomena
using measurements using CFD software
• for one quantity at a time • for all desired quantities
• at a limited number of points • with high resolution in
and time instants space and time
• for a laboratory-scale model • for the actual flow domain
• for a limited range of problems • for virtually any problem and
and operating conditions realistic operating conditions
Error sources: measurement errors, flow Error sources: modeling, discretization,
disturbances by the probes iteration, implementation
EXPERIMENTS SIMULATIONS
• expensive • cheaper
• slow • faster
• sequential • parallel
• single-purpose • multiple-purpose
PROBLEM STATEMENT
• What is known about the flow problem to be dealt with?
• What physical phenomena need to be taken into account?
• What is the geometry of the domain and operating conditions?
• Are there any internal obstacles or free surfaces/interfaces?
• What is the type of flow (laminar/turbulent, steady/unsteady)?
• What is the objective of the CFD analysis to be performed?
• What is the easiest/cheapest/fastest way to achieve the goal?
MATHEMATICAL MODEL
1. Choose a suitable flow model and reference frame.
2. Identify the forces which cause and influence the fluid motion.
3. Define the computational domain in which to solve the problem.
4. Formulate conservation laws for the mass, momentum, and energy.
5. Simplify the governing equations to reduce the computational effort:
6. Add constitutive relations and specify initial/boundary conditions.
DISCRETIZATION PROCESS
The PDE system is transformed into a set of algebraic equations
1. Mesh generation (decomposition into cells/elements)
• structured or unstructured, triangular or quadrilateral?
• mesh size, adaptive refinement in ‘interesting’ flow regions
2. Space discretization (approximation of spatial derivatives)
• finite differences/volumes/elements
• high-order vs. low-order approximations
3. Time discretization (approximation of temporal derivatives)
• explicit vs. implicit schemes, stability constraints
• local time-stepping, adaptive time step control
ITERATIVE SOLUTION STRATEGY
The coupled nonlinear algebraic equations must be solved iteratively
• Outer iterations: the coefficients of the discrete problem are updated using the solution values
from the previous iteration so as to
– get rid of the nonlinearities by a Newton-like method
– solve the governing equations in a segregated fashion
• Inner iterations: the resulting sequence of linear sub-problems is typically solved by an iterative
method (conjugate gradients, multi-grid) because direct solvers (Gaussian elimination) are
prohibitively expensive.
• Convergence criteria: it is necessary to check the residuals, relative solution changes and other
indicators to make sure that the iterations converge.
As a rule, the algebraic systems to be solved are very large (millions of unknowns) but sparse, i.e.,
most of the matrix coefficients are equal to zero.
CFD SIMULATIONS
The computing times for a flow simulation depend on
• the choice of numerical algorithms and data structures
• linear algebra tools, stopping criteria for iterative solvers
• discretization parameters (mesh quality, mesh size, time step)
• cost per time step and convergence rates for outer iterations
• programming language (most CFD codes are written in Fortran)
• many other things (hardware, vectorization, parallelization etc.)
The quality of simulation results depends on
• the mathematical model and underlying assumptions
• approximation type, stability of the numerical scheme
• mesh, time step, error indicators, stopping criteria.
POSTPROCESSING AND ANALYSIS
Post-processing of the simulation results is performed in order to extract the desired information
from the computed flow field
• calculation of derived quantities (stream function, vorticity)
• calculation of integral parameters (lift, drag, total mass)
• visualization (representation of numbers as images)
– 1D data: function values connected by straight lines
– 2D data: streamlines, contour levels, color diagrams
– 3D data: cutlines, cutplanes, isosurfaces, isovolumes
– arrow plots, particle tracing, animations
• Systematic data analysis by means of statistical tools
• Debugging, verification and validation of the CFD model
UNCERTAINTY AND ERROR
Whether or not the results of a CFD simulation can be trusted depends on the degree of uncertainty
and on the cumulative effect of various errors
• Uncertainty is defined as a potential deficiency due to the lack of knowledge (turbulence
modeling is a classical example).
• Error is defined as a recognizable deficiency due to other reasons.
– Acknowledged errors have certain mechanisms for identifying, estimating and possibly
eliminating or at least alleviating them.
– Unacknowledged errors have no standard procedures for detecting them and may remain
undiscovered causing a lot of harm.
– Local errors refer to solution errors at a single grid point or cell.
– Global errors refer to solution errors over the entire flow domain
CLASSIFICATION OF ERRORS
Acknowledged errors
• Physical modeling error due to uncertainty and deliberate simplifications
• Discretization error- approximation of PDEs by algebraic equations
– spatial discretization error due to a finite grid resolution
– temporal discretization error due to a finite time step size
• Iterative convergence error which depends on the stopping criteria
• Round-off errors due to the finite precision of computer arithmetic
Unacknowledged errors
• Computer programming error: “bugs” in coding and logical mistakes
• Usage error: wrong parameter values, models or boundary conditions
VERIFICATION OF CFD CODES
Verification amounts to looking for errors in the implementation of the models
• Examine the computer programming by visually checking the source code, documenting it and
testing the underlying subprograms individually
• Examine iterative convergence by monitoring the residuals, relative changes of integral quantities
and checking if the prescribed tolerance is attained
• Examine consistency (check if relevant conservation principles are satisfied)
• Examine grid convergence: as the mesh and the time step are refined, the spatial and temporal
discretization errors, respectively, should asymptotically approach zero (in the absence of round-
off errors)
• Compare the computational results with analytical and numerical solutions for standard
benchmark configurations
VALIDATION OF CFD MODELS
Validation amounts to checking if the model itself is adequate for practical purposes
• Verify the code to make sure that the numerical solutions are correct.
• Compare the results with available experimental data to check if the reality is represented
accurately enough.
• Perform sensitivity analysis and a parametric study to assess the inherent uncertainty due to the
insufficient understanding of physical processes.
• Try using different models, geometry, and initial/boundary conditions.
• Report the findings, document model limitations and parameter settings.
The goal of verification and validation is to ensure that the CFD code produces reasonable results
for a certain range of flow problems.
NUMERICAL SCHEMES
Number of different schemes can be devised:
1. First-order upwind scheme.
2. Central differencing scheme.
3. Power-law scheme.
4. Second-order upwind scheme.
5. QUICK scheme.
FIRST ORDER UPWIND SCHEME
(x)
P e
P e E
Flow direction
• This is the simplest numerical scheme.
• We assume that the value of at the face is the same as the cell centered value in the cell
upstream of the face.
• The main advantages are that it is easy to implement and that it results in very stable
calculations, but it also very diffusive. Gradients in the flow field tend to be smeared out,
as we will show later.
• This is often the best scheme to start calculations with.
(x)
e
E
P e E
• We determine the value of at the face by linear interpolation between the cell centered
values.
• This is more accurate than the first order upwind scheme, but it leads to oscillations in the
solution or divergence if the local Peclet number is larger than 2. The Peclet number is the
ratio between convective and diffusive transport:
uL
Pe
D
• It is common to then switch to first order upwind in cells where Pe>2. Such an approach is
called a hybrid scheme.
e
E
P e E
x
L
• This is based on the analytical solution of the one-dimensional convection-diffusion
equation.
• The face value is determined from an exponential profile through the cell values. The
exponential profile is approximated by the following power law equation:
1 0.1 Pe5
e P E P
Pe
• For Pe>10, diffusion is ignored and first order upwind is used.
SECOND-ORDER UPWIND SCHEME
interpolated
W (x) value
P
e
E
W P e E
• We determine the value of from the cell values in the two cells upstream of the face.
• This is more accurate than the first order upwind scheme, but in regions with strong
gradients it can result in face values that are outside of the range of cell values. It is then
necessary to apply limiters to the predicted face values.
• Second-order upwind with limiters is one of the more popular numerical schemes because
of its combination of accuracy and stability.
QUICK SCHEME
interpolated
W (x value
)
P
ee
W P EE
Flow direction
6
• The first order upwind scheme only uses the constant and ignores the first derivative and
consecutive terms. This scheme is therefore considered first order accurate.
• For high Peclet numbers the power law scheme reduces to the first order upwind scheme, so it
is also considered first order accurate.
• The central differencing scheme and second order upwind scheme do include the first order
derivative, but ignore the second order derivative. These schemes are therefore considered
second order accurate. QUICK does take the second order derivative into account, but ignores
the third order derivative. This is then considered third order accurate.
TURBULENCE MODELLING
It is the construction and use of a model to predict the effects of turbulence.
TYPES OF TURBULENCE MODELS
1. EDDY VISCOSITY MODEL
2. PRANDTL MIXING LENGTH CONCEPT
3. SPALART- ALLMARAS MODEL
4. K-EPSILON MODEL
5. K-OMEGA MODEL
6. SHEAR STRESS TRANSPORT TURBULENCE MODEL
7. REYNOLDS STRESS MODEL
8. REYNOLDS AVERAGE NAVIER STOKES MODEL
9. RE-NORMALISATION GROUP K-EPSILON MODEL
EDDY VISCOSITY MODEL
• It is proposed relating to the turbulence stresses to the mean flow close to the system of
equations.
• Boussinesq hypothesis is applied to model the Reynolds stress term
• Turbulence eddy viscosity constant has been introduced.
• In this model, the additional turbulence stresses are given by augmenting the molecular
viscosity with an eddy viscosity.
PRANDTL MIXING LENGTH CONCEPT
• Prandtl introduced the additional concept of the mixing length along with the idea of
boundary layer.
• For wall bounded turbulent flows, the eddy viscosity must vary with distance from the wall,
hence addition of concept of a mixing length.
SPALART-ALLMARAS MODEL.
• It solves a modeled transport equation for the kinematic eddy turbulent viscosity.
• It was designed for aerospace applications involving wall bounded flows and give good
results for boundary layers subjected to adverse pressure gradients.
• It is also used in turbo-machinery applications.
K-EPSILON MODEL
• Standard k-epsilon model simulate mean flow characteristics for turbulent flow conditions.
• It is a two equation model which gives a general description of turbulence by means of two
transport equations.
• Main aim is to improve the mixing length model.
• In this model, the eddy viscosity is determined from a single turbulence length scale.
K-OMEGA MODEL
• It is a common two equation turbulence model that is used as a closure for the RANS
equations.
• It predicts turbulence by two partial differential equations for two variables, k and omega,
with the first variable being the turbulence kinetic energy (k) and specific rate of dissipation
(omega).
SST MODEL
• It combines k-omega and k-epsilon model such that k-omega is used in the inner region of
boundary layer and switches to k-epsilon in free shear flow.
REYNOLDS STRESS MODEL
• It is referred to as second order model.
• In flows with the streamline curvature, the performance of LES (Large Eddy Simulation)
or DNS (Direct Numerical Simulation) is highly unsatisfactory. This model offers better
predictive fidelity and better accuracy than one or two equation turbulence models.
RANS MODEL
• Reynolds Averaged Navier-Stokes equations are time averaged equations of motion for
fluid flow. The idea behind the equations is Reynolds decomposition, where an
instantaneous quantity is decomposed into its time averaged and fluctuating quantities.
RNG K-EPSILON MODEL
• Re-Normalisation Group is used to renormalize the Navier-Stokes equations to account for
effects of smaller scales of motion.
• It is used to derive a turbulence model similar to k-epsilon which deals with different scales
of motion.
SIMPLE
SIMPLE stands for Semi-Implicit method of Pressure linked Equations. It is used to solve the
Navier-Stokes equations.
BASIC STEPS OF SIMPLE METHOD
• Set the boundary conditions.
• Compute gradients of velocity and pressure.
• Solve discretized momentum equation to compute intermediate velocity field.
• Compute uncorrected mass fluxes at faces.
• Solve pressure correction equation to produce cell values of pressure correction.
• Update pressure field.
• Update boundary pressure corrections.
• Correct face mass fluxes.
• Correct cell velocities.
• Update density due to pressure changes.
[ Mesh, Blocking, Spliting, Mesh quality, orthogonal quality, Aspect ratio, Froude number, Grid
consistency or independent grid test.]
CONVERGENCE CRITERIA IN CFD
CFD problems in general are non-linear and the solution techniques use an iterative process to
successively improve a solution, until ‘convergence’ is reached. In mathematics, convergence
describes limiting behaviour, particularly of an infinite sequence or series toward
some limit . The exact solution to the iterative problem is unknown, but you want to be
sufficiently close to the solution for a particular required level of accuracy. Convergence therefore
does need to be associated with a requirement for a particular level of accuracy. This requirement
depends upon the purpose to which the solution will be applied.
CRITERIA FOR ASSESSING CFD CONVERGENCE
The CFD solution imbalances will never be exactly zero. However, the imbalances should be
sufficiently small before considering the solution converged. As a good practice, aim for solution
imbalances of less than 1% as a starting point.
FROUDE NUMBER
A dimensionless number used in hydrodynamics to indicate how well a particular model works in
relation to a real system. The Froude number (Fr) is a dimensionless number defined as the ratio
of the flow inertia to the external field.
Fr = u0/(g0l0)0.5
Blocking
A blocking breaks down a geometry into large brick-shapes and structures the direction of
grid lines by the arrangement of the blocks.
Block entities (faces, edges, and vertices) are projected onto the geometry
Geometry/Blocking Nomenclature
• Geometry • Blocking
– Point – Vertex
– Curve – Edge
– Surface – Face
– Volume – Block
Blocking process
Structure blocking to capture the shape of the geometry
– Top down
– Bottom up
Initialize Blocking-3D or 2D
– 3D Bounding Box
• No surfaces required
– 2D Surface Blocking
• Most robust
– Mapped – structured
– In the final mesh, edges will take the shape (be projected to) these curves
– Right click on Edges > Show Association in the model tree to display the association
arrows
Meshing
Meshing is a discrete representation of the geometry that is involved in the problem. Essentially,
it partitions space into elements (or cells or zones) over which the equations can be approximated.
Mesh quality
Low Orthogonal Quality or high skewness values are not recommended. Generally try to keep
minimum orthogonal quality > 0.1, or maximum skewness < 0.95.
The mesh quality can be conclusively determined based on the following factors.
a) Rate of convergence
The greater the rate of convergence, the better the mesh quality. It means that the correct solution
has been achieved faster.
b) Solution precision
A better mesh quality provides a more precise solution. For example, one can refine the mesh at
certain areas of the geometry where the gradients are high.
c) CPU time required
For a highly refined mesh, where the number of cells per unit area is maximum, the CPU time
required will be relatively large. Time will generally be proportional to the number of elements.
d) Grid Independence result
Once the computations are done and the desired property of fluid does not vary with respect to
different mesh elements then it represents that further change in elements doesn't vary your results
and is termed as Independent Grid. This is an essential tool to know how good you mesh from the
point of purpose of comparative results.
Impact of the Mesh Quality
Good quality mesh means that
• Mesh quality criteria are within correct range
– Orthogonal quality
• Mesh is valid for studied physics
– Boundary layer
• Solution is grid independent
• Important geometric details are well captured
Bad quality mesh can cause;
• Convergence difficulties
• Bad physic description
• Diffuse solution
User must
• Check quality criteria and improve grid if needed
• Think about model and solver settings before generating the grid
Classification of Grids
Structured grids
Structured grids are identified by regular connectivity. The possible element choices are
quadrilateral in 2D and hexahedra in 3D. This model is highly space efficient. Some other
advantages of structured grid over unstructured are better convergence and higher resolution.
Unstructured grids
An unstructured grid is identified by irregular connectivity. It cannot easily be expressed as a two-
dimensional or three-dimensional array in computer memory. Compared to structured meshes, this
model can be highly space inefficient. These grids typically employ triangles in 2D and tetrahedra
in 3D.
Hybrid grids
A hybrid grid contains a mixture of structured portions and unstructured portions. It integrates the
structured meshes and the unstructured meshes in an efficient manner. Those parts of the geometry
that are regular can have structured grids and those that are complex can have unstructured grids.
DECIDE TYPE OF MESH
Based on the skewness, smoothness, and aspect ratio, the suitability of the mesh can be decided.
Skewness
The skewness of a grid is an indicator of the mesh quality and suitability. Large skewness
compromises the accuracy of the interpolated regions.
Smoothness
The change in size should also be smooth. There should not be sudden jumps in the size of the cell
because this may cause erroneous results at nearby nodes.
Aspect ratio
It is the ratio of longest to the shortest side in a cell. Ideally it should be equal to 1 to ensure best
results. For multidimensional flow, it should be near to one. Having a large aspect ratio can result
in an interpolation error of unacceptable magnitude.
Orthogonal Quality
The range for orthogonal quality is 0-1, where a value of 0 is worst and a value of 1 is best. The
orthogonal quality for cells is computed using the face normal vector, the vector from the cell
centroid to the centroid of each of the adjacent cells, and the vector from the cell centroid to each
of the faces. The orthogonal quality for faces is computed using the edge normal vector and the
vector from the face centroid to the centroid of each edge.