Project

Stability Analysis in a Transient Problem ( 2-D Heat Conduction Equation )

Objective:

In this report, we analyze the stability in a Transient Problem of the 2-D Heat Conduction model.

Theory :

The only difference between the steady-state and transient state analysis is that in the study state the solution will not change with time. However, in the transient systems the solution changes with time and after a very long time it will reach steady-state. The transient form of the 2-D heat conduction equation without the presence of the source term can be simplified to :

`frac(partialT)(partialt) = alpha(frac(partial^2T)(partialx^2)+frac(partial^2T)(partialy^2))`

Then in the discretized form, with `Deltax` and `Deltay` the grid spacing along the x and the y-directions respectively and `Deltat` as the time step, this equation can be written as:

`frac(T_(current) - T_(old))(Deltat) = alpha(frac(T_L - 2T_P + T_R)(Deltax^2) +frac(T_T - 2T_P + T_B)(Deltay^2))`

With the grid point (i,j) and the time step as n this equation can be further simplified to :

`frac(T_(i,j)^(n+1) - T_(i,j)^n)(Deltat) = alpha(frac(T_(i-1,j) - 2T_(i,j) + T_(i+1,j))(Deltax^2) +frac(T_(i,j+1) - 2T_(i,j) + T_(i,j-1))(Deltay^2))`

In the Explicit method, all the values at the right-hand-side are from the previous time step and hence are known. So we can isolate the new time step term `T_(i,j)^(n+1)` to the left and take everything else to the right and we get an equation of the form :

`T_(i,j)^(n+1) = T_(i,j)^n+ alphaDeltat( frac{T_(i+1,j)^n - 2T_(i,j)^n + T_(i-1,j)^n }{Deltax^2}+frac{T_(i,j+1)^n - 2T_(i,j)^n + T_(i,j-1)^n}{Deltay^2})`

Simplifying it a little bit, we get :

`T_(i,j)^(n+1) = T_(i,j)^n( 1-2 frac(alphaDeltat)(Deltax^2) -2 frac(alphaDeltat)(Deltay^2)) + alphaDeltat(frac{T_(i+1,j)^n + T_(i-1,j)^n }{Deltax^2})+ alphaDeltat(frac{T_(i,j+1)^n + T_(i,j-1)^n}{Deltay^2})`

Now with the values known from the previous time step we can easily substitute them in this equation and calculate the the new time step value at each grid point. One more important thing to keep in mind is the selection of `alpha`,`Deltat`,`Deltax` and `Deltay`. If they are not selected properly the solution may never reach steady state, Instead it will keep growing and will blow up. For convenience the convergence criteria for the explicit method can be checked as :

`frac(alphaDeltat)(Deltax^2) + frac(alphaDeltat)(Deltax^2) \leqfrac(1)(2)`

The above condition is called the CFL stability criteria and the solution from the explicit form will converge only if this condition is satisfied. Now we shall look at several examples of the way the CFL constant and the time step size affects the stability of the solution.

What is CFL?

The CFL condition expresses that the distance that any information travels during the timestep length within the mesh must be lower than the distance between mesh elements. In other words, information from a given cell or mesh element must propagate only to its immediate neighbors.

The CFL condition is commonly confused with linear stability conditions or nonlinear stability conditions. However, it’s important to emphasize that it is not a sufficient condition for stability, and other stability conditions are generally more restrictive than the CFL condition.

The following code was implemented in MATLAB to study the effect of stability :

clear;
close all;
clc;

%
% In this program I will try to solve the 2-D transient Heat Conduction
% Problem using Explicit Method :
%
% The equation is of the form :
%
%                    alpha(Txx + Tyy) = Ttt
%
% With the boundary conditions specified as :
%
%                       T_top = 600K
%                       T_bottom = 900K
%                       T_left = 400K
%                       T_right = 800K
%
% The domain of this problem is a 2-D unit square with equal number of grid
% points in the x and the y direction
%

% Defining the number of sub-intervals
nx = input('Input the number of sub-intervals you want along the y-direction : ');
fprintf('\n');
ny = input('Input the number of sub-intervals you want along the x-direction : ');
fprintf('\n');

% Defining the interval spacing in x-direction
h = 1/nx;

% Defining the interval spacing in y-direction
h_1 = 1/ny;

% Defining the time step spacing
dt = input(' Input the time step value you want to solve the problem : ');

% Defining the initial guess of the temperature on the domain to start
% iteration in the time loop
T_previous_dt = 0*ones(nx,ny);

% Defining the boundary conditions on the Initial Guess
T_previous_dt(1,2:end-1) = 600;
T_previous_dt(end,2:end-1) = 900;
T_previous_dt(2:end-1,1) = 400;
T_previous_dt(2:end-1,end) = 800;

% Defining the Initial Guess as the average of its nearest neighbours
T_previous_dt(1,1) = 500;
T_previous_dt(1,end) = 700;
T_previous_dt(end,1) = 650;
T_previous_dt(end,end) = 850;

% Creating a copy of T_initial
T_new_dt = T_previous_dt;

% Defining the alpha
alpha = input(' Enter the thermal diffusivity(alpha) you would like to use : ');
fprintf('\n');

% As the spacing in the x and the y-direction is the same
CFL_constant = alpha*dt/h^2 + alpha*dt/h_1^2;

% Defining the constants
K1 = alpha*dt/h^2;
K2 = alpha*dt/h_1^2;

% Defining the initial error
state_error = 9e9;

% Defining the steady state tolerance
tol = 1e-4;

% As it is an Explicit method we don't need any iterative methods to solve
% it as the temperature values are already known from the previous time
% step

% setup movie
mov = VideoWriter(['Transient State 2-D conduction using Explicit method using CFL = ' num2str(CFL_constant) '.avi']);
mov.FrameRate = 10;
open(mov);

% Defining the initial loop counter
ct = 0;

% Main Time loop
% Converge until two consecutive iterates are not changing more than the
% specified tolerance
while(state_error>tol)
    
    % Incrementing the loop counter
    ct = ct + 1;
    
    % the space loop
    for ii = 2:nx-1
        
        % columns
        for jj = 2:ny-1
            
            % computing the value of T at the new time step
            T_new_dt(ii,jj) = T_previous_dt(ii,jj) + K1 * ( T_previous_dt(ii+1,jj) + ...
                T_previous_dt(ii-1,jj) -2*T_previous_dt(ii,jj) ) + ...
                K2*(T_previous_dt(ii,jj+1) + T_previous_dt(ii,jj-1) -2*T_previous_dt(ii,jj));
            
        end
        
    end
    
    % Defining the state error to allow for convergence in steady state
    state_error = max(max(abs(T_previous_dt - T_new_dt)));
    
    % Updating the previous time step value for the next iteration
    T_previous_dt = T_new_dt;
    
    
    % writing the movie only when nt is a factor of 20
    if rem(ct,50) == 0
        % Plotting some figures
        % Plotting the surface to see how the plot looks like
        figure(1);clf;
        [C,q] = contourf(T_new_dt,'ShowText','on');
        colormap(jet);
        clabel(C,q,'Fontsize',10);
        
        % making the plot look a bit nicer
        set(gca,'Fontsize',20);
        set(gca,'YDir','reverse');
        title({[ 'After ' num2str(ct*dt) ' Seconds' ];...
            'Using the Explicit Solver' ; ...
            ['With CFL number = ' num2str(CFL_constant)]});
        set(gca,'XTick',[],'YTick',[]);
        
        % update movie frame
        writeVideo(mov,getframe(gcf));
        
        % pausing the loop to see the relaxation happening
        pause(0.001);
        
    end
    
end

% write out movie and close the handle
close(mov);

% Printing the final message :
fprintf([' The CFL Constant used was : ' num2str(CFL_constant)]);

% Making the final Plot
figure(2);clf;
% Plotting the final steady state graph
[C,q] = contourf(T_new_dt,'ShowText','on');
colormap(jet);
clabel(C,q,'Fontsize',10);
xlabel('X-Axis');
ylabel('Y-Axis');
colorbar;

% making the plot look a bit nicer
set(gca,'Fontsize',20);
set(gca,'YDir','reverse');
title({[ 'After ' num2str(ct*dt) ' Seconds' ];...
    'Using the Explicit Solver' ; ...
    ['With CFL number = ' num2str(CFL_constant)]});
set(gca,'XTick',[],'YTick',[]);

1.) Take `alpha` = 1.4 and the time step size = `Deltat` = 0.0001

The following data and animation were obtained :

As it is clear the CFL number for this case is 0.028 which is clearly less than half and so the solution is stable as is seen in this animation:

2.) Take the `alpha =1.4` and `Deltat = 0.001 sec`

The following data and animation were obtained :

As it is evident the CFL number is 0.28 and hence the solution is stable which is confirmed from the animation shown below :

3.) Take `alpha =1.4` and `Delta t = 0.01`

The following data and animation were obtained :

As can be seen, the solution has blown up and hence it is not stable. If we see at some of the plots at intermediate steps:

As it is clearly evident the solution has blown up.

The CFL constant used here was 2.8 which is clearly much larger than the limit 0.5. In about 3.2 seconds the solution has blown up to such an extent that MATLAB is not even able to plot it . See the animation below :

Now let's see what happens just at the boundary of the constant :

4.) Take `alpha = 1.4` and `Delta t = 0.0017`

The following data and animation were obtained :

Now let us look at the CFL constant :

The CFL constant used here is 0.476 which is below the safe limit of 0.5 and hence out solution will converge and is stable as is shown in the following animation :

Now let us take a case when the CFL constant is just greater than 0.5

5.) Take`alpha` = 1.4 and `Deltat = 0.002`

The following data and animation were obtained :

It is clear here that the solution has blown up. Consider some more time steps of the same simulation :

Now let us see the CFL constant.

As the CFL number is 0.56 which is greater than 0.5 the solution blows up and is very evident from the animation :

As it is clear from the above plots the unstable solution makes the patches of small bubbles around it having locally very high values. From the above simulation performed the solution becomes unstable at CFL number 0.5 which is in agreement with the theory.

Conclusion: It is evident from the data and the simulations that the CFL constant plays a very crucial role in determining the stability of the solution. This CFL constant is directly dependent upon the grid size `Delta x` and `Deltay` and the time step size `Delta t`. The selection of these parameters should be done with care if we allow the convergence of the solution otherwise the solution will blow up. In general, the notion is that the CFL constant is bound by a constant which in case of the explicit finite difference methods is 0.5. If the CFL constant is greater than 0.5 then the solution is unstable and will blow up. If the CFL number is well within the bounds of this constant then the solution is stable and the scheme will converge. If the grid sizes are made to account for more accuracy proportional changes must be made in the time step size to account for the convergence and the stability.

IMPLICIT METHOD

Now we shall see the effect of the CFL constant on the stability of the solution using the implicit methods.

The following code was used in MATLAB for the same :

clear;
close all;
clc;

%
% In this program I will try to solve the 2-D transient Heat Conduction
% Problem using Explicit Method :
%
% The equation is of the form :
%
%                    alpha(Txx + Tyy) = Ttt
%
% With the boundary conditions specified as :
%
%                       T_top = 600K
%                       T_bottom = 900K
%                       T_left = 400K
%                       T_right = 800K
%
% The domain of this problem is a 2-D unit square with equal number of grid
% points in the x and the y direction
%

% Defining the number of sub-intervals
nx = input('Input the number of sub-intervals you want along the y-direction : ');
fprintf('\n');
ny = input('Input the number of sub-intervals you want along the x-direction : ');
fprintf('\n');

% Defining the interval spacing in x-direction
h = 1/nx;

% Defining the interval spacing in y-direction
h_1 = 1/ny;

% Defining the time step spacing
dt = input(' Input the time step value you want to solve the problem : ');

% Defining the initial guess of the temperature on the domain to start
% iteration in the time loop
T_previous_dt = 300*ones(nx,ny);

% Defining the boundary conditions on the Initial Guess
T_previous_dt(1,2:end-1) = 600;
T_previous_dt(end,2:end-1) = 900;
T_previous_dt(2:end-1,1) = 400;
T_previous_dt(2:end-1,end) = 800;

% Defining the Initial Guess as the average of its nearest neighbours
T_previous_dt(1,1) = 500;
T_previous_dt(1,end) = 700;
T_previous_dt(end,1) = 650;
T_previous_dt(end,end) = 850;

% Creating a copy of T_initial
T_new_dt = T_previous_dt;

% Creating a new copy of T for the use of the spacial iterations
T_new = T_new_dt;

% Defining the alpha
alpha = input(' Enter the thermal diffusivity(alpha) you would like to use : ');
fprintf('\n');

% Defining the constants
K1 = alpha*dt/h^2;
K2 = alpha*dt/h_1^2;

CFL_constant = K1 + K2;

% As it is an Implicit method we need iterative methods to solve
% it as the temperature values are unknown from the previous time
% step
%
% In this three types of Iterative Solvers have been implemented :
%
%                    1.) Jacobi
%                    2.) Gauss - Seidel
%                    1.) Successive - Over - Relaxation
%
% inputing the type of solver to be employed
fprintf(' Types of iterative solvers available :');
fprintf('\n');
fprintf(' 1 - Jacobi Iterative Solver');
fprintf('\n');
fprintf(' 2 - Gauss Seidel Iterative Solver');
fprintf('\n');
fprintf(' 3 - Successive Relaxation solver');
fprintf('\n');
iterative_solver = input('Enter the type of solver you want to employ : ');

%%

% Jacobi Method
if iterative_solver == 1
    
    % Defining the state error 
    state_error = 9e9;
    
    % tolerance
    tol = 1e-4;
    
    % the main Time loop
    %
    % The steady state will be reached when the difference between the old
    % and new values is negligible which will be satisfied by this while
    % loop
    %
    
    % Defining the loop counter
    ct = 0;
    
    % setup movie
    mov = VideoWriter(['Transient State 2-D conduction using'...
        ' Implicit method with Jacobi solver using CFL = ' ...
        num2str(CFL_constant) '.avi']);
    mov.FrameRate = 10;
    open(mov);
    
    % Main Time Loop
    while(state_error>tol)
        
        % Initialising the T for the space iteration matrix as the average
        % as to allow for the faster convergence using iterative techniques
        T_initial = 0.5*(T_new_dt + T_previous_dt);
        
        % Updating the loop counter
        ct = ct + 1;
        
        % Defining the error in the JACOBI ITERATION
        error = 9e9;
        
        % the main loop for the convergence of the iterative solver
        while(error>tol)
            
            % rows
            for ii = 2:nx-1
                
                % columns
                for jj = 2:ny-1
                    
                    % storing the values in the new variable while keeping the
                    % old ones intact per relaxation sweep
                    T_new(ii,jj) = T_previous_dt(ii,jj)/(1+2*K1+2*K2) + K1*( T_initial(ii+1,jj) + ...
                        T_initial(ii-1,jj) )/(1+2*K1+2*K2) + ...
                        K2*( T_initial(ii,jj+1) + T_initial(ii,jj-1) )/(1+2*K1+2*K2);
                    
                end
                
            end
            
            % Defining the error to converge for the JACOBI LOOP
            error = max(max(abs(T_new - T_initial)));
            
            % Updating the T_old value
            T_initial = T_new;
            
        end
        
        % Updating the state error to allow for steadt state convergence
        state_error = max(max(abs(T_previous_dt - T_new)));
        
        % Updating the previous time step value once the solution has
        % converged in a particular time step
        T_previous_dt = T_new;
        
        % writing the movie only when nt is a factor of 20
        if rem(ct,10) == 0
            
            % Plotting some figures
            % Plotting the surface to see how the plot looks like
            figure(1);clf;
            [C,q] = contourf(T_new,'ShowText','on');
            colormap(jet);
            clabel(C,q,'Fontsize',10);
            
            % making the plot look a bit nicer
            set(gca,'Fontsize',20);
            set(gca,'YDir','reverse');
            title({[ 'After ' num2str(ct*dt) ' Seconds' ];...
                'Using the Implicit JACOBI Solver' ; ...
                ['With CFL number = ' num2str(CFL_constant)]});
            set(gca,'XTick',[],'YTick',[]);
            
            % update movie frame
            writeVideo(mov,getframe(gcf));
            
            % pausing the loop to see the relaxation happening
            pause(0.001);
            
        end
        
        
        
    end
    
    % write out movie and close the handle
    close(mov);
    
    fprintf([' THe CFL number used is : ' num2str(CFL_constant)]);
    fprintf('\n');
    
    % Plot the final graph after about 1400 iterations
    % Plotting the surface to see how the plot looks like
    figure(2);clf;
    contourf(T_initial,'ShowText','on');
    colormap(jet);
    colorbar;
    
    % making the plot look a bit nicer
    set(gca,'Fontsize',20);
    set(gca,'YDir','reverse');
    title({[ 'After ' num2str(ct*dt) ' Seconds' ];...
        'Using the Implicit JACOBI Solver' ; ...
        ['With CFL number = ' num2str(CFL_constant)]});
    set(gca,'XTick',[],'YTick',[]);
    
    
    % Employ the Gauss-Seidel Iteration
elseif iterative_solver == 2
    
    % Defining the state error 
    state_error = 9e9;
    
    % tolerance
    tol = 1e-4;
    
    % the main Time loop
    %
    % The steady state will be reached when the difference between the old
    % and new values is negligible which will be satisfied by this while
    % loop
    %
    
    % Defining the loop counter
    ct = 0;
    
    % setup movie
    mov = VideoWriter(['Transient State 2-D conduction using Implicit'...
        ' method with Gauss-Seidel solver using CFL = '...
        num2str(CFL_constant) '.avi']);
    mov.FrameRate = 15;
    open(mov);
    
    % Main Time Loop
    while(state_error>tol)
        
        % Updating the loop counter
        ct = ct + 1;
        
        % Initialising the T for the space iteration matrix
        T_initial = 0.5*(T_new_dt + T_previous_dt);
        
        % Defining the error in the JACOBI ITERATION
        error = 9e9;
        
        % the main loop for the convergence of the iterative solver
        while(error>tol)
            
            % rows
            for ii = 2:nx-1
                
                % columns
                for jj = 2:ny-1
                    
                    % storing the values in the new variable while keeping the
                    % old ones intact per relaxation sweep
                    T_new(ii,jj) = T_previous_dt(ii,jj)/(1+2*K1+2*K2) + ...
                        K1*( T_new(ii+1,jj) + T_new(ii-1,jj) ) /(1 + 2*K1 + 2*K2 )  + ...
                        K2*( T_new(ii,jj+1) + T_new(ii,jj-1) ) /(1 + 2*K1 + 2*K2);
                    
                end
                
            end
            
            % Defining the error to converge for the JACOBI LOOP
            error = max(max(abs(T_new - T_initial)));
            
            % Updating the T_old value
            T_initial = T_new;
            
            
        end
        
        % Finding the state error after the iteration
        state_error = max(max(abs(T_previous_dt - T_new)));
        
        % Updating the previous time step value once the solution has
        % converged in a particular time step
        T_previous_dt = T_new;
        
        % writing the movie only when nt is a factor of 10
        if rem(ct,10) == 0
            
            % Plotting some figures
            % Plotting the surface to see how the plot looks like
            figure(1);clf;
            [C,q] = contourf(T_new,'ShowText','on');
            colormap(jet);
            clabel(C,q,'Fontsize',10);
            
            % making the plot look a bit nicer
            set(gca,'Fontsize',20);
            set(gca,'YDir','reverse');
            title({[ 'After ' num2str(ct*dt) ' Seconds' ];...
                'Using the Implicit GAUSS-SEIDEL Solver' ; ...
                ['With CFL number = ' num2str(CFL_constant)]});
            set(gca,'XTick',[],'YTick',[]);
            
            % update movie frame
            writeVideo(mov,getframe(gcf));
            
            % pausing the loop to see the relaxation happening
            pause(0.01);
            
        end
        
    end
    
    % write out movie and close the handle
    close(mov);
    
    fprintf([' THe CFL number used is : ' num2str(CFL_constant)]);
    fprintf('\n');
    
    % Plot the final graph after about 1400 iterations
    % Plotting the surface to see how the plot looks like
    figure(2);clf;
    contourf(T_initial,'ShowText','on');
    colormap(jet);
    colorbar;
    
    % making the plot look a bit nicer
    set(gca,'Fontsize',20);
    set(gca,'YDir','reverse');
    title({[ 'After ' num2str(ct*dt) ' Seconds' ];...
        'Using the Implicit GAUSS-SEIDEL Solver' ; ...
        ['With CFL number = ' num2str(CFL_constant)]});
    set(gca,'XTick',[],'YTick',[]);
    
    
    % for successice Over-Relaxation
elseif iterative_solver == 3
    
    % Defining the state error
    state_error = 9e9;
    
    % tolerance
    tol = 1e-4;
    
    %
    % The steady state will be reached when the difference between the old
    % and new values is negligible which will be satisfied by this while
    % loop
    %
    
    % Defining the loop counter
    ct = 0;
    
    % Entering the relaxation parameter
    w = input('Enter the relaxation parameter omega : ');
    fprintf('\n');
    
    % setup movie
    mov = VideoWriter(['Transient State 2-D conduction using Implicit method'...
        ' with SOR solver using CFL = ' num2str(CFL_constant) '.avi']);
    mov.FrameRate = 15;
    open(mov);
    
    % Main Time Loop
    while(state_error>tol)
        
        % Updating the loop counter
        ct = ct + 1;
        
        % Initialising the T for the space iteration matrix
        T_initial = 0.5*(T_new_dt + T_previous_dt);
        
        % Defining the error in the SOR ITERATION
        error = 9e9;
        
        % the main loop for the convergence of the iterative solver
        while(error>tol)
            
            % rows
            for ii = 2:nx-1
                
                % columns
                for jj = 2:ny-1
                    
                    % storing the values in the new variable while keeping the
                    % old ones intact per relaxation sweep
                    T_new(ii,jj) = T_previous_dt(ii,jj)/(1+2*K1+2*K2) + ...
                        K1*( T_initial(ii+1,jj) + ...
                        T_initial(ii-1,jj) )/(1+2*K1+2*K2) + ...
                        K2*(T_initial(ii,jj+1) +...
                        T_initial(ii,jj-1) )/(1+2*K1+2*K2);
                    
                    % Actual T_new will be the average of the two
                    T_initial(ii,jj) = w*T_new(ii,jj) + (1-w)*T_initial(ii,jj);
                    
                end
                
            end

            % Defining the error to converge for the SOR LOOP
            error = max(max(abs(T_new - T_initial)));
            
            % Updating the T_old value
            T_initial = T_new;
              
        end
        
        % Updating the state error
        state_error = max(max(abs(T_previous_dt - T_new)));
        
        % Updating the previous time step value once the solution has
        % converged in a particular time step
        T_previous_dt = T_new;
        
        % writing the movie only when nt is a factor of 10
        if rem(ct,1) == 0
            
            % Plotting some figures
            % Plotting the surface to see how the plot looks like
            figure(1);clf;
            [C,q] = contourf(T_new,'ShowText','on');
            colormap(jet);
            clabel(C,q,'Fontsize',10);
            
            % making the plot look a bit nicer
            set(gca,'Fontsize',20);
            set(gca,'YDir','reverse');
            title({[ 'After ' num2str(ct*dt) ' Seconds' ];...
                'Using the Implicit SOR Solver' ; ...
                ['With CFL number = ' num2str(CFL_constant) ' and \omega = '...
                num2str(w)]});
            set(gca,'XTick',[],'YTick',[]);
            
            % update movie frame
            writeVideo(mov,getframe(gcf));
            
            % pausing the loop to see the relaxation happening
            pause(0.01);
            
        end
        
    end
    
    % write out movie and close the handle
    close(mov);
    
    fprintf([' THe CFL number used is : ' num2str(CFL_constant)]);
    fprintf('\n');
    
    % Plot the final graph 
    figure(2);clf;
    contourf(T_initial,'ShowText','on');
    colormap(jet);
    colorbar;
    
    % making the plot look a bit nicer
    set(gca,'Fontsize',20);
    set(gca,'YDir','reverse');
    title({[ 'After ' num2str(ct*dt) ' Seconds' ];...
        'Using the Implicit SOR Solver' ; ...
        ['With CFL number = ' num2str(CFL_constant) ' and \omega = '...
        num2str(w)]});
    set(gca,'XTick',[],'YTick',[]);
    
else
    
    % Printing the error message
    error('Please select from the choices above only !!!!');
    
end









For Jacobi Method

Effect of Various time steps sizes is studied on the stability of the solution using the JACOBI iteration method in IMPLICIT METHOD.

1.) Take `alpha = 1.4` and `Delta t = 0.0001`

The following graph and animation are obtained :

Let us look at the CFL constant :

We find that the CFL number is 0.028 which smaller than 0.5 and we see the solution is stable and is converging. It is confirmed in the following animation:

2.) Take `alpha = 1.4` and `Delta t = 0.01`

The following graph and animation are obtained :

Let us look at the CFL constant :

To our surprise, we can see that the CFL number is much greater than 0.5 and still the solution is converging and is stable.

3.) We take one more case of `alpha = 1.4` and `Deltat = 0.1` :

The following graph and animation are obtained :

Let us look at the CFL number for this simulation:

We see to our surprise here that the CFL constant is 28 which is very much higher than 0.5 and still the solution is converging as is evident in the following animation:

Now let us look at:

GAUSS-SEIDEL SOLVER

We take a similar set of data as we did in the case of the Jacobi method.

1.) Take `alpha = 1.4` and `Delta t = 0.01`

The following graph and animation are obtained :

We see the same as here the CFL constant is 2.8 and yet the solution is converging :

2.) We take one more case of `alpha =1.4`and `Deltat = 0.1`

The following data and animation were obtained:

Here also we see that the CFL constant is 28 but yet the solution is converging.

SOR Technique for Implicit

In the successive-Over-Relaxation, we again use the same parameters we used for the Jacobi and the Gauss-Seidel with the relaxation parameter as 1.05.

1.) Take `alpha`= 1.4 and `Deltat = 0.01`

The following graphs and data were obtained.

Now if we look at the CFL number for this simulation it is 2.8 and yet the solution is converging:

See the animation below :

2.) We take one more case of `alpha = 1.4 , Deltat = 0.1 and \omega = 1.6`

The following graphs and data were obtained

If we look at the CFL number

As can be seen, the CFL number is pretty high and yet the solution is converging which is seen from the animation below:

CONCLUSION: For the implicit method, it is clear that it doesn't matter what CFL number we take, It always converges. This is because as per the definition of CFL constant it states how fast the information should travel. But in Implicit schemes, we use the values at the current time step to approximate them, and hence the information is always available instantly and so it doesn't matter what the CFL number is as it doesn't play any significance here. This robust property of the implicit schemes can be used to our advantage when we want to run the simulation quickly we can choose the time step `Deltat` very large while still giving excellent convergence results.

Hence we conclude that the CFL number only helps in determining the stability of the explicit scheme as it needs to take the information from the previous time step and CFL constant governs that whereas in Implicit scheme it doesn't matter what the CFL constant is, the solution is always convergent and stable. This property of implicit schemes allows for their wide variety of uses.

Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.