Finite Difference Discretization
Reference: Computational Fluid
Dynamics by J. D. Anderson
Discrete Grid Points
Taylor’s Series
• Above equation is mathematically exact if
number of terms in the series are infinite and
series converges or
• Delta X goes to zero.
Taylor’s Series Continued
Finite Difference Representation
Forward Difference Formula
Finite Difference Representation
Backward Difference Formula
Finite Difference Representation
Central Difference Formula
Finite Difference Representation
Second Order Derivative
Second Order Derivative
Differentiating with respect to y
Second Order Derivative
Differentiating with respect to y
Second Order Derivative
Subtracting
Finite Differences
Finite Differences
Higher Order Finite Differences
Fourth Order Accurate Finite Difference Formula
• Higher order accurate finite difference
formulae need more grid points.
• They may require smaller number of total grid
points to get accurate results.
• In general, higher order accurate formulae
higher quality solution.
Boundary Condition
Polynomial Approach
Difference Equation
Difference Equation
• Difference equation is not same as PDE.
• Difference equation is an algebraic equation.
• As Delta t and Delta x go to zero, difference
equation approach PDE => Consistency
Explicit and Implicit Approaches
Explicit Approach
Crank Nicolson Approach
Crank Nicolson Approach
Explicit Schemes
• Relatively simple to set up and program.
• Stability constraint restricts choice of time step,
more computer time may be needed.
Implicit Schemes
• More complicated to set up.
• More stable, large time steps may be taken,
may lead to lower computer time.
• Computer time per time step is much higher
compared to explicit scheme.
• May not be suitable for time accurate
calculations if higher time step is chosen.
Error Analysis
• Discretization error
– Difference between exact solution of PDE and exact
solution of corresponding difference equation.
– It is truncation error for the difference equation.
• Round-off error
– Numerical error introduced by computer due to
rounding off the numbers to given significant digits
after repetitive number of calculations.
Error Analysis
• A: analytical solution of PDE
• D: exact solution of difference equation
• N: Numerical solution from computer with
finite accuracy
• Discretization error = A – D
• Round-off error = R = N – D
•N=D+R
Error Analysis
Stable solution
Error Analysis
• Length of domain = L (-L/2:L/2)
• Exact values known at boundaries: Error = 0.
• Variation of error with distance is random.
Error Analysis
Von Nuemann Method
Fourier Series
• Above equation represents both sine and
cosine series.
• km is called wave number.
• Real part of above equation represents error.
Wave number
Wavelength: Wave number:
Wave number
Wave number
• km = 2 π / L : One wave fitted into interval L
• km = 2 π / (L / 2) = 2 (2 π / L): Two wave fitted
into interval L
• km = m (2 π / L): m waves fitted into interval L
• Higher the wave number for a given interval,
more waves are fitted into the interval
Error Analysis
• Consider a domain with length L divided into (N
+ 1) points or N intervals, i.e. Δx = L/N.
• Largest allowable wavelength = L
• Smallest allowable wavelength = 2Δx = 2L/N
Error Analysis
• Consider a domain with length L divided into (N
+ 1) points or N intervals.
• Δx = L/N.
• Largest allowable wavelength = L
• Smallest allowable wavelength = 2Δx = 2L/N
• k1 = 2 π / L
• km = 2 π / (2L / N) = (N/2) (2 π / L)
• For a grid with (N + 1) grid points:
Error Analysis
• Include temporal variation of error with time
too.
Error Analysis
Error Analysis
Error Analysis
G: Amplification Factor
Error Analysis
Always True
Condition for stability