You are on page 1of 24

Finite Difference Method

Dr. Zaib Ali


Discretization

• Space discretization – Mesh Generation


– Continuum of space is replaced by a finite number of points where the numerical values of the
variables will have to be determined.

• Equation discretization – FDM, FVM


– transformation of the differential or integral equations (having continuum of values) to discrete
algebraic operations involving the values of the unknowns at only finite number of points or
volumes.
Finite Difference Method

• Structured Grid
• Uniform and equal ∆x and ∆y
• Index i and Index j
• Computational Domain

Replacing a partial derivative with a suitable


algebraic difference quotient, i.e., a finite
difference.

if ui, j denotes the x component of velocity at


point (i, j). Then using Taylor’s series: x

(1)
Finite Difference Method

Algebraic finite-difference quotient

• The lowest-order term in the truncation error involves ∆x to the first power; hence,
the finite-difference expression in the above Eq. is called first-order-accurate.

First-order forward difference

terms of order ∆x
Finite Difference Method

Taylor series expansion for ui-1, j , expanded


about ui, j

(2)
x

First-order backward difference

In CFD, first-order accuracy is not sufficient. To construct a finite-difference


quotient of second-order accuracy, simply subtract Eq. (2) from Eq. (1)

Second Order Central Difference


Finite Difference Method
• Difference expressions for the y derivatives

Forward Difference

Backward Difference

Central Difference

• Highest-order derivatives which appear in the Navier-Stokes equations are second


order partial derivatives, reflected in the viscous terms.
• Summing Eq. (2) and Eq. (1)

Second-order Central Differences


Finite Difference Method
For the case of mixed derivatives, Differentiating Eq. (1) with respect to y

Differentiating Eq. (2) with respect to y

Subtracting above equations


Finite Difference Method

Using expressions:

Second-order Central Differences


Finite Difference Method
Finite Difference Method
Finite Difference Method
Finite Difference Method

• Unlimited number of finite-difference expressions can be derived with ever


increasing accuracy. For example,
Finite Difference Method

• What about 2nd order differencing at a boundary?


• Using an alternative approach to Taylor’s series: Polynomial Approach
Finite Difference Equations

• Consider unsteady, one-dimensional heat conduction equation with constant


thermal diffusivity

Parabolic PDE, Marching Solution

i Index of variable x, subscript


n Index of marching variable t, superscript
Finite Difference Equations

• Truncation error for the difference equation is


• Difference equation is an algebraic equation
Explicit and Implicit Methods
In an explicit approach, each difference equation contains only one unknown and
therefore can be solved explicitly for this unknown in a straightforward manner.
Explicit and Implicit Methods
writing the spatial difference on the right-hand side in terms of average properties
between time levels n and n + 1.

Crank Nicolson form.


One equation with
three unknowns

• The above Eq. applied at a given grid point i does not stand alone; it cannot by
itself result in a solution for
• Rather this Eq. must be written at all interior grid points, resulting in a system of
algebraic equations from which the unknowns for all i can be solved
simultaneously.
• Implicit approach is one where the unknowns must be obtained by means of a
simultaneous solution of the difference equations applied at all the grid points
arrayed at a given time level.
Explicit and Implicit Methods

Rearranging to display the unknowns on the LHS

Simplifying the nomenclature by denoting the following quantities by A, B, and Ki

Ki in the above Eq. consists of properties at time level n, which are known.
Explicit and Implicit Methods

Dropping the superscript for convenience

Because of the stipulated boundary conditions at grid points 1 and 7, T1 in above Eq. is a
known number.

T7 is also a known number.


Explicit and Implicit Methods
Five equations for the five unknowns T2 , T3 , T4 , T5 , and T6

Tridiagonal Matrix, solved


for example using Thomas’
Algorithm

• Clearly, implicit approach is more involved than an explicit approach.


• For the explicit approach, once ∆x is chosen, then ∆t is not an independent,
arbitrary choice; rather, ∆t is restricted to be equal to or less than a certain
value prescribed by a stability criterion else the time-marching procedure will
quickly go unstable.
• There are no such stability restrictions on an implicit approach.
• For most implicit methods, stability can be maintained over much larger values
of ∆t than for a corresponding explicit method; indeed, some implicit methods
are unconditionally stable, meaning that any value of ∆t, no manner how large,
will yield a stable solution.
• Hence, for an implicit method, considerably fewer time steps are required to
cover a given interval in time compared to an explicit method.
Explicit and Implicit Methods

An implicit method using large values of ∆t may not accurately define the
timewise variation of the unsteady flow field.
Finite Difference Method
Finite Difference Method
The Eigenvalue Method

You might also like