<< Chapter < Page Chapter >> Page >
Finite difference grid for discretizing PDE (grid point formulation)

The unit square is now discretized into JMAX by JMAX grid points where the boundary conditions and dependent variables will be evaluated. The grid spacing is δ = 1 / ( J M A X - 1 ) . The first and last row and column are boundary values.

The partial derivatives will be approximated by finite differences. For example, the second derivative of vorticity is discretized by a Taylor's series.

w i + 1 = w i + δ w x i + δ 2 2 2 w x 2 i + δ 3 6 3 w x 3 i + δ 4 24 4 w x 4 x ¯ w i - 1 = w i - δ w x i + δ 2 2 2 w x 2 i - δ 3 6 3 w x 3 i + δ 4 24 4 w x 4 ¯ ¯ x 2 w x 2 i = w i - 1 - 2 w i + w i + 1 δ 2 - δ 2 24 4 w x 4 x ¯ + 4 w x 4 ¯ ¯ x = w i - 1 - 2 w i + w i + 1 δ 2 + O δ 2

The finite difference approximation to the PDE at the interior points results in the following set of equations.

ψ i + 1 , j + ψ i - 1 , j + α 2 ψ i , j + 1 + α 2 ψ i , j - 1 - 2 ( 1 + α 2 ) ψ i , j + δ 2 w i , j = 0 w i + 1 , j + w i - 1 , j + α 2 w i , j + 1 + α 2 w i , j - 1 - 2 ( 1 + α 2 ) w i , j = 0 i , j = 2 , 3 , J M A X - 1

The vorticity at the boundary is discretized and expressed in terms of the components of velocity at the boundary, the stream function values on the boundary and a stream function value in the interior grid. (A greater accuracy is possible by using two interior points.) The stream function at the first interior point ( i = 2 ) from the x boundary is written with a Taylor's series as follows.

ψ 2 = ψ 1 ± δ ψ x 1 + δ 2 2 2 ψ x 2 1 + O ( δ 3 ) 2 ψ x 2 1 = 2 ( ψ 2 - ψ 1 ) δ 2 2 δ ψ x 1 + O δ = 2 ( ψ 2 - ψ 1 ) δ 2 ± 2 δ v y B C + O δ w 1 B C v y x - α v x y B C = - 2 ψ x 2 1 - α v x B C y = - 2 ( ψ 2 - ψ 1 B C ) δ 2 2 δ v y B C - α v x B C y + O δ

The choice of sign depends on whether x is increasing or decreasing at the boundary. Similarly, on a y boundary,

w 1 B C = - 2 α 2 ( ψ 2 - ψ 1 B C ) δ 2 ± 2 α v x B C δ + v y B C x + O δ

The boundary condition on the stream function is specified by the normal component of velocity at the boundaries. Since we have assumed zero normal component of velocity, the stream function is a constant on the boundary, which we specify to be zero.

The stream function at the boundary is calculated from the normal component of velocity by numerical integration using the trapezodial rule, e.g.,

ψ j = ψ j - 1 + δ 2 v x j - 1 + v x j / α

Solution of linear equations

The finite difference equations for the PDE and the boundary conditions are a linear system of equations with two dependent variables. The dependent variables at a x i , y j grid point will be represented as a two component vector of dependent variables,

u i , j = ψ i , j w i , j

The pair of equations for each grid point can be represented in the following form

a i , j u i + 1 , j + b i , j u i - 1 , j + c i , j u i , j + 1 + d i , j u i , j - 1 + e i , j u i , j = f i , j i , j = 2 , 3 , J M A X - 1

Each coefficient is a 2x2 matrix. For example,

e i , j u i , j = e i , j , 1 , 1 ψ i , j + e i , j , 1 , 2 w i , j e i , j , 2 , 1 ψ i , j + e i , j , 2 , 2 w i , j

The components of the 2x2 coefficient matrix are the coefficients from the difference equations. The first row is coefficients for the stream function equation and the second row is coefficients for the vorticity equation. The first column is coefficients for the stream function variable and the second column is the coefficients for the vorticity variable. For example, at interior points not affected by the boundary conditions,

a i , j = 1 0 0 1 b i , j = 1 0 0 1 c i , j = α 2 0 0 α 2 d i , j = α 2 0 0 α 2 e i , j = - 2 ( 1 + α 2 ) δ 2 0 - 2 ( 1 + α 2 ) f i , j = 0 0

The coefficients for the interior grid points adjacent to a boundary are modified as a result of substitution the boundary value of stream function or the linear equation for the boundary vorticity into the difference equations. The stream function equation is coupled to the vorticity with the e i j coefficient and the vorticity equation is coupled to the stream function through the boundary conditions. For example, at a x = 0 boundary, the coefficients will be modified as follows.

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Transport phenomena. OpenStax CNX. May 24, 2010 Download for free at http://cnx.org/content/col11205/1.1
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Transport phenomena' conversation and receive update notifications?

Ask