Finite Difference Method (FDM)

This section describes the formulation and methodology of finite difference method to solve the governing equations on a computational domain.

The finite difference method is the oldest method for the numerical solution of partial differential equations. It is also the easiest to formulate and program for problems which have a simple geometry.

When calculating derivatives finite difference replaces the infinitesimal limiting process with a finite quantity. The derivative of a function at point expressed as: (1)
f x = lim Δ x 0   f ( x + Δ x ) f ( x ) Δ x  
is replaced by: (2)
f x = f ( x + Δ x ) f ( x ) Δ x + O ( Δ x )  

The preceding expression is commonly referred to as the forward difference approximation. This derivative can have more refined approximations using a number of approaches such as truncated Taylor series expansions and polynomial fitting.

The term O ( Δ x ) gives an indication of the magnitude of the error as a function of the mesh spacing and is therefore termed as the order of magnitude of the finite difference method. In the above formulation, the finite difference approximation employed is first-order accurate. A second-order approximation would have the order of magnitude expressed as O ( Δ x 2 ) . Most of the finite difference methods used in practice are second-order accurate. An example of a second-order method is the central difference approximation of the first derivative. It is expressed as: (3)
f x = f ( x + Δ x ) f ( x Δ x ) 2 Δ x + O ( Δ x 2 )  
The basic methodology in the simulation process using finite difference approach consists of the following steps.

Figure 1. Basic Methodology in the Simulation Process Using Finite Difference Approach

The finite difference formulation generally employs a structured grid. The most commonly used indices are i , j and k for the grid lines at x = x i , y = y j and z = z k , respectively. The function value at such a grid point is expressed as f i , j , k f i j k f ( x i , y j ,   z k ) .

Consider the one dimension advection-diffusion equation for a scalar quantity φ governed by (4)
d ( ρ u φ ) d x = d d x ( ϵ d φ d x )

where u is the specified velocity, ρ is the density of the fluid and ϵ is the diffusivity.

If the domain is defined by the boundary x = 0 and x = L and the boundary conditions by φ ( 0 ) = φ 0 and φ ( L ) = φ L , the domain can be discretised (non-uniformly) by a total of N + 1 grid points for the finite difference solution of the problem.

The diffusion term can be approximated using the central difference (both the inner and outer derivative) as: (5)
d d x ( ϵ d φ d x ) i ( ϵ d φ d x ) i + 1 2 ( ϵ d φ d x ) i 1 2 1 2 ( x i + 1 x i 1 )
d d x ( ϵ d φ d x ) i ( ϵ i + 1 2 φ i + 1 φ i x i + 1 x i ) ( ϵ i 1 2 φ i φ i 1 x i x i 1 ) 1 2 ( x i + 1 x i 1 )
The convection term can also be approximated using the central difference as: (7)
d d x ( ρ u φ ) i ( ρ u φ ) i + 1 ( ρ u φ ) i 1 x i + 1 x i 1
If the grid is uniform and the values of density, velocity and coefficient of diffusion are constant throughout the domain the above equations reduce to: (8)
ρ u φ i + 1 φ i 1 2 Δ x = ϵ φ i + 1 2 φ i + φ i 1 Δ x 2

The resulting set of linear algebraic equations can be solved to get the values of at the grid points.

Finite difference methods are advantageous for the numerical solution of partial differential equations because of their simplicity, efficiency and low computational cost. Their major drawback is their geometrical inflexibility, such as application on an unstructured grid or moving boundaries. Their formulation increases in complexity as the complexity of the domain increases.

The restrictions resulting from the above mentioned geometrical complexities can be alleviated by the use of methods such as grid transformation and immersed boundary techniques.