0% found this document useful (0 votes)
37 views27 pages

EngAn3 CFD 2013 14 Lect - 5

This document discusses computational fluid dynamics (CFD) and its applications. It introduces CFD as a computer-based technique used to predict fluid flows and heat transfer. CFD is now commonly used in the design process across many industries like aerospace, automotive, and meteorology. The document then outlines the basic steps in the numerical CFD approach, including modeling the problem, discretizing the domain and equations, and solving the discretized equations. It also discusses discretization methods like finite difference, finite element, and finite volume methods.

Uploaded by

raphael.sanches
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views27 pages

EngAn3 CFD 2013 14 Lect - 5

This document discusses computational fluid dynamics (CFD) and its applications. It introduces CFD as a computer-based technique used to predict fluid flows and heat transfer. CFD is now commonly used in the design process across many industries like aerospace, automotive, and meteorology. The document then outlines the basic steps in the numerical CFD approach, including modeling the problem, discretizing the domain and equations, and solving the discretized equations. It also discusses discretization methods like finite difference, finite element, and finite volume methods.

Uploaded by

raphael.sanches
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 27

Dr Edmondo Minisci EngAn3-CFD

Engineering Analysis 3 (16363)


2012-2013 / 2nd semester

Introduction to Computational Fluid


Dynamics ( CFD )
Dr Edmondo MINISCI
edmondo.minisci@strath.ac.uk
Twitter: https://twitter.com/edmondo_minisci https://twitter.com/MAE_Strath
1
Dr Edmondo Minisci EngAn3-CFD

Lecture 5

2
Dr Edmondo Minisci EngAn3-CFD

CFD in engineering designs and …


CFD is a computer based technique to predict fluid flows and heat transfer.

Now a must during design processes and forecasting within a wide range of
industries
Aerospace industry:
Automotive industry:

Meteorology:

3
Dr Edmondo Minisci EngAn3-CFD

CFD in engineering designs

The CFD analysis focuses on distributed properties.

The objective is the determination of entire fields such as temperature T(x,


t ) velocity v(x, t ), density ρ(x, t ), etc.

Even when an integral characteristic, such as the friction coefficient,


aerodynamic coefficient, or the net rate of heat transfer, is needed, it is
derived from distributed fields.

4
Dr Edmondo Minisci EngAn3-CFD

Introduction to CFD [1]

Except for few strongly simplified models, the equations for distributed
properties
are partial differential equations (PDEs), often nonlinear, which are solved
analytically (exact solutions, which are only possible for a very limited
class of problems, typically formulated in an artificial, idealized way.)

or

using numerical methods (approximate solutions)

5
Dr Edmondo Minisci EngAn3-CFD

Formulation of a PDE problem [1]


A complete PDE problem consists of
- an equation
- a domain of solution
- boundary and initial conditions.

The problem has to be solved in a spatial domain, Ω, and, in the case of


time-dependency, in a time interval between t0 and tend .

Domains can finite of infinite.

Boundary conditions have to be imposed at the boundaries of the spatial


domain ∂Ω.
Only a problem with properly set boundary conditions is well-posed (i.e.,
consistent and having a unique solution).

6
Dr Edmondo Minisci EngAn3-CFD

Formulation of a PDE problem [2]


Physical boundary conditions are usually expressed in terms of the
boundary values of
- the unknown field u (Dirichlet boundary condition) or
- its normal derivative (Neumann boundary condition), or, again,
- a mix of both (Robin, mixed, boundary condition).

In general, all fluid flow and heat transfer processes evolve with time, but
depending on their behaviour it is advisable to consider two different
groups:
- time-independent and
- time-evolving.

7
Dr Edmondo Minisci EngAn3-CFD

Steps of numerical approach

1- Modeling: definition of the mathematical model describing the phenomenon

2- Discretisation of the domain and the equations

3- Solution of the discretised equations

8 8
Dr Edmondo Minisci EngAn3-CFD

Discretisation [4]
 we also discretise the fluid dynamic equations (PDEs) and transform them
into linear algebraic equations

PDEs are valid over continuum domain: i.e, at any position

Discretisation: transform a Partial Differential Equation into


a set of (linear) algebraic equations

Discretized equations are valid on discrete domain or grid

 the most common PDEs discretisation methods are


1. the finite difference method (FD)
2. the finite element method (FE)
3. the finite volume method (FV)

9
,
Dr Edmondo Minisci CFD – EngAn3
,

A Taylor series expansion, which gives the value of a function f at position x+Dx
located close to position x , reads:

Dx 2 Dx 3 ''' Dx 4 '''' Dx 5 '''''


f ( x  Dx)  f ( x)  Dxf ' ( x)  f ' ' ( x)  f ( x)  f ( x)  f ( x)...
2! 3! 4! 5!

The following expression is a finite difference which represents an approximation


to a certain partial derivative at the node labelled i.

Af i 3  Bf i  2  Cf i 1  Df i
Dx 2
where the following notations have been used :

fi 3  f xi  3Dx  fi 2  f xi  2Dx  f i 1  f xi  Dx 

1. Identify the corresponding derivative order

2. Find the values of coefficients A to D

3. Identify the order of the approximation.


,
Dr Edmondo Minisci CFD – EngAn3
,

Af i 3  Bf i  2  Cf i 1  Df i
 f ' '  xi   O??
Dx 2

f ( xi  3Dx)  f ( x )  3Dxf ' ( x ) 


 3Dx 
2
f ''(x ) 
 3Dx 
3
f '''
(x ) 
 3Dx 
4
f ''''
(x ) 
 3Dx 
5
f ''''' ( xi )  ...
i i i i i
2! 3! 4! 5!

f ( xi  2Dx)  f ( xi )  2Dxf ' ( xi ) 


 2Dx 
2
f ' ' ( xi ) 
  2Dx  '''
3
f ( xi ) 
 2Dx  ''''
4
f ( xi ) 
 2Dx  '''''
5
f ( xi )  ...
2! 3! 4! 5!

f ( xi  Dx)  f ( xi )  Dxf ' ( xi ) 


 Dx 
2
f ' ' ( xi ) 
  Dx  '''
3
f ( xi ) 
 Dx  ''''
4
f ( xi ) 
 Dx  '''''
5
f ( xi )  ...
2! 3! 4! 5!
f ( xi )  f ( xi )

fi 3  f xi  3Dx  fi 2  f xi  2Dx  f i 1  f xi  Dx 


,
Dr Edmondo Minisci CFD – EngAn3
,

Af i 3  Bf i  2  Cf i 1  Df i
 f ' '  xi   O??
Dx 2

Af ( xi  3Dx)  Af ( x )  A3Dxf ' ( x )  A


 3Dx 
2
f ''(x )  A
 3Dx 
3
f '''
(x )  A
 3Dx 
4
f ''''
(x )  A
 3Dx 
5
f ''''' ( xi )  ...
i i i i i
2! 3! 4! 5!

Bf ( xi  2Dx)  Bf ( xi )  B 2Dxf ' ( xi )  B


 2Dx 
2
f ' ' ( xi )  B
  2Dx  '''
3
f ( xi )  B
 2Dx  ''''
4
f ( xi )  B
  2Dx  '''''
5
f ( xi )  ..
2! 3! 4! 5!

Cf ( xi  Dx)  Cf ( xi )  CDxf ' ( xi )  C


 Dx 
2
f ' ' ( xi )  C
 Dx  '''
3
f ( xi )  C
 Dx  ''''
4
f ( xi )  C
 Dx  '''''
5
f ( xi )  ...
2! 3! 4! 5!
Df ( xi )  Df ( xi )

fi 3  f xi  3Dx  fi 2  f xi  2Dx  f i 1  f xi  Dx 


,
Dr Edmondo Minisci CFD – EngAn3
,

Af i 3  Bf i  2  Cf i 1  Df i
 f ' '  xi   O??
Dx 2

Af ( xi  3Dx)  Af ( x )  A3Dxf ' ( x )  A


 3Dx 
2
f ''(x )  A
 3Dx 
3
f '''
(x )  A
 3Dx 
4
f ''''
(x )  A
 3Dx 
5
f ''''' ( xi )  ...
i i i i i
2! 3! 4! 5!

Bf ( xi  2Dx)  Bf ( xi )  B 2Dxf ' ( xi )  B


 2Dx 
2
f ' ' ( xi )  B
  2Dx  '''
3
f ( xi )  B
 2Dx  ''''
4
f ( xi )  B
  2Dx  '''''
5
f ( xi )  ..
2! 3! 4! 5!

Cf ( xi  Dx)  Cf ( xi )  CDxf ' ( xi )  C


 Dx 
2
f ' ' ( xi )  C
 Dx  '''
3
f ( xi )  C
 Dx  ''''
4
f ( xi )  C
 Dx  '''''
5
f ( xi )  ...
2! 3! 4! 5!
Df ( xi )  Df ( xi )

Af i 3  Bf i  2  Cf i 1  Df i  A  B  C  D   3 A  2 B  C  f ' ( x )  9 / 2 A  4 / 2 B  1 / 2C  f ' ' ( x ) 


 f ( x ) 
Dx 2 Dx 2 Dx
i i i

  27 / 6 A  8 / 6 B  1 / 6C  f ''' ( xi ) 
 81 / 24 A  16 / 24 B  1 / 24C  f '''' ( xi )  ...

fi 3  f xi  3Dx  fi 2  f xi  2Dx  f i 1  f xi  Dx 


,
Dr Edmondo Minisci CFD – EngAn3
,

Af i 3  Bf i  2  Cf i 1  Df i
 f ' '  xi   O??
Dx 2

Af i 3  Bf i  2  Cf i 1  Df i  A  B  C  D   3 A  2 B  C  f ' ( x )  9 / 2 A  4 / 2 B  1 / 2C  f ' ' ( x ) 


 f (x ) 
Dx 2 Dx 2 Dx
i i i

  27 / 6 A  8 / 6 B  1 / 6C Dxf ''' ( xi ) 
 81 / 24 A  16 / 24 B  1 / 24C Dx 2 f '''' ( xi )  ...

 A  B  C  D   0 A  1
 3 A  2 B  C   0 B4


9 / 2 A  4 / 2 B  1 / 2C   1 C  5
 27 / 6 A  8 / 6 B  1 / 6C   0
D2

fi 3  f xi  3Dx  fi 2  f xi  2Dx  f i 1  f xi  Dx 


,
Dr Edmondo Minisci CFD – EngAn3
,

Af i 3  Bf i  2  Cf i 1  Df i
Dx 2
 f ' '  xi   O Dx
?? 2
 
Second
0 order

Af i 3  Bf i  2  Cf i 1  Df i  A  B  C  D 
 f ( xi ) 
Dx 2 Dx 2 0


 3 A  2 B  C  f ' ( x ) 
1
A  1 Dx
i

B4  9 / 2 A  4 / 2 B  1 / 2C  f ' ' ( xi )  0


C  5
D2   27 / 6 A  8 / 6 B  1 / 6C Dxf ''' ( xi ) 
≠0

 81 / 24 A  16 / 24 B  1 / 24C Dx 2 f '''' ( xi )  ...

fi 3  f xi  3Dx  fi 2  f xi  2Dx  f i 1  f xi  Dx 


Dr Edmondo Minisci EngAn3-CFD

Finite Difference Method for unsteady state heat conduction [1]

 in 1D with constant heat conductivity it is


k is the thermal
T  T 2  diffusivity
 Cv
t x 2
k is the heat
conductivity

Cv is the specific
heat at constant
volume

16
Dr Edmondo Minisci EngAn3-CFD

Finite Difference Method for unsteady state heat conduction [1]

t The time variable


T  T 2

t x 2 x The position variable

 position and time variables are independent


and therefore are discretised separately
Using forward difference to
discretise the time variation
n n 1
 Ti
n is the running index for time
 T   Ti
n
   Dt 
 t i Dt i is the running index
for position
Using second order central difference
to discretize the space variation
n
  2T  T n
 2T n
 T n
   i 1 i i 1  ( Dx 2 )
 x 2  D 2
 i x
17
Dr Edmondo Minisci EngAn3-CFD

Finite Difference Method for unsteady state heat conduction [3]

The time dependent heat Discretised equation using forward difference in time
conduction equation
Tin 1  Tin n n n
Ti 1  2Ti  Ti 1
T  2T 

t x 2 Dt Dx 2

Transient term Spatial term


discretization discretization

n
Ti  Tin 1 n n n
Ti 1  2Ti  Ti 1

Dt Dx 2
Discretised equation using backward difference in time
18
Dr Edmondo Minisci EngAn3-CFD

Finite Difference Method for unsteady state heat conduction [4]

 the discretised equation using forward difference in time can be rearranged as :

Dt
Ti n 1
 Ti  
n

Dx 2
T n
i 1  2Ti
n
 T n
i 1 

time

n 1 the value of the temperature at Tin 1


t
depends only on temperatures known
from the previous time steps.
n
t
 in this case the numerical scheme is said,

t n 1
Explicit Scheme

xi 1 xi xi 1
19
Dr Edmondo Minisci EngAn3-CFD

Finite Difference Method for unsteady state heat conduction [5]

 the discretised equation using backward difference in time can be rearranged as

Tin  
Dt
Dx 2
T n
i 1  2Ti
n
 T n
i 1   Ti
n 1

time

t n 1 there are more than one temperature


at the highest time step t n

tn  in this case the numerical scheme is said,


Implicit Scheme

t n 1
xi 1 xi xi 1
20
Dr Edmondo Minisci EngAn3-CFD

How good are numerical solutions?


Consistency, stability and convergence

21
Dr Edmondo Minisci EngAn3-CFD

How good are numerical solutions? [1]

 numerical solutions are approximate solutions as errors arise from each part
of the process.

 these errors are classified in three categories

1- Modeling errors: difference between actual solution and the exact solution
of the mathematical mode

2- Discretisation errors: difference between the exact solution of the system


of algebraic equations generated by the numerical
scheme and the exact analytical solution of the PDE problem
3- Round-off errors : difference between exact solution of algebraic
equations and the solution by iterative model
(i.e., solution given by the computer)

22
Dr Edmondo Minisci EngAn3-CFD

Consistency: analysis of truncation error [1] - RECALL

 a Finite Difference is identify by replacing every term by the corresponding


Taylor series expansions in the equation

an example, consider the Finite Difference given by:


Ti 1  Ti 1
2Dx
Terms in this finite difference can be written using
Taylor series expansion by:
Dx 2 Dx3
Ti 1  T ( xi  Dx)  T ( xi )  DxT ' ( x)  T ' ' ( x)  T ' ' ' ( x)  ...
2! 3!
Dx 2 Dx3 '''
Ti 1  T ( xi  Dx)  T ( xi )  DxT ' ( x)  T ' ' ( x)  T ( x)  ...
2! 3!
then substituting we have :
2
2DxT ' ( x )  Dx3T ' ' ' ( x )  ...
Ti 1  Ti 1 3!

2Dx 2Dx
23
Dr Edmondo Minisci EngAn3-CFD

Consistency: analysis of truncation error [2] - RECALL

which is written as

Ti 1  Ti 1 1
 T ' ( x)  Dx 2T ' ' ' ( x)  ...  T ' ( x)  ( Dx 2 )
2Dx 3!

T
 we conclude that this finite difference is a second order approximation to ( x)
x

Ti 1  Ti 1 1
 T ' ( x)  Dx 2T ' ' ' ( x)  ...  ( Dx 2 )
2Dx 3!

The truncation errors

Consistency means the discretization should become


the exact solution as the grid spacing Dx tends to zero.

Rule : Grid spacing should be chosen to minimize discretization error


24
Dr Edmondo Minisci EngAn3-CFD

Stability analysis of numerical Schemes: basics


T  2T

Consider the heat conduction equation t x 2

Tin 1  Tin
with an associated difference equation Tin1  2Tin  Tin1

Dt Dx 2

Din 1  Din
If D denotes the exact solution of the Din1  2 Din  Din1
finite difference equation then we have 
Dt Dx 2

The solution SC computed by


the computer is not the exact SC  D   Round-off error
solution:

Because the computer is


programmed to solve the difference SC in 1  SC in SC in1  2 SC in  SC in1
equation, the evolution equation 
for SC is also
Dt Dx 2
25
Dr Edmondo Minisci EngAn3-CFD

Stability analysis of numerical Schemes: basics

Combining equations for D and Sc it follows

 in 1   in  in1  2 in   in1

Dt Dx 2

So the iteration error evolves in time following the same numerical scheme

Stable numerical scheme is one in which the error does not increase as we
progress from time step n to step n+1

 in 1
1
i n

26
Dr Edmondo Minisci EngAn3-CFD

Stability analysis of numerical Schemes: basics

oscillations

A decreasing residual indicating Iteration errors cause oscillation at


convergence of numerical solution early stage of the solution before
smoothing out

27

You might also like