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 D steadystate diffusion
equation using the finite difference method:
x
y
S
on a square domain of unit length. The boundary conditions are as follows:
y exp y
y y expy
xx exp x
x exp x
The source term is given by:
S exp x
y
x
y
For reference, the analytical solution is given below:
x y exp x
y
x y
Solve the D steadystate diffusion equation using Gaussian elimination method for the
following grids: and 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.
Solve the same D steadystate diffusion equation using the GaussSeidel iterative method
for the following three grids: and 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 GaussSeidel iterative method and discuss the trend.
How do the CPU run times of the GaussSeidel iterative method compare with those of
Gauss elimination method?
Solve the same D steadystate diffusion equation using the linebyline method row
sweep for the following three grids: and 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 linebyline method and for the GaussSeidel method for the
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 linebyline method. How does the CPU run
times and the obtained scaling compare with those obtained for the Gauss elimination
method and pointwise iterative method?
Solve the same D steadystate diffusion equation using the Alternating Direction Implicit
ADI method for the grid and plot the residual vs number of iterations for rowwise
sweep, columnwise 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
