Why does the temperature “T” not change when I change total time “t” for 2D transient heat conduction using explicit FDM?

1 Ansicht (letzte 30 Tage)
I have the following code for a rectangular plate of copper with 0.2 mm thickness and 25 mm width. It is actually irradiated with a laser of heat flux q=1.12*10^10 W/m2 at the center of copper for 12 ms The problem is modeled using 2D transient heat conduction equation and solved using explicit FDM using matlab. The nodes in 2D consists of x = 4 and y = 20 and the time steps are chosen based on the stability criterion for explicit FDM. The initial temperature is chosen to be 25 degree celsius. My goal is to find temperatures after 12 ms in x and y. Here is the following matlab code.
%2D analysis (Explicit 2d)
% ----------------------------- Input --------------------------------
% Inputs
L1 = 0.2*10^-3; % sheet thickness (m) (x axis)
L2 = 25*10^-3; % sheet thickness (m) (y axis)
lambda = 260; % thermal conductivity (W/mK)
rho = 8065; % density (kg/m^3)
cp = 477; % specific heat capacity (J / kg-K)
T_ini = 25; % initial temperature (C);
q = 0.34*1.12*10^10*2; % absorbed heat flux(W/m^2)
alpha = 6.75*10^-5; % thermal diffusivity(m^2/s)(lambda/rho*cp)
% ----------------------------- Time stepping ------------------ --------------
% Setup time steps
M = 1200; % number of time steps
t = 12*10^-3; % total time
dg = t/M; % each time step
% ----------------------------- ------------------- Grid ----------------------
% Setup grid (x - axis)
N1 = 4; % number of nodes 1.Layer
delta_x = L1/(N1-1); % distance between adjacent nodes 1.Layer (m)
x = 0:delta_x:L1; % position of each node 1.Layer (m)
% Setup grid (y - axis)
N2 = 20;
delta_y = L2/(N2-1);
y = 0:delta_y:L2;
% --------------------------timestep Stability criterion --------------------- --------
dt = min([delta_x,delta_y])^2/alpha/4; % min time criteria for the
explicit FDM to be stable)
d1 = (alpha*dt)/(delta_x^2); % Fourier number (x)
d2 = (alpha*dt)/(delta_y^2); % Fourier number (y)
time = 0; % Initial time
if dg > dt % condition for stability
disp ('limit exceeds');
return
end
% ---------------------- Initial wall temperatures ------------------------ ---
% Initial wall temperatures T (i, 1)
T = ones([N1,N2])*T_ini;
% Step through time
for k = 1:M
Tnew = zeros(N1,N2); % Temperature matrix in two dimensions
for j = 2:N2-1 %top edge
Tnew(1,j) = T(1,j) + d1*(25-2*T(1,j)+T(2,j))+d2*(T(1,j-1)+T(1,j+1)-2*T(1,j));
end
% Heat flux condition (q = A * (- k * dT / dx)) [W / m ^ 2]
Tnew(1,(N2/2)) = T(1,(N2/2)) + d1*(2*T (2,(N2/2))- 2*T(1,(N2/2))+(2*delta_x*q)/(lambda)) + d2*(T(1,((N2/2)-1))+T(1,((N2/2)+1))-2*T(1,(N2/2)));
%left top corner
Tnew(1,1) = T(1,1) + d1*(25-2*T(1,1)+T(2,1))+d2*(25+T(1,2)-2*T(1,1));
%right top corner
Tnew(1,N2) = T(1,N2) + d1*(25-2*T(1,N2)+T(2,N2))+d2*(T(1,N2-1)+25-2*T(1,N2));
for i = 2:N1-1 %left edge
Tnew(i,1) = T(i,1) + d1*(T(i-1,1)-2*T(i,1)+T(i+1,1))+d2*(25+T(i,2)-2*T(i,1));
end
%middle elements
for i = 2:N1-1
for j = 2:N2-1
Tnew(i,j) = T(i,j) + d1*(T(i-1,j) + T(i+1,j) -2*T(i,j))+ d2*(T(i,j-1)+T(i,j+1)-2*T(i,j));
end
end
%bottom left corner
Tnew(N1,1) = T(N1,1) + d1*(T(N1-1,1)-2*T(N1,1)+25)+d2*(25+T(N1,2)-2*T(N1,1));
%bottom right corner
Tnew(N1,N2) = T(N1,N2) + d1*(T(N1-1,N2)-2*T(N1,N2)+25)+d2*(T(N1,N2-1)+25-2*T(N1,N2));
for i = 2:N1-1 %right edge
Tnew(i,N2) = T(i,N2) + d1*(T(i-1,N2)-2*T(i,N2)+T(i+1,N2))+d2*(T(i,N2-1)+25-2*T(i,N2));
end
for j = 2:N2-1 % bottom edge
Tnew(N1,j) = T(N1,j) + d1*(T(N1-1,j)-2*T(N1,j)+25)+d2*(T(N1,j-1)+T(N1,j+1)-2*T(N1,j));
end
T = Tnew;
time = time+dg;
end
When I execute the following code I get the following result for temperature T after 12 ms
T =
1.0e+03 *
Columns 1 through 8
0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0252
0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0252
0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0252
0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0251
Columns 9 through 16
0.0538 7.6241 0.0538 0.0252 0.0250 0.0250 0.0250 0.0250
0.0633 5.6907 0.0633 0.0252 0.0250 0.0250 0.0250 0.0250
0.0584 3.7862 0.0584 0.0252 0.0250 0.0250 0.0250 0.0250
0.0441 1.9008 0.0441 0.0251 0.0250 0.0250 0.0250 0.0250
Columns 17 through 20
0.0250 0.0250 0.0250 0.0250
0.0250 0.0250 0.0250 0.0250
0.0250 0.0250 0.0250 0.0250
0.0250 0.0250 0.0250 0.0250
The code is executed for 1 to M and when I change the total time t for whatever values, the temperature does not change at all. I get the temperature T distribution same for all changed values of "t". Is there any way I can incorporate the time value into the loop so that temperature T changes with the total time t ?
Now if I execute with t = 20*10^-6 sec, the T value remains the same.
T =
1.0e+03 *
Columns 1 through 8
0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0252
0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0252
0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0252
0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0250 0.0251
Columns 9 through 16
0.0538 7.6241 0.0538 0.0252 0.0250 0.0250 0.0250 0.0250
0.0633 5.6907 0.0633 0.0252 0.0250 0.0250 0.0250 0.0250
0.0584 3.7862 0.0584 0.0252 0.0250 0.0250 0.0250 0.0250
0.0441 1.9008 0.0441 0.0251 0.0250 0.0250 0.0250 0.0250
Columns 17 through 20
0.0250 0.0250 0.0250 0.0250
0.0250 0.0250 0.0250 0.0250
0.0250 0.0250 0.0250 0.0250
0.0250 0.0250 0.0250 0.0250
Any help will be appreciated !!!!!!

Akzeptierte Antwort

KALYAN ACHARJYA
KALYAN ACHARJYA am 20 Jul. 2019
Why does the temperature “T” not change when I change total time “t”
t = 12*10^-3; % total time
dg = t/M;
Please verify, at first look T is independent with t.

Weitere Antworten (0)

Kategorien

Mehr zu Thermal Analysis finden Sie in Help Center und File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by