MATLAB Heat Transfer 2D Steady State Explicit

  • #1
Hello. I am completely new to MATLAB and programming in general. I never thought I would have to resort to online help, but here I am. I have spent hours googling and haven't been able to get very far.

1. Homework Statement

Calculate the distribution of the temperature of the inner part of the model.
Thermal conductivity: λ = 47 W/(m*K)
Specific heat capacity: cp = 465 J/(kg*K)
Density: ρ = 7,85 kg/m^3
Length of one side of a cell: L = 0,05 m
Starting temperature of model: T0 = 0 °C

A:
Wall temperature: Tw = 500 °C

B:
Fluid temperature: Tf = 20 °C
Heat transfer coefficient: α = 500 W/(m^2*K)

Image of the model:
PTH_sem2b.png


Homework Equations


EqA.PNG


EqB.PNG

Here T_i,j is supposed to be the temperature of the cell in question, whereas the T_{i+1,j} should be known.


The Attempt at a Solution


Yes I know it's a rather weak attempt, as I stated earlier, I'm new to programming in general, any further attempts would look like the work of a chimpanzee, ergo pointless.
Code:
% Given variables
lambda = 47 % Thermal conductivity [W/(m*K)]
cp = 465 % Specific heat capacity [J/(kg*K)]
rho = 7.85 % Density [kg/m^3]
L = 0.05 % Length of one side of a cell [m]
T0 = 0 % Starting temperature of the model [°C]

%Boundary condition A
Tw = 500 % Wall temperature [°C]

%Boundary condition B
Tf = 20 % Fluid temperature [°C]
alfa = 500 % Heat transfer coefficient [W/(m^2*K)]

model =  [0  0  Tf 0  Tf 0  Tf 0  0  0  % model matrix, an attempt
  0  Tf T0 Tf T0 Tf T0 Tf 0  0
  Tw T0 T0 Tf T0 Tf T0 Tf Tf 0
  Tw T0 T0 T0 T0 T0 T0 T0 T0 Tf
  0  Tf T0 T0 T0 T0 Tf Tf Tf 0
  0  Tf T0 T0 T0 T0 Tf Tf Tf 0
  Tw T0 T0 T0 T0 T0 T0 T0 T0 Tf
  Tw T0 T0 Tf T0 Tf T0 Tf Tf 0
  0  Tf T0 Tf T0 Tf T0 Tf 0  0
  0  0  Tf 0  Tf 0  Tf 0  0  0];

  mean = ( ...  %Should I use something like this for the equation?
  sum (  ) ...
  + sum (  ) ...
  + sum (  ) ...
  + sum (  ) ) ...
  / ( 2 * m + 2 * n - 4 );
If the images aren't visible I'll upload them externally and link to them.
 

Answers and Replies

  • #2
18,264
7,947
Thanks for the post! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post?
 

Related Threads on MATLAB Heat Transfer 2D Steady State Explicit

Replies
0
Views
3K
  • Last Post
Replies
0
Views
8K
Replies
5
Views
4K
Replies
1
Views
3K
Replies
12
Views
1K
  • Last Post
Replies
0
Views
4K
Replies
0
Views
12K
  • Last Post
Replies
2
Views
10K
  • Last Post
Replies
2
Views
5K
Top