Solve 2D Transient Heat Conduction Problem with Convection BCs using FTCS Finite Difference Method

Поделиться
HTML-код
  • Опубликовано: 4 окт 2024
  • Solve 2D Transient Heat Conduction Problem with Convection Boundary Conditions using FTCS Finite Difference Method

Комментарии • 20

  • @samseleven1
    @samseleven1  6 лет назад +22

    % Diffusion equation - 2D - Explicit Method
    % Convection boundary conditions
    clear
    clc
    clf
    % Inputs
    alpha = 1e-4; % Thermal diffusivity, m2/s (Heat Conduction - Ozisik & Hahn)
    kt = 386; % Thermal conductivity of the material, W/(m*deg.C), eg 386
    h1 = 30; % Convection heat transfer coefficient at end 1, W/(m2*C), eg 30
    Tinf1 = 100; % Temperature of the convection medium at end 1, deg.C, eg 100
    h2 = 40; % Convection heat transfer coefficient at end 1, W/(m2*C), eg 40
    Tinf2 = 200; % Temperature of the convection medium at end 1, deg.C, eg 200
    h3 = 50; % Convection heat transfer coefficient at end 1, W/(m2*C), eg 50
    Tinf3 = 300; % Temperature of the convection medium at end 1, deg.C, eg 300
    h4 = 60; % Convection heat transfer coefficient at end 1, W/(m2*C), eg 60
    Tinf4 = 400; % Temperature of the convection medium at end 1, deg.C, eg 400
    t = 15; % total time, s eg. 200, 1600
    nt = 300; % total no. of time steps eg. 2, 160
    delta_t = t/nt; % timestep, s
    xlength = 1; % xlength = yheight, m
    nx = 4; % total no. of spatial grids eg. 4, 15
    delta_x = xlength/nx; % delta_x = delta_y, m
    delta_y = delta_x; % delta_x = delta_y, m
    Tin = 0; % Initial temperature
    Tmax = max([Tinf1,Tinf2,Tinf3,Tinf4,Tin]);
    Bi1 = (h1*delta_x)/kt % Biot number
    Bi2 = (h2*delta_x)/kt % Biot number
    Bi3 = (h3*delta_x)/kt % Biot number
    Bi4 = (h4*delta_x)/kt % Biot number
    Fo = alpha*delta_t/delta_x^2 % Note: Fourier number, Fo = diffusion number, d
    % Solution
    n = ((xlength/delta_x) + 1)^2; % no. of interior points
    m = sqrt(n); % no. of points in a row / column
    r = (t/delta_t) + 1; % no. of time steps
    d = alpha*delta_t/delta_x^2; % diffusion number
    if d < 0.25
    fprintf('solution stable
    d = %8.4f', d)
    else
    fprintf('solution unstable
    d = %8.4f', d)
    end
    % Creating initial and boundary conditions
    T = zeros(m,m,r);
    % Creating initial conditions
    for k = 1:1
    for j = 1:m
    for i = 1:m
    T(i,j,k) = Tin;
    end
    end
    end
    T;
    %{
    % Creating boundary conditions
    for k = 1:1
    for j = 1:m
    for i = 1:m
    if (j == 1) && (i>1) && (i1) && (j1) && (i1) && (j1) && (i1) && (j1) && (i1) && (j

  • @kubetail12
    @kubetail12 4 месяца назад

    I am curious if one can still use fictitious nodes like Neumann BCs for Convection BCs, or do you have to do this heat balance? That being said, wouldn't you still need this heat balance for, say, the corner nodes for all Neumann BCs?
    Edit: I guess I am confusing the energy balance and the Taylor approaches to finite differences.

  • @oguzklc9894
    @oguzklc9894 3 года назад +1

    Thank you for sharing this video , appreciate you. I encountered with a problem, if top side will be insulated, what will we do ?

    • @samseleven1
      @samseleven1  3 года назад

      Consider insulated boundary conditions.

  • @ashwinibhusari3244
    @ashwinibhusari3244 2 года назад

    Detailed explanation.. Thank you for the video. :-) how will this case differ with convectioin BCs using BTCS method?

  • @sadHorsey13
    @sadHorsey13 2 года назад

    Can anyone tell me what the errors would be compared to the analytical solitaire? Where would it be higher boundary or center?

  • @pabloANR
    @pabloANR 4 года назад

    Have you the functions of Gauss elimination, SOR method, vector to matrix?

    • @samseleven1
      @samseleven1  4 года назад

      Did you check in
      engineering-stream.com ?

    • @pabloANR
      @pabloANR 4 года назад

      @@samseleven1 Yes, but i couldn't find it out

    • @pabloANR
      @pabloANR 4 года назад

      @@samseleven1 I found all, except gauss elimination, have you the code?

    • @samseleven1
      @samseleven1  4 года назад

      @@pabloANR gauss elimination should be there. Pls double check.

    • @pabloANR
      @pabloANR 4 года назад

      @@samseleven1 It's the only missing :c

  • @samseleven1
    @samseleven1  5 лет назад

    Codes may be obtained from engineering-stream.com under Numerical Methods Section

    • @samseleven1
      @samseleven1  3 года назад

      I believe the unit for g is W/m3 so you may use the volume info to calculate g depending on how your model is set up

  • @abdelazizkoubabi
    @abdelazizkoubabi Год назад

    thank you sir please send me the programme 1D theat conduction please

    • @samseleven1
      @samseleven1  Год назад +1

      Pls check engineering-stream.com for the codes under Numerical methods

  • @agiram
    @agiram 4 года назад

    can I get the ppt for this one

    • @samseleven1
      @samseleven1  4 года назад

      Check into
      engineering-stream.com