FDM 1 PDF
FDM 1 PDF
FDM 1 PDF
Problem Description
Solve the unsteady 1-D heat conduction equation using the finite difference method
2. Governing Equation
The governing equation of this problem is 1D conduction equation in transient state.
3. Solution Method
The problem was solved with MATLAB code and the result also verified with commercial CFD code, FLUENT
ver. 6.3.
I assumed achievement of linear temperature distribution occur when average of temperature at each
Average of temperature along the bar should be same with average of temperature at
1) MATLAB code
To solve this problem, I used explicit method to calculate temperature distribution of the rod.
By
discretizing 1D conduction equation for explicit method, the finite difference of temperature was
obtained as below.
2 T 1
=
x 2
1 (+1 ) +1
2 + 1
=
()2
+1 =
(+1
2 + 1
)
+
()2
2) FLUENT
To solve this problem, 2 dimensional problem solver of FLUENT ver. 6.3.26 was used. The solver is
pressure based, unsteady solver with 1st order implicit formulation.
4. Boundary Condition
1) Grid Generation for CFD (FLUENT)
2) Boundary Condition
To make 1D conduction condition, it was assumed that there is no heat flux to the y-direction.
At the
left side of the bar, where x=-0.5m, temperature was set to 298.15K and at the opposite side of the bar,
where x=0.5m, temperature was set to 373.15K.
3) Material Properties
I selected three different materials to examine the effect of thermal conductivity to the time elapsed to
achieve linear temperature distribution along longitudinal direction.
own thermal conductivity are tabulated in Table. 1.
Material
Aluminum (Al)
Gold (Au)
Copper (Cu)
Thermal Conductivity
202.4 W/mK
297.73 W/mK
387.6 W/mK
Density
2719 kg/m3
19320 kg/m3
8978 kg/m3
Cp
871 J/kgK
129.81 J/kgK
381 J/kgK
Thermal Diffusivity
8.546e-05 m2/s
1.19e-04 m2/s
1.13e-04 m2/s
5. Result
1) MATLAB with Explicit Solution Method
a) Aluminum
Elapsed Time: 4776 s
Temperature Distribution along x-Direction and Change along Time
b) Gold
Elapsed Time:3430 s
Temperature Distribution along x-Direction and Change along Time
c) Copper
Elapsed Time:3612 s
Temperature Distribution along x-Direction and Change along Time
b) Gold
Elapsed Time: 3520 s
Temperature Distribution along x-Direction and Change along Time (Visualized)
c) Copper
Elapsed Time: 3713 s
Temperature Distribution along x-Direction and Change along Time (Visualized)
3) Discussion
In this project, I derived the governing equation of one-dimensional heat transfer phenomenon
of different metallic materials Aluminum, Gold, Copper and solved it with two different method
and tools; finite difference method with explicit solution method and commercial CFD code, FLUENT
with implicit solver.
As shown in 5.1 and 5.2, the elapsed time to achieve proper average
temperature, which is set to 335.15 K (-0.5K error with theoretical value), was almost similar. The
elapsed time for each case was tabulated in Table. 2. There was approximately 100 seconds of
difference in every case, which was considered mainly because of the different length of a section 10
pcs for MATLAB, 100 pcs for FLUENT and difference of solution method.
time were similar in same material, and quite different along with material property, heat diffusivity .
Material\Solver
Aluminum
4776 s
4863 s
Gold
3430 s
3520 s
Copper
3612 s
3713 s
Appendix
MATLAB Explicit Solution Method Source Code
clear
%Generating Grid
n=input('Insert number of grid... ');
dx=1/n;
x=linspace(0,1,n+1);
%Material Property
a=input('Insert thermal diffusivity of the material... ');
%Setting Time Step and Initializing
dt=input('Insert time step size... ');
j=0; % # of iteration
Temp=298.15*ones(1,n+1);
Temp(n+1)=373.15;
T0=Temp;
%Formulation goes until avg of temperature of each point is equal to=335K
while mean(Temp(j+1,:))<335
j=j+1
for i=2:n
Temp(j+1,i)=(a)*(dt)/(dx)^2*(Temp(j,i+1)-2*Temp(j,i)+Temp(j,i-1))+Temp(j,i);
Temp(j+1,1)=298.15;
Temp(j+1,n+1)=373.15;
end
end
Elaptime=j*dt