How to Model Time-Dependent Boundary Conditions in MATLAB for 2D Heat Transfer?

In summary, the conversation is about writing a MATLAB code for 2d transient heat transfer. The problem involves a titanium block in the shape of a rectangle that is being exposed to a much hotter surrounding temperature. The dimensions, coefficients of heat transfer, and temperatures are all given. The main difficulty is understanding how to relate the boundary conditions to the initial temperature and making it a function of time. The code provided sets up the temperatures of the nodes on the wall and at the corners using nodal finite-difference equations from a textbook. The next step is to write equations for the interior nodes.
  • #1
mjaisit
1
0
Im trying to write a MATLAB code for 2d transient heat transfer. The problem is a titanium block in the shape of a rectangle is staring at a specified temperature and is being exposed to a much hotter surrounding temperature. The dimensions, coefficients of heat transfer, and temperatures are all given. We are suppose to write a code for the temperature of the block as a function of time. I understand the basics of the problem, but I am having trouble understanding how to relate the boundary conditions to the initial temperature. We worked a problem similar, but the boundary conditions were that the walls were held at a specified temperature. With this problem though, the wall temperatures are a function of time. I started writing the code below and setup the temperatures of the nodes on the wall and at the corners using nodal finite-difference equations from our textbook. My main question is even though i setup the temperature of the walls of the block, I am not sure how to relate it to the initial temperature and making it a function of time. I know the next step will be to write the equations for the interior nodes, but I want to get the temperature of the nodes on the wall first. I also attached the problem statement in case my description isn't clear. Thanks for your time.


%Dimensions of the block
L=1.2;
H=1;

%Heat Transfer Coeffcients
h=150;

%Distance between nodes
dx=.005;

%Number of nodes in each direction
m=L/dx+1;
n=H/dx+1;

%Given Temperatures
To=278;
Tinf=533;

%Biot number equation
Bi=(h*dx)/k;


for j=2:n-1
%Left Wall
T(1,j)=((2*T(i+1,j)+T(i,j+1)+T(i,j-1))+2*Bi*Tinf)/(2*(Bi+2));
%Right Wall
T(m,j)=((2*T(i-1,j)+T(i,j+1)+T(i,j-1))+2*Bi*Tinf)/(2*(Bi+2));
end

for i=2:m-1
%Bottom Wall
T(i,1)=((2*T(i,j+1)+T(i-1,j)+T(i+1,j))+2*Bi*Tinf)/(2*(Bi+2));
%Top Wall
T(i,n)=((2*T(i,j-1)+T(i-1,j)+T(i+1,j))+2*Bi*Tinf)/(2*(Bi+2));
end

%Bottom Left Corner
T(1,1)=((T(i,j+1)+T(i+1,j))+2*Bi*Tinf)/(2*(Bi+1));
%Bottom Right Corner
T(m,1)=((T(i,j+1)+T(i-1,j))+2*Bi*Tinf)/(2*(Bi+1));
%Top Left Corner
T(1,n)=((T(i,j-1)+T(i+1,j))+2*Bi*Tinf)/(2*(Bi+1));
%Top Right Corner
T(m,n)=((T(i,j-1)+T(i-1,j))+2*Bi*Tinf)/(2*(Bi+1));
 

Attachments

  • HT_Project.pdf
    66.6 KB · Views: 530
Physics news on Phys.org
  • #2
%Equation for the interior nodesfor i=2:m-1 for j=2:n-1 T(i,j)=(T(i-1,j)+T(i+1,j)+T(i,j-1)+T(i,j+1))/4; endend
 

Related to How to Model Time-Dependent Boundary Conditions in MATLAB for 2D Heat Transfer?

1. What is 2D transient heat transfer?

2D transient heat transfer is the transfer of thermal energy in two-dimensional systems over time. It involves the movement of heat within a material or between materials as a result of temperature differences.

2. What are the factors that affect 2D transient heat transfer?

The factors that affect 2D transient heat transfer include the thermal conductivity of the materials involved, the temperature difference between the materials, the size and shape of the materials, and the duration of the heat transfer.

3. How is 2D transient heat transfer different from 2D steady-state heat transfer?

2D transient heat transfer occurs when there is a change in temperature over time, while 2D steady-state heat transfer occurs when the temperature remains constant. In 2D transient heat transfer, the temperature at any given point within the material can change over time, whereas in 2D steady-state heat transfer, the temperature is constant at all points within the material.

4. What are some practical applications of 2D transient heat transfer?

2D transient heat transfer is important in many everyday applications, such as cooking, heating and cooling systems, and electronics. It is also essential in industrial processes such as welding, casting, and heat treatment.

5. How is 2D transient heat transfer studied and analyzed in scientific research?

Scientists use mathematical models, computer simulations, and experimental techniques to study and analyze 2D transient heat transfer. These methods allow for the prediction and understanding of heat transfer in various materials and systems, and can help in the design and optimization of heat transfer processes.

Similar threads

  • Engineering and Comp Sci Homework Help
Replies
4
Views
1K
  • Thermodynamics
Replies
3
Views
1K
Replies
2
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
3K
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
1K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
2K
  • Engineering and Comp Sci Homework Help
Replies
5
Views
1K
Replies
1
Views
3K
  • Engineering and Comp Sci Homework Help
Replies
1
Views
3K
Back
Top