EngAn3 CFD 2013 14 Lect - 1
EngAn3 CFD 2013 14 Lect - 1
Engineering Analysis 3
2013-2014 / 2nd semester
What about
CFD terminology
Discretisation techniques
2
Dr Edmondo Minisci EngAn3-CFD
“Housekeeping”
This CFD course has two components
3
Dr Edmondo Minisci EngAn3-CFD
“Housekeeping”
4
Dr Edmondo Minisci EngAn3-CFD
“Housekeeping”
???????????????????????????
5
Dr Edmondo Minisci EngAn3-CFD
“Housekeeping”
recommended textbooks :
Zikanov, O., Essential Computational Fluid Dynamics, Wiley Higher
Education, March 2010.
• other textbooks:
H K Versteeg & W Malalasekera, An introduction to computational fluid dynamics
J H Ferziger & M Peric , Computational methods for fluid dynamics
6
Dr Edmondo Minisci EngAn3-CFD
“Housekeeping”
Details on the project and on the report will be given during Fluent
tutorial sessions
7
Dr Edmondo Minisci EngAn3-CFD
Now a must during design processes and forecasting within a wide range of
industries
Aerospace industry:
Automotive industry:
Meteorology:
8
Dr Edmondo Minisci EngAn3-CFD
Relatively fast
• CFD simulations can be executed in a short period of time.
• Quick turnaround means engineering data can be introduced early in the design
process.
9
Dr Edmondo Minisci EngAn3-CFD
10
Dr Edmondo Minisci EngAn3-CFD
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
11
Dr Edmondo Minisci EngAn3-CFD
12
Dr Edmondo Minisci EngAn3-CFD
The first version of the FLUENT code was launched in October 1983 by
Creare Inc. Fluent Inc. was established in 1988
13
Dr Edmondo Minisci EngAn3-CFD
The original codes were relatively primitive, hard to use, and not very
accurate
14
Dr Edmondo Minisci EngAn3-CFD
2w 2w
0 one dimensional wave
w(t , x) Partial
t 2
x 2
propagation equation
Differential
T T 2
one dimensional
0 diffusion equation T (t , x) Equations
t x 2
15
Dr Edmondo Minisci EngAn3-CFD
The quasilinear PDEs can be classified into three types according to the
existence and form of their characteristics.
This has deep implications for the choice of numerical methods: different
numerical methods must be used for equations of different types.
16
Dr Edmondo Minisci EngAn3-CFD
PDE is parabolic if u 2u
B 4 AC 0
2
0
x y 2
2u 2u
hyperbolic if B 2 4 AC 0 2 0
x 2
y
B 4 AC 0
2 2u 2u
elliptic if 2 0
x 2
y
17
Dr Edmondo Minisci EngAn3-CFD
Class exercise
1 M
a
2 2 2
x 2
y 2
0 with Ma 1
1 M
a
2 2 2
x 2
y 2
0 with Ma 1
T 2T
k 0 with k 0
t x 2
18
Dr Edmondo Minisci EngAn3-CFD
Class exercise
1 M
a
2 2 2
x 2
y 2
0 with Ma 1
2 2 2
A B C D E F G 0
x 2
xy y 2
x y
B 2 4 AC 0 elliptic
19
Dr Edmondo Minisci EngAn3-CFD
Class exercise
1 M
a
2 2 2
x 2
y 2
0 with Ma 1
2 2 2
A B C D E F G 0
x 2
xy y 2
x y
B 2 4 AC 0 hyperbolic
20
Dr Edmondo Minisci EngAn3-CFD
Class exercise
T 2T
k 0 with k 0
t x 2
2T 2T 2T T T
A B C D E FT G 0
x 2
xt t 2
x t
B 2 4 AC 0 parabolic
21
Dr Edmondo Minisci EngAn3-CFD
Class exercise
1 M
a
2 2 2
x 2
y 2
0 with Ma 1
Potential equation
governing steady,
isentropic, inviscid,
compressible flow past
1 M
a
2 2 2
x 2
y 2
0 with Ma 1
a slender body with a
free stream Mach
number Ma
T 2T
k 0 with k 0 Diffusion equation
t x 2
22
Dr Edmondo Minisci EngAn3-CFD
Time-marching finite-difference
technique of Euler equations
The unsteady Euler equations are
hyperbolic with respect to time, no
matter whether the flow is locally
subsonic or supersonic.
23
23
Dr Edmondo Minisci EngAn3-CFD
MATLAB stands for MATrix LABoratory: its basic variable is arrays, i.e. vectors
and matrices. Matlab also has many built-in functions, as well as specialised add-
on tool boxes.
24
Dr Edmondo Minisci EngAn3-CFD
25
Dr Edmondo Minisci EngAn3-CFD
1. Interactive mode
• just type commands and define variables, empty workspace with
command clear
2. Simple scripts
• M-file (name.m) with list of commands
• Operate on existing data in work space, or create new data
• Variables remain in workspace (until cleared)
• Re-useable
3. M-file functions
• M-fille as with scripts
• May return values
• Re-usable
• Easy to call from other functions
26
Dr Edmondo Minisci EngAn3-CFD
27
Dr Edmondo Minisci EngAn3-CFD
Matlab distinguishes between row and column vectors. x defined on the previous
slide is a row vector - use spaces or commas (,) to separate entries. To define
column vector, use semi-colons (;) to separate entries (rows), e.g.
>> y = [6; 7; 8; 9; 10];
Or transpose a row vector with the prime symbol ('), e.g.
>> y = [6 7 8 9 10]‘;
Or directly write it as a column vector, e.g.
>> y = [6
7
8
9
10];
A dot product is a row vector multiplied by (*) a column vector, e.g. x*y, y'*x', x*x' or
y'*y.
What happens when we multiply a column vector by a row vector, e.g. y*x?
28
Dr Edmondo Minisci EngAn3-CFD
Create a natural integer sequence (vector) by specifying the first and the last
element separated by a colon (:), e.g.
>> u = [0:8]
u=
012345678
A different increment can be specified as a third (middle) argument, e.g.
>> v = [0:2:8]
v=
02468
Vector elements can be referenced with parentheses.
Be careful: Indices start at 1.
>> v(2)
ans =
2
A number of elements can be referenced using the colon notation, e.g. v(1:3),
u(2:2:6). What will these give?
29
Dr Edmondo Minisci EngAn3-CFD
Row vectors are simply 1 x n matrices, and column vectors are n x 1 matrices.
We can define more general matrices using spaces (or commas) to separate
column entries, and semi-colons (or carriage return) to separate rows, e.g.
1 2
A=[1 2; 3 4]; is the 2 x 2 matrix
3
4
4 5
B=[4 5; 6 7; 8 9]; is the 3 x 2 matrix 6 7
8 9
Reference the ith-row jth-column element of matrix A, with A(i,j). We can also
extract a submatrix with the colon notation (just a colon gives the full row/column),
e.g.
B(2:3,:) is the 2 x 2 matrix 6 7
8
9
A prime (') transposes a matrix.
30
Dr Edmondo Minisci EngAn3-CFD
We can use vectors to build larger vectors by placing them in square parenthesis
and separating them by spaces (commas), called horizontal concatenation, so
>> z=[x y'] is the row vector 1 2 3 4 5 6 7 8 9 10
31
Dr Edmondo Minisci EngAn3-CFD
We can multiply every element of a matrix by a scalar, e.g. 3*A, with the obvious
results. So if r is a real number, and
>> D is the matrix d ... d
1,1 1, n
...... ... .....
d ... d
then
m ,1 m,n
Similarly, if we add or subtract a scalars and matrices together, e.g. A+3 or 1-B,
then the same scalar operation is applied to each element in the matrix.
32
Dr Edmondo Minisci EngAn3-CFD
Two matrices of the same dimension can be added together with +. The operation
is elementwise, so the two matrices must have the same dimension.
For the two matrices D and E, where
d1,1 ... d1, n
>> D is the matrix ...... ... .....
d ... d
m ,1 m , n
So for example,
>> B'+C
ans =
5 8 11
13 16 19
but
>> B+C
??? Error using ==> plus
Matrix dimensions must agree.
We also have elementwise multiply (.*) and divide (./). With elementwise division,
be careful that there are no zero elements in the second matrix. Why?
The elementwise power operator (.^), applies a power to each element of a matrix.
34
Dr Edmondo Minisci EngAn3-CFD
Can also take the power of any square matrix with the hat symbol (^), e.g. A^2 is
equivalent to A*A.
35
Dr Edmondo Minisci EngAn3-CFD
36