Challenge

FINAL INDEPENDENT PROJECT

Aim

    To find the transfer of heat in a 2d element by using MATLAB.

  Objectives

     1. To simulate the amount of heat transfer in the  2d element from one point to another.

     2. Plot the surface temperatute in the 2d element

Introduction

  Physical system / Process chosen

     The conduction of heat transfer in a 2d element is a process which i have taken to analyze using the MATLAB computer program

  Plan for this project

     I planned to calculate the transfer of heat in a 2d element from one point to another by supplying the temperatute from one at steady state values and also simulate the transfer of heat by visually and also plotting the values of temperature by using MATLAB.

  Engineering Significance 

     The Engineering Significance of this project is to eliminate the manual calculations, wastage of material and also give the visual image of heat transfer in an object. It also reduces the error made by human.

Modes of heat transfer

  1. Conduction
  2. Convection
  3. Radiation

Conduction

     Conduction takes place at a microscopic level. Atoms or molecules at higher temperature have high levels of energy. Through vibration, this energy is passed on to neighboring atoms and molecules. In other words, in conductive mode of heat transfer, vibrating atoms and molecules a part of their energy.

     This kind of heat transfer can take place between two or more substances or through the substance. Conduction can also take place when electrons move from one atom to another. Transient conduction takes place when temperature within an object changes a the function of time.

Convection

     Convection is a mode of heat transfer which takes place through the movement of collective masses of heated atoms and molecules. Convection requires actual flow of material particles whereas in conduction, the heat is transferred through vibration without the atoms or molecules leaving their original position. In convection, heat transfer takes place through both diffusion and advection.

     As convection requires the actual movement of the heated atoms/ molecules, it requires presence of a fluid for heat transfer.

Radiation

     Radiation is a mode of heat transfer which takes place through vacuum and hence, does not need a physical medium. Radiation takes place either through vacuum or through a transparent medium. In radiative mode, heat transfer takes place through photons present in the electromagnetic waves. The random movement of atoms and molecules in heated substances results in emission of electromagnetic waves which carry the heat to be transferred.

     The radiative heat transfer is governed by Stephen- Boltzman law. A body radiates heat at all temperatures above the absolute zero, irrespective of the ambient temperature.

Heat conduction 
     Heat conduction is the diffusive transport of thermal energy. In liquids and gases, it iscaused by the interaction of moving atoms and molecules, in solids by lattice oscillations and in electroconductive material additionally by unbound electrons.

     For instance, consider a swimming pool that is warm on the left and cold on the right hand side . We suppose that the water is completely motionless. On a microscopic level, neighboring molecules are in mutual interaction and exchange kinetic energy—more or less chaotically. But if we change the scale of our observation to the macroscopic level, it is evident that, in total, more kinetic energy will be transferred from the left to the right than vice versa. The system tends towards an equilibrium state with the same temperature everywhere. During this levelling diffusion process, a transport of thermal energy occurs.

                                                             

                                                        Brownian motion of H2O molecules (red: warm, blue: cold)

Discrete Laplace equation for heat transfer

`(del^2u)/(delx^2) + (del^2u)/(dely^2) = grad^2u = 0`

           u = Dimensional matrix

Main code

% Calculation of conduction of heat in a 2d object
% Clearing the screen and closing the previous windows 
clear all
close all
clc

% Inputs for the creation of 2 dimensional matrix
% Length and height of material in mm
length = 200;
height = 200;
% Two_dim_Mat is a 2 dimensional matrix variable with rows as length and column as height
Two_dim_Mat = zeros(length,height);

% Creation of boundary layers 
Two_dim_Mat(1, :) = 0;                 % Top side of the 2d material
Two_dim_Mat(length, :) = 0;            % Bottom side of the 2d material
Two_dim_Mat(:, 1) = 1000;              % Left side of the 2d material
Two_dim_Mat(:, height) = 0;            % Right side of the 2d material

% No of iteration
c = 0 ;

ct = 1;
while (c<5000)
    c = c+1;
    % plotting the exact values in the graph
    if (mod(c,20) == 0)
        figure(1)
        imagesc(Two_dim_Mat)
        title('Simulation of heat transfer')
        xlabel('Length in mm')
        ylabel('height in mm')
        colorbar;
        drawnow;
        M(ct) = getframe(gcf);
        ct = ct + 1;
    end
    % Caluculation of heat transfer using laplace equation 
    Laplase_Two_dim_Mat = del2(Two_dim_Mat);
    Two_dim_Mat(2:length-1, 2:height-1) = Two_dim_Mat(2:length-1, 2:height-1) + Laplase_Two_dim_Mat(2:length-1, 2:height-1);
end

% For getting videofile
movie(M)
videofile = VideoWriter('Conduction of heat in 2d element.avi', 'uncompressed AVI');
open(videofile)
writeVideo(videofile,M)
close(videofile)

% X and Y vectors for plotting graph 
x = 1:length;
y = 1:height;

figure(2)
hold on
surf(Two_dim_Mat)
colorbar
shading interp
title('Surface Temperature at steady state')
xlabel('x')
ylabel('y')
zlabel('Temperature')

figure(3)
subplot(2,1,1)
contour(x,y,Two_dim_Mat)
colorbar
shading interp
title('Temperature at steady state')
xlabel('Length in mm')
ylabel('height in mm')

subplot(2,1,2)
pcolor(x,y,Two_dim_Mat)
shading interp
colorbar
title('Temperature at steady state')
xlabel('Length in mm')
ylabel('height in mm')

Explanation of code

  1. This operation is done by the program language MATLAB.

  2. Open Matlab software and start to type the command.

  3. Write clear all, close all and clc command to clear previous command and close previous figure windows.
  4. Get the input values such as length and height of the 2d element.
  5. Create a 2 dimensional matrix with rows as length and height as column.
  6. Create a boundary layers for this 2 dimensional matrix.
  7. Assign the values(temperature) for all boundaries in that 2d element.
  8. Hence it was a 2d element it has four boundary layers, such as top layer, bottom layer, right layer and left layer.
  9. In this case the temperature is applied in left layer on the 2d element.
  10. Temperature in the other layers in this 2d element remains zero.
  11. The initial value of heat is provided and ploted by using teh command imagesc in 2 dimension matrix or 2d element.
  12. After that laplace equation of heat transfer of the matrix is obtained by using del2 command.
  13. The new position 2d matrix value can be obtained  by  the summation of old position of 2d matrix value and laplace matrix value.
  14. The while loop is created for 5000 iteration to get new position of trasfer of heat for every iteration.
  15. The mod command is used to conduct 20 iteration for single image ploting the graph by using if command.
  16. The drawnow command is used to get update the graph for every iteration and helps to show us the simulation of heat transfer visually.
  17. The getframe command is used to get every plot value and stored it in variable M.
  18. The movie command with variable M is uesd to get the video file of the simulation of heat transfer in the 2d element.
  19. Create the x and y vector for plotting the Surface temperatute and values of temperature at different positions.
  20. The command shading interp is used to make the graph smooth to appear.
  21. Plot the graph for surface temperature and values of temperature at diffent position of the 2d element.

Output

  Temperature at steady state

               

  

Surface temperature at steady state

               

Conclusion

     1.The transfer of heat in the  2d element from one point to another is sucessfully simulated by MATLAB software.

     2.The graphs are successfully plotted for the surface temperature in the 2d element

References

  1. https://link.springer.com/chapter/10.1007/0-8176-4450-4_2
  2. https://github.com/topics/heat-transfer?l=matlab

Videofile

  1. Youtube          : Simulation of conduction of heat in 2d element
  2. Google Drive   : Simulation of conduction of heat in 2d element
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.