0% found this document useful (0 votes)
32 views36 pages

EngAn3 CFD 2013 14 Lect - 1

This document provides an introduction to a course on Computational Fluid Dynamics (CFD). It discusses key topics that will be covered, including CFD terminology, discretization techniques, sources of errors, and the goal of gaining understanding to apply CFD tools in engineering practice. It also outlines the structure of the course, which includes both theoretical lectures and hands-on simulations using ANSYS software. The use of CFD in engineering design is discussed due to its ability to simulate real conditions relatively quickly and inexpensively compared to physical testing. Finally, the mathematical foundations of CFD are introduced, including the use of partial differential equations to model fluid and heat transfer problems.

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)
32 views36 pages

EngAn3 CFD 2013 14 Lect - 1

This document provides an introduction to a course on Computational Fluid Dynamics (CFD). It discusses key topics that will be covered, including CFD terminology, discretization techniques, sources of errors, and the goal of gaining understanding to apply CFD tools in engineering practice. It also outlines the structure of the course, which includes both theoretical lectures and hands-on simulations using ANSYS software. The use of CFD in engineering design is discussed due to its ability to simulate real conditions relatively quickly and inexpensively compared to physical testing. Finally, the mathematical foundations of CFD are introduced, including the use of partial differential equations to model fluid and heat transfer problems.

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/ 36

Dr Edmondo Minisci EngAn3-CFD

Engineering Analysis 3
2013-2014 / 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

What about

 CFD terminology

 Discretisation techniques

 Nature of the errors

 Aim: knowledge and understanding to better use CFD tools for


engineering practice

2
Dr Edmondo Minisci EngAn3-CFD

“Housekeeping”
This CFD course has two components

Part 1. theory behind Computational Fluid Dynamics:


this involves numerical approximations to Partial
Differential Equations (PDEs)
lectures: Tuesday 1-2 pm (Dr Minisci)

Part 2. flow simulations using the software ANSYS (Workbench/Fluent):


Computer Labs: Tuesday 10am - 1pm (Dr Minisci , Mr Mogavero)
A-G H–M N-Z

50% part 1 + 50% part 2 = 2nd semester marks

3
Dr Edmondo Minisci EngAn3-CFD

“Housekeeping”

there is NO separate tutorial class !

 the lecture is both the course and exercises

 Matlab will be introduced and used as a practical tool to “digest”

 possible mid term assessments to verify current understanding


 mid term and final class evaluation

4
Dr Edmondo Minisci EngAn3-CFD

“Housekeeping”

 provisional date of exam :

???????????????????????????

 no lecture material will be allowed during the exam:


although the exam will not be a memory test
 to succeed at the exam, make sure you understand examples shown
during lectures
 Examples of questions and good answers will be given through the
class

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”

 flow simulations using the software ANSYS Workbench/Fluent


 Report to be submitted online within
?????????????????????

 Details on the project and on the report will be given during Fluent
tutorial sessions

7
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:

8
Dr Edmondo Minisci EngAn3-CFD

CFD in engineering designs


Relatively low cost
• Using physical experiments and tests to get essential engineering data for
design can be expensive.
• CFD simulations are relatively inexpensive, and costs are likely to decrease as
computers become more powerful.

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.

Ability to simulate real conditions


• Many flow and heat transfer processes can not be (easily) tested, e.g.
hypersonic flow.
• CFD provides the ability to theoretically simulate any physical condition.

9
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.

10
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)

11
Dr Edmondo Minisci EngAn3-CFD

Introduction to CFD [2]

Development of numerical methods for solving ordinary and partial


differential equations started in the first half of the twentieth century.

First simulations of realistic two-dimensional flows were performed in the


late 1960s, while three-dimensional flows could not be seriously
approached until the 1980s.

From a scientific discipline, CFD has transformed into an everyday tool of


engineering design, optimization, and analysis.

12
Dr Edmondo Minisci EngAn3-CFD

Introduction to CFD [3]


Except for few strongly simplified models, the equations for distributed
properties
are partial differential equations (PDEs), often nonlinear, which are solved
analytically (exact solutions) or using numerical methods (approximate
solutions)

The first version of the FLUENT code was launched in October 1983 by
Creare Inc. Fluent Inc. was established in 1988

STAR-CD's origins go back to the foundation of Computational Dynamics


in 1987 by Prof. David Gosman

13
Dr Edmondo Minisci EngAn3-CFD

Introduction to CFD [4]


Except for few strongly simplified models, the equations for distributed
properties
are partial differential equations (PDEs), often nonlinear, which are solved
analytically (exact solutions) or using numerical methods (approximate
solutions)

The original codes were relatively primitive, hard to use, and not very
accurate

Current CFD packages generally are capable of producing accurate


solutions of simple flows. The codes are designed to be able to handle
very complex geometries and complex industrial problems.

When used with care by a knowledgeable user CFD codes are an


enormously valuable design tool!

14
Dr Edmondo Minisci EngAn3-CFD

The mathematical aspect of 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) or using numerical methods (approximate solutions)

 examples of ODE and PDEs :

d 2x x(t), position of a mass Ordinary


m 2
 kx  0 attached to spring (only one Differential
dt unknown independent variable) Equations

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 mathematical aspect of CFD [2]

Partial differential equations of fluid dynamics and heat transfer belong to


the class of quasilinear PDE, which means that they are linear in their
highest-order derivatives, but perhaps not in other terms.

The quasilinear PDEs can be classified into three types according to the
existence and form of their characteristics.

The information in the solutions tends to propagate along the


characteristics if they exist.

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

The mathematical aspect of CFD [3]

Single linear equation of second order for a function of two variables

 2u  2u  2u u u where u ( x, y ) is the unknown


A 2 B C  D  E  Fu  G  0
x xy y 2 x y function

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

Are the following Partial Differential Equations


elliptic, hyperbolic, or parabolic ?

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

Are the following Partial Differential Equations


elliptic, hyperbolic, or parabolic ?

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
xy y 2
x y

A0 B0 C 1 D0 E0 F 0 G0

B 2  4 AC  0 elliptic

19
Dr Edmondo Minisci EngAn3-CFD

Class exercise

Are the following Partial Differential Equations


elliptic, hyperbolic, or parabolic ?

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
xy y 2
x y

A0 B0 C 1 D0 E0 F 0 G0

B 2  4 AC  0 hyperbolic

20
Dr Edmondo Minisci EngAn3-CFD

Class exercise

Are the following Partial Differential Equations


elliptic, hyperbolic, or parabolic ?

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
xt t 2
x t

A0 B0 C 0 D0 E 1 F 0 G0

B 2  4 AC  0 parabolic

21
Dr Edmondo Minisci EngAn3-CFD

Class exercise

Are the following Partial Differential Equations


elliptic, hyperbolic, or parabolic ?

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

Hypersonic blunt body problem


First practical solution by Moretti and
Abbett in 1966

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.

Then major modelling achievements


in 80’s and 90’s

23

23
Dr Edmondo Minisci EngAn3-CFD

Introduction to Matlab [1]


Matlab is an intuitive, easy-to-learn, high performance language for numerical
computation and data visualisation. It can handle:

• Numerical mathematics and computation


• Algorithm development
• Data acquisition
• Modelling, simulations, and prototyping
• Data analysis, exploration, and visualisation
• Scientific and engineering graphics
• Application development, incl. graphical user interfaces

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

Introduction to Matlab [2]

25
Dr Edmondo Minisci EngAn3-CFD

Introduction to Matlab [3]


Different ways to use Matlab

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

Introduction to Matlab [4]


Variables do not need to be declared. Simply assign values to variable names,
e.g.
>> x = [1 2 3 4 5]
x=
12345

For quiet assignment, terminate expression with a semi-colon. To display a


variable, simply use the variable name on its own.
>> x = [1 2 3 4 5];
>> x
x=
12345

27
Dr Edmondo Minisci EngAn3-CFD

Introduction to Matlab [5]


Vectors

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

Introduction to Matlab [6]


Vectors

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

Introduction to Matlab [7]


Matrices

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

Introduction to Matlab [8]


Matrices

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

Semi-colons (carriage returns) are for vertical concatenation, so


>> C=[x(1:3) ; y(3:5)'] is the matrix
1 2 3 
 
 8 9 10 

Likewise we can block together compatible matrices to build larger


matrices.

What will [A B'] and [A ; B] produce?

31
Dr Edmondo Minisci EngAn3-CFD

Introduction to Matlab [9]


Matrices

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 

>> r*D is the matrix  rd1,1 ... rd1, n 


 
 ...... ... ..... 
 rd ... rd 
 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

Introduction to Matlab [10]


Matrices

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 

 e1,1 ... e1, n 


 
>> E is the matrix  ...... ... ..... 
e 
 m ,1 ... em , n 
then
 d1,1  e1,1 ... d1, n  e1, n 
>> D+E is the matrix  
 ...... ... ..... 
d  e ... d m , n  em , n 
 m ,1 m ,1

Subtraction works in a similar elementwise way, e.g. C'-B.


33
Dr Edmondo Minisci EngAn3-CFD

Introduction to Matlab [11]


Matrices

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

Introduction to Matlab [12]


Matrices

Standard Matrix multiplication, with *, requires matrices to have compatible


dimensions, so
19 28 
>> B*A gives the matrix  
 27 40 
 35 52 
 
but
>> A*B
??? Error using ==> mtimes
Inner matrix dimensions must agree.

Which of the following are valid: A*A, A*B', B'*A'?

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

Introduction to Matlab [13]


Matrices

For a square invertible n x n matrix M, and compatible vector b, we have the


matrix equivalent of division,

>> a = M\b is the solution of the equation Ma = b


>> a = b/M is the solution of the equation aM = b

More generally, see the eig built-in function.

When is a matrix invertible?

36

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy