Basics of CFD Modeling For Beginners
Basics of CFD Modeling For Beginners
Basics of CFD Modeling For Beginners
Table of Contents
An Introduction To
Experimental Analysis
o Using theory and mathematical formulation we can solve simple problems in our
real life and nature
o Experiment is conducted for simple cases to understand the details of objectives
o Carrying out experiments is expensive, risky and time consuming
o There are many limitations to get solutions for complex problems either by
theory and experiments
1) Mathematics:
o
Partial differential equations, integration
Numerical Methods: finite volume method (FVM), finite element method
(FEM), finite difference method (FDM)
2) Flow Physics:
o
Fluid mechanics: Proerties of fluid, Laminar and Turbulent Flow
Heat and mass transfer
Reaction: reactive or passive flow in combustion
Phases of material: single or multi-phase flow
Other flow physics: Magnetic or electric field acting on fluid
3) Computer science:
Programming tools like C or C++ need to be learnt by CFD users initially. Familiarity with CFD
software is essential for geometry, meshing, simulation and post-processing. Parallel computing
may need for complex industrial problems, large eddy simulations (LES ) and DNS.
As discussed above, simulation and experiment are two commonly used methods for
design and analysis
Simulations provide a thorough analysis at a lower cost compared to experimental
analysis
Hence CFD is used in a wide range of industrial applications where fluid flow is involved
like automotive, aerospace, power generation, etc
CFD is used for design and optimization of industrial problems
• CFD has a large potential to solve industrial problems at bigger scale due to continuous
improvement in computational power and numerical models
i) To find the impact of Smoke and pollution level: Flow pattern for an oil fire
ii) Turbo machinery Analysis
• In general, the Reynolds number is used to determine the flow whether it is laminar or turbulent
o Re < Recr: Laminar flow
o Re > Recr : Turbulent Flow flow
The transition from laminar to turbulent flow depends on the surface geometry, surface
roughness, free-stream velocity, surface temperature, and type of fluid, among other
things.
If flow becomes turbulent for the small sectional area, then CFD user has to select an
appropriate turbulence model while modeling the flows
To simulate complex turbulent flow, turbulence models are used for numerical simulation
Regime for Laminar and turbulent Internal Flow
o Example 1: Buoyant flow from a cigarette shows that laminar and turbulent
regions are formed in fluid flow
o Example 2: Water falling from a tap Water falling from a tap
Example 3: Water channel flows show that laminar flows in the channel and turbulent
around the gate due to increase in velocity
Natural (free) flow: the Flow is driven by the density difference between hot and cold
fluids
Single Phase flow : only one phase exits in the fluid system Examples: water through a
pipe, air flow over a surface etc.
Multi-phase flow : more than two or more phases interact each other.
Examples of multi-phase flows: Boiling flow, condensation, bubble column etc..
Water evaporation and boiling consists of two phases water and steam
Condensation consists of two phases water and steam
To model the flow when two (inter penetrating or separated)phases, multiphase models
are used based on approximation and cost of simulations
For details of reactive flow modeling, read basics of combustion in this website. Majority
of flow in combustion is turbulent for good mixing of fuel and air. It can lead to stable
flames. Turbulent combustion modeling need to be studied in details before CFD
modeling.
• In fluid flow, transport of various physical quantities such as mass, momentum, energy and
species is involved.
• CFD user must know the governing equations and the physical meaning of various
terms in equations.
• CFD user must know the governing equations and the physical meaning of various terms in
equations.
1) Conduction (diffusion): need a medium for transfer of mass, momentum, heat and species at
molecular level.
2) Advection: need a medium for transfer of mass, momentum, heat and specie at bulk level.
3) Radiation: no need a medium for heat (Not applicable for mass, momentum and species)
• In general, the conservation equation for any physical conserved variable is written as:
Computational fluid dynamics (CFD) is the science of predicting fluid flow, heat and
mass transfer, chemical reactions, and related phenomena by solving numerically the set
of governing mathematical equations• Governing (PDE) equations are Conservation of
fluid flow, heat and mass transfer and species, etc.
Generally, CFD works based on the Finite volume methods (Conservative Method).
Fluid region of pipe flow is discretized into a finite set of control volumes (mesh/cells).
Partial differential equations (PDEs) are discretized into a system of algebraic equations
using finite volume method or finite element method
Fig.13 Computational domain defined for a circular pipe
The process of mesh generation is generally classified into two categories based on the
topology of the elements that fill the domain
After the selection of CFD domain, next step is to divide the domain into finite number
of volumes or cell based on the physics to be resolved.
Types of Meshes for Computational domain.
Mesh quality is essential for correct CFD simulations. Three ways are to measure of the
quality of mesh
Skewness /Orthogonal quality:
o The skewness of mesh should low as much as possible
o Higher skewness can slow down the convergence of simulation and incorrect
computations fluxes near walls.
o Skewness and orthogonal both are opposite each other. Higher orthogonal quality
means lower the skewness of mesh
o For complete Hexahedral elements, skewness is zero. It is non-zero value for
inclined faces.
Smoothness (change in size):
o Sudden jumping in mesh should be avoided in high gradient region
o The growth factor of 1.2 is recommended
o Smoothness in mesh is very essential near wall boundaries.
Aspect ratio:
o Select it as per need of simulation
o In the direction of high gradient region, aspect ratio should be less ( < 20)
o In the direction of no gradient region,higher aspect ratio ( ~ 250) is enough to
reduce the mesh size.
The discretization methods approximate the PDEs of fluid flows with numerical model
equations, which are solved using different numerical methods.
The computational domain is usually divided into hexahedral elements (grids) and the
numerical solution is obtained at each node .
The finite difference method (FDM) is simple to understand when the physical elements
are defined in the Cartesian co-ordinate system, but the use of curvilinear transforms the
method can be extended to domains that can not be easily represented using brick-shaped
elements
The discretization results in a system of equations of the variable for grid points, and
once a solution is obtained then a discrete representation of the solution is obtained.
Note the following points for FDM:
o It is applicable only for regular grid (equal size of meshing).
o This method is based on Taylor series of differentiation. Finite difference methods
for spatial derivatives with different order of accuracies is obtained using Taylor
expansions like first or second order upwind difference scheme (UDS), central
differences schemes (CDS), etc.
o The FDM is difficult to use for non-uniform grid. Hence it is rarely used for CFD
solvers
o This method is not easy to implement conservation of mass, momentum and
energy
Taylor series of expansion dicretizes diferential terms in partial differential equations
Forward, backward and central schemes are commonly used finite difference schemes to
discretize partial differential equations
Discretization is carried out over all the nodes of computational doain
Finite Volume Methods (FVM)
This approach is suitable for both irregular or irregular meshes. is based upon an integral
form of the PDE to be solved (e.g. conservation of mass, momentum, or energy).
The governing equations are solved for a given finite volume (or cell) using finite
volume methods
The computational domain is discretized into finite volumes and then for every volume
the governing equations are solved.
The final forms equations after discretiazion involves fluxes of the conserved variable
(mass, momentum and energy), and thus the calculation of fluxes is essential in this
method
Note:The Finite volume method is conservative (for mass, momentum and energy etc).
Hence, the FVM discretization is widely used for many CFD solvers (e.g. ANSYS FLUENT,
OpenFOAM.
The FDM is based upon a piece wise representation of the solution in terms of specified
basis functions.
The computational domain is divided up into smaller domains (finite elements) and the
solution in each element is constructed from the basis functions.
This can be a double-edged situation, as the section of basis functions is essential and
boundary conditions can be more difficult to formulate for complex geometries. A set of
equations is obtained (for nodal values) are solved to get a solution.
To get numerical solutions, a set of equations are obtained using the conservation
equation: Field variables are written as the basis functions, the equation is multiplied with
appropriate test functions, and then integrated over an element. Since the FEM solution is
defined in terms of specific functions, a significant solution is obtained by solving the
equations algebraically.
The finite element method (FEM) is used to compute such approximations.Take, for
example, a function u that may be the dependent variable in a PDE (i.e., temperature,
electric potential, pressure, etc.) The function u can be approximated by a
function uh using linear combinations of basis functions according to the following
expressions:
The FEM discretization is used by some CFD solvers (e.g. COMSOL). For
COMSOL CFD solver, click here: COMSOL_NUMERICAL_METHOD
Temporal derivatives can be integrated either by the explicit method or implicit method
Explipit Method: Euler, Runge-Kutta
Implicit method : Beam-Warming method
Explicit Method
Advantages:
• direct computation without solving a system of equations
• easy to programme and parallel computing
• few number of operations per time step
Disadvantage: strong conditions on the time step for stability
Implicit Method
Two types of methods for solving the system of linear algebraic equations
1) Direct methods
o Gauss elimination
o LU decomposition
o Trid-iagonal matrix algorithm (TDMA)
o Jacobi method
o Gauss-Seidel method
o Successive over-relaxation (SOR)
o Conjugate gradient method (CG)
o Multi-grid methods
Node for pressure and velocity components at the control volume (CV) center.
Same CV for all variables.
Possible oscillations of pressure
Staggered grid
SIMPLE Algorithm
Semi-implicit method for Pressure-linked Equations
1.
1. 1.Advance to the next iteration t(n)=t(n+1)
2. Initialize u(n+1) and p(n+1) using latest available values of u and p
3. Construct the momentum equations
4. Under-relax the momentum matrix
5. Solve the momentum equations to obtain a prediction for u (n+1)
6. Construct the Pressure equation
7. Solve the pressure equation for p(n+1)
8. Under-relax p(n+1)
9. Correct the velocity for u(n+1)
10. If not converged, go back to step 2
11. Correct the fluxes for ϕ(n+1)
The pressure-correction under-relaxation factor is generally set to 1.0, which helps for
faster convergence
This method is suitable for turbulent flow with pressure varying fields
Properties of Fluid
• A CFD user must be familiar with what fluid/solid properties are given to the CFD solver (e.g.
FLUENT, OpenFOAM and COMSOL etc.) as input data and what properties will be calculated
by the CFD solver
Boundary Conditions
The following boundary conditions which are commonly used in a variety of CFD domains:
1) Inflow (inlet)condition:
2) Wall:
4) Symmetry condition:
This boundary is used when flow does not cross the boundary
Across the boundary all gradient are zero
Boundary conditions for flow through a pipe or duct is shown below. Inlet is specified
with a fixed velocity
Initial Boundary conditions for flow over a cylinder are defined as below
Most of boundary conditions are defined based on fixed value and fixed gradients of
velocity, pressure and temperature. That understanding will help decoding open FOAM
CFD solver: Adiabatic wall ( dT/dx =0) and Outlet (dT/dx=0)
References
For CFD Beginners:
Jiyuan Tu Guan Heng Yeoh Chaoqun Liu, Computational Fluid Dynamics: A Practical
Approach,Butterworth-Heinemann, Elsevier Publication,. 2018