a1 essential of numerical methods

10
Page 1 of 10 Department of Mechanical Engineering Indian Institute of Technology Bombay ME415: Computational Fluid Dynamics & Heat Transfer Assignment # 1: Essentials of Numerical Methods for CFD Instructor: Prof. Atul Sharma, Date Posted: 15/01/2014 Due Date: 26/01/14 ONLINE SUBMISSION THROUGH MOODLE ONLY (No late submission allowed): Create a single zipped file consisting on (a) filled-in answer sheet of this doc file converted into a pdf file and (b) all the computer programs. The name of the zipped file should be rollnumber_A1 Note: Refer http://www.spokentutorial.org/list_videos? view=1&foss=Scilab&language=English , for getting started to SCILAB which should be used for programming as well as generating graphical results. To save figure: Go to “Graphic window number”, click on “File”, then click on “Export to”, select “Windows BMP image” in the “Files of type”. Make sure to save the file in the same location where you have this file. More details are given in the next page; after the problems. Problem as well as answer sheet are provided below. 1. Solution of LAEs: Finite difference method based discretization of one-dimensional steady-state heat conduction problem (in a domain of length 1m with end temperatures of 0 0 C and 100 0 C) results in a tridiagonal matrix given - for uniformly spaced 6 grid points - as Calculate the temperature at interior grid points (T i , i=2-5) using (a) Tridiagonal matrix algorithm (b) Jacobi Iteration (c) Gauss-Siedel Iteration For (b) and (c), calculate the temperature for only 2 iterations using an initial guess of 65 0 C. Thereafter, develop a computer program for all the three methods to compute the temperature. Make

Upload: hrishikesh-kulkarni

Post on 20-Apr-2017

214 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: A1 Essential of Numerical Methods

Page 1 of 7

Department of Mechanical EngineeringIndian Institute of Technology Bombay

ME415: Computational Fluid Dynamics & Heat TransferAssignment # 1: Essentials of Numerical Methods for CFD

Instructor: Prof. Atul Sharma,

Date Posted: 15/01/2014 Due Date: 26/01/14 ONLINE SUBMISSION THROUGH MOODLE ONLY (No late submission allowed): Create a single zipped file consisting on (a) filled-in answer sheet of this doc file converted into a pdf file and (b) all the computer programs. The name of the zipped file should be rollnumber_A1

Note: Refer http://www.spokentutorial.org/list_videos?view=1&foss=Scilab&language=English, for getting started to SCILAB which should be used for programming as well as generating graphical results. To save figure: Go to “Graphic window number”, click on “File”, then click on “Export to”, select “Windows BMP image” in the “Files of type”. Make sure to save the file in the same location where you have this file. More details are given in the next page; after the problems. Problem as well as answer sheet are provided below.

1. Solution of LAEs: Finite difference method based discretization of one-dimensional steady-state

heat conduction problem (in a domain of length 1m with end temperatures of 00C and 1000C)

results in a tridiagonal matrix given - for uniformly spaced 6 grid points - as

Calculate the temperature at interior grid points (Ti, i=2-5) using

(a) Tridiagonal matrix algorithm

(b) Jacobi Iteration

(c) Gauss-Siedel Iteration

For (b) and (c), calculate the temperature for only 2 iterations using an initial guess of 650C.

Thereafter, develop a computer program for all the three methods to compute the temperature.

Make sure that the calculated results matches with the computed results (for (b) and (c), run the

code for 2 iterations only). Finally, run for a convergence criteria of 10-3 and compare the number

of iterations required in (b) and (c) for convergence using an initial guess of (i) 300, (ii) 1000C and

(iii) 650C.

2. Solution of PDEs: 1D Steady State Heat Conduction

Develop a computer program for a finite difference method based solution of 1D steady state heat con-

duction equation, using Gauss-Seidel method. Consider 1D conduction in a thin (thickness of 1 m in x-

direction) and long steel plate (density: 7750 kg/m3, specific-heat: 500 J/Kg K, thermal-conductivity:

16.2 W/m-K). The plate is taken from a furnace at a temperature of 1500C (initial-condition) and is

Page 2: A1 Essential of Numerical Methods

Page 2 of 7

subjected to various thermal boundary conditions and volumetric heat generation; shown in a table be-

low.

Run the code for four different boundary-conditions (Cases), given as:

Cases Boundary Conditions Volumetric Heat

Generation (W/m3)Left Right

A 00C 1000C 0

B 1000C h=100W/m2.K, T∞=300C 0

C 00C 1000C 30,000

D 1000C h=100W/m2.K, T∞=300C 30,000

Take the maximum number of grid points in x-and y-direction as imax=11 and convergence criteria as

0.000001.

Report the results as

a) Plot the steady state temperature profiles for the different cases (4 figures).

b) Discuss the effect of volumetric heat generation on the results for both the types of BCs.

3. Solution of PDEs: 1D Unsteady State Heat Conduction

Solve the previous problem after developing a computer program for a finite difference method based

solution of 1D unsteady state heat conduction equation, using explicit method. Use stability criterion to

calculate the time-step. For all the four cases, if the time required to reach steady state is ts, draw an

overlap plot of the temperature profile at time instant t= ts /4, ts/2, 3ts /4 and ts.

4. Numerical Differentiation: Consider a 2D heat conduction in a square plate of dimension 1m,

subjected to boundary conditions shown in of the lecture slide for this topic. Grid is generated by

the intersection of 11 equi-spaced horizontal and vertical lines resulting in a grid size of 11×11. The

temperature distribution near the bottom plate is shown in a lecture slide. Store the tabular data in a

data file and develop a computer program to compute local heat flux (qy(x)) in the bottom wall by I,

II and III order one-sided differentiation formula. Present your result in a tabular form. Finally,

draw an overlap plot for the variation of the local heat flux with increasing x corresponding to

various order of differentiation.

5. Numerical Integration: For the problem discussed above, store the results in a data file and

develop a program to obtain the total rate of heat transfer from the bottom wall ( )

using (a) trapezoidal rule (b) Simpson's 1/3rd rule. Present your result in the tabular form.

Page 3: A1 Essential of Numerical Methods

Page 3 of 7

NOTE: CODE EXECUTION IN SCILABTo open a Scilab console :

Linux: Applications→Programming→Scilab or Applications→Science→ScilabWindows: Start→All programs→Scilab→Scilab.exe

To load a source code (or a Scinote file):In the Scilab console, go to top menu bar

File→Open a file…→(Browse for the *.sci file path)The source code opens in a new Scinote window.

NOTE: Once this window is open, subsequent loading of a new *.sci file will open a new tab in the same Scinote window.

To execute a program written in Scinote : In the Scinote window (with the desired program tab open), go to top menu bar

Execute→…file with no echo (please do not select …file with echo)The execution begins in the Scilab console window.

NOTE: Only one Scilab code can be executed at a time. Once an execute command is given and the code is to be stopped at an intermediate stage, use the method given below. If another execute command is given without completing/aborting the previous run, erroneous results may be produced.To abort a running program : Go to the Scilab console window and press CTRL+C. This interrupts the code execution. A prompt appears asking for user input. Enter “abort” here to stop the code execution.

BEST OF LUCKKeep Playing with the OPEN-SOURCE Codes (developed by Mr. Vishesh Aggarwal,

under the Supervision of Dr. Atul Sharma, IIT Bombay) in Future also.

MULTIPLE SCINOTE TABS

Page 4: A1 Essential of Numerical Methods

Page 4 of 7

Answer Sheet

Problem # 1: Solution of LAEs

Table 1.1.: Comparison of calculated and computed temperature distribution with TDMA algorithm and first two iterative results of Jacobi as well as Gauss-Seidel iteration

Temp

Calculated Computed

TDMAJacobi GS**

TDMAJacobi GS**

1st

itr*2nd

itr* 1st itr* 2nd itr* 1st

itr*2nd

itr* 1st itr* 2nd itr*

T2 44 47.5 47.5 47.5 43.125 44 47.5 47.5 47.5 43.125

T3 58 65 56.25 56.25 51.875 58 65 56.25 56.25 51.875T4 72 65 73.75 60.625 66.0937 72 65 73.75 60.625 66.0937T5 86 82.5 82.5 80.312 83.0468 86 82.5 82.5 80.312 83.0468

Table 1.2.: Number of iterations required for convergence of Jacobi and Gauss-Seidel iteration for three different initial conditions.

S. No.Initial Condition

No. of Iterations

Jacobi GS**

1. 30oC 47 25

2. 60oC 44 23

3. 100oC 47 24

Page 5: A1 Essential of Numerical Methods

Page 5 of 7

Problem # 2: Solution of PDEs: 1D Steady State Heat Conductiona) Plot the steady-state temperature profile (T(x)) for the different cases (4 figures).

b) Discuss the effect of volumetric heat generation on the results for both the types of BCs.

Answer-1.Volumetric Heat generation is responsible for parabolic profile of temperature in each case.2.Volumetric Heat generation increases the heat flux coming out from right face and after applying convective boundary condition,the temperature at the right face is obtained.this temperature is much greater then that of temperature without heat generation.

(a) (b)

(c) (d)

Fig. 1.1: Steady state temperature profile T(x) in the 1D domain for (a) Case A, (b) Case B, (c) Case C and (d) Case D

Page 6: A1 Essential of Numerical Methods

Page 6 of 7

Problem # 3: Solution of PDEs: 1D Unsteady State Heat Conductiona) Plot the transient as well as steady-state temperature profile (T(x)) for the different cases (4 figures).

Problem # 4: Numerical Differentiation

(a) (b)

(c) (d)

Fig. 1.2: Overlapped temperature profile T(x) in the 1D domain for (a) Case A, (b) Case B, (c) Case C and (d) Case D, at four different time instants t= ts /4, ts/2, 3ts /4 and ts (steady state time instant).

Table 1.3.: Local heat flux (qy(x)) at the bottom wall computed by I, II and III order one-sided differentiation formula.

x = 0.1 m 0.2 m 0.3 m 0.4 m 0.5 m 0.6 m 0.7 m 0.8 m 0.9 m

qy(x): I Order 460 220 80 0 -70 -130 -200 -300 -500

qy(x): II Order

615 280 100 15 -65 -135 -220 -350 -650

qy(x): III Order

681.7 296.7 96.7 18.3 -65 -138.3 -226.7 -363.3 -716.7

Page 7: A1 Essential of Numerical Methods

Page 7 of 7

Problem # 5: Numerical Integration

Fig. 1.3: Overlapped plot for the variation of the local heat flux, with increasing x; corresponding to various order of differentiation.

Table 1.4.: Total rate of heat transfer from the bottom wall using (a) trapezoidal rule (b) Simpson's 1/3rd rule.

Integration Rule ---> Trapezoidal Simpson's 1/3

Q ( using qy(x): I Order ) -42 -42

Q ( using qy(x): II Order) -39.25 - 38.833333

Q ( using qy(x): III Order) - 39.916667 - 39.055556