1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

MATLAB Heat Transfer 2D Steady State Explicit

  1. Apr 11, 2015 #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. The problem statement, all variables and given/known data

    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

    2. Relevant 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.


    3. 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 (Text):

    % 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.
     
  2. jcsd
  3. Apr 16, 2015 #2
    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?
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted