Find answers, ask questions, and connect with our <br>community around the world.

Home Forums CFD foundation course: Forum Implicit scheme

  • Posted by Mohammed Sadique Shaikh on September 23, 2023 at 3:51 pm

    I try many time but facing problem i don’t know where please help,<div>

    % Geometry details(all known values)

    xmin = 0;

    xmax = 0.2; % length of the rod

    N = 10 ; % NO.of nodes

    dx = (xmax-xmin)/(N-1); % grid size

    x = xmin:dx:xmax;

    dt = 1e-4 % time step size

    tmax = 0.6; % max time to simulate

    t = 0:dt:tmax;

    alpha = 0.05; % diffusion coefficient

    % Initial And Boundary Conditions

    Tcurrent = ones(1,N)*30; %Initial boundary condition

    Tb = 300; % boundary condition t_base

    Ttip = 50; % boundary condition t_tip

    % Solution

    d = alpha*dt/dx^2

    for j = 2:length(t) % loop for time step

    T = Tcurrent;

    for i = 1:N

    if i==1

    T(i) = Tb;

    elseif i==N

    T(i) = Ttip;

    else

    1/2*d*(T(i)-(1+d)*T(i)+1/2*d*(T(i))) = -T(i)-1/2*d*(T(i+1)-2*T(i)+T(i-1));

    end

    end

    Tcurrent = T;

    time = j*dt;

    plot(x,Tcurrent)

    </div>

    Sandeep replied 8 months, 3 weeks ago 2 Members · 1 Reply
  • 1 Reply
  • Sandeep

    Administrator
    September 23, 2023 at 4:04 pm

    This not the way to use TDMA. Can you please check the sessions by Nishant on programming/linear algebra to check the implementation.

Log in to reply.

error: Content is protected !!