Question: You are required to write a computer program and solve the following 2 D steady - state diffusion equation using the finite difference method: 2

You are required to write a computer program and solve the following 2D steady-state diffusion
equation using the finite difference method:
2
x
2+
2
y
2= S
on a square domain of unit length. The boundary conditions are as follows:
(0, y)=500 exp(50[1+ y
2
])
(1, y)=100(1 y)+500 exp(50y
2
)
(x,0)=100x +500 exp(50[1 x]
2
)
(x,1)=500 exp(50{[1 x]
2+1})
The source term is given by:
S=50000 exp(50{[1 x]
2+ y
2
})(100{[1 x]
2+ y
2
}2)
For reference, the analytical solution is given below:
(x, y)=500 exp(50{[1 x]
2+ y
2
})+100x(1 y)
(1) Solve the 2D steady-state diffusion equation using Gaussian elimination method for the
following grids: 21,41, and 81 grid points in each direction. Show the computed field as
a contour plot for the finest grid. Plot the CPU run time vs total number of grid points and
discuss the trend and comment on the computational efficiency of the Gauss elimination
method.
(2) Solve the same 2D steady-state diffusion equation using the Gauss-Seidel iterative method
for the following three grids: 41,81, and 161 grid points in each direction. Show the
computed field as a contour plot for the finest grid. Plot the residual vs number of
iterations for the three grids in the same plot. Compare and discuss the dependence of the
convergence rate on the total number of grid points. Plot the variation of CPU run time
with total number of grid points for the Gauss-Seidel iterative method and discuss the trend.
How do the CPU run times of the Gauss-Seidel iterative method compare with those of
Gauss elimination method?
(3) Solve the same 2D steady-state diffusion equation using the line-by-line method (row
sweep) for the following three grids: 41,81, and 161 grid points in each direction. Please
note that you will need to use the TDMA solver to solve the resulting system of linear
equations because of the tridiagonal structure of the resulting coefficient matrices. Show
the computed field as a contour plot for the finest grid. Plot residual vs number of
iterations for the line-by-line method and for the Gauss-Seidel method for the 161161
grid (both in the same plot). Compare and discuss the trends. Plot the variation of CPU run
time with total number of grid points for the line-by-line method. How does the CPU run
times and the obtained scaling compare with those obtained for the Gauss elimination
method and point-wise iterative method?
(4) Solve the same 2D steady-state diffusion equation using the Alternating Direction Implicit
(ADI) method for the 4181 grid and plot the residual vs number of iterations for row-wise
sweep, column-wise sweep, and ADI method in the same plot. Discuss the trends.
Solve in MATLAB

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mechanical Engineering Questions!