Project

Steady state vs unsteady analysis

Steady state vs unsteady analysis

Steady State Analysis

In steady state Analysis the solution is independent of time, hence it solves for the values at steady state.

The fastest steady state analysis is achieved using SOR(Successive over relaxation) method at α">αα(Relaxation factor) =1.7.

% Solving the steady 2D Heat conduction problem
clear all
close all
clc
% creating the 2d grid
a=linspace(0,1,20);
b=linspace(0,1,20);
[x y]=meshgrid(a,b);
delx=x(1,2)-x(1,1)
dely=y(2,1)-y(1,1)
% Initial_condition
for i=1:length(x)
    for j=1:length(y)
        t(i,j)=300;
    end
end
% Assigning boundary conditions (top,left,bottom,right)
for k=1:4
    if k==1
        c=1,d=1:length(x),p=600;
    elseif k==2
        c=2:length(y)-1,d=1,p=400;
    elseif k==3
        c=length(y),d=1:length(x),p=900;
    else
        c=2:length(y)-1,d=length(y),p=800;
    end
for i=c
    for j=d
        t(i,j)=p
    end
end
end
tic;
[t_steady,No_iterations,error]=steady_state_f(t,x,y,delx,dely)
Simulation_time=toc
[m n]=contourf(x,y,t_steady)
clabel(m,n)
colormap(jet)
colorbar
xlabel('x-axis')
ylabel('y-axis')
zlabel('Temperature')
function [t_steady,No_iter,e] =steady_state_f(t,x,y,delx,dely)
told=t % For comparison after every iteration
a=delx;
b=dely;
tol=1e-04;
e=8e08;
k=(2*(a^2+b^2))/(a^2*b^2);
% SOR Iteration
sor_iteration=0;
t_upd=t;
alpha=1.7
while(e>tol)
     for i=2:length(x)-1
        for j=2:length(y)-1
            c=(t_upd(i,j-1)+t_upd(i,j+1))/(a^2);
            d=(t_upd(i-1,j)+t_upd(i+1,j))/(b^2);
            t(i,j)=(1/k)*(c+d)
            t(i,j)=told(i,j)+(alpha*(t(i,j)-told(i,j)))
            t_upd=t;
        end
     end
     error=max(abs(told-t))
     e=max(abs(error))
     told=t
    sor_iteration=sor_iteration+1;

end
t_steady=told;
No_iter=sor_iteration;
end

The above figure depicts the contour plot for temperature at steady state.

Unsteady state Analysis

In Unsteady state Analysis the solution to the flow field is time dependent, hence the difference equation has to be solved for the entire flow field for each and every time step.

Explicit vs Implicit approach

In explicit approach we solve for the (n+1) time step values using n(th) time step values, hence we do time marching with known values. This makes explicit approach useful in getting the solution at any time step t and as it solves with known values there is no need of using iterative techniques.

In Implicit approach we solve for the (n+1) time step values using (n+1) and n(th) time step values, which makes them solve using Iterative techniques. The convergence loop is ran for each and every time step.

function [t_transient,No_iter]=transient_implicit(t,x,y,delx,dely,solver)
told=t
a=delx;
b=dely;
tol=1e-04;
dt=8.78;
alp_const=1 % Thermal Diffusivity
k1=(alp_const*dt)/a^2
k2=(alp_const*dt)/b^2
jacobi_iteration=0;
t_prev=told
% SOR Iteration
sor_iteration=0;
alpha=1.7
if solver==3
    t_upd=t;
    e=8e08;
while(e>tol)
     for i=2:length(x)-1
        for j=2:length(y)-1
            c=(t_upd(i,j-1)+t_upd(i,j+1))*k1;
            d=(t_upd(i-1,j)+t_upd(i+1,j))*k2;
            t(i,j)=(t_prev(i,j)+c+d)/(1+2*(k1+k2))
            t(i,j)=told(i,j)+(alpha*(t(i,j)-told(i,j)))
            t_upd=t;
        end
     end
     error=max(abs(told-t))
     e=max(abs(error))
     told=t
    sor_iteration=sor_iteration+1;
end

end
t_transient=told;
No_iter=sor_iteration;
end

The fastest Unsteady state analysis is achieved using SOR(Successive over relaxation) method with Implicit approach at α">αα(Relaxation factor)=1.7.

The above figure depicts the contour plot for temperature at transient state (Implicit approach) using SOR method.

The transient implicit approach converges faster compared to steady state as steady state is time independent which doesn't allow it to directly solve for a given time.

Steady state vs unsteady analysis

Steady State Analysis

In steady state Analysis the solution is independent of time, hence it solves for the values at steady state.

The fastest steady state analysis is achieved using SOR(Successive over relaxation) method at α">αα(Relaxation factor) =1.7.

% Solving the steady 2D Heat conduction problem
clear all
close all
clc
% creating the 2d grid
a=linspace(0,1,20);
b=linspace(0,1,20);
[x y]=meshgrid(a,b);
delx=x(1,2)-x(1,1)
dely=y(2,1)-y(1,1)
% Initial_condition
for i=1:length(x)
    for j=1:length(y)
        t(i,j)=300;
    end
end
% Assigning boundary conditions (top,left,bottom,right)
for k=1:4
    if k==1
        c=1,d=1:length(x),p=600;
    elseif k==2
        c=2:length(y)-1,d=1,p=400;
    elseif k==3
        c=length(y),d=1:length(x),p=900;
    else
        c=2:length(y)-1,d=length(y),p=800;
    end
for i=c
    for j=d
        t(i,j)=p
    end
end
end
tic;
[t_steady,No_iterations,error]=steady_state_f(t,x,y,delx,dely)
Simulation_time=toc
[m n]=contourf(x,y,t_steady)
clabel(m,n)
colormap(jet)
colorbar
xlabel('x-axis')
ylabel('y-axis')
zlabel('Temperature')
function [t_steady,No_iter,e] =steady_state_f(t,x,y,delx,dely)
told=t % For comparison after every iteration
a=delx;
b=dely;
tol=1e-04;
e=8e08;
k=(2*(a^2+b^2))/(a^2*b^2);
% SOR Iteration
sor_iteration=0;
t_upd=t;
alpha=1.7
while(e>tol)
     for i=2:length(x)-1
        for j=2:length(y)-1
            c=(t_upd(i,j-1)+t_upd(i,j+1))/(a^2);
            d=(t_upd(i-1,j)+t_upd(i+1,j))/(b^2);
            t(i,j)=(1/k)*(c+d)
            t(i,j)=told(i,j)+(alpha*(t(i,j)-told(i,j)))
            t_upd=t;
        end
     end
     error=max(abs(told-t))
     e=max(abs(error))
     told=t
    sor_iteration=sor_iteration+1;

end
t_steady=told;
No_iter=sor_iteration;
end

The above figure depicts the contour plot for temperature at steady state.

Unsteady state Analysis

In Unsteady state Analysis the solution to the flow field is time dependent, hence the difference equation has to be solved for the entire flow field for each and every time step.

Explicit vs Implicit approach

In explicit approach we solve for the (n+1) time step values using n(th) time step values, hence we do time marching with known values. This makes explicit approach useful in getting the solution at any time step t and as it solves with known values there is no need of using iterative techniques.

In Implicit approach we solve for the (n+1) time step values using (n+1) and n(th) time step values, which makes them solve using Iterative techniques. The convergence loop is ran for each and every time step.

function [t_transient,No_iter]=transient_implicit(t,x,y,delx,dely,solver)
told=t
a=delx;
b=dely;
tol=1e-04;
dt=8.78;
alp_const=1 % Thermal Diffusivity
k1=(alp_const*dt)/a^2
k2=(alp_const*dt)/b^2
jacobi_iteration=0;
t_prev=told
% SOR Iteration
sor_iteration=0;
alpha=1.7
if solver==3
    t_upd=t;
    e=8e08;
while(e>tol)
     for i=2:length(x)-1
        for j=2:length(y)-1
            c=(t_upd(i,j-1)+t_upd(i,j+1))*k1;
            d=(t_upd(i-1,j)+t_upd(i+1,j))*k2;
            t(i,j)=(t_prev(i,j)+c+d)/(1+2*(k1+k2))
            t(i,j)=told(i,j)+(alpha*(t(i,j)-told(i,j)))
            t_upd=t;
        end
     end
     error=max(abs(told-t))
     e=max(abs(error))
     told=t
    sor_iteration=sor_iteration+1;
end

end
t_transient=told;
No_iter=sor_iteration;
end

The fastest Unsteady state analysis is achieved using SOR(Successive over relaxation) method with Implicit approach at α">αα(Relaxation factor)=1.7.

The above figure depicts the contour plot for temperature at transient state (Implicit approach) using SOR method.

The transient implicit approach converges faster compared to steady state as steady state is time independent which doesn't allow it to directly solve for a given time.

Steady state vs unsteady analysis

Steady State Analysis

In steady state Analysis the solution is independent of time, hence it solves for the values at steady state.

The fastest steady state analysis is achieved using SOR(Successive over relaxation) method at α">αα(Relaxation factor) =1.7.

% Solving the steady 2D Heat conduction problem
clear all
close all
clc
% creating the 2d grid
a=linspace(0,1,20);
b=linspace(0,1,20);
[x y]=meshgrid(a,b);
delx=x(1,2)-x(1,1)
dely=y(2,1)-y(1,1)
% Initial_condition
for i=1:length(x)
    for j=1:length(y)
        t(i,j)=300;
    end
end
% Assigning boundary conditions (top,left,bottom,right)
for k=1:4
    if k==1
        c=1,d=1:length(x),p=600;
    elseif k==2
        c=2:length(y)-1,d=1,p=400;
    elseif k==3
        c=length(y),d=1:length(x),p=900;
    else
        c=2:length(y)-1,d=length(y),p=800;
    end
for i=c
    for j=d
        t(i,j)=p
    end
end
end
tic;
[t_steady,No_iterations,error]=steady_state_f(t,x,y,delx,dely)
Simulation_time=toc
[m n]=contourf(x,y,t_steady)
clabel(m,n)
colormap(jet)
colorbar
xlabel('x-axis')
ylabel('y-axis')
zlabel('Temperature')
function [t_steady,No_iter,e] =steady_state_f(t,x,y,delx,dely)
told=t % For comparison after every iteration
a=delx;
b=dely;
tol=1e-04;
e=8e08;
k=(2*(a^2+b^2))/(a^2*b^2);
% SOR Iteration
sor_iteration=0;
t_upd=t;
alpha=1.7
while(e>tol)
     for i=2:length(x)-1
        for j=2:length(y)-1
            c=(t_upd(i,j-1)+t_upd(i,j+1))/(a^2);
            d=(t_upd(i-1,j)+t_upd(i+1,j))/(b^2);
            t(i,j)=(1/k)*(c+d)
            t(i,j)=told(i,j)+(alpha*(t(i,j)-told(i,j)))
            t_upd=t;
        end
     end
     error=max(abs(told-t))
     e=max(abs(error))
     told=t
    sor_iteration=sor_iteration+1;

end
t_steady=told;
No_iter=sor_iteration;
end

The above figure depicts the contour plot for temperature at steady state.

Unsteady state Analysis

In Unsteady state Analysis the solution to the flow field is time dependent, hence the difference equation has to be solved for the entire flow field for each and every time step.

Explicit vs Implicit approach

In explicit approach we solve for the (n+1) time step values using n(th) time step values, hence we do time marching with known values. This makes explicit approach useful in getting the solution at any time step t and as it solves with known values there is no need of using iterative techniques.

In Implicit approach we solve for the (n+1) time step values using (n+1) and n(th) time step values, which makes them solve using Iterative techniques. The convergence loop is ran for each and every time step.

function [t_transient,No_iter]=transient_implicit(t,x,y,delx,dely,solver)
told=t
a=delx;
b=dely;
tol=1e-04;
dt=8.78;
alp_const=1 % Thermal Diffusivity
k1=(alp_const*dt)/a^2
k2=(alp_const*dt)/b^2
jacobi_iteration=0;
t_prev=told
% SOR Iteration
sor_iteration=0;
alpha=1.7
if solver==3
    t_upd=t;
    e=8e08;
while(e>tol)
     for i=2:length(x)-1
        for j=2:length(y)-1
            c=(t_upd(i,j-1)+t_upd(i,j+1))*k1;
            d=(t_upd(i-1,j)+t_upd(i+1,j))*k2;
            t(i,j)=(t_prev(i,j)+c+d)/(1+2*(k1+k2))
            t(i,j)=told(i,j)+(alpha*(t(i,j)-told(i,j)))
            t_upd=t;
        end
     end
     error=max(abs(told-t))
     e=max(abs(error))
     told=t
    sor_iteration=sor_iteration+1;
end

end
t_transient=told;
No_iter=sor_iteration;
end

The fastest Unsteady state analysis is achieved using SOR(Successive over relaxation) method with Implicit approach at α">αα(Relaxation factor)=1.7.

The above figure depicts the contour plot for temperature at transient state (Implicit approach) using SOR method.

The transient implicit approach converges faster compared to steady state as steady state is time independent which doesn't allow it to directly solve for a given time.

Steady state vs unsteady analysis

Steady State Analysis

In steady state Analysis the solution is independent of time, hence it solves for the values at steady state.

The fastest steady state analysis is achieved using SOR(Successive over relaxation) method at α">αα(Relaxation factor) =1.7.

% Solving the steady 2D Heat conduction problem
clear all
close all
clc
% creating the 2d grid
a=linspace(0,1,20);
b=linspace(0,1,20);
[x y]=meshgrid(a,b);
delx=x(1,2)-x(1,1)
dely=y(2,1)-y(1,1)
% Initial_condition
for i=1:length(x)
    for j=1:length(y)
        t(i,j)=300;
    end
end
% Assigning boundary conditions (top,left,bottom,right)
for k=1:4
    if k==1
        c=1,d=1:length(x),p=600;
    elseif k==2
        c=2:length(y)-1,d=1,p=400;
    elseif k==3
        c=length(y),d=1:length(x),p=900;
    else
        c=2:length(y)-1,d=length(y),p=800;
    end
for i=c
    for j=d
        t(i,j)=p
    end
end
end
tic;
[t_steady,No_iterations,error]=steady_state_f(t,x,y,delx,dely)
Simulation_time=toc
[m n]=contourf(x,y,t_steady)
clabel(m,n)
colormap(jet)
colorbar
xlabel('x-axis')
ylabel('y-axis')
zlabel('Temperature')
function [t_steady,No_iter,e] =steady_state_f(t,x,y,delx,dely)
told=t % For comparison after every iteration
a=delx;
b=dely;
tol=1e-04;
e=8e08;
k=(2*(a^2+b^2))/(a^2*b^2);
% SOR Iteration
sor_iteration=0;
t_upd=t;
alpha=1.7
while(e>tol)
     for i=2:length(x)-1
        for j=2:length(y)-1
            c=(t_upd(i,j-1)+t_upd(i,j+1))/(a^2);
            d=(t_upd(i-1,j)+t_upd(i+1,j))/(b^2);
            t(i,j)=(1/k)*(c+d)
            t(i,j)=told(i,j)+(alpha*(t(i,j)-told(i,j)))
            t_upd=t;
        end
     end
     error=max(abs(told-t))
     e=max(abs(error))
     told=t
    sor_iteration=sor_iteration+1;

end
t_steady=told;
No_iter=sor_iteration;
end

The above figure depicts the contour plot for temperature at steady state.

Unsteady state Analysis

In Unsteady state Analysis the solution to the flow field is time dependent, hence the difference equation has to be solved for the entire flow field for each and every time step.

Explicit vs Implicit approach

In explicit approach we solve for the (n+1) time step values using n(th) time step values, hence we do time marching with known values. This makes explicit approach useful in getting the solution at any time step t and as it solves with known values there is no need of using iterative techniques.

In Implicit approach we solve for the (n+1) time step values using (n+1) and n(th) time step values, which makes them solve using Iterative techniques. The convergence loop is ran for each and every time step.

function [t_transient,No_iter]=transient_implicit(t,x,y,delx,dely,solver)
told=t
a=delx;
b=dely;
tol=1e-04;
dt=8.78;
alp_const=1 % Thermal Diffusivity
k1=(alp_const*dt)/a^2
k2=(alp_const*dt)/b^2
jacobi_iteration=0;
t_prev=told
% SOR Iteration
sor_iteration=0;
alpha=1.7
if solver==3
    t_upd=t;
    e=8e08;
while(e>tol)
     for i=2:length(x)-1
        for j=2:length(y)-1
            c=(t_upd(i,j-1)+t_upd(i,j+1))*k1;
            d=(t_upd(i-1,j)+t_upd(i+1,j))*k2;
            t(i,j)=(t_prev(i,j)+c+d)/(1+2*(k1+k2))
            t(i,j)=told(i,j)+(alpha*(t(i,j)-told(i,j)))
            t_upd=t;
        end
     end
     error=max(abs(told-t))
     e=max(abs(error))
     told=t
    sor_iteration=sor_iteration+1;
end

end
t_transient=told;
No_iter=sor_iteration;
end

The fastest Unsteady state analysis is achieved using SOR(Successive over relaxation) method with Implicit approach at α">αα(Relaxation factor)=1.7.

The above figure depicts the contour plot for temperature at transient state (Implicit approach) using SOR method.

The transient implicit approach converges faster compared to steady state as steady state is time independent which doesn't allow it to directly solve for a given time.

Steady state vs unsteady analysis

Steady State Analysis

In steady state Analysis the solution is independent of time, hence it solves for the values at steady state.

The fastest steady state analysis is achieved using SOR(Successive over relaxation) method at α">αα(Relaxation factor) =1.7.

% Solving the steady 2D Heat conduction problem
clear all
close all
clc
% creating the 2d grid
a=linspace(0,1,20);
b=linspace(0,1,20);
[x y]=meshgrid(a,b);
delx=x(1,2)-x(1,1)
dely=y(2,1)-y(1,1)
% Initial_condition
for i=1:length(x)
    for j=1:length(y)
        t(i,j)=300;
    end
end
% Assigning boundary conditions (top,left,bottom,right)
for k=1:4
    if k==1
        c=1,d=1:length(x),p=600;
    elseif k==2
        c=2:length(y)-1,d=1,p=400;
    elseif k==3
        c=length(y),d=1:length(x),p=900;
    else
        c=2:length(y)-1,d=length(y),p=800;
    end
for i=c
    for j=d
        t(i,j)=p
    end
end
end
tic;
[t_steady,No_iterations,error]=steady_state_f(t,x,y,delx,dely)
Simulation_time=toc
[m n]=contourf(x,y,t_steady)
clabel(m,n)
colormap(jet)
colorbar
xlabel('x-axis')
ylabel('y-axis')
zlabel('Temperature')
function [t_steady,No_iter,e] =steady_state_f(t,x,y,delx,dely)
told=t % For comparison after every iteration
a=delx;
b=dely;
tol=1e-04;
e=8e08;
k=(2*(a^2+b^2))/(a^2*b^2);
% SOR Iteration
sor_iteration=0;
t_upd=t;
alpha=1.7
while(e>tol)
     for i=2:length(x)-1
        for j=2:length(y)-1
            c=(t_upd(i,j-1)+t_upd(i,j+1))/(a^2);
            d=(t_upd(i-1,j)+t_upd(i+1,j))/(b^2);
            t(i,j)=(1/k)*(c+d)
            t(i,j)=told(i,j)+(alpha*(t(i,j)-told(i,j)))
            t_upd=t;
        end
     end
     error=max(abs(told-t))
     e=max(abs(error))
     told=t
    sor_iteration=sor_iteration+1;

end
t_steady=told;
No_iter=sor_iteration;
end

The above figure depicts the contour plot for temperature at steady state.

Unsteady state Analysis

In Unsteady state Analysis the solution to the flow field is time dependent, hence the difference equation has to be solved for the entire flow field for each and every time step.

Explicit vs Implicit approach

In explicit approach we solve for the (n+1) time step values using n(th) time step values, hence we do time marching with known values. This makes explicit approach useful in getting the solution at any time step t and as it solves with known values there is no need of using iterative techniques.

In Implicit approach we solve for the (n+1) time step values using (n+1) and n(th) time step values, which makes them solve using Iterative techniques. The convergence loop is ran for each and every time step.

function [t_transient,No_iter]=transient_implicit(t,x,y,delx,dely,solver)
told=t
a=delx;
b=dely;
tol=1e-04;
dt=8.78;
alp_const=1 % Thermal Diffusivity
k1=(alp_const*dt)/a^2
k2=(alp_const*dt)/b^2
jacobi_iteration=0;
t_prev=told
% SOR Iteration
sor_iteration=0;
alpha=1.7
if solver==3
    t_upd=t;
    e=8e08;
while(e>tol)
     for i=2:length(x)-1
        for j=2:length(y)-1
            c=(t_upd(i,j-1)+t_upd(i,j+1))*k1;
            d=(t_upd(i-1,j)+t_upd(i+1,j))*k2;
            t(i,j)=(t_prev(i,j)+c+d)/(1+2*(k1+k2))
            t(i,j)=told(i,j)+(alpha*(t(i,j)-told(i,j)))
            t_upd=t;
        end
     end
     error=max(abs(told-t))
     e=max(abs(error))
     told=t
    sor_iteration=sor_iteration+1;
end

end
t_transient=told;
No_iter=sor_iteration;
end

The fastest Unsteady state analysis is achieved using SOR(Successive over relaxation) method with Implicit approach at α">αα(Relaxation factor)=1.7.

The above figure depicts the contour plot for temperature at transient state (Implicit approach) using SOR method.

The transient implicit approach converges faster compared to steady state as steady state is time independent which doesn't allow it to directly solve for a given time.

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.