Descritization
Descritization
What is Discretization?
Discretization is the process by which a closed-form mathematical
expression, such as a function or a differential or integral equation
involving functions, all of which are viewed as having an infinite continuum
of values throughout some domain, is approximated by analogous (but
different) expressions which prescribe values at only a finite number of
discrete points or volumes in the domain.
Analytical solutions of partial differential
equations involve closed-form expressions
which give the variation of the dependent
variables continuously throughout the
domain. In contrast, numerical solutions can
give answers at only discrete points in the
domain, called grid points.
Discrete grid points.
1
What is Discretization?
Discretization is all about how to replace the partial derivatives ( or
integrals) in the governing equations of motion with discrete numbers.
Discretization of the partial differential equations is called finite
differences, and discretization of the integral form of the equations is
called finite volumes.
For a two-dimensional flow field which is governed by the Navier-Stokes
equations, or by the Euler equations, are partial differential equations. An
analytical solution of these equations would provide expressions for u, v,
p, density, etc., as functions of x and y, or the flow-field variables at any of
the infinite number of (x, y) points in the domain.
The partial differential equations are replaced by a system of algebraic
equations which can be solved for the values of the flow-field variables at
the discrete grid points only. In this sense, the original partial differential
equations have been discretized.
2
Finite Difference Method – FDM
The partial differential equation (PDE) can be replaced with an algebraic
equation using a finite difference method. Most common finite-difference
representations of derivatives are based on Taylor's series expansions.
For example, referring to Fig., if u(i, j) denotes the x component of
velocity at point (i, j), then the velocity u(i+1, j) at point (i + 1, j) can be
expressed in terms of a Taylor series expanded about point (i, j) as
follows:
3
Finite Difference Method – FDM
𝐟 𝐱 𝐬𝐢𝐧 𝟐𝛑𝐱
𝑓 0.2 𝑠𝑖𝑛2 ∗ 𝜋 ∗ 0.2= 0.9511
Let ∆𝑥 0.02
𝑓 𝑥 ∆𝑥 𝑓 0.22 𝑠𝑖𝑛2 ∗ 𝜋 ∗ 0.22 0.9823
4
Finite Difference Method – FDM
10
11
5
Finite Difference Method – FDM
12
13
6
Finite Difference Method – FDM
Given the function 𝑓 𝑥 𝑥 compute the first derivative off 𝑓 at x = 2 using forward and backward
differencing of order (∆x). Compare the results with a central differencing of O(∆x)2 and the exact analytical
value. Use a step size of ∆x = 0.1. Repeat the computations for a step size of ∆x=0.4.
Forward Difference
Backward Difference
14
Exact Solution
15
7
Finite Difference Method – FDM
Solution at ∆x=0.4
16
Problem
Consider the viscous flow of air over a flat plate. At a given station in the flow
direction, the variation of the flow velocity, u, in the direction perpendicular to the
plate (the y direction) is given by the expression
Eq # 1
where L = characteristic length = 1 in. The units of u are feet per second. The
viscosity coefficientµ= 3.7373 x 10-7 slug/(ft · s). We use this Eq. 1 to provide
the values of u at discrete grid points equally spaced in they direction, with ~y =
0.1 in. Specifically, we obtain from Eq. 1 are given in Table.
Using these discrete values, calculate the shear stress at
the wall Tw three different ways, namely: (a) Using a first-
order one-sided difference (b) Using the second-order one-
sided difference (c) Using the third-order one-sided
difference. Finally, compare these calculated finite-
difference results with the exact value of Tw.
17
8
Problem
18
Problem
19
9
FDM for 2D conduction problem
𝜕 2𝑇 𝜕 2𝑇 𝜕 2𝑇 1 𝜕𝑇
𝐻𝐺
𝜕𝑥2 𝜕𝑦2 𝜕𝑧2 𝛼 𝜕𝑡
𝜕 2𝑇 𝜕 2𝑇
0
𝜕𝑥2 𝜕𝑦2
𝑇𝑖 1, 𝑗 2𝑇𝑖 . 𝑗 𝑇𝑖 1, 𝑗 𝑇𝑖 , 𝑗 1 2𝑇𝑖 , 𝑗 𝑇𝑖 , 𝑗 1
→ 0
∆𝑥2 ∆𝑦2
21
𝜕 2𝑇 𝑇 2𝑇 𝑇
𝐻𝑂𝑇
𝜕𝑥2 ∆𝑥2
𝜕𝑇 𝑇 𝑇
𝐻𝑂𝑇
𝜕𝑡 ∆𝑡
𝑇 𝑇 𝑇 2𝑇 𝑇
𝛼
∆𝑡 ∆𝑥2
23
10
Explicit Method
Using 1D transient heat equation
𝑇 𝑇 𝑇 2𝑇 𝑇
𝛼
∆𝑡 ∆𝑥2
27
Explicit Method
𝛼 ∆𝑡 𝑇 2𝑇 𝑇
𝑇 𝑇
∆𝑥 ∆𝑥2
𝛼 ∆𝑡 𝑇 2𝑇 𝑇
𝑇 𝑇
∆𝑥 ∆𝑥2
28
11
Implicit Method - Crank Nicholson Technique
1 1
𝑇 𝑇 𝑇 𝑇 𝑇 𝑇 𝑇 𝑇
𝛼2 2
∆𝑡 ∆𝑥2
29
Let
𝛼 ∆𝑡
𝐴
2∆𝑥
𝛼 ∆𝑡
𝐵 1
∆𝑥
∆
𝐾 𝑇 𝑇 2𝑇 𝑇 )
∆
𝐴𝑇 𝐵𝑇 𝐴𝑇 𝐾
30
12
Implicit Method - Crank Nicholson Technique
AT BT AT K
• At point 2
AT BT AT K
BT AT K AT K
• At point 3
AT BT AT K
• At point 4
AT BT AT K
• At point 5
AT BT AT K
• At point 6
AT BT K AT K
31
32
13
Numerical Schemes for FDM
Laasonen scheme
Forward Time Central Space (FTCS) scheme
Richardson Scheme
DuFort-Frankel scheme
First-order upwind scheme
Runge-Kutta method
Crank-Nicolson method
Gauss-Seidel Iteration methods
Lax-Wendroff method
Richtmyer/Lax-Wendroff Multi-step method
MacCormack method
34
Type of Errors
Discretization error, the difference between the exact analytical solution
of the partial differential equation and the exact (round-off-free) solution of
the corresponding difference equation. The discretization error is simply
the truncation error for the difference equation plus any errors introduced
by the numerical treatment of the boundary conditions.
Round-off error, the numerical error introduced after a repetitive number
of calculations in which the computer is constantly rounding the numbers
to some significant figure.
35
14
Some terminologies
Consistency
A finite difference approximation of partial differential equation is
consistence if FDE approaches to PDE as the grid size approaches zero.
Stability
A numerical scheme is said to be stable if any error introduced in
the FDE does not grow with the iterations. They should either shrink or at
least stop growing.
Convergence
Convergence means the simulation's numerical values (like velocity,
pressure, temperature) no longer change significantly as the solver iterates
through the calculations.
36
Some terminologies
Boundedness
In CFD, boundedness refers to the property of a solution where all
flow properties (like velocity, pressure, and temperature) remain within their
physically meaningful bounds. Essentially, the numerical solution should
never exceed the maximum or minimum values observed at the boundaries
of the domain.
37
15
Thanks
38
16