THREE-DIMENSIONAL RADIATIVE HEAT TRANSFER COMPUTATION BY MONTE CARLO METHOD USING OBJECT ORIENTED PROGRAMMING
FINAL PROJECT This Scientific Script is one requirement to obtain Bachelor Degree in Mechanical Engineering from Bandung Institute of Technology
Prepared by
Franky Simamora 13103111
MECHANICAL ENGINEERING DEPARTMENT
FACULTY OF MECHANICAL AND AEROSPACE ENGINEERING
BANDUNG INSTITUTE OF TECHNOLOGY 2008
Final Project Title
Major
Three-Dimensional Radiative Heat Transfer Franky Simamora Computation by Monte Carlo Method Using Object Oriented Programming Mechanical Engineering 13103111 Faculty of Mechanical and Aerospace Engineering Bandung Institute of Technology Abstract
The exchange factors in radiative heat transfer exchange among surfaces depend on the interaction among the geometry, orientation and the material properties in a complex fashion and unique to a particular geometry and/or material property combination. It is difficult or not possible to extend a set of exchange factors calculated for a particular geometry and material property combination to another geometry or material property combination, even if only the geometry or only the material properties varies. In this final project, an object-oriented computer codes are written to compute exchange factor in three-dimensional geometry with material property combinations. The present computer codes are formulated implementing the Monte Carlo method where a large number of photons are emitted from each surface and traced until each is absorbed by another surface. The fraction between the numbers of photons emitted from one surface and the number of photon absorbed by the other surfaces is defined as the exchange factor. The computer codes are verified by calculating exchange factors in several combinations of geometries and material properties. The exchange factors for various numbers of photons are plotted to determine the convergence curve and compared to the exchange factor from manual calculation. The comparison between the computer code calculation and manual calculation shows that the result is statistically equal. Therefore, the computer codes for three-dimensional radiative heat transfer computation by Monte Carlo method using Objet-Oriented Programming has been successfully developed.
Tugas Sarjana Judul
Program Studi
Pemrograman Berorientasi-Obyek untuk Perhitungan Perpindahan Panas Radiasi Tiga-Dimensi dengan Metode Monte Carlo Teknik Mesin
Franky Simamora
13103111
Fakultas Teknik Mesin dan Dirgantara Institut Teknologi Bandung Abstrak Faktor bentuk pada pertukaran radiasi antar permukaan dipengaruhi oleh geometri, arah dan sifat masing-masing permukaan. Nilai dari faktor bentuk adalah unik dan hanya berlaku untuk suatu keadaan saja sehingga menentukan faktor bentuk untuk keadaan tertentu dengan menyesuaikan dengan faktor bentuk dari keadaan lain sulit atau bahkan tidak mungkin dilakukan. Oleh karena itu untuk melakukan perhitungan nilai dari faktor bentuk pada keadaan atau kombinasi sifat dan geometri yang lebih beragam, diperlukan bantuan komputer. Pada tugas akhir ini dibuat suatu perangkat lunak berorientasi objek untuk menghitung faktor bentuk dalam tiga-dimensi dengan metode Monte Carlo. Dengan metode Monte Carlo radiasi panas dimodelkan sebagai photon yang diemisikan oleh suatu permukaan untuk kemudian dapat dipantulkan, diteruskan atau diserap oleh permukaan lain. Perbandingan dari jumlah photon yang diemisikan oleh suatu permukaan dengan jumlah photon yang diserap oleh permukaan lain inilah yang digunakan untuk mendapatkan nilai faktor bentuk. Perangkat lunak yang dibuat selanjutnya diuji untuk menghitung faktor bentuk dari suatu geometri sederhana tertentu. Nilai faktor bentuk dari setiap pengujian diplot dengan jumlah photon yang berbeda-beda sehingga diperoleh suatu kurva konvegensi. Nilai faktor bentuk tersebut kemudian dibandingkan dengan nilai yang berasal dari perhitungan menggunakan rumus perhitungan faktor bentuk untuk geometri sederhana yang sesuai. Dari hasil perbandingan ini diperoleh bahwa hasil yang diperoleh dari perhitungan menggunakan perangkat lunak dan hasil dari perhitungan secara manual secara statistik dapat dikatakan sama. Oleh karena itu, perangkat lunak untuk menghitung faktor bentuk telah berhasil dibuat dan dapat digunakan untuk menghitung faktor bentuk dari suatu perpindahan panas dalam tiga-dimensi.
PREFACE
In the name of God the merciful, the writer wishes to praise God for this guidance toward the writer that enables him to finish this script. This final project is one requirement for graduating from mechanical Engineering Study Program Bandung Institute of technology. The writer wishes to acknowledge his indebtedness to: 1. Dr. Ir. Yatna Yuwana Martawirya, as the advisor of this final project. 2. Ir. Hendi Riyanto, MSc., as the co-advisor of this final project. 3. Writer’s Father and Mother, Dj. Simamora, DFM, MPd. and B. Siregar. This final project would be inadequate to describe their qualities effort and love to the writer over the past 23 years. Thanks you both very much. 4. Writer’s Brothers, Purwanto Simamora and Hadioro Simamora. 5. Writer’s friends in Mechanical Engineering ITB especially Mesin 2003 Suggestion and criticism concerning some effort which may remain in spite of all precautions shall be greatly appreciates. They will contribute to further improvement of this research.
Writer
i
Acknowledgement
Final Project
Three-Dimensional Radiative Heat Transfer Computation by Monte Carlo Method using Object Oriented Programming
Prepared by
Franky Simamora 13103111 Mechanical Engineering Departement Bandung Institute of Technology
Acknowledged on February 12, 2008
Advisor,
Co-advisor,
Dr. Ir. Yatna Yuwana Martawirya NIP 130935700
Ir. Hendi Riyanto, MSc NIP 131572240
CONTENTS
PREFACE................................................................................................................i CONTENTS............................................................................................................ii SYMBOLS ............................................................................................................iv LIST OF FIGURES..............................................................................................vi LIST OF TABLES..............................................................................................viii
Chapter I Introduction..........................................................................................1 1.1 Background.......................................................................................1 1.2 Scope................................................................................................2 1.3 Objectives........................................................................................2 1.4 Methodology....................................................................................3 1.5 Layout..............................................................................................3
Chapter II Basic Theory........................................................................................4 2.1 Fundamental Concepts of Thermal Radiation.................................4 2.2 Radiation Intensity..........................................................................5 2.3 Blackbody Radiation ......................................................................6 2.4 Surface Emission.............................................................................7 2.5 Surface Absorption, Reflection and Transmission..........................8 2.5.1 Absorptivity...........................................................................9 2.5.2 Reflectivity………………..…………….………..……......9 2.5.3 Transmissivity......................................................................9 2.5.4 Special Considerations for Semitransparent Medium........10 2.5.5 Kirchhoff’s Law for Radiative...........................................11 2.5.6 Gray Surface.......................................................................12 2.6 The Exchange Factor....................................................................13 2.7 Monte Carlo Method for Thermal Radiation................................15 2.7.1 Introduction to Monte Carlo Method.................................15
ii
2.7.2 Monte Carlo Method in Radiative Exchange Calculation.15 2.8 Object-Oriented Programming....................................................18 2.9 The C++ Programming Language...............................................18 2.9.1 The History of C++............................................................20 2.9.2 The advantages of C++......................................................21
Chapter III Formulation.....................................................................................22 3.1 Nodes..........................................................................................22 3.2 Radiating Surfaces......................................................................22 3.3 Material Properties.....................................................................23 3.3.1 Material Type....................................................................23 3.3.2 Photon-Material Interaction..............................................25 3.3.3 Diffuse Characteristic Dependence...................................29 3.4 Tracing Photon...........................................................................29 3.5 Surface Division.........................................................................31 3.6 Computer Code Modeling..........................................................32 3.7 Computer Codes Flowchart ........................................................33
Chapter IV Analysis and Verification................................................................34 4.1 Number of Photon and Running Times.......................................33 4.2 Exchange Factor Calculation.......................................................35 4.2.1 Two-Dimensional Geometries...........................................37 4.2.2 Three-Dimensional Geometries.........................................43 4.2.3 Radiation Exchange with Specular Surface......................50
Chapter V Conclusion and Suggestion...............................................................52 5.1 Conclusion....................................................................................52 5.2 Suggestion....................................................................................52
BIBLIOGRAPHY................................................................................................53 APPENDIX
iii
LIST OF FIGURES Figure 2.1 Spectrum of electromagnetic radiation [1].............................................4 Figure 2.2 Radiation emitted in spectral and directional distribution [1]................5 Figure 2.3 Emission radiations [1............................................................................5 Figure 2.4 Comparison of blackbody and real surface emission in spectral and directional distribution [1] ………………………………..……….7 Figure 2.5 Absorption, reflection, and transmission process associated with a semitransparent medium[1] …………………….............………8 Figure 2.6 Diffuse and specular radiation [1]………………………………........10 Figure 2.7 Radiative exchanges in an isothermal enclosure [1].............................12 Figure 2.8 Conditions for which gray surface behavior be assumed [1]...............13 Figure 2.9 Exchange factor associated with radiation exchange between surfaces of area dAi and dAj [1] ……………...……………………….13 Figure 2.10 Flux emitted from surface dAi and intercepted by surface dAj [3].....16 Figure 2.11 Probability of angular emission with angle φ [6]................................17 Figure 2.12 Class and object in OOP [7]...............................................................19 Figure 3.1 The node position in global coordinate................................................22 Figure 3.2 Generating radiating surface (a) triangle (b) quadrilateral...................23 Figure 3.3 Emission direction in global coordinate...............................................24 Figure 3.4 Photon next direction for specular transmission …….……………….25 Figure 3.5 Photon next direction for Specular Reflection......................................26 Figure 3.6 Material Properties as the Function of Incident Angle (θi)...................27 Figure 3.7 Material properties in band k ...............................................................28 Figure 3.8 Tracing photon in vector notation.........................................................30 Figure 3.9 Surface division ...................................................................................31 Figure 3.11 The Object-Oriented modeling...........................................................33 Figure 3.12 The flowchart of whole process..........................................................33 Figure 4.1 Running times evaluation geometry.....................................................34 Figure 4.2 Running times curve.............................................................................35 Figure 4.3 Quadrilateral considered as two triangular...........................................36 Figure 4.4 Two-dimensional parallel plates geometry...........................................37
vi
Figure 4.5 Two-dimensional parallel plates exchange factor convergence curve . …………………………………....…………….38 Figure 4.6 Two infinitely long parallel plates with the same finite width.............39 Figure 4.7 Infinitely long parallel plates with the same finite width exchange factor convergence curve…………………………………..40 Figure 4.8 Two infinitely long plates having an angle 900 each other…………...42 Figure 4.9 Two infinitely long plates having an angle 900 each other exchange factor convergence curve…………..………..…42 Figure 4.10 Three-dimensional cube …….……………………………………....43 Figure 4.11 Convergence curve for 3-D cube exchange factor between surface 1 and surface 2 (F12)…..……......……....................44 Figure 4.12 Geometry of identical, parallel, directly opposed rectangles ………45 Figure 4.13 Convergence curve of 3-D cube exchange factor between surface 1 and surface 3 (F13) …….…….…………………. 46 Figure 4.14 Geometry of two finite rectangles of same length, having an angle of 900 each other ………………….……….……....47 Figure 4.15 Geometry of three-dimensional L-box...............................................48 Figure 4.16 Convergence curve of 3-D L-box exchange factor between surface 1 and surface 2 (F12) ………..…………………….49 Figure 4.17 Convergence curve of 3-D L-box exchange factor between surface 1 and surface 3 (F13) …………..…………………. 49 Figure 4.18 System with specular-diffuse reflecting ……………………………50 Figure 4.19 Convergence curve of 3-D L-box exchange factor between surface 1 and surface 3 (F13) ……………...………………51
vii
LIST OF TABLES
Table 3.1 Material Type for Emission………………………………………….. 24 Table 4.1 Material properties for Two-Dimensional Parallel Plates…………......37 Table 4.2 Material Properties for infinitely long, parallel plates with the same finite width …………………………………………......39 Table 4.3 Material property for two infinitely long plates having an angle 900 each other………………………………………...41 Table 4.4 Material property for two infinitely long plates having an angle 900 each other………………………………………...44 Table 4.5 Material property for three-dimensional L-box……………………….48 Table 4.6 Material property for system with specular-diffuse reflecting………...50
viii
SYMBOLS
Iλ
-
spectral radiation intensity W/m2.µm.sr
q
-
heat transfer rate, W
A
-
area, m2
h
-
Planck’s constant, 6.6256 x 10-34 J.s
k
-
Boltzmann’s constant, 1.3805 x 10-23 J/K
c
-
speed of light, c0= 2.998 x 108 m/s
T
-
temperature, K
Eλ
-
spectral emissive power, W/m2.μm.
Gλ
-
spectral irradiation, W/m2.μm
εi
-
total, hemispherical emissivity of surface Ai
Eb
-
total, emissive power of black body, σT 4 , W/m2
Qnet,I
-
heat loss of area dAi, W
Q
-
Energy flux leaving from dAi, W
Ni’
-
Number of energy particle absorbing by dAi
Ni
-
Number of energy particle leaving from dAi
Greek Letter α
-
absorptivity
ω
-
solid angle, sr
θ
-
zenith angle, degrees
ε
-
emissivity
λ
-
wavelength, µm
τ
-
transmissivity
ρ
-
reflectivity
iv
Subscript λ
-
spectral
e
-
emission
b
-
blackbody
ref
-
reflected radiation
abs
-
absorbed radiation
tr
-
transmitted radiation
i
-
incident radiation
v