Given Information:
The fixed temperature at top and right boundary is 100 °C and the fixed temperature at the left and lower boundary is 50 °C.
For overrelaxation the weighing factor is 1.5.
Limiting condition for iteration is εs≤1%
Formula used:
For a square grid, that is, Δx=Δy, the Laplacian difference equation is written using Liebmann’s method as,
Ti,j=Ti+1,j+Ti−1,j+Ti,j+1+Ti,j−14
With i varying from 1 to m and j varying from 1 to n.
Overrelaxation is applied using the following expression after each iteration,
Ti,jnew=λTi,jnew+(1−λ)Ti,jold
In the above expression, Ti,jold and Ti,jnew being the Ti,j values from the previous and present iteration.
The percent relative error is calculated using the following expression,
|(εa)i,j|=(|Ti,jnew−Ti,joldTi,jnew|×100)%
Laplacian equation for a node adjacent to an irregular boundary is solved for temperature distribution as,
2Δx2[Ti−1,j−Ti,jα1(α1+α2)+Ti+1,j−Ti,jα2(α1+α2)]+2Δy2[Ti,j−1−Ti,jβ1(β1+β2)+Ti,j+1−Ti,jβ2(β1+β2)]=0
Calculation:
Consider, Δx=Δy.
Consider the value of the parameters as,
α1=0.732α2=1β1=0.732β2=1
The temperature at the node (4,2) adjacent to the lower left round corner or the irregular boundary is calculated as,
2Δx2[T3,2−T4,20.732(0.732+1)+T5,2−T4,21(0.732+1)]+2Δy2[T4,1−T4,20.732(0.732+1)+T4,3−T4,21(0.732+1)]=0[T3,2−T4,20.732(0.732+1)+T5,2−T4,21(0.732+1)]+[T4,1−T4,20.732(0.732+1)+T4,3−T4,21(0.732+1)]=0
Thus,
−4T4,2+0.8453T5,2+0.8453T4,3=−1.1547(T3,2+T4,1)
Further, the temperature at the node (2,4) adjacent to the upper right round corner or the irregular boundary is calculated as,
2Δx2[T1,4−T2,40.732(0.732+1)+T3,4−T2,41(0.732+1)]+2Δy2[T2,3−T2,40.732(0.732+1)+T2,5−T2,41(0.732+1)]=0[T1,4−T2,40.732(0.732+1)+T3,4−T2,41(0.732+1)]+[T2,3−T2,40.732(0.732+1)+T2,5−T2,41(0.732+1)]=0
Thus,
−4T2,4+0.8453T3,4+0.8453T2,5=−1.1547(T1,4+T2,3)
Liebmann’s method is used to solve the temperature on the heated plate iteratively in MATLAB, until the percent relative error falls below 1%.
Use the following MATLAB code to implement the Liebmann’s method and the equation at the nodes (4,2)&(2,4) to solve for the temperature distribution on the heated plate with fixed boundary conditions as,
clear;clc;
% Enter the initial temperature distribution
T = zeros(5,5);
% Enter the initial conditions
T(1,1:4) = 100;
T(2:5,5) = 100;
T(5,2:4) = 50;
T(1:4,1) = 50;
ans
n = length(T(:,1));
m = length(T(1,:));
% Enter the Weighing factor
lambda = 1.5;
iteration = 0;
A = ((1/(0.732*1.732))*2/((1/(0.732*1.732))+(1/(1.732))));
B = ((1/(1.732))*2/((1/(0.732*1.732))+(1/(1.732))));
% Start the loop and run it until Ea < 1
while 1
for i = 2:m-1
for j = 2:n-1
Told(i,j) = T(i,j);
% for lower left and upper right corner nodes
if (i == 4 && j == 2) || (i == 2 && j == 4)
T(i,j) = (-(A*(T(i-1,j)+T(i,j-1)))-(B*T(i+1,j))...
-(B*T(i,j+1)))/(-4);
else
% Liebmann's method for rest of the interior nodes
T(i,j) = (T(i+1,j)+T(i-1,j)+T(i,j+1)+T(i,j-1))/4;
% Percent relative error
Ea(i,j) = abs((T(i,j)-Told(i,j))/T(i,j))*100;
T(i,j) = (lambda*T(i,j))+((1-lambda)*Told(i,j));
end
end
end
iteration = iteration+1;
if max(Ea(:,:)) < 1
break
end
end
T
iteration
Execute the above code to obtain the temperature distribution and the number of iterations performed, in the output as shown below,
T =
50.0000 100.0000 100.0000 100.0000 0
50.0000 75.0538 85.8151 92.8540 100.0000
50.0000 64.3565 75.0200 85.7216 100.0000
50.0000 57.1402 64.2716 75.0977 100.0000
0 50.0000 50.0000 50.0000 100.0000
iteration =
9
Hence, the temperature on the heated plate with desired accuracy is achieved after 9 iterations as obtained in the above MATLAB output.