Vous êtes sur la page 1sur 51

Computational Fluid

Dynamics
Finite Difference Method

1-1

FDM

1-2

FDM

1-3

FDM

1-4

FDM

1-5

FDM

1-6

FDM

1-7

FDM

1-8

FDM

1-9

FDM

1-10

FDM

1-11

FDM

1-12

FDM

1-13

FDM

1-14

FDM

1-15

FDM

1-16

FDM

1-17

FDM

1-18

FDM

1-19

FDM

1-20

FDM

1-21

FDM

Using this approach, now we derive the three point central difference
formula for second order derivative

1-22

FDM

1-23

FDM

1-24

FDM

1-25

POLYNOMIAL FITTING

1-26

POLYNOMIAL FITTING

1-27

POLYNOMIAL FITTING

1-28

POLYNOMIAL FITTING
Derive fourth order central difference Eq. by fitting a polynomial of
degree 4 on uniform grid. Also obtain the corresponding
approximations for the first, third and fourth order derivatives.

1-29

POLYNOMIAL FITTING

1-30

POLYNOMIAL FITTING

1-31

POLYNOMIAL FITTING

1-32

POLYNOMIAL FITTING

1-33

POLYNOMIAL FITTING

1-34

POLYNOMIAL FITTING

1-35

APPROXIMATION OF SECOND ORDER DERIVATIVE IN


GENERIC TRANSPORT EQUATION

1-36

APPROXIMATION OF SECOND ORDER DERIVATIVE IN


GENERIC TRANSPORT EQUATION

1-37

FINITE DIFFERENCE DISCRETE ALGEBRAIC SYSTEM


Finite difference approximation of derivatives in a partial differential
equation (PDE) leads to an algebraic equation at each node in terms of the
variable values at the node and its neighboring nodes.
This equation is linear for a linear PDE, and non-linear for non-linear
PDEs. In the latter case, the non-linear equation would require linearization
in the process of its numerical solution.
This quasi-linear equation obtained from the finite difference discretization
of a PDE of a generic scalar at a grid point can be represented as
(1)
where index P represents the node at which the PDE is approximated and l
denotes the neighboring node involved in finite difference approximation.
Coefficients Al and AP are functions of grid size and material properties. QP
1-38
contains all the terms which do not contains unknown variable

FINITE DIFFERENCE DISCRETE ALGEBRAIC SYSTEM


The node P and its neighbors form the so called computational molecule
(or stencil). In the finite difference and the finite volume methods, compass
notation is usually employed, i.e. for a node (i, j), node (i+1, j) is denoted
by E (eastern neighbor), node (i, j-1) is denoted by S (southern neighbor),
and so on. Figure depicts the computational molecules in 1D ,2D and 3D

1-39

FINITE DIFFERENCE DISCRETE ALGEBRAIC SYSTEM


Collection of algebraic equation (1) at all the computational nodes leads to
a system of algebraic equations given by
(2)
where A is the coefficient matrix, is the vector of unknown nodal values of
and Q is the vector containing terms on RHS of Eq. (1). Matrix A is sparse.
However, its structure depends on ordering of variables in vector .
For structured grids, variables are usually ordered starting from a corner
and traversing line after-line in a regular manner. This ordering scheme is
called lexicographic ordering and results in a poly-diagonal structure for
matrix A.
This ordering is not unique as it depends on the order of line traversal in
different directions. For example, if we start ordering the entries in vector
starting from southwest corner of the domain, proceed eastward
along each grid line, and then northward across the domain, we get the
1-40
ordering of indices as given in Table

FINITE DIFFERENCE DISCRETE ALGEBRAIC SYSTEM

Because matrix A is sparse and has a poly-diagonal structure for structured


grids, it is preferable to store it as a set of one dimensional arrays instead
of a full two-dimensional array. We can use the directional connection in
naming these 1D arrays (calling them as AP AW etc.), and thus write the
algebraic equation (1) for a two dimensional problem as
1-41

FINITE DIFFERENCE DISCRETE ALGEBRAIC SYSTEM

1-42

FINITE DIFFERENCE DISCRETE ALGEBRAIC SYSTEM


The indexing scheme described above is primarily required if one plans to
use a direct solver which require specification of an algebraic system in the
standard form Ax= b. In practical CFD applications, large size of the
system matrix normally dictates use of iterative solvers

1-43

ONE DIMENSIONAL HEAT CONDUCTION

1-44

ONE DIMENSIONAL HEAT CONDUCTION

1-45

TWO DIMENSIONAL HEAT CONDUCTION

1-46

ONE DIMENSIONAL ADVECTION-DIFFUSION

1-47

ONE DIMENSIONAL ADVECTION-DIFFUSION

1-48

ONE DIMENSIONAL HEAT CONDUCTION

1-49

ONE DIMENSIONAL HEAT CONDUCTION

1-50

ONE DIMENSIONAL HEAT CONDUCTION

1-51

Vous aimerez peut-être aussi