report lab 2

7
3/25/2015 COMPARISION OF ANSYS SIMULATION RESULT AND ANALYTICAL SOLUTION OF A GIVEN 2D STEADY CONDUCTION PROBLEM Guided By: Dr. D. Jayakrishna Submitted By: Abhishek Yamini (143701)

Upload: abhishek-yamini

Post on 14-Nov-2015

224 views

Category:

Documents


4 download

DESCRIPTION

good

TRANSCRIPT

  • 3/25/2015

    COMPARISION OF ANSYS SIMULATION

    RESULT AND ANALYTICAL SOLUTION OF

    A GIVEN 2D STEADY CONDUCTION

    PROBLEM

    Guided By: Dr. D. Jayakrishna

    Submitted By: Abhishek Yamini (143701)

  • 2.1 Introduction

    It is very important to compare results obtained by use of softwares with standard results. In last

    report we had taken problem and solved it by using analytical solution and by using finite

    difference method (i.e computationally). In this report same problem is taken and modelled in

    Ansys. All the boundary conditions are kept same. The results obtained by this analysis are

    compared with previous analytically and computationally obtained results.

    2.2 Problem Definition

    The same problem of two dimensional steady heat conduction is need to be modelled in Ansys.

    The aim of this analysis is to compare the results obtained so all the parameters to be taken same.

    2.3 Solution Methodology

    A rectangular sheet is designed in Ansys and than it was meshed having 20*20 grid size. Tags

    were assigned to the boundaries so that identification and assigning value became easier. This

    geometry and mesh were imported to Ansys Fluent environment. Since this problem consists of

    solid conduction all the flow related equations were turned off. Only energy equation module was

    turned on and following boundry conditions were given

    [Figure 1]

    Steady state two dimensional heat conduction does not depends on matrial selection so it is

    unimportant to set material for this analysis.

    Mesh genration on the above domain needed to be verified on five aspects, these are as follows:

    1. Aspect Ratio : Aspect ratio is used to maximum ratio of height and width of a cell for a

    given mesh. A mesh consisting most of the cell of aspect ratio near 1 is considered good.

    2. Skewness : Skewness refers to angle between to adjecent sides of a cell of given mesh. A

    mesh is considered good if it have minimum skewness or orthogonal cell bounderies.

    3. Jacobian Ratio, cell volume check also need to be done.

    Finally the analysis was done after checking all these parameters. In order to terminate the

    iteration tolerance was set to 10^-6.

    T2 1000 (degree C)

    T1 200 (degree C)

  • 2.4 Results

    The comparision of temperatures obtain from different methodologies is in figure

    [Figure 2]

    [ Figure 3]

  • [Figure 4]

    [Figure 5]

  • [Figure 6]

    2.5 Discussions

    As shown in the figure all the three methodologies are giving nearly same resullts. If number of

    nodes were taken less than 20*20 than there was significant deviation of results obtained by

    these methdologies whereas increasing number of nodes more than 20*20 resulted very less

    significant deviation in these graphs.

    Matlab code is mensioned in Appendix. It was used to generate analytical and numerical data

    whereas Ansys data was generated by avilable option Write to file in Ansys Fluent

    environment.

    2.6 References

    A. Fundamentals of Heat and Mass Transfer by THEODORE L. BERGMAN

    B. Anderson J D Computational-Fluid-Dynamics-the-Basics-With-Applications

  • Appendix

    clc clear

    %%% INPUTS OF THE PROBLEM

    L=5; W=5; n_of_interval_x=20;% intervals n_of_interval_y=20; nx=n_of_interval_x +1;% Nodes in x ny=n_of_interval_y +1;% Nodes in y T1=200; T2=1000; INFINITE_approximation=220; format short

    % Boundary Conditions T=zeros(ny,nx); T(1:end,1)=T1; T(1:end,end)=T1; T(1,2:end-1)=T2; T(end,2:end-1)=T1; T_true=T;

    % PRE PROCESSING dx=L/n_of_interval_x; dy=W/n_of_interval_y; N=(nx-2)*(ny-2);% Total unknowns K=zeros(N,N); B=zeros(N,1); m=1;

    for r=2:ny-1 for c=2:nx-1 if c==nx-1 && r~=2 && r~=ny-1

    % Right Intermediate BC K(m,m)=4; K(m,m-1)=-1; K(m,m+(nx-2))=-1; K(m,m-(nx-2))=-1; B(m)=T(r,end); m=m+1; elseif c==2 && r~=2 && r~=ny-1

    % Left Intermediate BC K(m,m)=4; K(m,m-1)=-1; K(m,m+(nx-2))=-1; K(m,m-(nx-2))=-1; B(m)=T(r,1); m=m+1;

    elseif r==2 && c~=2 && c~=nx-1

    % Top Intermediate BC K(m,m)=4; K(m,m+1)=-1; K(m,m-1)=-1; K(m,m+(nx-2))=-1; B(m)=T(1,c); m=m+1;

    elseif r==ny-1 && c~=2 && c~=nx-1

    % Bottom Intermediate BC K(m,m)=4; K(m,m+1)=-1; K(m,m-1)=-1; K(m,m-(nx-2))=-1; B(m)=T(end,c); m=m+1;

    elseif r==2 && c==2

    % Top Left corner K(m,m)=4; K(m,m+1)=-1; K(m,m+(nx-2))=-1; B(m)=T(1,2)+ T(2,1); m=m+1;

    elseif r==ny-1 && c==2

    % Bottom Left Corner K(m,m)=4; K(m,m+1)=-1; K(m,m-(nx-2))=-1; B(m)=T(ny,2)+ T(ny-

    1,1); m=m+1;

    elseif r==2 && c==nx-1

    % Top Right corner K(m,m)=4; K(m,m-1)=-1; K(m,m+(nx-2))=-1; B(m)=T(2,nx)+ T(1,nx-

    1); m=m+1;

    elseif r==ny-1 && c==nx-1

    % Bottom right corner K(m,m)=4; K(m,m-1)=-1; K(m,m-(nx-2))=-1; B(m)=T(ny-1,nx)+

    T(ny,nx-1); m=m+1;

  • else

    %Central nodes K(m,m)=4;

    %centre K(m,m+1)=-1;

    %right K(m,m-1)=-1;

    %left K(m,m+(nx-2))=-1;

    %bottom K(m,m-(nx-2))=-1;

    %top B(m)=0;

    %source m=m+1; end end end

    % SOLVER % [LL,UU] = ILU_2(K); temp=LL\K; M=temp/UU; NN=LL\B; [T_temp] = conjgrad(M,NN); T_final=UU\T_temp;

    % POST PROCESSING % m=1; for r=2:ny-1 for c=2:nx-1 T(r,c)=T_final(m); m=m+1; end end theta=(T-T1)/(T2-T1);

    % CODE FOR Analytical Solution % theta_true=zeros(nx*ny,1); s=1; for y=W:-dy:0 for x=L:-dx:0 sum=0; for

    n=1:INFINITE_approximation

    % defined earlier hop=(((-

    1)^(n+1)+1)/n)*(sin(n*pi*x/L))*((si

    nh(n*pi*y/L))/(sinh(n*pi*W/L))); sum=sum+hop; end theta_true(s)=(2/pi)*sum; s=s+1; end end

    % CODE FOR GENRATION OF GRAPHS % theta_analytical=zeros(ny,nx); m=1; for r=1:ny for c=1:nx

    theta_analytical(r,c)=theta_true(m)

    ; m=m+1; end end

    %CODE FOR Generating Output Sheet output=zeros(nx*ny,4); %%%

    Variable Which is used to store

    output m=1; for r=1:ny for c=1:nx output(m,1)=0+(c-1)*dx;

    % X values Storage output(m,2)=0+(r-1)*dy;

    % Y values Storage output(m,3)=(T1+(T2-

    T1)*theta_analytical(ny-r+1,nx-

    c+1)); % Analytical

    temperature values Storage output(m,4)=(T1+(T2-

    T1)*theta(ny-r+1,nx-c+1)); m=m+1; end end xlswrite('OUTPUT_of_conduction_prob

    lem.xlsx',output)

    % CODE FOR GENRATION OF GRAPHS xlswrite('OUTPUT_of_conduction_prob

    lem.xlsx',output) error=max(max(abs(theta-

    theta_analytical))); [X,Y] = meshgrid(L:-dx:0,W:-dy:0); surf(X,Y,theta_analytical) figure,

    contour(X,Y,theta_analytical) figure, surf(X,Y,theta)

    Ta=T(:,10); figure,plot(W:-

    dy:0,Ta,'r','Linewidth',2.5) hold on Tb=T1+(T2-

    T1)*theta_analytical(:,10); plot(W:-dy:0,Tb,'--

    b','Linewidth',2.5)