Project

2D Heat Conduction

PROBLEM STATEMENT:

  • Solving the Transient form of 2D Heat Conduction Equation using Matlab. Here the iterative methods of Jacobi, Gauss Siedel, and Successive Relaxation Methods will be employed.
  • In the discretization of the Transient equation, both explicit and implicit finite difference schemes will be employed.
  • Solving the Steady-state form of 2D Heat Conduction Equation using the aforementioned iterative methods.

2D-HEAT CONDUCTION IN TRANSIENT FORM:

The transient form of Heat conduction equation in two dimensions is given below.

`(del T)/(delt)=alpha((del^2T)/(delx^2)+(del^2 T)/(del y^2))`

This is a second-order PDE which gives us information regarding the variation of Temperature with respect to time. This establishes how the variation of Temperature with respect to time is dependent on the variation of Temperature with respect to spatial dimensions.

DISCRETIZATION:

The first step to be followed to numerically solve the Partial Differential Equation mention above is to discretize it. In Discretization, we convert the PDE into a system of algebraic equations. There are several approaches to implement this PDE and based on this we have several Discretization methods like Finite Element Method, Finite Difference Method, and Finite Volume Method.

Here we employ the Finite Difference Method where we use the Taylor series expansions of each derivative to convert the PDE into a system of algebraic equations. The basic philosophy here is that we utilize the information available of a function at location x and its higher-order derivatives to formulate its numerical approximation. There are several different schemes which differ in their execution of the Finite Difference Method.

Here we will use the Central difference scheme to discretize the spatial derivatives whereas we will use the Forward Difference scheme to discretize the time derivative. These Finite Difference Schemes are often referred to as being explicit or implicit. When a direct computation of the dependent variables can be made in terms of known quantities, the computation is said to be explicit. When the dependent variables are defined by coupled sets of equations, and either a matrix or iterative technique is needed to obtain the solution, the numerical method is said to be implicit. In computational fluid dynamics, the governing equations are nonlinear, and the number of unknown variables is typically very large. Under these conditions implicitly formulated equations are almost always solved using iterative techniques. Explicit Schemes are conditionally stable whereas the Implicit schemes have unconditional stability.

EXPLICIT FORMULATION OF TRANSIENT 2D-HEAT CONDUCTION EQUATION:

2D-Heat Conduction Equation:

`(del T)/(delt)=alpha((del^2T)/(delx^2)+(del^2 T)/(del y^2))`

Discretization of Time derivative:

`(delT)/(delt)~~(T_(ij)^(n+1)-T_(ij)^n)/dt`

Here in the notation `T_(ij)^n` the subscript ij refers to the spatial coordinates and the superscript n refers to the time steps. So `T_(ij)^n` refers to the Temperature of the node located at (i,j) coordinates on a 2D domain at the time step n.

Discretization of Spatial Derivatives:

`(del^2T)/(delx^2)~~(T_(i+1,j)^n-2T_(ij)^n+T_(i-1,j)^n)/(dx^2)`

`(del^2T)/(dely^2)~~(T_(i,j+1)^n-2T_(ij)^n+T_(i,j-1)^n)/(dy^2)`

Explicit Formulation:

Substituting the above mentioned approximations of individual derivatives in our 2D Heat Conduction we get

`(T_(ij)^(n+1)-T_(ij)^n)/dt~~alpha*((T_(i+1,j)^n-2T_(ij)^n+T_(i-1,j)^n)/(dx^2)+(T_(i,j+1)^n-2T_(ij)^n+T_(i,j-1)^n)/(dy^2))`

After rearranging the terms of the above equation we get

`T_(ij)^(n+1)=T_(ij)^n+alpha*dt*((T_(i+1,j)^n-2T_(ij)^n+T_(i-1,j)^n)/(dx^2)+(T_(i,j+1)^n-2T_(ij)^n+T_(i,j-1)^n)/(dy^2))`

This is the explicit formulation of tranisent 2D-Heat Conduction Equation.

NUMERICAL SOLUTION WITH MATLAB:

We will utilize an iterative technique to solve the above derived algebraic equation numerically using Matlab. The code depicting this technique is given below.

Matlab Code for Explicit formulation of Transient 2D-Heat Conduction Equation:

%Solving 2D Conduction Equation
%dT/dt=alpha*(d^2T/dx^2+d^2T/dy^2)

clear all
close all 
clc

%Specifying the Computational Domain
L=1;
%Number of grid points along x and x directions
nx=10;
ny=10;
x=linspace(0,L,nx);
y=linspace(0,L,ny);
%Specifying the grid spacing along and x and y directions
dx=x(2)-x(1);
dy=y(2)-y(1);

%Specifying the Initial Conditions
%Intialaize array T to store the initial temperature values

T=300*ones(nx,ny);

%Specifying Boundary Conditions
T(1,:)=900;
T(:,1)=400;
T(end,:)=600;
T(:,end)=800;

%Specifying the Temperature at t=0 and storing in Told array
Told=T;
%Specifying the time step size
dt=1e-2;
%Specifying the thermal diffusivity
a=1e-4;
%Specifying the acceptable tolerance
tol=1e-4;
%Providing the Initial Value for the error
error=5e5;

%Specifying variables k1 and k2
k1=(a*dt)/(dx^2);
k2=(a*dt)/(dy^2);

%Iterative solution
%Intial value of the iteration
explicit_iter=1;
%Convergence loop specifies the Matlab to run the simulation until the
%error calculated is above the tolerance value.
    while(error > tol)
        %Specifying the nodal loop
    for i=2:nx-1
        for j=2:ny-1
            %Discretized Tranisent 2D Heat Conduction in Explicit form
            T(i,j)=Told(i,j)+k1*(Told(i+1,j)-2*Told(i,j)+Told(i-1,j))+k2*(Told(i,j+1)-2*Told(i,j)+Told(i,j-1));
        end
    end
    %Calculating the error after each nodal loop
    error=max(max(abs(Told-T)));
    %Updating the values in the array Told to the values in the array T
    %This will help in calcualting the Tempaerature at n+1 time step using
    %the Temperature values at n time step
        Told=T;
        %Keeping a count of the explicit iterations
       explicit_iter=explicit_iter+1;
    end
    
    %Plotting the Temperature distribution represented by the solution calculated above
    figure(1)
    contourf(x,y,T,'Linecolor','none');
    colorbar
    colormap('jet')

CODE EXPLANATION:

  • Through this code, we will solve the explicit formulation of the Transient 2D-Heat Conduction Equation on a predefined 2D computational domain using an iterative technique.
  • Here we initially run a convergence loop which will make sure that the error calculated at each node is below the desired value of 1e-4.
  • Inside this convergence loop, there is a Nodal loop which will help us calculate the Temperature values at each time step throughout the computational domain by moving from one node to another. The iterations in time steps are brought about by the convergence loop.
  • At the end of each iteration of the nodal loop, we update the Temperature values.

STEP BY STEP EXPLANATION:

  • Initially, we define the computational domain by specifying the necessary variables like Domain length, Number of Grid points and grid spacing.
  • Then we define the Initial conditions of our simulation by specifying the Temperature value in our 2D domain at time t=0.
  • Then Boundary Conditions are defined by specifying the Temperature values at the corner nodes.
  • A new array Told is defined which will store the Temperature value at time step n when our simulation is at n+1time step.
  • Then few inputs like the time step size, thermal diffusivity, Initial error value, and tolerance error value are specified. Similarly, new variables like k1 and k2 are also specified.
  • Convergence loop is defined which will make sure that the error calculated is kept within the specified tolerance level. Here the iterations are counted using explicit iterations variable
  • The Nodal loop is initiated to calculate the Temperature throughout our domain.
  • The error value is calculated as the maximum value of the absolute difference between the Temperature at time step n and Temperature at time step is n+1.
  • The Temperature values in Told array is updated to the Temperature values calculated for the current time step.
  • The value of explicit iterations is updated.
  • Finally, we plot the temperature distribution representing the solution of our iterative process. This temperature distribution provides information regarding the temperature value at each node throughout our 2D Computational Domain.

RESULTS:

Temperature distribution -Explicit formulation of Transient 2D Heat Conduction Equation

IMPLICIT FORMULATION OF TRANSIENT 2D-HEAT CONDUCTION EQUATION:

2D-Heat Conduction Equation:

`(del T)/(delt)=alpha((del^2T)/(delx^2)+(del^2 T)/(del y^2))`

Discretization of Time derivative:

`(delT)/(delt)~~(T_(ij)^(n+1)-T_(ij)^n)/dt`

Here in the notation `T_(ij)^n` the subscript ij refers to the spatial coordinates and the superscript n refers to the time steps. So `T_(ij)^n` refers to the Temperature of the node located at (i,j) coordinates on a 2D domain at the time step n.

Discretization of Spatial Derivatives:

`(del^2T)/(delx^2)~~(T_(i+1,j)^(n+1)-2T_(ij)^(n+1)+T_(i-1,j)^(n+1))/(dx^2)`

`(del^2T)/(dely^2)~~(T_(i,j+1)^(n+1)-2T_(ij)^(n+1)+T_(i,j-1)^(n+1))/(dy^2)`

Implicit Formulation:

Substituting the above mentioned approximations of individual derivatives in our 2D Heat Conduction we get

`(T_(ij)^(n+1)-T_(ij)^n)/dt~~alpha*((T_(i+1,j)^(n+1)-2T_(ij)^(n+1)+T_(i-1,j)^(n+1))/(dx^2)+(T_(i,j+1)^(n+1)-2T_(ij)^(n+1)+T_(i,j-1)^(n+1))/(dy^2))`

After rearranging the terms of the above equation we get

`T_(ij)^(n+1)=T_(ij)^n+alpha*dt*((T_(i+1,j)^(n+1)-2T_(ij)^(n+1)+T_(i-1,j)^(n+1))/(dx^2)+(T_(i,j+1)^(n+1)-2T_(ij)^(n+1)+T_(i,j-1)^(n+1))/(dy^2))`

This is the implicit formulation of tranisent 2D-Heat Conduction Equation.

On rearranging the terms of the above equation we get:

`T_(ij)^(n+1)=(T_(ij)^n+k1(T_(i+1,j)^(n+1)+T_(i-1,j)^(n+1))+k2(T_(i,j+1)^(n+1)+T_(i,j-1)^(n+1)))/(1+2k1+2k2)`

Where `k1=alpha*(Deltat)/(Deltax^2) and k2=alpha*(Deltat)/(Deltay^2)`

The above equation can be further simplified as

`T_(ij)^(n+1)=A*T_(ij)^n+B*(T_(i+1,j)^(n+1)+T_(i-1,j)^(n+1))+C*(T_(i,j+1)^(n+1)+T_(i,j-1)^(n+1))`

`A=(1)/(1+2k1+2k2) ; B=(k1)/(1+2k1+2k2); C=k2/(1+2k1+2k2)`

NUMERICAL SOLUTION WITH MATLAB:

We will utilize an iterative technique to solve the above derived algebraic equations numerically using Matlab. The code depicting this technique is given below.

JACOBI ITERATIVE SOLVER:

When we observe the set of algebraic equations received through implicit formulation we can observe that these set of equations are coupled in space. We can directly solve these equations using Matrix inversion method. However, adopting this method would call for solving matrices containing millions of elements which would not be practically feasible. In these situations, we use iterative solvers to solve the set of equations we obtained above.

In iterative solvers, we take initial guess values for the temperature at every node in our domain and iteratively calculate the temperature values at succeeding time steps. This process is continued until we achieve a stable solution for the temperature in our domain.

Jacobi Method:

Implicit Formulation

`T_(ij)^(n+1)=A*T_(ij)^n+B*(T_(i+1,j)^(n+1)+T_(i-1,j)^(n+1))+C*(T_(i,j+1)^(n+1)+T_(i,j-1)^(n+1))`

We will use the notation `(T_(ij)^k)^(J_0)` represents the Temperature at node 'ij'. Here both k and J0 represents time steps. k represents time step w.r.t implicit formulation which is the inherent nature of an implicit scheme whereas J0 represents the 1 first time step w.r.t Jacobi solver this time step is introduced by us during the iterative process. Also at time step J0 we assign guess values to the nodes which will be used in our succeeding calculations.

Thus using the above implicit formulation and the initial Jacobi guess values the temperature at node ij at second-time step w.r.t Jacobi is as follows:

`(T_(ij)^(n+1))^(J_1)=A*(T_(ij)^n)^(J_0)+B*(T_(i+1,j)^(n+1)+T_(i-1,j)^(n+1))^(J_0)+C*(T_(i,j+1)^(n+1)+T_(i,j-1)^(n+1))^(J_0)`

Similarly

`(T_(ij)^(n+1))^(J_2)=A*(T_(ij)^n)^(J_1)+B*(T_(i+1,j)^(n+1)+T_(i-1,j)^(n+1))^(J_1)+C*(T_(i,j+1)^(n+1)+T_(i,j-1)^(n+1))^(J_1)`

Thus general formulation for Jacobi iterative solver is :

`(T_(ij)^(n+1))^(J_(n+1))=A*(T_(ij)^n)^(J_n)+B*(T_(i+1,j)^(n+1)+T_(i-1,j)^(n+1))^(J_n)+C*(T_(i,j+1)^(n+1)+T_(i,j-1)^(n+1))^(J_n)`

The code for solving these equations iteratively is given below.

MATLAB CODE USING JACOBI ITERATIVE SOLVER:

%Solving 2D Conduction Equation
%dT/dt=alpha*(d^2T/dx^2+d^2T/dy^2)

clear all
close all 
clc

%Specifying the input conditions
L=1;
%Number of grid points along x and y directions
nx=51;
ny=51;
x=linspace(0,L,nx);
y=linspace(0,L,ny);
[X,Y]=meshgrid(x,y);

%Specifying the grid spacing along and x and y directions
dx=x(2)-x(1);
dy=y(2)-y(1);

%Specifying the Initial Conditions
%Intialaize array T to store the initial temperature values
T=300*ones(nx,ny);

%Specifying the  Boundary Conditions
T(1,:)=900;
T(:,1)=400;
T(end,:)=600;
T(10,1)=400;
T(:,end)=800;

%Specifying the temperture at the corners
T(1,1)=(900+400)/2;
T(end,end)=(600+800)/2;
T(end,1)=(400+600)/2;
T(1,end)=(900+800)/2;



%Temperature corresponding to implicit timesteps is stored in Tprev_dt array
%and the initial condition of this array is specified here 
Tprev_dt=T;

%Temperature corresponding to Jacobi timesteps is stored in Told array
%and the initial condition of this array is specified here here
Told=T;

%Specifying the time step size
dt=1e-2;
%Specifying the thermal diffusivity
a=1;
%Specifying the acceptable tolerance
tol=1e-4;
%Providing the Initial Value for the error
error=5e5;


%Specifying variables k1,k2,Dn,B and C
k1=(a*dt)/(dx^2);
k2=(a*dt)/(dy^2);
Dn=(1+2*k1+2*k2)^-1;
B=k1*Dn;
C=k2*Dn;

%Iterative solution
%Intial value of the iteration
jacobi_iter=1;
%Time loop specifies the Matlab to run the simulation for 20 minutes
%This time loop specifies the time steps iterations introduced by the
%implicit formulation of the 2D Heat Conduction Equation.

   for k=1:12000
    %Convergence loop specifies the Matlab to run the simulation untill the
    %error calulated is above the tolerance value. 
    while(error > tol)  
    %Specifying the nodal loop
    for i=2:nx-1
        for j=2:ny-1
            H=(Told(i+1,j)+Told(i-1,j));
            V=(Told(i,j+1)+Told(i,j-1));
        %Discretized Tranisent 2D Heat Conduction in Implicit form    
        T(i,j)=(Dn*Tprev_dt(i,j))+(B*H)+(C*V);
        end
    end
       %Calculating the error after each nodal loop
        error=max(max(abs(Told-T)));
        %Updating the values in the array Told to the values in the array T
    %This will help in calculating the Temperature at n+1 time step using
    %the Temperature values at n time step (Here the time steps are w.r.t
    %Jacobi time steps)
        Told=T;
        jacobi_iter=jacobi_iter+1;
    end
       error=5e5;
        %Updating the values in the array Tprev_dt to the values in the
        %array Told This will help in calculating the Temperature at n+1
        %time step using the Temperature values at n time step (Here the
        %time steps are w.r.t Implicit time steps)
       Tprev_dt=Told;
       %Keeping a count of the explicit iterations
       
   end
    
    
    %Plotting the Temperature distribution represented by the solution
    %calculated above
    figure(1)
    contourf(x,y,T,'Linecolor','none');
    colorbar
    colormap('jet')

CODE EXPLANATION:

  • Through this code, we will solve the implicit formulation of the Transient 2D-Heat Conduction Equation on a predefined 2D computational domain using an iterative technique.
  • Here we first initiate a time loop in which the implicit formulation is iteratively solved. The time steps corresponding to this time loop represents the implicit formulation.
  • Then we run a convergence loop which will make sure that the error calculated at each node is below the desired value of 1e-4. The time steps corresponding to this loop represents the Jacobi iterative solver. Inside this convergence loop, there is a Nodal loop which will help us calculate the Temperature values at each time step throughout the computational domain by moving from one node to another.
  • At the end of each iteration of the nodal loop, we update the Temperature values of previous time steps w.r.t Jacobi time steps.
  • At the end of each iteration of convergence loop, we update the Temperature value of previous time steps w.r.t implicit time steps.

STEP BY STEP EXPLANATION:

  • Initially, we define the computational domain by specifying the necessary variables like Domain length, Number of Grid points and grid spacing.
  • Then we define the Initial conditions of our simulation by specifying the Temperature value in our 2D domain at time t=0.
  • Then Boundary Conditions are defined by specifying the Temperature values at the corner nodes.
  • A new array Told is defined which will store the Temperature value at time step n when our simulation is at n+1time step.
  • Then few inputs like the time step size, thermal diffusivity, Initial error value, and tolerance error value are specified. Similarly, new variables like k1 and k2 are also specified.
  • A Time loop is defined which will iteratively calculate the implicit formulation of the 2D Heat Conduction equation.
  • Convergence loop is defined which will make sure that the error calculated is kept within the specified tolerance level. Here the iterations are counted using Jacobi iterations variable
  • The Nodal loop is initiated to calculate the Temperature throughout our domain.
  • As we are using the Jacobi iterative solver we will use only the Temperature values at n-1 time steps to calculate the Temperature values at time step n.
  • The error value is calculated as the maximum value of the absolute difference between the Temperature at time step n and Temperature at time step is n+1.
  • The Temperature values in Told array is updated to the Temperature values calculated for the current time step and similarly, updating is carried out in the array Tprev_dt containing old Temperature values w.r.t the implicit iterations.
  • The value of implicit iterations is updated.
  • Finally, we plot the temperature distribution representing the solution of our iterative process. This temperature distribution provides information regarding the temperature value at each node throughout our 2D Computational Domain.

RESULTS:

Temperature distribution -Implicit formulation of Transient 2D Heat Conduction Equation using a Jacobi iterative solver.

GAUSS SIEDEL ITERATIVE SOLVER:

Gauss Siedel is also an iterative solver like the Jacobi solver. Here also we iteratively solve a set of coupled algebraic equations but differ in the implementation of this iterative process.

The general formulation for Gauss Siedel Solver:

`(T_(ij)^(n+1))^(GS_(n+1))=A*(T_(ij)^n)^(GS_n)+B*((T_(i+1,j)^(n+1))^(GS_n)+(T_(i-1,j)^(n+1))^(GS_(n+1)))+C*((T_(i,j+1)^(n+1))^(GS_n)+(T_(i,j-1)^(n+1))^(GS_(n+1)))`

Where `(T_(ij)^k)^(GS)` represents the temperature at 'ij' node at time step k w.r.t implict formulation and GS time step w.r.t Gauss Siedel solver.

In Gauss Siedel solver while we are calculating the temperature at a node 'ij ' at GSn+1 time step we use the Temperature values at GSn+1 timestep of nodes whose temperature is previously calculated.

MATLAB CODE USING GAUSS SIEDEL SOLVER:

%Solving 2D Conduction Equation
%dT/dt=alpha*(d^2T/dx^2+d^2T/dy^2)

clear all
close all 
clc

%Specifying the input conditions
L=1;
nx=51;
ny=51;

%Constructing the computational domain
x=linspace(0,L,nx);
y=linspace(0,L,ny);
[X,Y]=meshgrid(x,y);
dx=x(2)-x(1);
dy=y(2)-y(1);

%Intialaize array T to store temperature values
T=300*ones(nx,ny);

%Specifying the  Boundary Conditions
T(1,:)=900;
T(:,1)=400;
T(end,:)=600;
T(10,1)=400;
T(:,end)=800;

%Specifying the temperture at the corners
T(1,1)=(900+400)/2;
T(end,end)=(600+800)/2;
T(end,1)=(400+600)/2;
T(1,end)=(900+800)/2;

%Specifying the Temperature at t=0 and storing in Told array and Tprev_dt
%array

%Temperature corresponding to implicit timesteps is stored in Tprev_dt array
%and the initial condition of this array is specified here 
Tprev_dt=T;

%Temperature corresponding to Gauss Siedel timesteps is stored in Told array
%and the initial condition of this array is specified here here
Told=T;

%Specifying the time step size
dt=1e-2;
%Specifying the thermal diffusivity
a=1;
%Specifying the acceptable tolerance
tol=1e-4;
%Providing the Initial Value for the error
error=5e5;

%Specifying variables k1,k2,Dn,B and C
k1=(a*dt)/(dx^2);
k2=(a*dt)/(dy^2);
Dn=(1+2*k1+2*k2)^-1;
B=k1*Dn;
C=k2*Dn;

%Iterative solution
%Intial value of the iteration
Gauss_siedel_iter=1;

    %Time loop specifies the Matlab to run the simulation for 20 minutes
%This time loop specifies the time steps iterations introduced by the
%implicit formulation of the 2D Heat Conduction Equation.
    for k=1:12000
    %Convergence loop specifies the Matlab to run the simulation untill the
    %error calulated is above the tolerance value.  
    while(error > tol)  
    %Specifying the nodal loop
    for i=2:nx-1
        for j=2:ny-1
            H=(Told(i+1,j)+T(i-1,j));
            V=(Told(i,j+1)+T(i,j-1));
        %Discretized Tranisent 2D Heat Conduction in Implicit form    
        T(i,j)=(Dn*Tprev_dt(i,j))+(B*H)+(C*V);
        end
    end
        %Calculating the error after each nodal loop
        error=max(max(abs(Told-T)));
        %Updating the values in the array Told to the values in the array T
    %This will help in calculating the Temperature at n+1 time step using
    %the Temperature values at n time step (Here the time steps are w.r.t
    %Gauss Siedel time steps)
        Told=T;
        Gauss_siedel_iter=Gauss_siedel_iter+1;
    end
       error=5e5;
        %Updating the values in the array Tprev_dt to the values in the
        %array Told This will help in calculating the Temperature at n+1
        %time step using the Temperature values at n time step (Here the
        %time steps are w.r.t Implicit time steps)
       Tprev_dt=Told;
       
   end
    
    
    %Plotting the Temperture distribution represented by the 2D heat
    %Conduction Equation
    figure(1)
    contourf(x,y,T,'Linecolor','none');
    colorbar
    colormap('jet')

CODE EXPLANATION:

  • Through this code, we will solve the implicit formulation of the Transient 2D-Heat Conduction Equation on a predefined 2D computational domain using a Gauss Siedel iterative technique.
  • Here we first initiate a time loop in which the implicit formulation is iteratively solved. The time steps corresponding to this time loop represents the implicit formulation.
  • Then we run a convergence loop which will make sure that the error calculated at each node is below the desired value of 1e-4. The time steps corresponding to this loop represents the Gauss Siedel iterative solver. Inside this convergence loop, there is a Nodal loop which will help us calculate the Temperature values at each time step throughout the computational domain by moving from one node to another.
  • At the end of each iteration of the nodal loop, we update the Temperature values of previous time steps w.r.t Gauss Siedel time steps.
  • At the end of each iteration of convergence loop, we update the Temperature value of previous time steps w.r.t implicit time steps.

STEP BY STEP EXPLANATION:

  • Initially, we define the computational domain by specifying the necessary variables like Domain length, Number of Grid points and grid spacing.
  • Then we define the Initial conditions of our simulation by specifying the Temperature value in our 2D domain at time t=0.
  • Then Boundary Conditions are defined by specifying the Temperature values at the corner nodes.
  • A new array Told is defined which will store the Temperature value at time step n when our simulation is at n+1time step.
  • Then few inputs like the time step size, thermal diffusivity, Initial error value, and tolerance error value are specified. Similarly, new variables like k1 and k2 are also specified.
  • A Time loop is defined which will iteratively calculate the implicit formulation of the 2D Heat Conduction equation.
  • Convergence loop is defined which will make sure that the error calculated is kept within the specified tolerance level. Here the iterations are counted using Gauss Siedel iterations variable
  • The Nodal loop is initiated to calculate the Temperature throughout our domain.
  • As we are using the Gauss Siedel iterative solver we will use both the Temperature values at n-1 and n+1 Gauss Siedel time steps to calculate the Temperature values at time step n.
  • The error value is calculated as the maximum value of the absolute difference between the Temperature at time step n and Temperature at time step is n+1.
  • The Temperature values in Told array is updated to the Temperature values calculated for the current time step and similarly, updating is carried out in the array Tprev_dt containing old Temperature values w.r.t the implicit iterations.
  • The value of implicit iterations is updated.
  • Finally, we plot the temperature distribution representing the solution of our iterative process. This temperature distribution provides information regarding the temperature value at each node throughout our 2D Computational Domain.

RESULTS:

Temperature distribution -Implicit formulation of Transient 2D Heat Conduction Equation using a Gauss Siedel iterative solver:

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.