File loading please wait...

Citation preview

INTRODUCTION TO COMPUTATIONAL FLUID DYNAMICS

Introduction to Computational Fluid Dynamics introduces all the primary components for learning and practicing computational ﬂuid dynamics (CFD). The book is written for ﬁnal year undergraduates and/or graduate students in mechanical, chemical, and aeronautical engineering who have undergone basic courses in thermodynamics, ﬂuid mechanics, and heat and mass transfer. Chapters cover discretisation of equations for transport of mass, momentum, and energy on Cartesian, structured curvilinear, and unstructured meshes; solution of discretised equations, numerical grid generation, and convergence enhancement. The book follows a consistent philosophy of control-volume formulation of the fundamental laws of ﬂuid motion and energy transfer and introduces a novel notion of “smoothing pressure correction” for solution of ﬂow equations on collocated grids within the framework of the well-known SIMPLE algorithm. There are over 50 solved problems in the text and over 130 end-of-chapter problems. Practicing industry professionals will also ﬁnd this book useful for continuing education and refresher courses. Professor Anil W. Date obtained his bachelor’s degree in mechanical engineering from Bombay University; his master’s degree in thermo-ﬂuids from UMIST Manchester, UK; and his doctorate in heat transfer from Imperial College of Science and Technology, London. He has been a member of the ThermoFluids-Engineering group of the Mechanical Engineering Department at IIT Bombay since 1973. Over the past thirty years, he has taught courses at both undergraduate and postgraduate level in thermodynamics, energy conversion, heat and mass transfer, and combustion. He has been engaged in research and consulting in thermo-ﬂuids engineering and is an active reviewer of research proposals and papers for various national and international bodies and journals. He has been Editor for India of the Journal of Enhanced Heat Transfer and has contributed research papers to several international journals in the ﬁeld. He has been a visiting scientist at Cornell University and a visiting professor at the University of Karlsruhe, Germany. He has delivered seminar lectures at universities in Australia, Hong Kong, Sweden, Germany, UK, USA, and India. Professor Date derives great satisfaction from applying thermo-ﬂuid science to rural-technology problems in India and has taught courses in science, technology, and society and in appropriate technology at IIT Bombay. Professor Date is a Fellow of the Indian National Academy of Engineering (FNAE).

Cambridge University Press has no responsibility for the persistence or accuracy of urls for external or third-party internet websites referred to in this publication, and does not guarantee that any content on such websites is, or will remain, accurate or appropriate.

During the last three decades, computational ﬂuid dynamics (CFD) has emerged as an important element in professional engineering practice, cutting across several branches of engineering disciplines. This may be viewed as a logical outcome of the recognition in the 1950s that undergraduate curricula in engineering must increasingly be based on engineering science. Thus, in mechanical engineering curricula, for example, the subjects of ﬂuid mechanics, thermodynamics, and heat transfer assumed prominence. I began my teaching career in the early 1970s, having just completed a Ph.D. degree that involved solution of partial differential equations governing ﬂuid motion and energy transfer in a particular situation (an activity not called CFD back then!). After a few years of teaching undergraduate courses on heat transfer and postgraduate courses on convective heat and mass transfer, I increasingly shared the feeling with the students that, although the excellent textbooks in these subjects emphasised application of fundamental laws of motion and energy, the problem-solving part required largely varied mathematical tricks that changed from one situation to another. I felt that teachers and students needed a chance to study relatively more real situations and an opportunity to concentrate on the physics of the subject. In my reckoning, the subject of CFD embodies precisely this scope and more. The introduction of a ﬁve-year dual degree (B.Tech. and M.Tech.) program at IIT Bombay in 1996 provided an opportunity to bring new elements into the curriculum. I took this opportunity to introduce a course on computational ﬂuid dynamics and heat transfer (CFDHT) in our department as a compulsory course in the fourth year for students of the thermal and ﬂuids engineering stream. The course, with an associated CFDHT laboratory, has emphasised relearning ﬂuid mechanics and heat and mass transfer through obtaining numerical solutions. This, of course, contrasts with the analytical solutions learnt in earlier years of the program. Through teaching of this CFDHT course, I discovered that this relearning required attitudinal change on the part of the student. Thus, for example, the idea that all 1D conduction problems (steady or unsteady, in Cartesian, cylindrical, or spherical coordinates, with constant or variable properties, with or without area change, with or without xvii

xviii

PREFACE

internal heat generation, and with linear or nonlinear boundary conditions) in a typical undergraduate textbook can be solved by a single computer program based on a single method is found by the students to be new. Similarly, the idea that a numerical instability in an unsteady conduction problem essentially represents violation of the second law of thermodynamics is found to be new because no book on numerical analysis treats it as such. Nothing encourages a teacher to write a book more than the discomfort expressed by the students. At the same time, it must be mentioned that when a student succeeds in writing a generalised computer program for 1D conduction in the laboratory part of the course through struggles of where and how do I begin, of debugging, of comparing numerical results with analytical results, of studying effects of parametric variations, and of plotting of results, the computational activity is found to be both enlightening and entertaining. I speciﬁcally mention these observations because, although there are a number of books bearing the words Computational Fluid Dynamics in their titles, most emphasise numerical analysis (a branch of applied mathematics). Also, most books, it would appear, are written for researchers and cover a rather extended ground but are usually devoid of exercises for student learning. In my reckoning, the most notable exception to such a state of affairs is the pioneering book Numerical Heat Transfer and Fluid Flow written by Professor Suhas V. Patankar. The book emphasises control-volume discretisation (the main early step to obtaining numerical solutions) based on physical principles and strives to help the reader to write his or her own computer programs. It is my pleasure and duty to acknowledge that writing of this book has been inﬂuenced by the works of two individuals: Professor D. B. Spalding (FRS, formerly at Imperial College of Science and Technology, London), who uniﬁed the ﬁelds of heat, mass, and momentum transfer, and Professor S. V. Patankar (formerly at University of Minnesota, USA), who, through his book, has made CFD so lucid and SIMPLE.1 If the readers of this book ﬁnd that I have mimicked writings of these two pioneers from which several individuals (teachers, academic researchers, and consultants) and organisations have beneﬁted, I would welcome the compliment. I have titled this book as Introduction to Computational Fluid Dynamics for two reasons. Firstly, the book is intended to serve as a textbook for a student uninitiated in CFD but who has had exposure to the three courses mentioned in the ﬁrst paragraph of this preface at undergraduate and postgraduate levels. In this respect, the book will also be found useful by teachers and practicing engineers who are increasingly attracted to take refresher courses in CFD. Secondly, CFD, since its inception, has remained an ever expanding ﬁeld, expanding in its fundamental scope as well as in ever new application areas. Thus, turbulent ﬂows, which are treated in this book through modelling, are already being investigated through direct numerical simulation (DNS). Similarly, more appropriate constitutive relations for multiphase 1

The reader will appreciate the signiﬁcance of capital letters in the text.

PREFACE

ﬂow or for a reacting ﬂow are being explored through CFD. Newer application areas such as heat and mass transfer in biocells are also beginning to be explored through CFD. Such areas are likely to remain more at the research level than to be part of regular practice and, therefore, a student, over the next few years at least, may encounter them in research at a Ph.D. level. It is my belief that the approach adopted in this book will provide adequate grounding for such pursuits. Although this is an introductory book, there are some departures and basic novelties to which it is important to draw the reader’s attention. The ﬁrst of these concerns the manner in which the fundamental equations of motion (the Navier–Stokes equations) are written. Whereas most textbooks derive or write these equations for a continuum ﬂuid, it is shown in the ﬁrst chapter of this book that since numerical solutions are obtained in discretised space, the equations must be written in such a way that they are applicable to both the continuum as well as the discretised space. Attention is also drawn to use of special symbols that the reader may ﬁnd not in common with other books on CFD. Thus, a mass-conserving pressure correction is to contrast with the two other pressure corrections, namely, the given the symbol pm . Similarly, total pressure correction p and the smoothing pressure correction psm the velocities appearing at the control-volume faces are given the symbol u f,i to contrast with those that appear at the nodal locations, which are referred to as u i . Again, in a continuum, the two velocity ﬁelds must coincide but, in a discretised space, distinction between them preserves clarity of the physics involved. Novelty will also be found in the discussion of physical principles behind seemingly mathematical activity governing the topics of numerical grid generation and convergence enhancement. It is not my claim that the entire material of the book can be covered in a single course on CFD. It is for this reason that 1D formulations are emphasised through dedicated chapters. These formulations convey most of the essential ingredients required in CFD practice. The ambience of academic freedom, the variety of facilities and the friendly atmosphere on the campus of IIT Bombay has contributed in no small measure to this solo effort at book writing. I am grateful to my colleagues for their cooperation in many matters. I am particularly grateful for having had the association of a senior colleague like Professor S. P. Sukhatme (FNA, FNAE, former Director, IIT Bombay). It has been a learning experience for me to observe him carry out a variety of roles (including as writer of two well-received textbooks on heat transfer and solar energy) in our institute with meticulous care. Hopefully, some rub-off is evident in this book. I have also gained considerably from my Ph.D. and M.Tech. students who through their dissertations have helped validate the computer programs I wrote. I would like to express my special gratitude to Mr. Peter Gordon, Senior Editor (Aeronautical, Biomedical, Chemical, and Mechanical Engineering), Cambridge University Press, New York, for his considerable advice and guidance during preparation of the manuscript for this book.

xix

xx

PREFACE

Finally, I would like to record my appreciation of my wife Suranga, son Kartikeya, and daughter Pankaja (Pinky) for bearing my absence on several weekends while writing this book. Mumbai June 2004

Anil W. Date

1 Introduction

1.1 CFD Activity Computational ﬂuid dynamics (CFD) is concerned with numerical solution of differential equations governing transport of mass, momentum, and energy in moving ﬂuids. CFD activity emerged and gained prominence with availability of computers in the early 1960s. Today, CFD ﬁnds extensive usage in basic and applied research, in design of engineering equipment, and in calculation of environmental and geophysical phenomena. Since the early 1970s, commercial software packages (or computer codes) became available, making CFD an important component of engineering practise in industrial, defence, and environmental organizations. For a long time, design (as it relates to sizing, economic operation, and safety) of engineering equipment such as heat exchangers, furnaces, cooling towers, internal combustion engines, gas turbine engines, hydraulic pumps and turbines, aircraft bodies, sea-going vessels, and rockets depended on painstakingly generated empirical information. The same was the case with numerous industrial processes such as casting, welding, alloying, mixing, drying, air-conditioning, spraying, environmental discharging of pollutants, and so on. The empirical information is typically displayed in the form of correlations or tables and nomograms among the main inﬂuencing variables. Such information is extensively availed by designers and consultants from handbooks [55]. The main difﬁculty with empirical information is that it is applicable only to the limited range of scales of ﬂuid velocity, temperature, time, or length for which it is generated. Thus, to take advantage of economies of scale, for example, when engineers were called upon to design a higher capacity power plant, boiler furnaces, condensers, and turbines of ever higher dimensions had to be designed for which new empirical information had to be generated all over again. The generation of this new information was by no means an easy task. This was because the information applicable to bigger scales had to be, after all, generated via laboratory-scale models. This required establishment of scaling laws to ensure geometric, kinematic, and dynamic similarities between models and the full-scale equipment. This activity 1

2

INTRODUCTION

required considerable experience as well as ingenuity, for it is not an easy matter to simultaneously maintain the three aforementioned similarities. The activity had to, therefore, be supported by ﬂow-visualization studies and by simple (typically, one-dimensional) analytical solutions to equations governing the phenomenon under consideration. Ultimately, experience permitted judicious compromises. Being very expensive to generate, such information is often of a proprietary kind. In more recent times, of course, scaling difﬁculties are encountered in the opposite direction. This is because electronic equipment is considerably miniaturised and, in materials processing, for example, the more relevant phenomena occur at microscales (even molecular or atomic scales where the continuum assumption breaks down). Similarly, small-scale processes occur in biocells. Clearly, designers need a design tool that is scale neutral. The tool must be scientiﬁc and must also be economical to use. An individual designer can rarely, if at all, acquire or assimilate this scale neutrality. Fortunately, the fundamental laws of mass, momentum, and energy, in fact, do embody such scale-neutral information. The key is to solve the differential equations describing these laws and then to interpret the solutions for practical design. The potential of fundamental laws (in association with some further empirical laws) for generating widely applicable and scale-neutral information has been known almost ever since they were invented nearly 200 years ago. The realisation of this potential (meaning the ability to solve the relevant differential equations), however, has been made possible only with the availability of computers. The past ﬁve decades have witnessed almost exponential growth in the speed with which arithmetic operations can be performed on a computer. By way of reminder, we note that the three laws governing transport are the following: 1. the law of conservation of mass (transport of mass), 2. Newton’s second law of motion (transport of momentum), and 3. the ﬁrst law of thermodynamics. (transport of energy). 1.2 Transport Equations The aforementioned laws are applied to an inﬁnitesimally small control volume located in a moving ﬂuid. This application results in partial differential equations (PDEs) of mass, momentum and energy transfer. The derivation of PDEs is given in Appendix A.1 Here, it will sufﬁce to mention that the law of conservation of mass is written for a single-component ﬂuid or for a mixture of several species. When applied to a single species of the mixture, the law yields the equation of mass transfer when an empirical law, namely, Fick’s law of mass diffusion (m i = − ρ D ∂ω/∂ xi ), 1

The reader is strongly advised to read Appendix A to grasp the main ideas and the process of derivations.

In these equations, the sufﬁx m refers to the ﬂuid mixture. For a singlecomponent ﬂuid, the sufﬁx may be dropped and the equation of mass transfer becomes irrelevant. Similarly, the sufﬁx eff indicates effective values of mass diffusivity D, viscosity µ, and thermal conductivity k. In laminar ﬂows, the values of these transport properties are taken from property tables for the ﬂuid under consideration. In turbulent ﬂows, however, the transport properties assume values much in excess of the values ascribed to the ﬂuid; moreover, the effective transport properties turn out to be properties of the ﬂow [39], rather than those of the ﬂuid. From the point of view of further discussion of numerical methods, it is indeed a happy coincidence that the set of equations [(1.1)–(1.5)] can be cast as a single equation for a general variable . Thus, ∂ ∂ ∂(ρm ) ∂(ρm u j ) = (1.6) +

The meanings of eff and S for each are listed in Table 1.1. Equation 1.6 is called the transport equation for property . The rate of change (or time derivative) term is to be invoked only when a transient phenomenon is under consideration. The term ρm denotes the amount of extensive property available in a unit volume. The convection (second) term accounts for transport of due to bulk motion. This ﬁrst-order derivative term is relatively uncomplicated but assumes considerable signiﬁcance when stable and convergent numerical solutions are to be economically obtained. This matter will become clear in Chapter 3. Both the transient and the convection terms require no further modelling or empirical information. The greatest impediment to obtaining physically accurate solutions is offered by the diffusion and the net source (S ) terms because both these terms require empirical information. In laminar ﬂows, the diffusion term represented by the second-order derivative offers no difﬁculty because , being a ﬂuid property, can be accurately determined (via experiments) in isolation of the ﬂow under consideration. In turbulent (or transitional) ﬂows, however, determination of eff requires considerable empirical support. This is labelled as turbulence modelling. This extremely complex phenomenon has attracted attention for over 150 years. Although turbulence models of adequate generality (at least, for speciﬁc classes of ﬂows) have been proposed, they by no means satisfy the expectations of an equipment designer. These models determine eff from simple algebraic empirical laws. Sometimes, eff is also determined from other scalar quantities (such as turbulent kinetic energy and/or its dissipation rate) for which differential equations are constituted. Fortunately, these equations often have the form of Equation 1.6. The term net source implies an algebraic sum of sources and sinks of . Thus, in a chemically reacting ﬂow (combustion, for example), a given species k may be generated via some chemical reactions and destroyed (or consumed) via some others and Rk will comprise both positive and negative contributions. Also, some chemical reactions may be exothermic, whereas others may be endothermic, making positive and negative contributions to Q . Similarly, the term Bi in the momentum equations may represent a buoyancy force, a centrifugal and/or Coriolis force, an electromagnetic force, etc. Sometimes, Bi may also represent resistance forces. Thus, in a mixture of gas and solid particles (as in pulverised fuel combustion), Bi will represent the drag offered by the particles on air, or, in a ﬂuid ﬂow through a

1.3 NUMERICAL VERSUS ANALYTICAL SOLUTIONS

densely ﬁlled medium (a porous body or a shell-and-tube geometry), the resistance will be a function of the porosity of the medium. Such empirical resistance laws are often determined from experiments. The Su i terms represent viscous terms arising from Stokes’s stress laws that are not accounted for in the ∂∂x j [µeff ∂∂ux ij ] term in Equation 1.3. 1.3 Numerical Versus Analytical Solutions Analytical solutions to our transport equations are rarely possible for the following reasons: 1. The equations are three-dimensional. 2. The equations are strongly coupled and nonlinear. 3. In practical engineering problems, the solution domains are almost always complex. The equations, however, can be made amenable to analytical solutions when simpliﬁed through assumptions. In a typical undergraduate program, students develop extensive familiarity with such analytical solutions that can be represented in closed form. Thus, in a ﬂuid mechanics course, for example, when fully developed laminar ﬂow in a pipe is considered, a student is readily able to integrate the simpliﬁed (one-dimensional) momentum equation to obtain a closed-form solution for the streamwise velocity u as a function of radius r. The assumptions made are as follows: The ﬂow is steady and laminar, it is fully developed, it is axisymmetric, and ﬂuid properties are uniform. The solution is then interpreted to yield the scaleneutral result f × Re = 16. The friction factor f is a practically useful quantity that enables calculation of pumping power required to force ﬂuid through a pipe. Similarly, in a heat transfer course, a student learns to calculate reduction of heat transfer rate when insulation of a given thickness is applied to a pipe. In this case, the energy equation is simpliﬁed and the assumptions are as follows: Heat transfer is radial and axi symmetric, steady state prevails, and the insulation conductivity may be constant and there is no generation or dissipation of energy within the insulation. In both these examples, the equations are one dimensional. They are, therefore, ordinary differential equations (ODEs), although the original transport equations were PDEs. In many situations, in spite of the assumptions, the governing equations cannot be rendered one dimensional. Thus, the equations of a steady, two-dimensional velocity boundary layer or that of one-dimensional unsteady heat conduction are partial differential equations. It is important to recognise, however, that there are no direct solutions to partial differential equations. To obtain solutions, the PDEs are always ﬁrst converted to ODEs (usually more in number than the original PDEs) and the latter are solved by integration. Thus, in an unsteady conduction problem, the ODEs are formed by the method of separation of variables, whereas, for the two-dimensional velocity boundary layer, the ODE is

5

6

INTRODUCTION

formed by invoking a similarity variable. In such circumstances, often the solution is in the form of a series. We assume, of course, that the reader is familiar with the restrictive circumstances (often of signiﬁcant practical consequence) under which such analytical solutions are constructed. Analytical solutions obtained in the manner described here are termed exact solutions. They are applicable to every point of the time and/or space domain. The solutions are also called continuous solutions. All the aforementioned solutions are well covered in an undergraduate curriculum and in textbooks (see, for example, [34, 80, 88]). Unlike analytical solutions, numerical solutions are obtained at a few chosen points within the domain. They are therefore called discrete solutions. Numerical solutions are obtained by employing numerical methods. The latter are really an intermediary between the physics embodied in the transport equations and the computers that can unravel them by generating numerical solutions. The process of arriving at numerical solutions is thus quite different from the process by which analytical solutions are developed. Before describing the essence of numerical methods, it is important to note that these methods, in principle, can overcome all three aforementioned impediments to obtaining analytical solutions. In fact, the history of CFD shows that numerical methods have been evolved precisely to overcome the impediments in the order of their mention. Thus, the earliest numerical methods dealt with onedimensional equations for which analytical solutions may or may not be possible. Methods for two-dimensional transport equations, however, had to incorporate substantially new features. In spite of these new features, many methods applicable to two-dimensional coupled equations could not be extended to three-dimensional equations. Similarly, the earlier methods were derived for transport equations cast in only orthogonal co-ordinates (Cartesian, cylindrical polar, or spherical). Later, however, as computations over complex domains were attempted, the equations were cast in completely arbitrary curvilinear (ξ1 , ξ2 , ξ3 ) coordinates. This led to development of an important branch of CFD, namely, numerical grid generation. With this development, domains of arbitrary shape could be mapped such that the coordinate lines followed the shape of the domain boundary. Today, complex domains are mapped by yet another development called unstructured mesh generation. In this, the domain can be mapped by a completely arbitrary distribution of points. When the points are connected by straight lines, one obtains polygons (in two dimensions) and polyhedra (in three dimensions). Several methods (as well as packages) for unstructured mesh generation are now available. 1.4 Main Task It is now appropriate to list the main steps involved in arriving at numerical solutions to the transport equation. To enhance understanding, an example of an idealised

7

1.4 MAIN TASK

WALL

AIR

EXIT

INFLOW LIP WALL

FUEL

INFLOW SYMMETRY

Figure 1.1. Typical two-dimensional domain.

combustion chamber of a gas-turbine engine will be considered. 1. Given the ﬂow situation of interest, deﬁne the physical (or space) domain of interest. In unsteady problems, the time domain is imagined. Figure 1.1 shows the domain of interest of the idealised chember. Fuel and air streams, separated by a lip wall, enter the chamber at the inﬂow boundary. The cross section of the chamber is taken to be a perfect circle so that a symmetry boundary coinciding with the axis is readily identiﬁed. The enclosing wall is solid and the burnt products of combustion leave through the exit boundary. Because the situation is idealised as a two-dimensional axisymmetric domain that will involve ﬂuid recirculation, there are four boundaries of interest: inﬂow, wall, symmetry, and exit. 2. Select transport equations with appropriate diffusion and source laws. Deﬁne boundary conditions on segments of the domain boundary for each variable . Also, deﬁne the ﬂuid properties. The boundary segments have already been identiﬁed in Figure 1.1. Now, since air and fuel mix and react chemically, equations for = u 1 , u 2 , u 3 (swirl velocity), T or h, and several mass fractions ωk must be solved. The choice of ωk will of course depend on the reaction model postulated by the analyst. Further, additional equations must be solved to capture effects of turbulence via a turbulence model. This matter will become clear in later chapters. 3. Select points (called nodes) within the domain so as to map the domain with a grid. Construct control volumes around each node. In Figure 1.2, the domain of interest is mapped by three types of grids: Cartesian, Curvilinear, and Unstructured. The hatched portions show the control volumes and the ﬁlled circles are the nodes. Note that in the Cartesian grids, the control volumes near the slanted wall are not rectangular as elsewhere. This type of difﬁculty is overcome in the curvilinear grids where all control volumes are quadrilaterals and the grid lines follow the contours of the domain boundary as required. The unstructured grid is completely arbitrary. Although most control volumes are triangular, one can also

8

INTRODUCTION

CARTESIAN

CURVILINEAR

UNSTRUCTURED

Figure 1.2. Different types of grids.

have polygons of any number of sides. This activity of specifying coordinates of nodes and of speciﬁcation of control volumes is called grid generation. 4. Integrate Equation 1.6 over a typical control volume so as to convert the partial differential equation into an algebraic one. This is unlike the analytical solutions in which the original PDEs are converted to ordinary ones. Thus, if there are N V variables of interest and the number of nodes chosen is N P, one obtains a set of N V × N P algebraic equations. The process of converting PDEs into algebraic equations is called discretisation. 5. Devise a numerical method to solve the set of algebraic equations. This can be done sequentially, so that N P equations are solved for each in succession. Alternatively, one may solve the entire set of N V × N P equations simultaneously. The construction of the overall calculation sequence is called an algorithm. 6. Devise a computer program to implement the numerical method on a computer. Different numerical methods require different amounts of computer storage and different amounts of computer time to arrive at a solution. Aspects such as economy in terms of number of arithmetic operations, convergence rate, and stability of the numerical method are thus important.

1.5 A NOTE ON NAVIER–STOKES EQUATIONS

7. “Interpret the solution:” The numerical solution results in values of each at each node. Such a ﬁeld provides the distribution of over the domain. The task now is to interpret the solution to retrieve quantities of engineering interest such as the friction factor, a Nusselt number at the wall, or average concentrations of CO, fuel, and NOx at the exit from a combustion chamber. Sometimes the ﬁeld may be curve-ﬁtted to take the appearance of an analytical solution. Similarly, the derived quantities may also be curve-ﬁtted to take the appearance of an experimentally derived correlation for ready use in further design work. 8. “Display of results:” Since a numerical solution is obtained at discrete points, the solution comprises numbers that can be printed in tabular forms. The inconvenience of reading numbers can be circumvented by plotting results on a graph or by displaying the ﬁelds by means of contour or vector plots. Fortunately, such graphic displays can now be made using computers. This activity is called postprocessing of results. The commercial success of computer codes often depends on the quality and ﬂexibility of their postprocessors. The primary focus of this book is to explain procedures for executing these steps. Computer code developers and researchers adopt a variety of practices to implement the procedures depending on their background, familiarity, and notions of convenience. Clearly biases are involved. In this book, emphasis is laid on physical principles. In fact, the attitude is one of relearning ﬂuid mechanics and heat and mass transfer by obtaining numerical (as opposed to restrictive analytical) solutions. The book is not intended to provide a survey of all numerical methods; rather, the objective is to introduce the reader to a few speciﬁc methods and procedures that have been found to be robust in a wide variety of situations of a speciﬁc class. The emphasis is on skill development, skills required for problem formulation, computer code writing, and interpretation of results.

1.5 A Note on Navier–Stokes Equations The law of conservation of mass for the bulk ﬂuid together with Newton’s second law of motion constitutes the main laws governing ﬂuid motion. As shown in Appendix A, the equations of motion are written in differential form and, therefore, assume existence of a ﬂuid continuum. In this section, attention is drawn to an often overlooked requirement that assumes considerable importance in the context of CFD in which numerical solutions are obtained at discrete points rather than at every point in space as in a continuum. Attention is focussed primarily on the normal stress expressions given in Appendix A (see Equations A.15). As presented in Schlichting [65], the normal

1 p = − (σx + σ y + σz ). (1.10) 3 Now, an often overlooked requirement of the Stokes’s relations is that, in a continuum, p must equal the point value of pressure p and the latter, in turn, must equal the thermodynamic pressure pth . Thus, 2 µ · V. (1.11) 3 In the context of this requirement, we now consider different ﬂow cases to derive the signiﬁcance of q. p = p = pth = p − q −

1. Case 1 (V = 0): In this hydrostatic case, p = p − q.

(1.12)

But in this case, p can only vary linearly with x, y, and z and, therefore, the point value of p exactly equals its space-averaged value p in both continuum as well as discretised space and hence q = 0 exactly. 2. Case 2 (µ = 0 or · V = 0): Clearly when µ = 0 (inviscid ﬂow) or . V = 0 (constant-density incompressible ﬂow) Equation 1.12 again holds. But, in this case, since ﬂuid motion is considered, p can vary arbitrarily with x, y, and z and, therefore, p may not equal p in a discrete space. To understand this matter, consider a case in which pressure varies arbitrarily in the x direction, whereas its variation in y and z directions is constant or linear (as in a hydrostatic case). Such a variation is shown in Figure 1.3. Now consider a point P. According to Stokes’s requirement pP must equal p P in a continuum. However, in a discretised space, the values of pressure are available at points E and W only, and if these points are equidistant from P then p P = 0.5 ( pW + pE ). Now, this p P will not equal pP , as seen from the ﬁgure, and therefore the requirement of the Stokes’s relations is not met. However, without violating the continuum requirement, we may set q = λ1 ( p − p),

where λ1 is an arbitrary constant. In most textbooks, where a continuum is assumed, λ1 is trivially set to zero. 3. Case 3 (µ = 0 and · V = 0): This case represents either compressible ﬂow where density is a function of both temperature and pressure or incompressible ﬂow with temperature-dependent density. Thus, 2 p = p − q + µ ·V . (1.14) 3 In this case, Stokes’s requirement will be satisﬁed if we set q = λ1 ( p − p) + λ · V,

(1.15)

where λ is the well-known second viscosity coefﬁcient whose value is set to − (2/3)µ even in a continuum. It is instructive to note the reason for setting λ = −(2/3) µ. For, if this were not done, it would amount to 2 (1.16) (1 − λ1 ) ( p − p) · V = λ + µ ( · V )2 . 3 Clearly, therefore, the system will experience dissipation (or reversible work done at ﬁnite rate since · V is associated with the rate of volume change) even in an isothermal ﬂow [65, 86]. This is, of course, highly improbable.2 Thus, the Stokes’s relations require modiﬁcations in a continuum when compressible ﬂow is considered, and a physical explanation for this modiﬁcation can be found from thermodynamics. Now, the same interpretation can be afforded to the λ1 ( p − p) part of q in Equation 1.13 or 1.15. This term represents a necessary modiﬁcation in a discretised space. This is an important departure from the forms of normal stress expressions given in standard textbooks on ﬂuid mechanics. It will be shown in Chapter 5 that recognition of the need to include this term is central to prediction of smooth pressure distributions via CFD in discrete space [17]. 2

Schlichting [65] shows this improbability by considering the case of an isolated sphere of a compressible isothermal gas subjected to uniform normal stress. Now if λ is not set to − (2 / 3) µ, the gas will undergo oscillations.

12

INTRODUCTION

Before leaving this section, it is important to note that since p must equal p in a continuum (see Equation 1.11), the former must essentially be the hydrostatic pressure, irrespective of the ﬂow considered. Mathematically, therefore, we may deﬁne p as 1 1 p = − (σx + σ y + σz ) = ( p x + p y + p z ), 3 3

(1.17)

where p x is a solution to ∂ 2 p/∂ x 2 = 0, p y is a solution to ∂ 2 p/∂ y 2 = 0, and p z is a solution to ∂ 2 p/∂z 2 = 0. In effect, therefore, the equations of motion (also called the Navier–Stokes equations) valid for both continuum and discrete space must read as ρ

∂τ yx ∂( p − q) ∂τx x ∂τzx Du =− + + + , Dt ∂x ∂x ∂y ∂z

(1.18)

ρ

∂τ yy ∂τzy Dv ∂( p − q) ∂τx y =− + + + , Dt ∂y ∂x ∂y ∂z

(1.19)

ρ

∂τ yz Dw ∂( p − q) ∂τx z ∂τzz =− + + + , Dt ∂z ∂x ∂y ∂z

(1.20)

where q is given by Equation 1.13 for incompressible (viscous or inviscid) ﬂow and by Equation 1.15 for compressible ﬂow. In spite of this recognition, the equations are further discussed (in conformity with standard textbooks) for a continuum only with λ1 = 0, but the existence of ﬁnite λ1 will be discovered in Chapter 5 where solutions in discrete space are developed.

1.6 Outline of the Book The book is divided into nine chapters. Chapter 2 deals with one-dimensional (1D) conduction in steady and unsteady forms. In this chapter, the main ingredients of a numerical procedure are elaborately introduced so that familiarity is gained through very simple algebra. Chapter 3 deals with the 1D conduction–convection equation. This somewhat artiﬁcial equation is considered to inform the reader about the nature of difﬁculty introduced by convection terms. The cures for the difﬁculty developed in this chapter are used in all subsequent chapters dealing with solution of transport equations. Chapter 4 deals with convective transport through boundary layers. This is an important class of ﬂows encountered in ﬂuid dynamics and heat and mass transfer. The early CFD activity relied heavily on solution of two-dimensional (2D) parabolic equations (a subset of the complete transport equations) appropriate to boundary layer ﬂows. In this chapter, issues of grid adaptivity and turbulence modelling are introduced for external wall boundary layers and free-shear layers and for internal (ducted) boundary layer development.

EXERCISES

Chapter 5 deals with solution of complete transport equations on Cartesian grids. Only 2D ﬂow situations that may involve regions of ﬂuid recirculation are considered. The transport equations now take the elliptic form. In essence, this chapter introduces all ingredients required to understand CFD practice. In this sense, the chapter provides a ﬁrm foundation for development of solution procedures employing curvilinear and unstructured grids. The latter developments are described in Chapter 6. Chapters 7–9 deal with special topics in CFD. In Chapter 7, the reader is introduced to the topic of phase change. In engineering practice, heat and mass transfer are often accompanied by solid-to-liquid, liquid-to-vapour, and/or solid-tovapour (and vice versa) transformations. This chapter, however, deals only with solidiﬁcation/melting phenomena in one dimension to develop understanding of the main difﬁculties associated with obtaining numerical solutions. Chapter 8 deals with the topic of numerical grid generation and methods for curvilinear and unstructured grid generation are introduced. Finally, in Chapter 9, methods for enhancing the rate of convergence of iterative numerical procedures are introduced. There are three appendices. Appendix A provides the derivation of the transport equations. In Appendix B, a computer code for solving 1D conduction problems is given. This code is based on material of Chapter 2. Appendix C provides a computer code for 2D conduction–convection problems in Cartesian coordinates. This code is based on material of Chapter 5. Familiarity with the use of these codes, it is hoped, will provide readers with sufﬁcient exposure to enable development of their own codes for boundary layer ﬂows (Chapter 4) , for employing curvilinear and unstructured grids (Chapter 6), for phase change (Chapter 7), and for numerical grid generation (Chapter 8). At the end of each chapter, exercise problems are given to enhance learning. Also, in each chapter, sample problems are solved and results are presented to aid their interpretation.

EXERCISES 1. Express full forms of the Su i terms in Equation 1.3 for i = 1, 2, and 3. Show that if µ and ρ are constant then, for an incompressible ﬂuid, Su i = 0. 2. Consider Equations 1.1–1.5. Assuming SI units, verify that units of each term in a given equation are identical. 3. Show that summing of each term in Equation 1.2 over all species of the mixture results in the mass conservation equation (1.1) for the mixture. 4. Consider the plug-ﬂow thermo-chemical reactor (PFTCR) shown in Figure 1.4. To analyse such a reactor, the following assumptions are made: (a) All s vary only along the length (say, x) of the reactor. (b) Axial diffusion and conduction

2.1 Introduction A wide variety of practical and interesting phenomena are governed by the 1D heat conduction equation. Heat transfer through a composite slab, radial heat transfer through a cylinder, and heat loss from a long and thin ﬁn are typical examples. By 1D, we mean that the temperature is a function of only one space coordinate (say x or r). This indeed is the case in steady-state problems. However, in unsteady state, the temperature is also a function of time. Thus, although there are two relevant independent variables (or dimensions), by convention, we refer to such problems as 1D unsteady-state problems. The extension dimensional thus always refers to the number of relevant space coordinates. The 1D heat conduction equation derived in the next section is equally applicable to some of the problems arising in convective heat transfer, in diffusion mass transfer, and in ﬂuid mechanics, if the dependent and independent variables of the equation are appropriately interpreted. In the last section of this chapter, therefore, problems from these neighbouring ﬁelds will be introduced. Our overall objective in this chapter is to develop a single computer program that is applicable to a wide variety of 1D problems.

2.2 1D Conduction Equation Consider the 1D domain shown in Figure 2.1, in which the temperature varies only in the x direction although cross-sectional area A may vary with x. The temperature over the cross section is thus assumed to be uniform. We shall now invoke the ﬁrst law of thermodynamics and apply it to a typical control volume of length x. The law states that (Rate of energy in) − (Rate of energy out) + (Rate of generation of energy) = (Rate of change of Internal energy), or Q x − Q x+x + q A x =

∂ [ ρ A x C T ] ∂t

W,

(2.1) 17

18

1D HEAT CONDUCTION

L

Qx

Q x + ∆x

A

x

∆x Figure 2.1. Typical 1D domain.

where q (W/m3 ) is the volumetric heat generation rate, C denotes speciﬁc heat (J/kg-K), and Q (W) represents the rate at which energy is conducted. Further, it is assumed that the control volume V = A (x) × x does not change with time. Similarly, the density ρ is also assumed constant with respect to time but may vary with x. Therefore, dividing Equation 2.1 by V , we get ∂(C T ) Q x − Q x+x + q = ρ . A x ∂t Now, letting x → 0, we obtain

It will be instructive to make the following comments about Equation 2.5. 1. The equation is most general. It permits variation of medium properties ρ, k, and C with respect to x and/or t. 2. The equation permits variation of cross-sectional area A with x. Thus, the equation is applicable to the case of a conical ﬁn, for example. Similarly, the equation

19

2.3 GRID LAYOUT

PRACTISE A

Xc

X

1,2

3

1 2

4

3

5

6

4

7

5

6

8

9

7

8 N=9

PRACTISE B CELL FACE 1,2

1 2

3

4

3

5

4

6

5

7

6

8

7

9

8 N=9

NODE Figure 2.2. Grid layout practises.

is also applicable to the case of cylindrical radial conduction if it is recognised that A = 2 × π × r , and if x is replaced by r. 3. The equation also permits variation of q with T or x. Thus, if an electric current is passed through the medium, q will be a function of electrical resistance and the latter will be a function of T. Similarly, in case of a ﬁn losing heat to the surroundings due to convection, q will be negative and it will be a function of the heat transfer coefﬁcient h and perimeter P. 4. Equation 2.5 is to be solved for boundary conditions at x = 0 and x = L (say). Thus, 0 ≤ x ≤ L speciﬁes the domain of interest.1 2.3 Grid Layout As mentioned in Chapter 1, numerical solutions are generated at a few discrete points in the domain. Selection of coordinates of such points (also called nodes) is called grid layout. Two practises are possible (see Figure 2.2). Practise A In this practise, the locations of nodes (shown by ﬁlled circles) are ﬁrst chosen and then numbered from 1 to N. Note that the chosen locations need not be equispaced. Now the control volume faces (also called the cell faces) are placed midway between the nodes. When this is done, a difﬁculty arises at the nearboundary nodes 2 and N − 1. For these nodes, the cell face to the west of node 2 1

Numerical solutions are always obtained for a domain of ﬁnite size. In many problems, the boundary condition is speciﬁed at x = ∞. In this case, L is assumed to be sufﬁciently large but ﬁnite.

20

1D HEAT CONDUCTION

Figure 2.3. Typical node P – Practise A.

is assumed to coincide with node 1 and, similarly, the cell face to the east of node N − 1 is assumed to coincide with node N. As such, there is no cell face between nodes 1 and 2, nor between nodes N − 1 and N . The space between the adjacent cell faces deﬁnes the control volume. In this practise therefore the nodes, in general, will not be at the centre of their respective control volumes. Also note that if N nodes are chosen, then there are N − 2 control volumes. Practise B In this practise, the location of cell faces is ﬁrst chosen and then the grid nodes are placed at the centre of the control volumes thus formed. Note again that the chosen locations of the cell faces need not be equispaced. Both practises have their advantages and disadvantages that become apparent only as one encounters multidimensional situations. Yet, a choice must be made. In this chapter, much of the discussion is carried out using practise A, but it will be shown that a generalised code can be written to accommodate either practise. 2.4 Discretisation Having chosen the grid layout, our next step is to convert the PDE (2.5) to an algebraic one. This process of conversion is called discretisation. Here again, there are two possible approaches: 1. a Taylor series expansion (TSE) method or 2. an integration over a control volume (IOCV) method. In both methods, a typical node P is chosen along with nodes E and W to east and west of P, respectively (see Figure 2.3). The cell face at e is midway between P and E, likewise, the cell face at w is midway between P and W. Before describing these methods, it is important to note an important aspect of discretisation. Equation 2.5 is a partial differential equation. The time derivative on the right-hand side (RHS), therefore, must be evaluated at a ﬁxed x. We choose this ﬁxed location to be node P. The left-hand side (LHS) of Equation 2.5, however, contains a partial second derivative with respect to x and, therefore, this derivative

21

2.4 DISCRETISATION

must be evaluated at a ﬁxed time. The choice of this ﬁxed time, however, is not so straightforward because over a time step t, one may evaluate the LHS at time t, or t + t, or at an intermediate time between t and t + t. In general, therefore, we may write Equation 2.5 as ψ (L H S)nP + (1 − ψ) (L H S)oP = R H S|P

(2.6)

where ψ is a weighting factor, superscript n refers to the new time t + t, and superscript o refers to the old time t. If we choose ψ = 1 then the discretisation is called implicit, if ψ = 0 then it is called explicit, and if 0 < ψ < 1, it is called semiimplicit or semi-explicit. Each choice has a bearing on economy and convenience with which a numerical solution is obtained. The choice of ψ is therefore made by the numerical analyst depending on the problem at hand. The main issues involved will become apparent following further developments. 2.4.1 TSE Method To employ this method, Equation 2.5 is ﬁrst written in a nonconservative form. Thus, ∂2T ∂(k A) ∂ T + + q A, 2 ∂x ∂x ∂x ∂(C T ) RHS|P = ρ A . ∂t LHS|P = k A

Note that, in Equations 2.9 and 2.10, terms involving derivative orders greater than 2 are ignored. Therefore, Equations 2.11 and 2.12 are called second-orderaccurate representations of ﬁrst- and second-order derivatives with respect to x.

Note that Equation 2.24 has the same form as Equation 2.15, but there are important differences: 1. Coefﬁcients AE and AW can never be negative since k A/x can only assume positive values. 2. AE and AW are also amenable to physical interpretation; they represent conductances. 3. Again, in steady-state problems, ψ = 1 because t = ∞. In unsteady problems, for certain choices of t, however, the multiplier of TPo can still be negative. This observation is in common with the TSE method. 2.5 Stability and Convergence Before discussing the issues of stability and convergence, we recognize that there will be one equation of the type (2.24) [or (2.15)] for each node P. To minimize writing, we designate each node by a running index i = 1, 2, 3, . . . , N , where i = 1 and i = N are boundary nodes. Thus, Equations 2.24 are written as A Pi Ti = ψ [ AE i Ti+1 + AWi Ti−1 ] + Si ,

i = 2, 3, . . . , N − 1, (2.28)

where superscript n is now dropped for convenience. In these equations, A Pi represents multiplier of TP in Equation 2.24. It will be shown later that this equation set can be written in a matrix form [A][T] = [S], where [A] is the coefﬁcient matrix and [T] and [S] are column vectors. This set can be solved by a variety of direct and iterative methods. The methods yield converged solutions only when the condition for convergence (also known as Scarborough’s criterion [64]) is satisﬁed. To put it simply, the criterion states that Condition for Convergence ψ [|AE i | + |AWi |] ≤1 |A Pi |

The speciﬁcation of procedural steps is called an algorithm. To illustrate the algorithm, we again consider Problem 1. Then, using the IOCV method, the equations to be solved are 5,200 o 5,200 (2.40) + 375 T2 = 250 T1 + 125 T3 + T , t t 2

5,200 o 5,200 + 250 Ti = 125 (Ti−1 + Ti+1 ) + T t t i

i = 3, . . . , N − 2, (2.41)

5,200 5,200 o + 375 TN −1 = 125 TN −2 + 250 TN + T . t t N −1

(2.42)

It is now possible to cast our algorithm in the form of a computer program. This matter is taken up in a later section. Here, results of computations with t = 10 and 20 s are presented in Tables 2.3 and 2.4, respectively. Table 2.4: Implicit procedure with ∆t = 20 s. Time

0 mm

1 mm

3 mm

5 mm

7 mm

9 mm

10 mm

0 20 40 60 80 100 120

250 250 250 250 250 250 250

30 121.6 164.7 184.5 201.2 210.4 217.2

30 55.52 84.10 109.9 131.9 150.4 166.0

30 42.51 62.90 84.94 108.5 129.1 147.1

30 55.52 84.10 109.9 131.9 150.4 166.0

30 121.6 164.7 184.5 201.2 210.4 217.2

250 250 250 250 250 250 250

2.6 MAKING CHOICES

From the computed results, we make the following observations: 1. The temperature evolutions are monotonic irrespective of the time step since there is no restriction on the time step in the implicit procedure. 2. With t = 10 s, the time for pressing is evaluated at 107.81 s and with t = 20 s at 112.09 s. Again these times are not necessarily accurate. Accuracy can only be established by repeating computations with ever smaller values of t and x till the evaluated total time is independent of the choices made. 3. Comparison of results in Table 2.3 with those in Table 2.1 shows that temperature evolutions calculated by the implicit procedure are more realistic. Note, for example, that T4 in the explicit procedure does not even recognise that heating has started for the ﬁrst 20 s. Of course, this lacuna can be nearly eliminated by taking smaller time steps. 4. For the same time step, the explicit procedure reaches T4 = 140 in 10 time steps. The implicit procedure has, however, required 11 time steps. In addition, at each time step, a few iterative calculations have been carried out. Thus, in this example, the implicit procedure involves more arithmetic operations than the explicit procedure. This, however, is not a general observation. When x and t are reduced to obtain accurate solutions, or when coefﬁcients AE and AW are not constant but functions of temperature (through temperaturedependent conductivity, for example), or when q = q (T ) is present, one may ﬁnd that an implicit procedure may yield more economic solutions than the explicit procedure because the former enjoys freedom over the size of the time step.

2.6 Making Choices In the previous two sections, we have introduced TSE and IOCV methods as well as explicit and implicit procedures. Here, we offer advice on the best choice of combination, keeping in mind the requirements of multidimensional problems (including convection) to be discussed in later chapters. Further, we also keep in mind that coefﬁcients AE and AW are in general not constant. This makes the discretised equations nonlinear. 1. Note that the TSE method casts the governing equations in non-conservative form whereas the IOCV method uses the as-derived conservative form. As we shall observe later, this matter is of considerable physical signiﬁcance when convective problems are considered. 2. In the TSE method, coefﬁcients AE and AW carry little physical meaning. In the IOCV method, they represent conductances. 3. In the TSE method, Scarborough’s criterion may be violated. In the IOCV method, this can never happen.

31

32

1D HEAT CONDUCTION

4. The question of invoking explicit procedure arises only when unsteady-state problems are considered. The implicit procedure, in contrast, can be invoked for both unsteady-state as well as steady-state problems. In fact, in steady-state problems (t = ∞) the implicit procedure is the only one possible.6 5. The explicit procedure imposes restriction on the largest time step to obtain stable solutions. The implicit procedure does not suffer from such a restriction. In view of these comments, the best choice is to employ the IOCV method with an implicit procedure. Throughout this book, therefore, this combination will be preferred. 2.7 Dealing with Nonlinearities Now that we have accepted a combination of IOCV with the implicit procedure, we restate the main governing discretised equation (equations 2.38 and 2.39) but in a slightly altered form: l+1 l+1 + AWi Ti−1 + Su i , (A Pi + Spi ) Til+1 = AE i Ti+1

i = 2, 3, . . . , N − 1, (2.43)

A Pi = AE i + AWi , k A , AE i = x i+1/2 k A , AWi = x i−1/2 Su i =

ρ Vi Cio o Ti , t

(2.44) (2.45)

(2.46) Spi =

ρ Vi Cin . t

(2.47)

In these equations, the q term is deliberately ignored because it is a problemdependent term. The altered form shown in Equation 2.43 will be useful in dealing with nonlinearities. Also, a generalised computer code can be constructed around Equation 2.43 in such a way that preserves the underlying physics. The nonlinearities can emanate from three sources: 1. if q is a function of T 2. if conductivity k is a function of T or changes abruptly, as in a composite material and/or 3. boundary conditions at x = 0 and x = L. 6

Some analysts employ an explicit procedure even for a steady-state problem. In this case, calculations proceed by introducing a false or imaginary time step. Hence, such procedures are called false transient procedures.

33

2.7 DEALING WITH NONLINEARITIES

In the following, we discuss methods for dealing with nonlinearities through modiﬁcation of Su i and Spi . 2.7.1 Nonlinear Sources Consider a pin ﬁn losing heat to its surroundings under steady state by convection with heat transfer coefﬁcient h. Then, q will be given by qi = −

When this equation is included in Equation 2.43, it is obvious that Ti will now appear on both sides of the equation. One can therefore write the total source term as Source term = Su i + h i Pi xi (T∞ − Ti ).

(2.50)

This prescription can be accommodated by updating Su i and Spi as Su i = Su i + h i Pi xi T∞ , Spi = Spi + h i Pi xi ,

(2.51)

where Su i and Spi on the RHSs are the original quantities given in Equation 2.47. Note that, in this case, the updated Spi is positive and, therefore, there is no danger of rendering A Pi + Spi negative. Thus, Scarborough’s criterion cannot be violated. However, if we considered dissipation of heat due to an electric current or chemical reaction (as in setting of cement) then, because heat is generated within the medium, qi = a + b Tim , where b is positive. In this case, Su i = Su i + a Vi and Spi = Spi − b Tim−1 Vi . But now, there is a danger of violating Scarborough’s criterion and, therefore, one simply sets Su i = Su i + qi Vi and Spi is not updated. Accounting for the source term in the manner of Equation 2.51 is called source term linearization [49]. We shall discover further advantages of this form when dealing with the application of boundary conditions.

for example, may be evaluated in two ways: 2 ki+1/2 = a + b Ti+1/2 + c Ti+1/2 ,

Ti+1/2 = 0.5 (Ti + Ti+1 )

(2.52)

or ki+1/2 = 0.5 [ k (Ti ) + k (Ti+1 ) ] .

(2.53)

Both of these representations are pragmatically acceptable but neither can be justiﬁed on the basis of the physics of conductance. To illustrate this point, let us consider a composite medium consisting of two materials with constant conductivities k1 and k2 (see Figure 2.7). In this case, we lay the grid nodes i and i + 1 in such a way that the cell face i + 1/2 coincides with the location where the two materials are joined. Thus, there is a discontinuity in conductivity at the i + 1/2 location. Now, in spite of the discontinuity, the heat transfer Q i+1/2 on either side of i + 1/2 must be the same. Therefore, Q i+1/2 = k1 Ai+1/2 Q i+1/2 = k2 Ai+1/2

We recall, however, that our discretised equation was derived on the basis of linear temperature variation between nodes i and i + 1 (see Equation 2.21). This implies that A ki+1/2 (Ti − Ti+1 ). (2.57) Q i+1/2 = x i+1/2

35

2.7 DEALING WITH NONLINEARITIES

Comparing Equations 2.56 and 2.57, leads to ki+1/2 = xi+1/2

xi+1 − xi+1/2 xi+1/2 − xi + ki ki+1

−1

.

(2.58)

If the cell face were midway between the nodes then this equation would read as

ki+1/2

1 1 =2 + ki ki+1

−1

.

(2.59)

These equations suggest that the conductivity at a cell face should be evaluated by a harmonic mean to accord with the physics of conductance. We shall regard this as a general practise and extend it to the case when thermal conductivity varies with temperature. Thus, instead of using either Equation 2.52 or 2.53, Equation 2.58 will be used with ki and ki+1 evaluated in terms of temperatures Ti and Ti+1 , respectively. Further, note that if conductivity is constant, ki+1/2 = ki = ki+1 . 2.7.3 Boundary Conditions In practical problems, three types of boundary conditions are encountered: 1. Boundary temperatures T1 and/or TN are speciﬁed. 2. Boundary heat ﬂuxes q1 and/or q N are speciﬁed. 3. Boundary heat transfer coefﬁcients h 1 and/or h N are speciﬁed. Our interest in this section lies in prescribing these boundary conditions by employing Su and Sp for the near-boundary nodes.

Boundary Temperature Speciﬁed For the purpose of illustration, consider the i = 2 node, where T1 is speciﬁed. Then, Equation 2.43 will read as

(A P2 + Sp2 ) T2l+1 = AE 2 T3l+1 + AW2 T1l+1 + Su 2 ,

(2.60)

where Su 2 and Sp2 are already updated to account for any source term. Equation 2.60 can be left as it is but we alter it via a three-step procedure in which we set Su 2 = Su 2 + AW2 T1 , Sp2 = Sp2 + AW2 , AW2 = 0.0.

(2.61)

36

1D HEAT CONDUCTION

q1 1

2

Figure 2.8. Flux boundary condition.

3

h1 8

T

With this speciﬁcation, A P2 will now equal AE 2 because AW2 is set to zero, but the coefﬁcient of T2l+1 remains intact because Sp2 has been updated. Thus, the boundary condition speciﬁcation is accomplished by snapping the boundary connection in the main discretised equation.

In this case, the boundary condition can be implemented via the following steps: 1. Calculate T1 from Equation 2.65. 2. Update −1 −1 1 1 1 1 + and Su 2 = Su 2 + + T∞ . Sp2 = Sp2 + A1 h 1 AW2 A1 h 1 AW2 3. Set AW2 = 0. Thus, for all types of boundary conditions, we are able to ﬁnd appropriate Su and Sp augmentations and then set the boundary coefﬁcient of the near-boundary node (AW2 in our examples) to zero. The usefulness of this practise will become apparent when we consider the issue of convergence enhancement of the iterative solution procedures of 2D equations in Chapter 9. 2.7.4 Underrelaxation In a nonlinear problem, if k and/or q are strong functions of temperature then, in an iterative procedure, as the temperature ﬁeld changes, the coefﬁcients A P, AE, and AW and the source S may change very rapidly from iteration to iteration. In such highly nonlinear problems, the iterative solution may yield oscillatory or erratic convergence or may even diverge. Therefore, it is desirable to restrict the changes in temperature implied by Equation 2.43. Such a restriction is called underrelaxation. It can be effected by rewriting Equation 2.43 as l+1 l+1 + AWi Ti−1 + Su i α AE i Ti+1 l+1 + (1 − α) Til , (2.66) Ti = A Pi + Spi where 0 < α ≤ 1. If α = 1, no underrelaxation will be effected. If α = 0, no change will be effected, therefore, this case is not of interest. The underrelaxation can be effected without altering the structure of Equation 2.43 by simply augmenting Su and Sp before every iteration. Thus, Su i = Su i +

(1 − α) (A Pi + Spi ) Til , α

(2.67)

(1 − α) (A Pi + Spi ). α

(2.68)

Spi = Spi +

If the coefﬁcients AE i and AWi were constants and not functions of T then it is also possible to take 1 ≤ α < 2. This is called overrelaxation. Typically, compared to the case of α = 1, the convergence rate with overrelaxation is faster up to a certain optimum αopt , but for α > αopt , the convergence rate again slows down, so much so that it may be even slower than that with α = 1. The magnitude of αopt is problem dependent.

38

1D HEAT CONDUCTION

2.8 Methods of Solution When coefﬁcients AE i , AWi , and A Pi are calculated and Su i and Spi are suitably updated to account for the effects of source linearization, boundary conditions, and underrelaxation, we are ready to solve the set of equations (2.43) at an iteration level l + 1. There are two extensively used methods for solving such equations. 2.8.1 Gauss–Seidel Method The Gauss–Seidel (GS) method is extremely simple to implement on a computer. The main steps are as follows: 1. At a given iteration level l, calculate coefﬁcients AE, AW , A P, Su, and Sp using temperature T l for i = 2 to N − 1 2. Hence, execute a DO loop: 100

3. If FCMX > CC, go to step 1. The method is also called a point-by-point method because each node i is visited in succession. The method is very reliable but requires a large number of iterations and hence considerable computer time, particularly when N is large. 2.8.2 Tridiagonal Matrix Algorithm In the tridiagonal matrix algorithm (TDMA), Equation 2.43 is rewritten as Ti = ai Ti+1 + bi Ti−1 + ci ,

(2.69)

where ai =

AE i , A Pi + Spi

bi =

AWi , A Pi + Spi

ci =

Su i . A Pi + Spi

(2.70)

Note that since Spi ≥ 0, ai and bi can only be fractions. Equation 2.69 represents (N − 2) simultaneous algebraic equations. In matrix form, these equations can be written as [A] [T] = [C], where the coefﬁcient matrix [A] will appear as shown

39

2.8 METHODS OF SOLUTION

2

3

2

1

3

−b3

4

5

4

5

6

0

0

1

−a3

0

0

0

0

0

0

0

0

−b i

0

7

0

0

0

0

8

0

0

0

0

9

0

10

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

1

10 N − 1

9

0

0

0

8

−a 2

6

N−1

7

0

0

0

0

−a i

0

0

0

T2

C2

0

0

T3

C3

0

0

Ti

C

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

i

0

0

0

− a 10

0

0

0

0

−b N−1 1

T N−1

C N−1

Figure 2.9. Diagonally dominant matrix [A].

in Figure 2.9. Notice that the coefﬁcient of Ti occupies the diagonal position of the matrix with −ai and −bi occupying the neighbouring diagonal positions. All other elements of the matrix are zero. The matrix [A] thus has diagonally dominant tridiagonal structure. This structure can be exploited as follows. Let Ti = Ai Ti+1 + Bi ,

Thus, Ai and Bi can be calculated by recurrence. The implementation steps are as follows: 1. Prepare ai , bi , and ci for i = 2 to N − 1 from knowledge of the Til distribution. 2. From comparison of Equations 2.69 and 2.71, set A2 = a2 and B2 = c2 (because b2 = 0 via the boundary condition speciﬁcation). Now evaluate Ai and Bi for i = 3 to N − 1 by recurrence using Equations 2.74 and 2.75. 3. Evaluate Ti by backwards substitution using Equation 2.71, that is, from i = N − 1 to 2. Note that since we prescribe boundary conditions such that AE N −1 = 0, it follows that A N −1 = 0. 4. Evaluate fractional change as before and go to step 1 if the convergence criterion is not satisﬁed. The TDMA is essentially a forward elimination (implicit in the recurrence relations) and backward substitution procedure in which temperatures at all i are updated simultaneously in step 3. Hence, the TDMA is also called a line-by-line procedure to contrast it with the point-by-point GS procedure introduced earlier. Further, we note that if ai , bi , and ci were constants and not functions of T then the TDMA would yield a solution in just one iteration whereas the point-by-point procedure would require several iterations even when coefﬁcients are constants. 2.8.3 Applications To illustrate performance of the methods just described, we consider two steadystate problems.7 Problem 2 – Rectangular Fin [80] A rectangular ﬁn of length 2 cm, thickness 2 mm, and breadth 20 cm is attached to a plane wall as shown in Figure 2.10. The wall temperature Tw = 225◦ C and ambient temperature T∞ = 25◦ C. For the ﬁn material, k = 45 W/m-K and the operating h = 15 W/m2 -K. Determine the heat loss from the ﬁn and its effectiveness. Assume the tip heat loss to be negligible. Solution The exact solution to this problem is cosh m (L − x) T − T∞ = , Tw − T∞ cosh m L

[4.5 + 0.024] T6 = 4.5 T5 + 0.6, T7 = T6 . In this problem, the conductivity, area, perimeter, and heat transfer coefﬁcient are constants. Therefore, coefﬁcients AE i and AWi do not change with iterations. Thus, after carrying out the developments of Section 2.7.3, it is possible to construct a coefﬁcient table. The relevant quantities are shown in Table 2.5. The solutions obtained using the GS method are shown in Table 2.6. No underrelaxation is used. Entries for l = 0 indicate the initial guess for temperatures (assuming a linear variation). At subsequent iterations, maximum fractional change (FCMX) reduces monotonically from 0.01 at l = 1 to 0.000092 at l = 24. The convergence criterion was set at 10−4 . The converged solution compares favourably with the exact solution although only ﬁve control volumes have been

42

1D HEAT CONDUCTION

Table 2.5: Coefﬁcients in the discretised equation – Problem 2. i

2

3

4

5

6

AWi AE i Su i Spi

0 4.5 2025.6 9.024

4.5 4.5 0.6 0.024

4.5 4.5 0.6 0.024

4.5 4.5 0.6 0.024

4.5 0 0.6 0.024

used. Greater accuracy can be obtained with ﬁner grids; however, this will require more computational effort. From the converged solution, the ﬁn heat loss is estimated as Q loss = AW2 × (T1 − T2 ) = 9 (225 − 222.42) = 23.26 W. This also compares favourably with the exact solution already mentioned. Table 2.7 shows the execution of the same problem using TDMA. The table shows values of Ai and Bi derived from Table 2.5 and Equations 2.74 and 2.75. Since these are constants, solution is now obtained in only one iteration. Also, the initial guess becomes irrelevant. The estimated heat loss is Q loss = 9 (225 − 222.45) = 22.967 W. Thus, compared to GS, the TDMA procedure is considerably faster. Experience shows that this conclusion is valid even in nonlinear problems. For this reason, the TDMA is the most preferred solution procedure in generalised codes. Problem 3 – Annular Composite Fin Consider an annular ﬁn put on a tube (of outer radius r1 = 1.25 cm), as shown in Figure 2.11. The ﬁn is made from two materials: The inner material has radius r2 = 2.5 cm and conductivity k2 = 200 W/m-K and the outer material extends to radius r3 = 3.75 cm and has conductivity k3 = 40 W/m-K. The ﬁn thickness t = 1 mm. The tube wall (and hence the ﬁn base) temperature is T0 = 200◦ C. The Table 2.6: Solution by Gauss–Seidel method – Problem 2. l

FCMX

0 cm

0.2 cm

0.6 cm

1.0 cm

1.4 cm

1.8 cm

2.0 cm

0 1 2 3 .. . 22 23 24 Exact

0.01 0.0034 0.0021 .. . 0.00012 0.00011 0.000092 −

225 225 225 225 .. . 225 225 225 225

223 222.65 222.42 222.24 .. . 222.41 222.41 222.42 222.58

219 218.31 217.77 217.32 .. . 218.28 218.30 218.31 218.52

215 214.15 213.44 213.54 .. . 215.22 215.24 215.25 215.51

211 210.08 210.77 211.16 .. . 213.19 213.21 213.23 213.49

207 209.1 209.78 210.18 .. . 212.19 212.21 212.23 212.49

205 209.1 209.78 210.18 .. . 212.19 212.21 212.23 212.37

43

2.8 METHODS OF SOLUTION

Table 2.7: Solution by TDMA – Problem 2. x (cm)

0

0.2

0.6

1.0

1.4

1.8

2

Ai Bi l=1 Exact

− − 225 225

0.333 149.78 222.45 222.58

0.598 89.628 218.40 218.52

0.711 63.776 215.38 215.51

0.772 49.357 213.37 213.49

0.0 212.375 212.37 212.49

− − 212.37 212.37

ﬁn surface experiences heat transfer coefﬁcient h = 20 W/m2 -K and the ambient temperature is T∞ = 25◦ C. Assuming conduction to be radial, estimate the heat loss from the ﬁn and the ﬁn effectiveness. Neglect heat loss from the ﬁn tip. Solution In this problem, if the origin x = 0 is assumed to coincide with the base of the ﬁn, then at any radius r, area A = 2 π r t = 2 π (r1 + x) t and perimeter P = 2 × (2 π r ) = 2 × [2 π (r1 + x)]. The multiplication factor 2 in P arises because the ﬁn loses heat from both its faces. Further, since the ﬁn material is a composite, grids must be laid such that the cell face coincides with the location of the discontinuity in conductivity. Therefore, we adopt practise B and specify cell-face coordinate (xc ) values. Choosing N = 8 and equal cell-face spacings, we have six control volumes of size x = (r3 − r1 )/(N − 2) = 0.4167 cm. This grid speciﬁcation provides three control volumes in each material. The boundary conditions at the ﬁn base and ﬁn tip are T (1) = 200 and q N = 0, respectively. Finally, the heat loss from the ﬁn is accounted for in the manner of Equations 2.51.

MATERIAL K 3 r3 MATERIAL K 2 r2 r1

T0

TUBE h

ANNULAR FIN

8

Τ

t Figure 2.11. Annular ﬁn of composite material – Problem 3.

44

1D HEAT CONDUCTION

Table 2.8: Solution by TDMA (N = 8) – Problem 3. x × 103

0

2.083

6.25

10.417

14.58

18.75

22.917

25.0

A × 105 T

7.845 200

7.845 196.7

10.5 192.43

13.1 189.4

15.7 183.38

18.3 177.39

20.9 174.63

23.6 174.63

The predicted temperature distribution in the ﬁn is shown in Table 2.8 and plotted (open circles) in Figure 2.12. From the table, the heat loss Q = −k2 A ∂ T /∂ x |x=0 = −200 × 7.845 × 10−5 (196.7 − 200)/2.083 × 10−3 = 24.86 W. To evaluate ﬁn effectiveness, the maximum possible heat loss from the ﬁn is evaluated from 2 × h × π (r32 − r12 ) × (T0 − T∞ ) = 27.49 W. Therefore, the predicted effectiveness = 24.86/27.49 = 0.9046. To carry out the grid-independence study, computations are repeated for N = 16 and N = 32. These results are also plotted in Figure 2.12. The ﬁgure shows that results for N = 16 (open squares) and N = 32 (solid line) almost coincide. Thus, in this problem, results obtained with N = 16 may be considered quite accurate for engineering purposes. This is also corroborated by the computed Q and for the two grids. For N = 16, the computed results are Q = 24.933 and = 0.907; for N = 32, they are Q = 24.941 and = 0.9073. Note also the change in the

200

N=8 N = 16 N = 32

T

190

180

X (meters) 170 0.0000

0.0050

0.0100

Figure 2.12. Variation of temperature with X – Problem 3.

0.0150

0.0200

0.0250

45

2.9 PROBLEMS FROM RELATED FIELDS

slope of the temperature proﬁle at the point of discontinuity (x = 0.0125 m) in conductivity. Finally, by assigning different values to k2 , k3 , r2 , r3 , and t, it would be possible to carry out a parametric study to aid optimisation of ﬁn volume and economic cost in a separate design study. 2.9 Problems from Related Fields Quite a few problems from the ﬁelds of ﬂuid mechanics, convective heat transfer, and diffusion mass transfer are governed by equations that bear similarity with Equation 2.5. Only the dependent variable, the coefﬁcients, and the source term need to be interpreted appropriately. We discuss such problems next. Fully Developed Laminar Flow Steady, fully developed laminar ﬂow in a tube is governed by ∂u dp ∂ µ 2π r − 2π r = 0, ∂r ∂r dz

(2.77)

where u is velocity parallel to the tube axis and the pressure gradient is a negative constant. Since velocity u is directed in the z direction, it can be treated as a scalar with respect to the r direction. Comparison with Equation 2.5 shows that T ≡ u, ∂ x ≡ ∂r , A ≡ 2πr , k ≡ µ, and q ≡ − d p/d z. For a circular tube, u = 0 at r = R (tube radius) and ∂u/∂r = 0 at the tube axis r = 0. Equation 2.77 is also applicable to an annulus with boundary conditions u = 0 at r = Ri and r = Ro . Similarly, the equation is applicable to ﬂow between parallel plates if we set A = 2π r = 1 and ∂ x ≡ ∂r ≡ ∂ y, where y is measured from the symmetry axis. Fully Developed Turbulent Flow In this case, if Boussinesq approximation is considered valid then the axial velocity is governed by

and y is measured from the symmetry axis. The initial condition is T = Ti at z = 0 and the symmetry boundary condition is ∂ T /∂ y = 0 at y = 0. At y = b, however, T = Tw if both walls are at constant wall temperature, or, if constant wall heat ﬂux is speciﬁed, then k ∂ T /∂ y |b = qw . For this problem, if we set y ≡ x, z ≡ t, q = 0, A = 1, and C p u fd ≡ 1.5 u (1 − y 2 /b2 ) C p then Equation 2.85 is the same as Equation 2.5 in which the unsteady term is retained. Diffusion Mass Transfer In a binary mixture of species i and j, the equation (in spherical coordinates) governing radial diffusion of j in a stationary medium i is given by

∂ω j ∂ ρm D 4π r 2 ∂ω j = ρm 4πr 2 , (2.87) ∂r (1 − ω j ) ∂r ∂t

where ω j is the mass fraction of j in the mixture and D is the mass diffusivity. Thus, if we set ∂r ≡ ∂ x, A = 4π r 2 , k = ρm D/(1 − ω j ), C p = 1, T = ω j , and, q = 0 then this equation is the same as Equation 2.5. To solve the equation, one will need boundary conditions at r = ri and r = ro and the initial condition at t = 0. Estimation of penetration depth during surface hardening of materials, estimation of leakage ﬂow of gases from storage vessels, or estimation of burning rate of volatile fuel in still surroundings are some of the mass transfer problems of interest. The reader is referred to the uniﬁed formulation of the mass transfer problem by Spalding [72] and to the book by Gupta and Srinivasan [26]. EXERCISES8 1. Show that the derivative expressions in Equation 2.21 are second-order accurate if the cell face is midway between adjacent nodes. 2. A slab of thickness 2b is initially at temperature T0 . At t = 0, the boundary temperatures at x = −b and +b are raised to Tb and maintained there. The exact solution for evolution of temperature in this case is given by ∞

All numerical problems given in these exercises can be solved by the generalised computer code given in Appendix B.

48

1D HEAT CONDUCTION

temperature to reach 140◦ C. What is the minimum value of n required to obtain an accurate estimate of t? 3. Repeat Problem 1 from the text using both explicit and implicit methods by choosing N = 7, 12, and 22. Determine the largest allowable time step in the explicit case. Compare your solution for the time required for adhesion with the exact solution determined in the previous problem. 4. Evaluate Su N −1 and Sp N −1 for an unsteady problem when TN is speciﬁed as a function of time. Assume an arbitrary value of ψ. 5. Consider a time-varying heat-ﬂux-speciﬁed condition at i = 1. Hence, derive Su 2 and Sp2 for arbitrary ψ. Conﬁrm the validity of the three-step procedure following Equation 2.63 for ψ = 1. 6. Repeat Exercise 5 for a time-varying heat transfer coefﬁcient boundary condition. Hence, conﬁrm the validity of the procedure following Equation 2.65 for ψ = 1. 7. Conﬁrm the correctness of Equations 2.67 and 2.68. 8. Verify the entries in Tables 2.5 and 2.7 by carrying out the necessary calculations. 9. Develop a TDMA routine in which the postulated equation is Ti = Ai Ti−1 + Bi . 10. Consider a slab of width b = 20 cm. At x = 0, T = 100◦ C and at x = b, q = 1 kW/m2 . The heat generation rate is q = 1,000 − 5 T W/m3 . Calculate the steady-state temperature distribution with and without source-term linearisation. Compare the number of iterations required in the two cases for N = 22 and 42. Also calculate the heat ﬂux at x = 0 and Tb and check the overall heat balance. Take k = 1 W/m-K. Use TDMA. 11. Consider a nuclear fuel rod of length L and diameter D. The two ends of the rod are maintained at T0 . The internal heat generation rate is q = a sin (π x/L), where x is measured from one end of the rod and a is an arbitrary constant. The rod loses heat by convection (coefﬁcient h) to a coolant ﬂuid at T∞ . (a) Nondimensionalise the steady-state heat conduction equation and identify the dimensionless parameters. [Hint: Deﬁne θ = (T − T∞ )/(T0 − T∞ ), x ∗ = x/L, P1 = a L 2 /k (T0 − T∞ ), and P2 = 4 h L 2 /(k D).] (b) Compute the temperature distribution in the rod and compare with the exact solution for 0 < P1 , P2 < 10. Use source-term linearisation and TDMA. Carry out an overall heat balance from the computed results (c) Solve the problem for P1 = P2 = 10 using different underrelaxation parameters 0 < α < 2 for N = 22 and N = 42. Determine αopt in each case. Use uniform grid spacing and the GS procedure.

49

EXERCISES

8

T D

h B

hi

L

Tf Figure 2.13. Circumferential ﬁn.

12. Exploit the symmetry in Exercise 11 at L/2 and compute the temperature distribution over 0 ≤ x ≤ L/2. Compare the value of TL/2 with the exact solution. 13. Consider the ﬁn shown in Figure 2.13. The following are given: T∞ = 25◦ C, Tf = 200◦ C, B = 2 mm, L = 6 mm, tube diameter D = 4 mm, kﬁn = 40 W/mK, h = 20 W/m2 -K, and h i = 200 W/m2 -K. (a) Write the appropriate differential equation for steady-state heat transfer and the boundary conditions to determine the temperature distribution in the ﬁn. (b) Discretise the equation assuming six nodes (four control volumes) and list AE, AW , Su, Sp, and A P for each node. (c) Evaluate the effectiveness of the ﬁn. 14. Consider a rod of circular cross section (L = 10 cm, d = 1 cm, k = 1 W/m-K, ρ = 2,000 kg/m3 , and C = 850 J/kg-K). The rod is perfectly insulated around its periphery. At t = 0, the rod is at 25◦ C. For t > 0, Tx=0 = 25◦ C and Tx=L = 25 + t(s)◦ C. Compute temperature distribution in the rod as a function of x and t over a period of 15 min using ψ = 0, 0.5, and 1. Also determine qx=0 as a function of time and plot the variation. Take N = 22 and t = 5 s in each case. 15. Consider a rod of circular cross section (L = 10 cm, d = 1 cm, k = 1 W/m-K, ρ = 2,000 kg/m3 , and C = 850 J/kg-K). The rod is initially at 600◦ C. The temperatures at the two ends of the rod are suddenly reduced to 100◦ C and maintained at that temperature. The rod is also cooled by natural convection

50

1D HEAT CONDUCTION

to surroundings at 25◦ C. If h = 3 (Trod − T∞ )0.25 W/m2 -K, perform the following: (a) Compute the variation of h with time at x = 5 cm and x = 9 cm over a period of 1 min. Take t = 1 s and ψ = 1 and use TDMA. (b) Compute the percentage reduction in the energy content of the rod at the end of 1 min. (c) Extend the calculation beyond 1 min and estimate the time required to reach near steady state. (Hint: You will need to specify a criterion for steady state.) 16. Consider an unsteady conduction problem in which T1 is given. However, at x = L, the heat transfer coefﬁcient is speciﬁed. By examining the discretised equation for a general node i, for node i = 2, and for node i = N − 1, determine the stability constraint on t. Assume uniform control volumes, constant area, and conductivity with q = 0 and ψ = 0. 17. A semi-inﬁnite solid is initially at 25◦ C. At t = 0, the solid surface (x = 0) is suddenly exposed to qw = 10 kW/m2 . A thermocouple is placed at x = 1 mm to apparently measure the surface temperature. Compute the temperature distribution in the solid as a function of x and t and estimate the error in the thermocouple reading as a function of time. Carry out computations up to 1 s. Given are the following: k = 80 W/m-K, ρ = 7, 870 kg/m3 , and C = 450 J/kg-K. [Hint: The boundary condition at x = ∞ is TL = 25◦ C at all times. Choose sufﬁciently large L (say 1 cm) and execute with t = 0.01 s.] 18. A laboratory built in the Antarctic has a composite wall made up of plaster board (10 mm), ﬁbreglass insulation (100 mm), and plywood (20 mm). The inside room temperature is maintained at Ti = 293 K throughout. The plywood is exposed to an outside temperature To that varies with time t (in hours) as π ⎧ ⎪ t for 0 ≤ t ≤ 12 h, ⎨ 273 + 5 sin 12 To = ⎪ ⎩ 273 + 30 sin π t for 12 ≤ t ≤ 24 h. 12 (a) Compute the heat loss to the outside over a typical 24-h period (i.e., under periodic steady state) in J/m2 . (b) Plot the variation of interface temperatures between the plasterboard and the ﬁbreglass and between the ﬁbreglass and the plywood as a function of time. Assume: h i = 15 W/m2 -K and h o = 60 W/m2 -K. Material properties are given in Table 2.9. 19. Solve for fully developed laminar ﬂow in a concentric annular (r ∗ = Ri /Ro = 0.6) duct. Compare the predicted velocity proﬁle with the exact solution [33] 2 r 2 r u , + B ln = 1− u A Ro Ro

22. It is proposed to remove NO from exhaust gases of an internal combustion engine by passing them over a catalyst surface. It is assumed that chemical reactions involving NO are very slow so that NO is neither generated nor destroyed in the gas phase. At the catalyst surface, however, NO is absorbed at the rate of m˙ = Kρm ω0 , where the rate constant K = 0.075 m/s and ω0 is the mass fraction of NO at the catalyst surface. In the exhaust gases (T = 500◦ C, p = 1 bar, M = 30) the mole fraction of NO is X NO = 0.002. Now, it is assumed that NO diffuses to the catalyst surface over a stagnant layer of 1 mm with effective diffusivity = 3 × D, where D = 10−4 m2 /s. Determine the steady-state absorption rate (kg/m2 -s) of NO and its mass fraction at the surface. 23. The mass fraction of carbon in a low-carbon steel rod (2 cm diameter) is 0.002. To case-harden the rod it is preheated to 900◦ C and packed in a carburising mixture at 900◦ C. The mass fraction of carbon at the rod surface is now 0.014 and is maintained at this value. Calculate the time required for the carbon mass fraction to reach 0.008 at a depth of 1 mm from the rod surface. Assume radial diffusion only. In this case, cross-sectional area A = 2πr . However, since the penetration depth is only 10% of the rod radius, one may take A = 2π R = constant (i.e., assume plane diffusion). Compare the time required in the two cases. Take the diffusivity of carbon in steel to be D = 5.8 × 10−10 m2 /s. 24. Gaseous H2 at 10 bar and 27◦ C is stored in a 10-cm inside diameter spherical tank having a 2-mm-thick wall. If diffusivity of H2 in steel is D = 0.3 × 10−12 m2 /s and solubility S = 9 × 10−3 kmol/m3 -bar, estimate the time required for the tank pressure to reduce to 9.9 bar. Also, plot the time variation of tank pressure pH2 and the instantaneous hydrogen loss rate. Take ρsteel = 8,000 kg/m3 . The density of hydrogen at the inner surface of the tank is given by ρH2 ,i = SpH2 MH2 . Is an exact solution possible for this problem? 25. Consider steady-state heat transfer through the composite slab shown in Figure 2.14. Assume k1 = 0.05 (1 + 0.008 T ), k2 = 0.05 (1 + 0.0075 T ), and k3 = 2 W/m-K, where T is in degrees centigrade. Calculate the rate of heat transfer and the temperatures of the two interfaces. Ignore radiation. 26. Repeat Exercise 25 including the effect of radiation. The emissivities at x = 0 and x = 17 cm are 0.1 and 0.8, respectively. In this problem, one must use the concept of effective heat transfer coefﬁcient h eff = h + h rad . Thus, at x = 0, for example,

3.1 Introduction Consider a 1D domain (0 ≤ x ≤ L) through which a ﬂuid with a velocity u is ﬂowing. Then, the steady-state form of the ﬁrst law of thermodynamics can be stated as ∂qx = S, ∂x

(3.1)

where qx = qxconv + qxcond = ρ C p u T − k

∂T . ∂x

(3.2)

These equations are to be solved for two boundary conditions, T = T0 at x = 0 and T = TL at x = L. It is further assumed that ρ u is a constant as are properties C p and k. Our interest in this chapter is to examine certain discretisational aspects associated with Equation 3.1. This is because in computational ﬂuid dynamics (momentum transfer) and in convective heat and mass transfer, we shall recurringly encounter representation of the total ﬂux in the manner of Equation 3.2. Note that if u = 0, only conduction is present and the discretisations carried out in Chapter 2 readily apply. However, difﬁculty is encountered when convective ﬂux is present. The objective here is to understand the difﬁculty and to learn about commonly adopted measures to overcome it. In the last section of this chapter, stability and convergence aspects of explicit and implicit procedures for an unsteady equation in the presence of conduction and convection are considered. 3.2 Exact Solution Because our interest lies in examining the discretisational aspects associated with convective–conductive ﬂux, we take the special case of S = 0. For this case, an 55

The solution is plotted in Figure 3.1 for both positive and negative values of P. Negative P implies that the ﬂuid ﬂow is from x = L to x = 0 (or u is negative).

57

3.3 DISCRETISATION

It will be instructive to note the tendencies exhibited by the solution. 1. Figure 3.1 shows that irrespective of the value of P, always lies between 0 and 1. This means that at any x is bounded between its extreme values. 2. When P = 0, the conduction solution is obtained and, as expected, the solution is linear. 3. At X = 0.5 (i.e., at the midpoint) (0.5) =

exp (0.5 P) − 1 . exp (P) − 1

(3.8)

It is seen from the ﬁgure that as P → + ∞, (0.5) → 0 and as P → − ∞, (0.5) → 1. Thus, at large values of |P|, the midpoint solution tends to a value at the upstream extreme. This last comment is particularly important because a large |P| implies dominance of convection over conduction. As we will shortly discover, the main difﬁculty in obtaining numerical solution to Equation 3.6 is also associated with large |P|. 3.3 Discretisation Equation 3.6 will now be discretised using the IOCV method. Then with reference to Figure 2.3 of Chapter 2, we have e ∂ ∂ P− d X = 0, (3.9) ∂X w ∂X or ∂ ∂ − P w + = 0. (3.10) P e − ∂ X e ∂ X w Now, as in the case of conduction, it will be assumed that varies linearly between adjacent nodes. Also, though not essential, we shall assume a uniform grid so that X e = X w = X . Thus, since the cell face is midway between adjacent nodes, e = and

Clearly, the ﬁrst term represents the net convection whereas the second term represents the net conduction. However, note that, unlike in the conduction term, P does not appear in the convection term. Equation 3.13 will now be rewritten in the familiar discretised form to read as A P P = AE E + AW W ,

(3.14)

Pc AE = 1 − , 2

(3.15)

Pc , AW = 1 + 2

(3.16)

A P = AE + AW = 2,

(3.17)

where

and Pc = P X =

u L x u x = , α L α

(3.18)

where α = k/(ρ C p ) is the thermal diffusivity and Pc is called the cell Peclet number. If we now invoke Scarborough’s criterion, it is clear that Equation 3.14 will be convergent only when AE and AW are positive. This implies that the condition for convergence is |Pc | ≤ 2.

(3.19)

Thus, when convection is very large compared to conduction, to satisfy condition (3.19), one will need to employ very small values of X or a very ﬁne mesh. However, this can prove to be very expensive. The more relevant question, however, is, Why do AE and/or AW turn negative when convection is dominant? The answer to this question can be found in Equation 3.11, where, contrary to the advice provided by the exact solution, the cell-face values are linearly interpolated between the values of at the adjacent nodes. Note that when Pc > 2 and large, the exact solution gives e → P and w → W . Similarly, when Pc < −2, e → E and w → P . In Equation 3.11, we took no cognizance of either the direction of ﬂow (sign of Pc ) or its magnitude. To obtain economic convergent solutions, therefore, one must write e = ψ P + (1 − ψ) E ,

These expressions show that when P > 0, e = P and w = W . Similarly, when P < 0, e = E and w = P . That is, the cell-face values always pick up the upstream values of irrespective of the magnitude of P, hence, giving rise to the name of this interpolation scheme as the upwind difference scheme.1 Substituting these equations in Equation 3.10, we can show that Equation 3.14 again holds with 1 (|Pc | − Pc ), 2 1 AW = 1 + (|Pc | + Pc ), 2 AE = 1 +

(3.23) (3.24)

and A P = AE + AW . Equations 3.23 and 3.24 show that, irrespective of the magnitude or sign of P (or Pc ), AE and AW can never become negative. Also, A P remains dominant. Therefore, obstacles to convergence are removed for all values of Pc . This was not the case with CDS.2 1

2

Physically, the UDS can be understood as follows: Imagine standing at the middle of a long corridor at one end of which there is an icebox (at Tice ) and at the other end a ﬁrebox (at Tﬁre ). Then, neglecting radiation, the temperature experienced by you will be Tm = 0.5 (Tice + Tﬁre ) when the air in the corridor is stagnant and heat transfer is only by conduction. Now, imagine that there is air-ﬂow over the ﬁrebox ﬂowing through the corridor in the direction of the icebox. You will now experience Tm that weighs more in favour of Tﬁre than Tice . The reverse would be the case if the airﬂow was from the icebox end and towards the ﬁrebox end. The UDS takes an extreme view of both situations and sets Tm = Tﬁre in the ﬁrst case and Tm = Tice in the second case. Incidentally, with respect to Equation 3.20, we may generalise AE and AW coefﬁcients for both CDS and UDS in terms of ψ as AE = 1 − (1 − ψ) Pc , ψ = 0.5 (CDS),

In general, E and W may have any value. However, to simplify matters, we take the case of E = 1 and W = 0 and study the behaviour of P with Pc . Values computed from Equations 3.28–3.30 are tabulated in Table 3.1 and plotted in Figure 3.2. Two points are worth noting: 1. The CDS goes out of bounds for |Pc | > 2. For this range, the CDS is also not convergent as was noted earlier. It is a reasonable approximation to the exact

61

3.6 NUMERICAL FALSE DIFFUSION

CDS

EXACT

ΦP

1.0

UDS

0.0

−10

−5

0

5

10

Pc Figure 3.2. Comparison of CDS and UDS with exact solution.

solution when |Pc | → 0. In spite of this, mathematically speaking, CDS is taken as the best reference case to compare all other differencing approximations because the CDS representation evaluates both convective and conductive contributions with the same approximation. That is, the spatial variation of is assumed to be linear between adjacent grid nodes. 2. Although UDS is convergent at all values of Pc and nearly approximates the exact solution for |Pc | → ∞, it is not a very good approximation to the exact solution at moderate values of |Pc |. Also, UDS deviates from CDS for |Pc | < 2.

To compare CDS and UDS formulas, we modify Equation 3.32 to read as3 | Pc | Pc [ E − 2 P + W ] = 0 (UDS). (3.33) (E − W ) − 1 + 2 2 Comparison of Equation 3.33 with the CDS formula (3.31) raises several interesting issues: 1. Recall that the ﬁrst term in Equation 3.31 corresponds to the convective contribution whereas the second term corresponds to the conductive contribution. Further, since P is constant, we may view Equation 3.6 as ∂ ∂ 2 = 0. (3.34) − ∂X ∂ X2 If we discretise both the ﬁrst and the second derivative through a Taylor series expansion, it will be found that the CDS formula (3.31) represents both the derivatives to second-order accuracy. 2. Equation 3.32, in contrast, suggests that UDS represents the convective contribution to only ﬁrst-order accuracy, whereas the conductive contribution is still represented to second-order accuracy. Mathematically speaking, therefore, the estimate of the convective contribution will have an error of O (x). 3. In Equation 3.33, this error is reﬂected in the augmented conduction coefﬁcient because the convective term is now written to second-order accuracy as in the CDS formula. Mathematically speaking, therefore, it may be argued that the second-order-accurate UDS formula represents discretisation with augmented or false conductivity kfalse = ρ C p | u | x/2. In fact, it can be shown that Equation 3.33 is nothing but a CDS representation of ρ C p | u | x ∂ T ∂ ρ Cp u T − k + = 0. (3.35) ∂x 2 ∂x P

Thus, if the last comment is given credence, then clearly the UDS represents distortion of reality and is therefore a poor choice. Yet, the closeness of the UDS result to the exact solution shown in Figure 3.2 suggests that the so-called false conductivity is indeed needed. In fact, it is this false conductivity that reduces the value of the effective Peclet number and thereby ensures convergence of the UDS formula for all Peclet numbers. Patankar [49] has therefore argued that to form a proper view of false diffusion, it is necessary to compare the UDS with the exact solution rather than with the second-order-accurate CDS formula. This is yet another example where the TSE method is found wanting. Of course, this is not to suggest that the UDS formula is the best representation of reality. The properties embodied in the UDS formula suggest that one can derive other variants that will sense not only the sign of Pc but also its magnitude. Further 3

With these two expressions for ψ, it is now possible to construct AE and AW coefﬁcients (see Equation 3.25) for the HDS and power-law schemes. The resulting implications for P are tabulated in Table 3.1. Notice that for |Pc | ≤ 2, the HDS results match exactly with those of the CDS. For |Pc | > 2, the HDS assumes that |Pc | = ∞ or, in other words, conduction ﬂux is set to zero. This may be considered too drastic but it nonetheless ensures positivity of coefﬁcients for all values of Pc . The results from the power-law scheme, of course, do mimic the exact solution quite well. 3.8 Total Variation Diminishing Scheme The difference schemes discussed so far are found to be adequate when the spatial variation of is expected to be smooth and continuous. Often, however, the variation is almost discontinuous (as across a shock). To capture such variation, extremely small values of x become necessary, resulting in uneconomic computations. However, if coarse grids are employed then UDS, HDS, or power-law schemes produce smeared shock predictions. Total variation diminishing (TVD) schemes enable sharper shock predictions on coarse grids. In these schemes, in addition to magnitude and sign of Pc , the nature of the variation of in the neighbourhood of node P is also sensed. Thus, instead of Equations 3.21 and 3.22, we write P e =

with sufﬁx D referring to downstream, U to upstream, and UU to upstream of U. The f e+ , for example, is thus a function of (P − W )/(E − W ) and f e− is a function of (E − EE )/(P − EE ). Here, EE refers to the node east of node E and WW to the node west of node W. It is interesting to note that if f equals its associated ξ then Equations 3.38 and 3.39 readily retrieve the UDS formula. Therefore, writing f (ξ ) = ξ + f c (ξ )

Thus, for positive Pc , whereas UDS will always return e = P , the TVD scheme returns different values of e depending on the value of ξ (or shape of the local proﬁle). In fact, as the last expression shows, even a downwind value may be returned. The TVD schemes thus typically switch among upwind, central-like, and downwind (DDS) schemes. 3.9 Stability of the Unsteady Equation We now consider the unsteady conduction–convection equation ρ Cp

The solution represents a wave that moves P τ to the right in each time interval τ . The amplitude of the wave is T0 exp (−τ ). Thus, over a time interval τ , the amplitude ratio (or the amplitude decay factor) AR is given by AR =

T0 exp [−(τ + τ )] = exp (−τ ). T0 exp (−τ )

(3.49)

66

1D CONDUCTION–CONVECTION

To understand the relevance of A R, let TP be the temperature at X P after the ﬁrst time step. Then, from Equation 3.48, it follows that TP = exp (−τ ) = A R, T0 sin (X P + )

(3.50)

where the wave propagation speed is given by u t . (3.51) λ Finally, we note that the arbitrary length scale λ is nothing but the wavelength and the propagation speed depends on λ. This dependence on λ is called dispersion. exact = −P τ = −

14. It is desired to investigate stability of the equation in Exercise 13 for different values of weighting factor ψ (see Equation 2.6) so that the equation will read as ∂2T ∂2T o ∂T =ψ + (1 − ψ) . ∂τ ∂ X2 ∂ X2 (a) Obtain a discretised analogue of this equation and substitute the exact solution for temperatures at P, E, and W. Set X P = π/2 and show that exp (−τ ) =

1 − 4 A (1 − ψ) sin2 (X/2) , 1 + 4 A ψ sin2 (X/2)

where A = AE = AW = τ/(X )2 . (b) Hence, show that A R for any X P is given by AR =

4.1 Governing Equations It will be fair to say that the early developments in CFD and heat and mass transfer began with calculation of boundary layers. The term boundary layer is applied to long and thin ﬂows: long in the streamwise direction and thin in the transverse direction. The term applies equally to ﬂows attached to a solid boundary (wall boundary layers) as well as to jets or wakes ( free-shear layers). Calculation of boundary layer phenomena received a considerable boost following the development of a robust numerical procedure by Patankar and Spalding [50]. This made phenomena that were either impossible or too cumbersome to calculate by means of earlier methods (similarity, nonsimilarity, and integral) amenable to fast and economic computation. The procedure, for example, permitted use of variable properties, allowed for completely arbitrary variations of boundary conditions in the streamwise direction, and led to several new explorations of diffusion and source laws. Thus, calculation of free or forced ﬂames or wall ﬁres could be carried out by considering the detailed chemistry of chemical reactions. Similarly, calculation of turbulent ﬂows (and development of turbulence models, in particular) could be brought to a substantial level of maturity through newer explorations of diffusion and source laws governing transport of variables that characterise turbulence. Computer programs based on the Patankar–Spalding procedure are available in [50, 77, 10]. There are also other methods, for example, the Keller–Box method described in [35]. The emphasis in this chapter is on describing the Patankar–Spalding procedure using simple notation. The procedure generalises all two-dimensional boundary layer phenomena by introducing the coordinate system shown in Figure 4.1. This system permits consideration of 1. axisymmetric as well as plane ﬂows, 2. wall boundary layers as well as free-shear layers, and 3. internal (or ducted) as well as external boundary layers. 71

where stands for u (streamwise velocity), w (azimuthal velocity), T (temperature), h (speciﬁc enthalpy), and ωk (mass fraction). The meanings of and S are given in Table 4.1. The source terms of the u and w equations assume axisymmetry and ∂ p/∂r → 0 so that ∂ p/∂ x = dp/d x. In writing the energy equation in terms of T , we assume the speciﬁc heat to be constant. Note that in the presence of mass transfer, ρ and represent mixture properties and, in turbulent ﬂows, the sufﬁx eff (for effective) must be attached to . Later, we shall ﬁnd that may also represent further scalar variables such as turbulent kinetic energy k and its dissipation rate . Independent variables x and y are shown in Figure 4.1 and are applicable to both axisymmetric and plane ﬂows. In the latter, r = 1. It will be shown later that r , y, and angle α(x) are connected by an algebraic relation. Table 4.1: Generalized representation of boundary layer equation. Φ

ΓΦ

SΦ

1 u w ωk T h

0 µ µ ρ Dk k/Cp k/Cp

0 −dp/d x + Bx 0 Rk Q /Cp Q

73

4.2 ADAPTIVE GRID

Wasted Nodes

ymax

E Boundary ω

y

x

x Too Fine

I Boundary

Too Coarse

(a)

(b)

Figure 4.2. Notion of adaptive grid.

Equation 4.1 is to be solved with appropriate boundary conditions at I (inner) and E (external) boundaries and an initial condition at x = x0 (say) for each . Although the I boundary with radius r I (x) is shown as a wall boundary, it may well be an axis of symmetry with r I (x) = 0. Similarly, although the E boundary is shown as a free boundary, it may be a wall boundary. Thus, the speciﬁcation of the three types of ﬂows mentioned here can be sensed through appropriate designation of I and E boundaries as free, wall, or symmetry boundaries. Finally, we note that Equation 4.1 is parabolic. This implies that the values of at a given x are inﬂuenced only by – values upstream of x; values downstream of x have no inﬂuence. Our task now is to discretise Equation 4.1.

4.2 Adaptive Grid It is well known from boundary layer theory that, in general, boundary layer thicknesses of velocity and other scalar variables can grow or shrink in an arbitrary manner in the streamwise direction. Also, for a given domain length L (say) in the x direction, the maximum values of thicknesses for different s are a priori not known. This makes the choice of ymax [see Figure 4.2(a)] difﬁcult if the (x, y) coordinate system is used. Further, in this system, for a given number of nodes in the y direction, the boundary layer region of interest may be occupied by too few grid nodes, resulting in wasted nodes. Similarly, in some other regions, there may be more nodes than necessary for accuracy. What one would ideally like is a grid that expands and contracts with the changes in boundary layer thickness preserving the same number of grid nodes in the transverse direction at each axial location. Such a grid (called an adaptive grid) is shown in Figure 4.2(b) with coordinates x and ω, where ω is deﬁned as ω=

where C is a constant. The y coordinate is thus related to ψ and the latter, in turn, is related to ω via Equation 4.2. Sufﬁxes I and E, of course, refer to inner and external boundaries. 4.3 Transformation to (x, ω) Coordinates Our task now is to transform Equation 4.1 from the (x, y) coordinate system to the (x, ω) coordinate syatem. To do this, we shall follow the sequence (x, y) → (x, ψ) → (x, ω). Making use of the mass conservation equation ( = 1), we can write Equation 4.1 in nonconservative form as ∂ 1 ∂ ∂ ∂ +v = r

This is the required boundary layer equation in the (x, ω) coordinate system written in conservative form. It will be useful at this stage to interpret the terms in Equation 4.22. Thus, from Equations 4.12 and 4.5, it is easy to show that ψEI

76

2D BOUNDARY LAYERS

represents the total streamwise mass ﬂow rate through the boundary layer at any x. Similarly, making use of the deﬁnitions of a, b, and c and using Equation 4.16, we can show that

∂ ∂ ψEI (a + b ω) − c = r m˙ − r

, (4.23) ∂ω ∂y where ψEI ∂ ∂ = ∂ω ρ r u ∂y

(4.24)

and r m˙ = r ρ v = (1 − ω) rI m˙ I + ω rE m˙ E with

m˙ E = (ρ v)E ,

m˙ I = (ρ v)I .

(4.25)

Thus the total transverse mass ﬂux m˙ at any y is a weighted sum of mass ﬂuxes at the inner (m˙ I ) and external (m˙ E ) boundaries in the positive y direction. Equation 4.23 therefore represents the total convective–diffusive ﬂux in the y direction. Then by substituting Equation 4.23, Equation 4.22 can be written as ∂ ∂ ψEI S ∂ [ψEI ] + r m˙ − r

= . (4.26) ∂x ∂ω ∂y ρu 4.4 Discretisation Figure 4.3 shows the (x, ω) grid at streamwise location x. Sufﬁx u refers to upstream and d refers to downstream. Note that nodes N, P, and S are not equidistant because ω, in general, will not be uniform. This will become apparent in a later section. To derive the discretised version of Equation 4.26, each term in the equation will be integrated over the control volume. Thus, assuming source term S to be constant over the control volume, we have xd n xd n xd n ψEI S S S r d x dy d x dω = d x dψ = ρu s s ρu s xu xu xu = S rP x y = S V,

Finally, the convection–diffusion term in the transverse direction integrates to

xd xu

n s

∂ ∂ ∂ x r m˙ − r

d x dω = r m˙ − r

∂ω ∂y ∂y n

∂ − r m˙ − r

x. ∂y s

(4.30)

Equation 4.30 implies that the net ﬂux at the cell faces is uniform between xu and xd . Now, assuming linear variation of between adjacent nodes gives

d N − dP ∂ = , ∂ y n yn

d P − dS ∂ = , ∂ y s ys

(4.31)

where yn = yN − yP and ys = yP − yS . Note that the s are evaluated at xd rather than midway between xu and xd . However, assuming that x is small, this liberty is permissible. The next task is to evaluate convective ﬂuxes at the cell faces. To do this, we may use any of the schemes introduced in the previous chapter but, following Patankar [52], we use the exponential scheme that follows from the exact solution

P Thus, substituting Equations 4.33–4.36 in Equation 4.30 and combining the latter with Equations 4.27 and 4.29, we can show that the discretised version of Equation 4.26 takes the following form: A P dP = AN dN + AS dS + AU uP + S V,

for j = 2, 3, . . . , J N − 1. Note that superscript d is now dropped for convenience. 4.5 Determination of ω, y, and r Equation 4.43 represents a set of algebraic equations at a streamwise location xd . These equations can be solved by TDMA when values of uj at xu are known along with the two boundary conditions at xd (i.e., at j = 1 and j = J N ). Thus, starting with x = x0 (say), one can execute a marching procedure taking step x. This situation is very much like the unsteady conduction problem in which the marching procedure is executed with time step t. Thus, at x = x0 , the u j ∼ y j relationship is assumed to have been prescribed either from experimental data or from an analytical solution. One can use this prescription to set ω j once and for all. Let ω j = ωP ,

It is now a simple matter to evaluate ω j and ωc, j using deﬁnition (4.2). Thus, ω j at y j represents the ratio of streamwise mass ﬂow rate from y1 = yI to y j to the total mass ﬂow rate from yI to yE at x = x0 . It is now assumed that this ratio remains intact at all values of x and thus the ω j distribution does not change throughout the domain in the x direction. Note, however, that the physical distance y (and therefore r) must go on changing at different values of x as the boundary layer grows or shrinks. We thus seek the y j ∼ ω j relationship applicable to every x.

80

2D BOUNDARY LAYERS

Plane Flow From Equations 4.4 and 4.2, it can be shown that ω dω y = ψEI = I (say). ρu 0

(4.48)

Thus, knowing the initially set values of ω j and ωc, j , y j and yc, j can be estimated. Note that ψEI and ρ u will change with x. Therefore, y will also change with x. Axisymmetric Flow In this case, from Equation 4.45, it follows that

ψEI d ω = (r I + y cos α) dy ρu

(4.49)

and, therefore, from Equation 4.48 I = rI y + cos α

y2 . 2

(4.50)

The solution to this quadratic equation suitable for computer implementation is y=

2I

2 0.5 , rI + rI + 2 I cos α

(4.51)

where I is given by Equation 4.48. Now, knowing y j and yc, j in this manner, r j and rc, j can be evaluated using Equation 4.45.

4.6 Boundary Conditions At the E and I boundaries, three types of boundary conditions are possible: symmetry, wall, or free stream. We discuss them in turn.

4.6.1 Symmetry There can be no mass ﬂux across the symmetry plane. Also, ∂/∂n|b = 0, where sufﬁx b denotes the E or I boundary node. This implies that b = nb

and

m˙ b = 0,

(4.52)

where sufﬁx nb stands for near-boundary node. A further consequence of the m˙ b = 0 condition is that ∂ψb /∂ x = 0 or ψb = constant. The boundary condition can be effected by setting AS2 = 0 at the I boundary or AN J N −1 = 0 at the E boundary.

81

4.6 BOUNDARY CONDITIONS

4.6.2 Wall The term wall signiﬁes a solid boundary. However, it must be remembered that when a gas ﬂows over a liquid surface, the gas–liquid interface too will act like a wall. For different s, the wall boundary conditions are also different. We consider them in turn. Velocity Variables = u or w For these variables,

u b = u wall ,

wb = wwall .

(4.53)

Thus, if the surface is rotating about the axis of symmetry (see Figure 4.1) with angular velocity , then the surface ﬂuid velocity will be wwall = rI . Similarly, the streamwise velocity will always be zero unless the surface itself is moving with velocity u wall . Equation 4.53, therefore, signiﬁes the no-slip condition. In some circumstances, a ﬂuid may be injected (by blowing) into the boundary layer or the boundary layer ﬂuid may be withdrawn (by suction) through the wall. Alternatively, in case of evaporation or surface burning, mass will be transferred into the boundary layer. In all such cases m˙ b is known or knowable and the consequence is ψb (x) = ψb (x − x) − rb m˙ b x.

(4.54)

Thermal Variables = T or h For these variables, typically two types of conditions are speciﬁed. In the ﬁrst, the value of the variable itself is speciﬁed. Thus,

. (4.56) ∂ y y=0 C p ∂ y y=0 ∂ y y=0 The ﬂux boundary condition is effected by adding qb x to the source term of Equation 4.43 for j = 2 and, further, by setting AS2 = 0, the values of Tb or h b can be extracted in the usual manner. A similar procedure is adopted if qb is speciﬁed at the E boundary. In a chemically reacting boundary layer, the mass transfer ﬂux at the wall m˙ b is given by ∂ωk ∂T −1 m˙ b = (h b − h T ) , (4.57) h k + km ρm D k ∂y ∂ y y=0 k where h T is the enthalpy of the mixture deep inside the I boundary. If the Lewis number is taken to be unity (i.e., Pr = Sc) or a simple chemical reaction (SCR)

where ωk,T refers to the mass fraction deep inside the I boundary. The sufﬁx T, thus, represents the transferred substance state and ωk,T must be known. Equation 4.59 is again a ﬂux condition, therefore, it can be treated in the manner of the qb condition just described. Again, from the converged solution, ωk,b can be extracted. When heterogeneous chemical reactions occur at the wall, m˙ b is typically given by the Arrhenius relationship, which yields m˙ b = f (ωk,b , Tb ).

(4.60)

The exact implementation of the boundary condition for a heterogeneous reaction requires modiﬁcation of Equation 4.59. This is explained later through an example of carbon burning (see Equation 4.129). In problems involving evaporation or condensation, the value of ωk,b itself can be speciﬁed from the equilibrium relation (or saturation condition). ωk,b = f (Tb ).

(4.61)

Thus, in mass transfer problems with or without surface chemical reaction, m˙ b can be known and this knowledge can be used to evaluate ψb from Equation 4.54. It is important to remember, however, that the most general problem of mass transfer is usually quite complex and, therefore, several manipulations are typically introduced to simplify the boundary condition treatment [33, 38]. 4.6.3 Free Stream The free-stream boundary condition has relevance only when external1 boundary layers are considered. The free stream is really a ﬁctitious boundary and is identiﬁed 1

In internal ﬂows, only wall or symmetry conditions are relevant because in these ﬂows the ﬂow width is a priori known. Thus, for developing ﬂow between two parallel plates a distance b apart, for example, the ﬂow width b remains constant with x. However, in 2D plane diffusers or nozzles, b may vary with x but still be known a priori.

83

4.6 BOUNDARY CONDITIONS

with the notion that the variation in in the transverse direction asymptotically approaches a value ∞ (say) there. Thus, the ﬁctitious notion of a boundary layer thickness is associated with − I = A, (4.62) ∞ − I where sufﬁx I refers to the inner boundary (wall or symmetry) and A is typically taken to be 0.99 by convention. Note, however, that this boundary layer thickness will be different for different meanings of and the magnitude of thickness typically depends on the Prandtl number2 Pr deﬁned as ν . (4.63) Pr ≡

The Prandtl number is a property of the ﬂuid. In fact, in Table 4.1, we may replace k/Cp by µ/PrT and ρ Dk by µ/Prωk . There is one further notion associated with the free stream. If we assume the E boundary to be the free boundary (see Figure 4.1), the ﬂow region above the boundary can be taken to be a region in which there is no transverse convection or diffusion and b = ∞ (x),

(4.64)

where ∞ (x) is speciﬁed. However, the physical location where this boundary condition is to be applied is not a priori known because of the asymptotic nature of variation of in the vicinity of this boundary. To circumvent this problem, Patankar and Spalding [50] relied on estimating the entrainment rate (−m˙ E ) into the boundary layer that occurs from the ﬂuid above the E-boundary. Thus, as previously mentioned, since there is no net ﬂux of in the transverse direction, from Equation 4.17, it follows that ∂ ∂ ∂ = . (4.65) c (a + b ω)E ∂ω E ∂ω ∂ω E However, at the E boundary, ω = 1. Therefore, −1 (a + b ω)E = a + b = − ψEI

The term Prandtl number applies to variables T and h. When = ωk , the appropriate dimensionless number is called the Schmidt number (Sc). For velocity variables, of course, Pr = 1. We thus use Pr generically to cover all s.

With this estimate, it is now possible to evaluate coefﬁcients in Equation 4.43. This is because, when the E boundary is a free boundary, the I boundary can only be a wall or a symmetry boundary for which ψI (x) is already known. Equation 4.71 is of course an approximate formula for m˙ E . To derive an exact formula, we note that will be different for different s and, as already noted, the respective boundary layer thicknesses will also be different. Our interest lies in

85

4.7 SOURCE TERMS

selecting that for which the thickness is largest. Usually, the largest thickness will correspond to the largest , and for this selected , we evaluate R=

where, from computational experience, n 0.1 is found to be a convenient value in most cases. Thus, when Equation 4.43 has converged, ψE , as evaluated from Equation 4.72, will provide a correct estimate of total mass ﬂow rate ψEI = ψE − ψI through the boundary layer at the given x. Once this mass ﬂow rate is known, the y dimension and hence the largest boundary layer thickness among all s can be estimated. 4.7 Source Terms 4.7.1 Pressure Gradient In external boundary layers, the pressure gradient is speciﬁed or indirectly evaluated from d U∞ dp = − ρ U∞ , dx dx

(4.75)

where U∞ (x) is speciﬁed. In internal ﬂows, however, a special procedure must be adopted to specify the pressure gradient. The procedure relies on satisfying the overall mass ﬂow rate balance at every streamwise location x. Thus, in a general duct, let Ad (x) represent the duct area between the axis of symmetry (I boundary) and the wall (E boundary). Then E 1 dω Ad = r dy = ψEI . (4.76) I 0 ρu Therefore, ω j Ad = C (constant) = . ψEI ρj u j

(4.77)

The task now is to replace u j in terms of the pressure gradient. To do this, Patankar [52] writes the discretised version of the momentum equation as A P j u j = AN j u j+1 + AS j u j−1 + D j − V j px ,

u ∂ p/∂ x represents the pressure–work effect in steady ﬂow, and Q˙ md = ∂/∂ y {( all k ρ Dk ∂ωk /∂ y) h k } represents the contribution of species diffusion mass transfer having speciﬁc enthalpy h k . If h k equals mixture enthalpy h then Q˙ md = 0. When no chemical reaction is present, Rk = 0. However, for a reacting boundary layer, Rk will be ﬁnite for each species because each may be generated via some reactions and destroyed via some other reactions among the postulated chemical reactions. Very often, for gaseous fuels and for highly volatile solid/liquid fuels, an SCR can be assumed [73]. The SCR is speciﬁed as 1 kg of fuel + Rst kg of oxidant → (1 + Rst ) kg of product,

(4.86)

where Rst is the stoichiometric ratio for the fuel under consideration. Thus, there are three species and one must specify Rfu , Rox , and Rpr . However, in an SCR, Rfu = Rox /Rst = −Rpr /(1 + Rst ) so that no net mass is generated or destroyed as a result of chemical reaction. This enables construction of a conserved scalar variable = ωfu − ωox /Rst = ωfu + ωpr /(1 + Rst ) when mass diffusivities of all species are taken equal. Thus, one may now solve only for ωfu and with R = 0 instead of three variables. Further, Q˙ cr = |Rfu |Hc where Hc is the heat of combustion of the fuel. The value of Rfu is obtained from a reaction rate law E m n Rfu = Rfu,kin = − A exp − ωfu ωox , (4.87) Ru T where, preexponential constant A and constants E, m, and n are speciﬁed for the fuel [82] and Ru is the universal gas constant. If turbulent reacting ﬂow is considered then the effective Rfu is given by a variant [44] of the eddy-breakup model due to Spalding [74],

ωprod ωox , Rfu,kin , (4.88) , A Rfu = −ρm min A ωfu , A e Rst (1 + Rst ) where A = 4 and A = 2. The postulated arguments in favour of this expression are beyond the scope of this book. 4.8 Treatment of Turbulent Flows In turbulent ﬂows, in Table 4.1 will assume an effective value. Thus, following Equation 4.63, we have

,eff =

µ µt + , Pr Prt,

(4.89)

where sufﬁx t denotes the turbulent contribution. The task now is to represent µt and Prt, via modelled expressions. This exercise, called turbulence modelling, implies validity of the Boussinesq approximation for turbulent viscosity. Although there

88

2D BOUNDARY LAYERS

are many variants, all turbulence models of this type stem from a dimensionally correct representation µt ∝ ρ l v ,

(4.90)

where v is the representative velocity ﬂuctuation scale in the transverse direction y and l is a representative length scale. Two turbulence models used extensively for boundary layer calculations are described in the following. 4.8.1 Mixing Length Model Since v is responsible for transverse momentum transfer, it may be written in dimensionally correct form as ∂u (4.91) v = lm ∂y so that µt =

ρ lm2

∂u , ∂y

(4.92)

where lm is called Prandtl’s mixing length. Now, because the velocity gradient can be evaluated from the solution of the momentum equation, lm must be prescribed to complete evaluation of µt . Kays and Crawford [33], after extensive investigations of a variety of wall-boundary-layer ﬂows have prescribed the following formulas: ⎧ y y+ ⎪ ⎪ < 0.2, (4.93) , for ⎨ κ y 1 − exp − + A δ lm = y ⎪ ⎪ ⎩ 0.085 δ for ≥ 0.2, (4.94) δ where y is the normal distance from the wall, δ is the velocity-boundary-layer thickness and κ = 0.41. Further, y uτ ∂u τw (4.95) , uτ = , τw = µ |w . y+ = ν ρ ∂y Finally, the value of A+ is sensitised to effects of suction or blowing and local pressure gradient in a generalised manner as −1

In this equation, xts and xte denote the start and the end of transition, respectively. When x = xte , ϒ = 1 and a fully turbulent state is reached. For x = xts , ϒ = 0 and the ﬂow is laminar. There are several empirical relations proposed in the literature for estimating xts and xte ; here, two will be given. Abu-Ghannam and Shaw Model In the Abu-Ghannam and Shaw [1] model

where Rex = U∞ x / ν. 4.8.2 e– Model In this model, the turbulent viscosity is determined from solution of two partial differential equations for scalar quantities e (turbulent kinetic energy) and

90

2D BOUNDARY LAYERS

(turbulent energy dissipation3 ). Thus, e2 . (4.104) Fortunately, the modelled equations for e and can also be cast in the form of Equation 4.1. Thus, we have µt = C µ ρ

Turbulent Kinetic Energy Equation

= e,

e = µ +

µt , Prt,e

Se = G − ρ ∗

(4.105)

and Energy Dissipation Rate Equation = ∗,

∗ = µ +

µt , Prt, ∗

∗ S = [C1 G − C2 ρ ∗ ] + 2 ν µt e ∗

where

∂ 2u ∂ y2

2 ,

√ 2 ∂ e = − 2ν , ∂y ∗

and

G = µt

∂u ∂y

(4.106)

(4.107)

2 .

(4.108)

In these equations, Launder and Spalding [40] specify Prt,e = 1, Prt, ∗ = 1.3, C1 = 1.44, −3.4 Cµ = 0.09 exp , (4.109) (1 + Ret /50)2 and C2 = 1.92 1 − 0.3 exp −Ret2 , (4.110) where the turbulence Reynolds number Ret = µt /µ. The e− model described here, called the Low Reynolds number (LRE) turbulence model, permits application of boundary conditions e = ∗ = 0 at the wall. Further, the model is equally applicable to prediction of laminar-to-turbulent transition and one need not invoke the intermittency factor required in the mixing length model. In fact, Jones and Launder [30] have successfully applied the model even to the case where a turbulent boundary layer reverts to a laminar boundary layer becuase of strong free-stream acceleration. Several changes to the e– model have been proposed by different authors. The more recent among these, for example, are listed in [9]. 3

Here ρ is the turbulent counterpart of the µ v term introduced in Equation 4.85.

where the E boundary is free and the I boundary is the symmetry axis. The value of constant β depends on the type of ﬂow. According to Spalding [78] β = 0.09 for a plane jet, β = 0.075 for a round jet, and β = 0.16 for a plane wake. In general, however, β must be regarded as an arbitrary constant whose value is determined from experiment. When the e– model is used, Equations 4.105 and 4.106 are directly applicable. However, because of the absence of a wall, there will be no region where Ret → 0. √ Also, the wall-correction terms ∂ e/∂ y and 2 ν µt (∂ 2 u/∂ y 2 )2 vanish. As such, the model will reduce to µt , Se = G − ρ , (4.112) = e, e = µ + Prt,e = , = µ +

6. Reset y j , r j using the u j just calculated. Also reset ψb for a free boundary (b = E or I). 7. Go to step 5 and repeat until convergence of all relevant s is reached. 8. Calculate integral quantities δ1 , δ2 , Cfx , Stx , etc. 9. Set xu = xd and uP = P and return to step 3 to execute a new step. 10. Continue untill the domain of interest in the x direction is covered. 4.9.2 Initial Conditions For internal ﬂows, the ﬂow width at x = x0 = 0 is known and it is easy to specify all φ(y j ). For external wall boundary layers, the initial proﬁles by necessity are to be speciﬁed at x = x0 to avoid singularity at x = 0 where the boundary layer thickness is zero. A suitable choice of x0 can be made assuming Rex0 = 103 (say). If and when experimentally measured starting proﬁles are not available, one may choose the generalised polynomial velocity proﬁle used in the integral method of laminar boundary layer analysis: λ u (4.114) = 2 η − 2 η3 + η4 + η − 3 η2 + 3 η3 + η4 , u 6 ∞ x0

where η = y / δ and

δ 2 d U∞ . λ= ν d x x0

(4.115)

With reference to Figure 4.1, the region 0 < x < x0 will typically connote a . If one is dealing stagnation ﬂow region for which λ = 7.052 and δ 2.65 x0 Rex−0.5 0 [65]. with a ﬂat surface, however, one may set λ = 0 and evaluate δ 5.83 x0 Rex−0.5 0 Thus, one is now free to choose the y j distribution and evaluate u j from equation 4.114. With these speciﬁcations, calculations can continue from the laminar region through the transition region and ending in the turbulent region. If, however, the ﬂow was turbulent from the start of the boundary layer, it is advisable to use an experimentally generated velocity proﬁle. Alternatively, one may use y 1/7 u = , (4.116) u δ ∞ x0

For free-shear ﬂows, again x0 must be chosen to avoid the elliptic ﬂow region very close to where a jet or a wake originates. For advice on the choice of x0 and the u(y) proﬁle, the reader is referred to Schlichting [65]. 4.9.3 Choice of Step Size and Iterations Iterative calculation is required to deal with nonlinearities arising out of implicitness. In the present procedure, nonlinearities arise from four sources: 1. They can arise from dependence of coefﬁcients and sources in Equation 4.43 on other scalar s. Thus, the source term Rk in the equation for ωk may depend on T , and ρ, and may depend on ωk and T . 2. At a downstream station, y j are not a priori known and therefore the values yn , ys required in several evaluations are not known. These y j s can be evaluated only after the dj proﬁle is established. 3. In external boundary layers and free-shear ﬂows, the ﬂow width at a downstream station is not known and we wish to select the largest width among all s. This is done via Equation 4.74. 4. In internal ﬂows, the pressure gradient is not known at a downstream station. By choosing a small enough x, one can make the procedure completely noniterative. This can be achieved by evaluating AN , AS, and S in terms of upstream values. We, however, prefer partial linearization. Thus, whereas the different s required in the evaluation of AN , AS, and S are taken from the upstream station, y j are established through an iterative solution of equations for all relevant s. With this choice, experience shows that we may choose x 0.25 δ2u .

(4.118)

This choice ensures both economy and accuracy. However, situations may arise when larger step sizes are also permissible. 4.10 Applications Flat Plate Boundary Layer Figure 4.5 shows computed results of friction coefﬁcient C f x and Stanton number Stx for a ﬂat plate boundary layer. Computations were begun with a laminar velocity (with λ = 0 in Equation 4.114) and temperature proﬁles prescribed at Rex0 = 103 with J N = 102. Such a large number of (nonuniform) grid points are necessary to resolve the proﬁles in the vicinity of the wall and in the turbulent range. In the mixing length model, transition is sensed by the Cebeci model (Equations 4.102 and 4.103). In the LRE model, the transition is sensed automatically. It is seen that the mixing length model predicts transition at a higher Rex than the LRE model.

94

2D BOUNDARY LAYERS

1E-2

1E-2 −0.2 Cfx = 0.0574 Rex

−0.5 Cfx = 0.664 Rex

−0.2 Stx = 0.0331 Rex

Stx

Cfx

−0.5 Stx = 0.42 Rex

LOW Re MODEL

1E-3

1E-3

LOW Re MODEL

MIXING LENGTH MODEL

Pr = 0.7

MIXING LENGTH MODEL

Rex

Rex

1E-4

1E-4 1E5

1E6

1E7

1E5

1E6

1E7

Figure 4.5. Flat plate boundary layer.

The predicted values of C f x and Stx are compared with well-known correlations derived from integral analysis. The agreements are satisfactory. Figure 4.6 shows the velocity and temperature proﬁles in wall coordinates. The predictions of the mixing length model [Figure 4.6(a)] nearly agree with the two-layer prescriptions of the law of the wall [33] except in the very outer layers. The predictions from the LRE model [Figure 4.6(b)] are somewhat higher than those of the law of the wall. The dimensionless temperature is deﬁned as T + = (T − Tw ) ρ C p u τ / qw . Burning of Carbon We consider burning of carbon in a laminar plane stagnation ﬂow of dry air so that the free-stream velocity varies as U∞ = C x. The surface is held at constant wall temperature Tw . The objective is to predict the burning rate of carbon as a function of Tw . The postulated chemical reactions at the surface are [82] as follows:

where ωH2 O is treated as a parameter of the problem. The steam mass fraction is, of course, small enough so that it does not take part in other possible reactions. These rate laws are taken from Smoot and Pratt [68] and Turns [82]. The problem thus requires solution of equations for = u, ωO2 , ωCO2 , ωCO , and enthalpy h. We deﬁne h = C p (T − Tref ) so that the source terms for each of the variables are Su = ρ C 2 x V, SωO2 = − SωCO2 =

where TT = Tw and the carbon speciﬁc heat is C pc = 1,300 J/kg-K. In the free stream at the E boundary, we specify U∞ = C x, T∞ = 298 K, ωO2 ,∞ = 0.232, ωCO,∞ = 0.0, and ωCO2 ,∞ = 0.0. The reference temperature is taken as Tref = T∞ so that h ∞ = 0. To start the computations, it is assumed that for the starting length x0 (Rex0 = 1,000), the surface is inert. So, the inlet proﬁles for mass fractions and enthalpy are easily speciﬁed as uniform, corresponding to the free-stream state. The velocity proﬁle is of course derived from Equation 4.114 with λ and δ corresponding to the stagnation ﬂow condition. Computations are now continued till Rex = 105 so that the combustion is well established and the burn rate is constant with x. The density and viscosity are assumed to vary over the width of the boundary layer according to p Mmix , Ru T T 1.5 303 + 110 −6 µ = 18.6 × 10 303 T + 110 ρ=

(4.135) N-s/m2 ,

(4.136)

where p = 105 N/m2 and Ru = 8,314 J/kmol-K. The molecular weight of the mixture is evaluated from ωCO2 ωCO ωN2 ωH2 O −1 ωO2 + + + + , (4.137) Mmix = M O2 MCO2 MCO MN2 MH2 O where ωN2 = 1 − ωO2 − ωCO2 − ωCO − ωH2 O . The gas speciﬁc heat is, however, assumed constant and is calculated from Cp = 919.2 + 0.2 Tm J/kg-K and Tm = 0.5 (Tw + T∞ ). Computations are carried out for 800 < Tw < 2,000 K and Pr = 0.72. The value of the Schmidt number is uncertain in this highly variable property reacting ﬂow. Following Kuo [38], we take the Schmidt number for all species as 0.51. To facilitate evaluation of RCO , the water vapour fraction is taken as ωH2 O = 0.001, but the vapour is assumed chemically inert. For the purpose of comparison with published [38] experimental data, the predicted burning rate is normalised with respect to the diffusion controlled burning rate. Thus we form the ratio m˙ (predicted) , (4.138) BRR = c m˙ c (dc)

and the driving force B = 0.174. Figure 4.7 shows the variation of the ratio BRR with Tw . The experimental data for the burn rate are shown by ﬁlled circles. Data are predicted with (solid lines) and without (dashed lines) Reaction 1 to ascertain the inﬂuence of this reaction at low temperatures. It is seen that the experimental BRR has considerable scatter and exceeds unity, against expectation. However, this may be due to the normalising factor used by Kuo [38]. Nonetheless, the data show a mild plateau for 1,100 < Tw < 1,400. This tendency is nearly predicted by the present computations, particularly when Reaction 1 is included. For Tw > 1,350, the experimental data show a sudden rise that is again observed in present predictions. The predicted BRR → 1 at 1,800 K as expected. However, for Tw < 1,000 K, the present data grossly underpredict the experimental data; the underprediction is greater when Reaction 1 is ignored. 4

Equation 4.139 is derived from Reynolds-ﬂow model developed by Spalding [73] assuming ﬂuid properties in the free-stream state and then corrected for property variations through the boundary layer.

4.10 APPLICATIONS

The predicted wall mass fractions for CO, O2 , and CO2 are also plotted in Figure 4.7. The wall mass fraction ωO2 ,w , starting from 0.232 at 800 K, decreases rapidly to zero at Tw ∼ 1,300 K. Note that ωO2 ,w decreases more rapidly when Reaction 1 is included, as expected. The wall mass fraction ωCO2 ,w gradually increases with temperature, peaks at Tw = 1,300 K, and then rapidly falls to zero. In this range where ωCO2 ,w is signiﬁcant, the BRR indicates a mild plateau after an initial rapid rise with temperature. The ωCO,w , however, increases with wall temperature. At Tw > 1,300, CO evolution becomes signiﬁcant, indicating dominance of Reaction 3. At very high temperatures, this reaction becomes the most dominant and combustion is now diffusion controlled with ωO2 ,w = ωCO2 ,w = 0 and ωCO,w → 0.406. Overall, Reaction 1 is important at low temperatures and Reaction 3 is important at high temperatures. It must be noted that although the tendencies predicted here are similar to the similarity solution for BRR obtained by Kuo [38], the quality of predictions in combustion calculations greatly depends on the accuracy of the assumed reaction-rate laws. Entrance Region of a Pipe We consider simultaneous development of velocity and temperature proﬁles in the entrance region of a pipe of radius R. The ﬂow is laminar (Re = 500) and the ﬂuid Prandtl number Pr = 0.7. An axially constant wall temperature boundary condition is assumed. In this axisymmetric ﬂow, the I boundary coincides with the pipe axis and the E boundary with the pipe wall. Computations are performed with a J N = 25 nonuniform grid with closer spacings near the wall. The axial locations are determined from x = L (I − 1 / I M AX − 1)1.5 , where L = 0.2 × R × Re and I is the axial step number. Figure 4.8 shows the computed variations of f × Re, N u x , and velocity u at the pipe axis with x + = (x/R) / Re / Pr . Also plotted in the ﬁgure are previous numerical solutions for N u x reported in [33]. It is seen that the present solutions match perfectly with the previous solutions. The f × Re product also varies as expected with asymptotic approach to 16.0. Similarly, the velocity u/u at the pipe axis also reaches 2.0 at large x + . Similar computations are now carried out at higher Reynolds numbers (1,000 < Re < 10,000) including the transition range. For this purpose, the LRE model is used and computations are performed with a J N = 47 nonuniform grid. Here, IMAX = 1,000 and L = 100 × D. Figure 4.9 shows variation of f, N u (Pr = 0.7 and 5.0), and u axis /u with Reynolds number in the fully developed state (X/D = 100). It is seen that for Re < 1,600, the characteristics correspond to those of a laminar ﬂow (u axis /u = 2.0). Accoring to the model, transition occurs abruptly and appears to extend up to Re ∼ 2,500, as evident from the N u predictions. The u axis /u ratio now drops suddenly from its laminar value of 2.0. At Re = 10,000, u axis /u = 1.246. For N u, the expected trend is again observed. In the laminar range, N u approaches the analytically derivable fully developed value of 3.667 for Tw = constant boundary condition for both Prandtl numbers. The thermal development

99

100

2D BOUNDARY LAYERS

50

40

Re = 500

Pr = 0.7

30

f ∗ Re (Uc / Ubar) ∗ 10 20

O

10

O O

O

0 0.000

Nux

Previous Num Soln O

0.025

O

0.050

0.075

X

+ 0.100

0.125

0.150

Figure 4.8. Entrance region of a pipe – laminar ﬂow.

100

Tw = Constant X / D = 100

Nu (Pr = 5)

LRE Model

(Uc / Ubar) ∗ 10

Nu (Pr = 0.7)

10

f ∗ 1000

Nu (Laminar) = 3.667 1000

Re

Figure 4.9. Fully developed ﬂow and heat transfer in a pipe.

10000

101

EXERCISES

(b)

(a) 30

30

Re = 3000

Re = 10000

COMPUTED U+

COMPUTED U+

20

U

U

+

+

20

U+ = 2.5 ln Y+ + 5.5

U = 2.5 ln Y + 5.5

10

10 +

U = Y

+

+ + U = Y Ret

0 1

10

Y

+

100

Ret 1

10

Y

+

100

Figure 4.10. Variation of u+ and Ret with y+ – pipe ﬂow.

length is a function of Pr in laminar ﬂow [33]. In turbulent ﬂow, X/D = 100 is sufﬁcient for fully developed ﬂow and heat transfer and, therefore, the predicted values of N u match well with the well-known correlation N u = 0.023 Re0.8 Pr 0.4 . In the turbulent range, the friction factor also corroborates f = 0.079 Re−0.25 well. Figure 4.10 shows the fully developed velocity proﬁle in wall coordinates at Re = 3,000 and 10,000. In the transition range, the sublayer is thick. At Re = 10,000, the predicted proﬁle nearly coincides with the wall law up to y + = 30 and then departs in the outer layers. The ﬁgure also shows variations of turbulence Reynolds number Ret = µt /µ. At Re = 3,000, the maximum value of Ret is lower than that at Re = 10,000. All these tendencies accord with expectation.

EXERCISES 1. Starting with Equation 4.17, derive Equations 4.22 and 4.26 in their conservative form. 2. Verify Equations 4.37–4.40 through detailed algebra. 3. Derive an equation for m˙ I,std , similar to Equation 4.71, when the free-stream boundary is located at the I boundary. 4. Derive recurrence relations (4.80) and (4.82). 5. Show that when Ret is large, the LRE model reduces to the HRE model given in Equations 4.112 and 4.113.

102

2D BOUNDARY LAYERS

Uo

Φ

Figure 4.11. Flow over a spinning cone.

6. It is desired to calculate turbulent boundary layer development so that the initial velocity proﬁle may be given by Equation 4.116. Choose a distribution of y j (0 < y < δ) such that (ω j+1 − ω j ) / (ω j − ω j−1 ) = 1.2 for all j. 7. Consider ﬂow across a long horizontal cylinder of radius R. It is desired to calculate boundary layer development near the forward stagnation point. Specify variation of α and rI with x. Also specify the starting velocity proﬁle. 8. In Exercise 7, it is of interest to calculate the mass transfer of an inert substance in the forward stagnation region. Specify the starting mass fraction proﬁle and select the appropriate boundary conditions for the mass-fraction variable ω and u. (Hint: Use the integral method to specify the ω proﬁle.) 9. It is desired to calculate boundary layer development over a cone spinning with angular velocity (see Figure 4.11). Write the governing equations and the boundary conditions at the I and E boundaries for this problem. Also provide initial conditions. (Hint: Assume that the spinning rate is high so that centrifugal and Coriolis forces must be considered. Also, ∂ p/∂r is not negligible. Hence, d p/d x will vary with y.) 10. Consider an adiabatic wall 2 m high, as shown in Figure 4.12. The bottom 1 m is covered with a thick layer of highly volatile solid material having latent heat λfu . The fuel burns in stagnant dry air under natural convection conditions. Assume SCR (4.86) with reaction rate given by (4.87). (a) Write all relevant equations governing the phenomenon of burning along with their source terms. (Hint: Use the Boussinesq approximation for the buoyancy term.) (b) Write boundary conditions at the I boundary to determine the burning rate. Also write conditions at the E boundary. [Hint: In this problem, the adiabatic condition implies that Tb = TT . Further, the burning surface temperature will equal the evaporation (or boiling) point temperature Tbp and is a known property. Further, the SCR assumption implies that ωfu = ωox = 0 at the burning surface.]

103

EXERCISES

ADIABATIC WALL

T

8

1m Figure 4.12. Burning from a vertical wall.

g 1m VOLATILE FUEL

(c) Write initial conditions for each variable assuming pure natural convection heat transfer between x = 0 and x = x0 . 11. In the stagnation-ﬂow carbon-burning problem described in the text, the water vapour was treated as inert and its mass fraction was held constant. However, water vapour can react with carbon, resulting in the following two additional surface reactions: C∗ + H2 O → CO + H2 C∗ + 2H2 → CH4 . The reaction rate of the ﬁrst reaction is about twice that of Reaction 3 (i.e., 2 k3 ). For the second reaction, k = 0.035 exp (−17,900/Tw ). Assuming ωH2 O,∞ = 0.01, write the equations to be solved along with their source terms and boundary conditions. [Hint: You will need to postulate the following additional gas-phase reactions to approximately account for the presence of H2 , H2 O, and CH4 : CH4 →

5.1 Introduction 5.1.1 Main Task In the previous chapter, we considered convective–diffusive transport in long (x direction) and thin ( y direction) ﬂows. This implied that although convective ﬂuxes were signiﬁcant in both x and y directions, signiﬁcant diffusion ﬂuxes occurred only in the y direction; diffusion ﬂuxes in the x direction are negligible. We now turn our attention to ﬂows in which diffusive ﬂuxes are comparable in both x and y directions. Thus, the general transport Equation (1.25) may be written1 as ∂(ρ ) 1 ∂(r q j ) = S, + ∂t r ∂x j

j = 1, 2,

(5.1)

where q j = ρ u f j − eff

∂ . ∂x j

(5.2)

In Equation 5.2, the ﬁrst term on the right-hand side represents the convective ﬂux whereas the second term represents the diffusive ﬂux. Note that sufﬁx f is attached to the velocity appearing in the convective ﬂux; the signiﬁcance of this sufﬁx will become clear in a later section. In Equation 5.1, r stands for radius. This makes the equation applicable to axisymmetric ﬂows governed by equations written in cylindrical polar coordinates. When plane ﬂows are considered, r = 1 and Equation 1.25 is readily recovered. By way of reminder, we note that may stand for 1, u i (i = 1, 2), u 3 (velocity in the x3 direction), ωk , T or h, and e and , and

eff is the effective exchange coefﬁcient (see Equation 4.89). Flows with comparable convective–diffusive ﬂuxes in each direction occur routinely in most practical equipment although they are usually three dimensional. Here, only 2D situations are considered for convenience and because the primary 1

Note that ρm signifying mixture density is now written as ρ for convenience. 105

106

2D CONVECTION – CARTESIAN GRIDS

X2

WALL

X1

INFLOW

RECIRCULATION

r

EXIT

SYMMETRY

Figure 5.1. 2D ﬂow situation.

objective is to learn the main issues of discretisation. Figure 5.1 shows a practical situation that can be represented by 2D equations (5.1). The ﬁgure shows ﬂow at the connection between two pipes of different diameters. The ﬂow is assumed to be axisymmetric. Immediately downstream of the pipe enlargement, the ﬂow will exhibit recirculation and thus, in the absence of any predominant ﬂow direction, convective–diffusive ﬂuxes in the x1 and x2 directions will be comparable. This implies that property at any x1 in the recirculation region will be inﬂuenced by property values both upstream as well as downstream of x1 . Similar two-way inﬂuence is also expected in the x2 direction. Such two-way inﬂuences are called elliptic inﬂuences [49] and, therefore, Equation 5.1 is an elliptic partial differential equation.2 5.1.2 Solution Strategy Before discretising Equation 5.1, we shall make distinction between the following two problems: 1. the problem of ﬂow prediction and 2. the problem of scalar transport prediction. Here, scalar transport means transport of all s (u 3 , ωk , T , h, e, , etc.) other than velocities ( = u 1 , u 2 ) that are vectors. Note that u 3 , although a vector, is included in the list of scalars. This is because variations in direction x3 are absent and, with respect to x1 and x2 directions, u 3 may be treated as a scalar. The reason for this distinction between scalars and vectors is twofold. It is clear from Equation 5.2 that calculation of scalar transport will be facilitated only when the velocity ﬁeld is established. In fact, if source S and the properties 2

A few comments having a bearing on the solution strategy are now in order. 1. In Equations 5.3–5.5, there are three unknowns (u 1 , u 2 , and p). Therefore, the equation set is solvable. 2. In boundary layer ﬂows, the pressure gradient is speciﬁed (external ﬂows) or is evaluated via the overall duct mass ﬂow rate balance (internal ﬂows). In elliptic ﬂows, however, ∂ p/∂ x1 and ∂ p/∂ x2 are not a priori known. 3. Thus, if we regard Equation 5.4 as the determinant of u 1 ﬁeld and Equation 5.6 as the determinant of u 2 ﬁeld, then the pressure ﬁeld can be established only via the mass conservation equation (5.3). The situation is somewhat similar to the case of internal boundary layer ﬂows but is not as straightforward. 4. The sufﬁx f is attached to velocities satisfying the mass conservation equation. The velocity ﬁeld without sufﬁx f may or may not satisfy mass conservation directly although, in a continuum, it is expected that the u i and u fi ﬁelds are identically overlapping and, therefore, the former must also satisfy mass conservation. 5. The reader may ﬁnd this distinction between the u i and u fi ﬁelds somewhat unfamiliar. This is because most textbooks a priori assume a ﬂuid continuum. Numerical solutions are, however, developed in a discretised space and the distinction mentioned here becomes relevant. This will become clear in a later section. These points reveal the fact that there is no explicit differential equation for determination of the pressure ﬁeld with p (or its variant) as the dependent variable.

108

2D CONVECTION – CARTESIAN GRIDS

N

nW

nw

n

ne

Figure 5.2. The staggered grid.

W

sW

Uf1 w

sw wS

e

P

s

se

Uf 2 S

E

eS

Such an equation, however, can be derived from explicit satisfaction of the mass conservation equation. In the sections to follow, the SIMPLE method for determination of the pressure ﬁeld is presented. This method was developed by Patankar and Spalding [51]. It is among the most extensively used methods in CFD practice. In fact, most CFD packages employ this method. The acronym SIMPLE stands for Semi-Implicit Method for Pressure-Linked Equations.3 The original SIMPLE method [51] was derived for Cartesian grids in which the scalar s (including pressure p) and the velocity vectors were deﬁned in a staggered arrangement (see Figure 5.2). To understand this arrangement, consider typical node P (i, j) with the surrounding control volume whose faces are located at e, w, n, and s. In the staggered arrangement, pressure pi, j is stored/deﬁned at the node P. The same holds for other scalars i, j . However, the vector u f1 (i, j) is stored at the cell face w and vector u f2 (i, j) is stored at cell face s. Thus, the vectors and the scalars are stored in staggered locations. It is easy to identify appropriate control volumes surrounding the cell-face locations as shown in Figure 5.2. Thus, in the (i, j) address system, there are three partially overlapping control volumes. Now, the SIMPLE method requires that to determine the pressure ﬁeld, the mass conservation equation must be satisﬁed over the control volume (ne-se-swnw) surrounding node P where pi, j is stored. Thus, using the IOCV method, the discretised version of Equation 5.3 is written as

In compressible ﬂows, p = ρ Rg T , where Rg is the gas constant, must be added to the equation set (5.3–5.6). This equation of state is used to determine density ρ.

5.2 SIMPLE – COLLOCATED GRIDS

where V = rP x1 x2 and superscript o represents values at the old time. Superscript n is dropped for convenience. Equation 5.6 indicates that the velocities with sufﬁx f appear at the cell faces of the control volume surrounding node P. Therefore, in SIMPLE-staggered, momentum equations, Equation (5.4) is solved over control volume n-nW-sW-s and Equation 5.6 is solved over the control volume w-wS-eS-e without explicit commitment to satisfy mass conservation over these control volumes. The overall strategy for solution of the ﬂow equations is as follows: 1. Guess a pl ﬁeld and solve momentum equations (5.4) and (5.6) over control volumes surrounding cell faces to yield u lf1 and u lf2 ﬁelds. 2. These ﬁelds, in general, will not satisfy the mass conservation equation (5.6). 3. Derive a mass-conserving pressure-correction equation to satisfy mass conservation over the control volume surrounding node P. 4. Use the pressure correction p so determined to correct the guessed pressure pl and velocities u lf1 and u lf2 . For a complete description of the SIMPLE-staggered method, the reader is referred to [49, 51]. 5.2 SIMPLE – Collocated Grids 5.2.1 Main Idea Although the SIMPLE-staggered grid method enjoyed considerable success particularly when Cartesian grids were employed, the procedure was found to be inconvenient when curvilinear or unstructured grids were to be employed to compute over ever more complex domains. Further, even on Cartesian grids, the process of discretisation required considerable book keeping because the dimensions of the control volumes of vector and scalar variables were different. Since the early 1980s, therefore, researchers began to explore the possibility of implementing the SIMPLE procedure using collocated variables.4 That is, the velocity and the scalar variables were to be stored/deﬁned at the same node P (i, j). This, it was felt, would permit attention to be directed to a single transport equation (5.1), thereby reducing the book-keeping requirements considerably. Although convenient, this departure also brought within its wake a major difﬁculty with respect to the pressure-ﬁeld prediction. It was found that if the pressurecorrection equation as derived for staggered grids was used to predict pressure on collocated grids, the predicted pressure distribution showed zigzagness. Depending on the identiﬁed cause of this problem, different researchers (see, for example, [59]) 4

In the literature, the procedure with collocated variables is sometimes referred to as a procedure employing nonstaggered or collocated grids.

109

110

2D CONVECTION – CARTESIAN GRIDS

∆X1w

W

w

∆X1e N

Ne

n

ne

P

e

s

se

S

Se

∆X1ee NE

∆X 2n E

ee

EE

∆X2

∆ X2s

SE

∆X1 Cell Faces

Nodes Figure 5.3. The collocated grid.

proposed different cures with differing amounts of complexity. Here, we shall describe the method developed by Date [14] that elegantly eliminates the problem of the zigzag pressure prediction. It will be shown in a later section that this matter is connected with the recognition of the need to modify the normal-stress expression as discussed in Chapter 1. 5.2.2 Discretisation For collocated variables, we need to consider only one control volume (hatched) surrounding typical node P, as shown in Figure 5.3. Further, the cell faces are assumed to be midway between the adjacent nodes. As usual, using the IOCV method (d V = r d x1 d x2 ), we integrate Equation 5.1 so that

Now, in terms of the notation just introduced, the discretised mass conservation equation (5.6) (with = 1) can be written as

ρP − ρPo

V + Ce − Cw + Cn − Cs = 0. t

(5.11)

Further, the expressions for C at the cell faces can be generalised to account for any of the convection schemes introduced in Chapter 3. When this is done and Equation 5.11 is employed, it can be shown that Equation 5.8 reduces to A P P = AE E + AW W + AN N + AS S + D,

m˙ R = AE Ruf1 x1 |e − AW Ruf1 x1 |w + AN Ruf2 x2 |n − AS Ruf2 x2 |s . (5.31) A number of comments with respect to Equations 5.25–5.31 are now in order. 1. On both staggered and collocated grids, the pressure is stored at node P and the mass conservation equation is solved over the control volume surrounding node P. Therefore, Equation 5.25 is applicable to both types of grids. 5

2. In incompressible ﬂows, density is independent of pressure. Therefore, ρ l+1 = ρ l = ρ (say). Derivation of the pressure-correction equation for compressible ﬂow is left to the reader as an exercise (see Date [15, 17]). 3. On staggered grids, the momentum equations are solved at the cell faces and, therefore, residuals Ruf1 and Ruf2 must vanish at full convergence, rendering m˙ R = 0. Although this state of affairs will prevail only at convergence, one may ignore m˙ R even during iterative solution. Thus, effectively, the pressurecorrection equation applicable to computations on staggered grids is 1 ∂ r ∂ x1 =

This equation is derived in [51] via an alternative route. It is solved with the boundary condition ∂ pm = 0. (5.33) ∂n b The explanation for this boundary condition is given in a later section. 4. On collocated grids, cell-face velocities must be evaluated by interpolation to complete evaluation of m˙ P because only nodal velocities u i are computed through momentum equations. Thus, m˙ P in Equation 5.30 is evaluated as

m˙ P = ρ l+1 r u l1 e − ρ l+1 r u l1 w x2

V + ρ l+1 r u l2 n − ρ l+1 r u l2 s x1 + ρPl+1 − ρPo . t

(5.34)

Now, to evaluate u i , we use multidimensional averaging rather than simple onedimensional averaging. Thus, for example, u l1,e

1 = 2 1 4 1 = 4

u l1,se = u l1,ne

l l x u + x u 1 l 2,n 2,s 1,se 1,ne , u + u l1,E + 2 1,P x2,n + x2,s

u l1,P + u l1,E + u l1,S + u l1,SE ,

u l1,P + u l1,E + u l1,N + u l1,NE .

(5.35)

Similar expressions can be derived for other interpolated cell-face velocities. 5. On collocated grids, we do not explicitly satisfy momentum equations at the cell-face locations. Therefore, there is no guarantee that m˙ R will vanish even at

This equation is the same as Equation 5.26 written for location e, but the net momentum transfer terms are again multidimensionally averaged. This averaging is done because, when computing on collocated grids, one does not have the cell-face coefﬁcients Ak .6 Now, again using Equation 5.26, we get A P u f1 u lf1 − Ak u lf1,k − Dul 1 ∂ pl (5.37) . = R u f1,e − V ∂ x1 e

Note that, in principle, evaluation of these coefﬁcients can be carried out. However, the computational effort involved will be prohibitively expensive in multidimensions. For example, in a three-dimensional calculation, one will need to evaluate eighteen extra coefﬁcients at the cell faces in addition to the six coefﬁcients evaluated at the nodal locations.

116

2D CONVECTION – CARTESIAN GRIDS

To simplify the evaluation, we introduce the following deﬁnitions: p x1 ,P =

(5.53) This equation represents the appropriate form of the mass-conserving pressurecorrection equation on collocated grids.

5.2.4 Further Simpliﬁcation It is possible to further simplify Equation 5.53. To understand this simpliﬁcation, consider, for example, the grid disposition near the west boundary as shown in Figure 5.4. When computing at the near-boundary node P (2, j), the pressure gradient ∂ p/∂ x1 |P must be evaluated in the momentum equation for velocity u 1,P . This will require knowledge of the boundary pressure pb = p (1, j). On collocated grids, this pressure is not known and, therefore, is evaluated by linear extrapolation from interior ﬂow points. Thus, pb =

L bE L bP pP − pE , L PE L PE

(5.54)

where L denotes length. The same procedure is adopted at Nb and Sb. Now, assuming that the pressure variation near a boundary is locally linear in both x1 and x2 directions, it follows that pb − p b = pP − p P

or

psm,b = psm,P ,

(5.55)

118

2D CONVECTION – CARTESIAN GRIDS

N 2, j + 1

Nb

q 1, j

1, j

b

3, j

P 2, j

Figure 5.4. West boundary, i = 1.

E

Φ

θ

S

Sb

2, j − 1 i=1

and, therefore,

∂ psm = ∂ psm = 0. ∂ x1 b ∂n b

(5.56)

(see Equation 5.33). Now, EquaThe same condition is also applicable to pm and psm are identical and, since tion 5.53 shows that multipliers of gradients of pm the boundary conditions for these two variables are also identical, we may write the mass-conserving pressure correction equation in the following form:

where m˙ P is given by Equation 5.34 and the coefﬁcients by Equation 5.29. In passing we note that Equation 5.57 for collocated grids has great resemblance

119

5.2 SIMPLE – COLLOCATED GRIDS

to Equation 5.32, which is applicable to staggered grids, although the dependent variables have different meanings. 5.2.5 Overall Calculation Procedure The sequence of calculations on collocated grids is as follows. 1. At a given time step, guess the pressure ﬁeld pi,l j . This may be the pressure ﬁeld from the previous time step. 2. Solve (see the next section) the momentum equations (5.12) once each for = u 1 and u 2 with problem-dependent boundary conditions. Designate the velocity ﬁelds so generated by u l1 and u l2 . 3. Form m˙ i, j (Equation 5.34) using multidimensional7 interpolations of cell-face velocity. Now, solve Equation 5.60 with boundary condition (5.58) iteratively to yield the total pressure-correction pi, j ﬁeld. The number of iterations may not exceed 5 to 10. 4. Recover the mass-conserving pressure correction via Equation 5.59. Thus, pm,i, j = pi, j − psm,i, j = pi, j −

Note that A P u1 = A P u2 . Solve the discretised equations (5.12) for all other scalar i, j relevant to the problem at hand. Check convergence through evaluation of residuals (see the next section) for momentum and scalar equations. Care is, however, required in calculation of mass residuals as will be discussed shortly. If the convergence criterion is not satisﬁed, treat pl+1 = pl , l+1 = l and return to step 2 To execute the next time step, set all o = l+1 and return to step 1. Although multidimensional interpolation is prescribed, in actual computations, one-dimensional interpolations sufﬁce in most applications.

where Su = D, A P = AE + AW + AN + AS, and Sp = (ρ o V / t). Note that Su and Sp can be further augmented to effect underrelaxation, boundary conditions, and to some extent domain complexity. If there are I N nodes in the i direction and J N nodes in the j direction, Equation 5.65 represents a set of (I N − 2) × (J N − 2) equations for the interior nodes for each . These equations can be solved by matrix-inversion-type direct methods. However, in multidimensional convection, iterative methods are usually preferred in which Equation 5.65 is solved sequentially for each . There are two extensively used methods of this type: GS and alternating direction integration (ADI). Gauss–Seidel (GS) Method In the GS method, for each , coefﬁcients AE, AW, AN , AS, Su, and Sp are evaluated based on values at iteration level l for each node (i, j), i = 2 to I N − 1 and j = 2, J N − 1. Then the nodal value is updated in a double DO loop:

This method is sometimes called a point-by-point method because each node (i, j) is visited in turn. Note that as one progresses from i = 2 and j = 2, some of the neighbouring values are already updated whereas others still retain their values at iteration level l. Thus, the net evaluation is really a mixed evaluation. Yet, at the end of the DO loop, values at all nodes are treated as having (l + 1)-level values. Convergence is declared when the residuals (see the next subsection) fall below a certain low value. This iterative method, though very robust and simple to implement, is very slow to converge.

121

5.3 METHOD OF SOLUTION

ADI Method The ADI method is a line-by-line method in which Equation 5.65 is ﬁrst solved for all j = constant lines (say). This is called the j-direction sweep. The solution thus obtained may be called the l+1/2 solution. Now, using this solution, Equation 5.65 is again solved for i = constant lines to generate the l+1 solution. This is called the i-direction sweep. The implementation details are as follows. For the j sweep, Equation 5.65 is written as l+1/2

l+1/2

(5.66)

S Ji, j = ANi, j li, j+1 + ASi, j li, j−1 + Su i, j .

(5.67)

(A Pi, j + Spi, j ) i, j

l+1/2

= AE i, j i+1, j + AWi, j i−1, j + S Ji, j ,

where

Now, dividing by coefﬁcient of i, j , Equation 5.66 for ﬁxed j can also be written as l+1/2

Equation 5.69 can again be cast in the form of Equation 5.68 and subsequently solved for each i = constant line by TDMA. The two sweeps complete one iteration. Thus, in the ADI method, the domain is swept twice per iteration. In spite of this, the procedure proves to be much faster than the GS procedure. In Chapter 9, some additional methods for convergence enhancement are described. 5.3.2 Evaluation of Residuals The convergence of the iterative procedure is checked by evaluating the imbalance in Equation 5.12. Thus, for each , we evaluate ⎡ 2 ⎤0.5 A P P − A k k − D ⎦ . (5.71) R = ⎣ all nodes

k

When the maximum value of R among all s is less than the convergence criterion (typically 10−5 ), the iteration is stopped. Often, R is normalized with a reference quantity speciﬁc to a problem having units of A P .

However, on collocated grids, one cannot use this equation directly because m˙ i, j = 0 even at convergence. Therefore, Equation 5.72 is written as ⎡ 2 ⎤0.5 ⎦ , A P pm,i, Ak pm,k (5.73) Rm = ⎣ j − all nodes

k

where A P and Ak are coefﬁcients of the pressure-correction equation. It will be recognized that this equation simply represents the discretised version of the left-hand side of Equation 5.32 (or see Equation 5.28 with m˙ R = 0). Thus, Rm is evaluated after pm,i, j is recovered in step 4 of the calculation procedure. This is an important departure from the staggered-grid practice that a casual reader may overlook. 5.3.3 Underrelaxation Global Relaxation As mentioned in Chapter 2, in steady-state problems (t → ∞), underrelaxation is effected by augmenting Su and Sp as

Su i, j = Su i, j + B li, j ,

Spi, j = Spi, j + B,

B=

(1 − α) (A Pi, j + Spi, j ), α (5.74)

where α is the underrelaxation factor and l is the iteration level. The value of α is the same for all nodes but it may be different for different s. This is called global, or constant, underrelaxation. False Transient In multidimensional problems, underrelaxation is often effected in another way. Thus, consider a steady-state problem in which t = ∞ and, therefore, the transient term is zero. However, one can imagine that the steady state is achieved following a transient and each time step is likened to a change in iteration level by one. In this case, i,o j may be viewed as li, j and the time step t as the false-transient step. Then, combining Equation 5.65 with Equation 5.74, we can deduce that the resulting equation may be viewed as one in which

αeff,i, j =

A Pi, j

A Pi, j + Spi, j , + Spi, j + (ρ o V /t)i, j

(5.75)

123

5.3 METHOD OF SOLUTION

where the sufﬁx eff is added for two reasons. Firstly, note that this equation arises out of comparison with Equation 5.74; secondly, αeff is not a global constant but will vary for each node (i, j). In fact, this variation also proves to be most appropriate. This can be understood as follows. When A Pi, j + Spi, j is small, the change in from iteration level l to l + 1 will be large (see Equation 5.65). It is precisely this large change that is to be controlled by underrelaxation. Equation 5.75 shows that αeff is indeed small when A Pi, j + Spi, j is small. Conversely, when A Pi, j + Spi, j is large, the implied change in is small; therefore, we can afford a larger value of α. Thus, underrelaxation through the false-transient method is proportionate to the requirement. Of course, the smaller the value of the false t, the smaller is the value of the estimated αeff . Although in most nonlinear problems use of constant α sufﬁces, the falsetransient method needs to be invoked when couplings between equations for different s are strong or when the source terms for a given vary greatly over a domain or when the initial guess of different variables is very poor. Most practitioners invoke the false-transient method when the global underrelaxation method fails. 5.3.4 Boundary Conditions for Φ In ﬂuid ﬂow and convective transport, ﬁve types of boundaries are encountered: inﬂow, outﬂow or exit, symmetry, wall, and periodic. At all these boundaries, mainly three types of conditions are encountered: 1. b speciﬁed, 2. ∂/∂n|b speciﬁed, and 3. ∂ 2 /∂n 2 |b speciﬁed, where n is normal to the boundary. We shall discuss each boundary type separately. Inﬂow Boundary At the inﬂow boundary, values of all variables are speciﬁed and are therefore known.8 Thus, at a west boundary (see Figure 5.4), for example, we can write

Su 2, j = Su 2, j + AW2, j 1, j ,

Sp2, j = Sp2, j + AW2,J ,

AW2, j = 0. (5.76)

8

Care is needed in specifying inﬂow conditions for turbulence variables e and . Typically, ein = (T u u in )2 , where T u is the prescribed turbulence intensity. Now, the dissipation is speciﬁed through the deﬁnition of turbulent viscosity. Thus, in = Cµ ρ e2 /(µ VISR), where the ratio VISR = µt /µ is assumed (typically, of the order of 20 to 40). In practical applications, T u and VISR are rarely known and, therefore, the analyst must assume their magnitudes.

124

2D CONVECTION – CARTESIAN GRIDS

SYMMETRY

c

e

f

WALL j = jn

WALL

EXIT INFLOW

d i = in

Fin

b c

d

e i=1

WALL

Fin

WALL a

WALL

b

WALL a

a) Exit Boundary

j=1 WALL

f

b) Periodic Boundaries

Figure 5.5. Exit and periodic boundaries.

Wall Boundary At the wall, either b or its ﬂux qb is speciﬁed. For the ﬁrst type, Equation 5.76 applies. If ﬂux is speciﬁed, then at the west boundary again,

Su 2, j = Su 2, j + A1, j q1, j ,

1, j =

A1, j q1, j + 2, j , AW2, j

AW2, j = 0, (5.77)

where A1, j = r j x2 j is the boundary area.9 Symmetry Boundary At this boundary, there is no ﬂow normal to the boundary and no diffusion either. Thus, with reference to Figure 5.4, for a scalar , q1, j = 0.0. For vectors, the normal velocity component u 1 (1, j) = 0 and u 2 (1, j) = u 2 (2, j). In all cases, AW2, j = 0. Outﬂow Boundary The outﬂow boundary is one where the ﬂuid leaves the domain of interest. The boundary condition at the outﬂow or exit plane is most uncertain. To understand the main issues involved, consider Figure 5.5(a) in which de represents the outﬂow boundary. Now to affect the boundary condition, we may assume that the Peclet number (u 1 x1 / )|b is very large. In this case, the AE coefﬁcient of all nearboundary nodes will be zero and, therefore, no explicit boundary condition b or ∂/∂n|b is necessary. In many circumstances, this assumption may not be strictly valid. One way to overcome this difﬁculty is to shift boundary de further downstream than required in the original domain speciﬁcation. Thus, one carries out computations over an extended domain and effect AE = 0 at the new location of de. A third alternative is to assume that a fully developed state prevails at de so that both the ﬁrst as well as the second normal derivatives are zero. Most researchers prefer to set the second-order derivative to zero and extract b by extrapolation while the transport equation is solved with AE = 0. 9

In turbulent ﬂows, the wall boundary requires special attention when the HRE form of the e– model is employed. This matter will be taken up in the next section.

125

5.3 METHOD OF SOLUTION

Since none of these alternatives can be relied upon, it is advisable to ensure that the overall mass balance for the domain is maintained throughout the iterative process. This means that the exit-mass ﬂow rate must equal the known inﬂow rate. Thus, after effecting the boundary condition (marked by superscript *, say) according to any of the alternatives just described, it is important to correct the boundary velocities as # u 2b = u ∗2b F, F = m˙ in (5.78) m˙ ∗exit , u 1b = u ∗1b F, where m˙ ∗exit is evaluated from the starred velocity boundary condition. Periodic Boundary Figure 5.5(b) shows ﬂow between parallel plates with attached ﬁns. In this case, after an initial development length, the ﬂow between two ﬁns will repeat exactly. Such a ﬂow is called periodically fully developed ﬂow and the periodic boundary condition will imply

where I N and J N are the total number of nodes in the i and j directions, respectively. Note that in this boundary condition speciﬁcation, the u 2 velocity has antiperiodicity whereas all other s have even periodicity. 5.3.5 Boundary Condition for pm The boundary condition for pm is given by Equation 5.33. The reason for this can be understood from step 3 of the calculation procedure. When this step is executed, the u li ﬁelds along with their boundary values u li,b are already known. Now, when the p equation is solved, it is assumed that these boundary values are correct and, therefore, require no further corrections. and = u l1 and subtract the If we now consider Equation 5.12 for = u l+1 1 l latter equation from the former, with u 1 = u l+1 1 − u 1 , we have ∂ pm , Ak u 1,k − V A P u 1,P = ∂ x 1 P where k s represent neighbours of P. Also, Ak u 1,k = 0 through our assumption introduced in Section 5.2.3. This explains the form of velocity correction introduced in Equation 5.63 for an interior node. The same arguments apply to the u 2 velocity corrections given in Equation 5.64. Now, if the preceding equation is written for the boundary nodes (P = b), clearly u 1,b = 0 because no corrections are to be applied to the boundary velocities. /∂ x1 |b = 0. This is boundary condition (5.33). In discretised form, Therefore, ∂ pm

126

2D CONVECTION – CARTESIAN GRIDS

d

m

JN

e

n

12 11 10 9 8 b 7

c

f

g

6 5 4 3 2

h i

a

l

j 2

3

4

5 6

7

8

9 10

11

12

13 14 15 16 IN

Figure 5.6. Node tagging.

the boundary condition is implemented by setting the boundary coefﬁcient of the pressure-correction equation to zero for the near-boundary node. Sometimes, we may have a boundary on which pressure is speciﬁed and, there = 0. fore, remains ﬁxed. For such boundaries, pm,b

5.3.6 Node Tagging In Chapter 2, we emphasised that the introduction of Su and Sp can facilitate writing of generalised computer codes by capturing a large variety. In multidimensional codes, further variety can be captured by tagging each node of the domain with a number. This is intended to facilitate handling of 1. different types of boundary conditions over different portions of the same physical boundary and 2. domains that are not perfect rectangles. Figure 5.6 shows an arbitrary domain a-b-c-d-e-f-g-h-i-j, which we shall call the domain of interest. However, we regard it as a part of a rectangular domain a-m-n-l with nodes i = 1 to I N and j = 1 to J N . This will create areas b-c-d-m, f-g-n-e, and j-l-h-i, which are not of interest. We term them as inert or blocked areas. Now, coordinates x 1i and x2 j are chosen so that the implied cell-face locations exactly coincide with the boundaries of the domain of interest. This ensures that our domain of interest is ﬁlled with full (not partial) control volumes as shown in the ﬁgure.

127

5.3 METHOD OF SOLUTION

Node tagging is now accomplished using the following convention: 1. NTAG (I, J) = 0 identiﬁes all nodes interior to the domain. That is, nodes falling on the boundaries a-m, m-n, n-l, and l-a are excluded. 2. NTAG (I, J) = 1 identiﬁes all interior nodes in the inert areas. 3. NTAGW (I, J) = 11, 12, 13, 14, 15 identiﬁes nodes adjacent to the WEST boundary with 11 for inﬂow boundary, 12 for symmetry boundary, 13 for exit boundary, 14 for wall boundary, and 15 for periodic boundary. NTAGW is zero for all other nodes. 4. Similarly, NTAGE (I , J) = 21, 22, 23, 24, 25 identiﬁes nodes adjacent to the EAST boundary, NTAGS (I , J) = 31, 32, 33, 34, 35 identiﬁes nodes adjacent to the SOUTH boundary, and NTAGN (I, J) = 41, 42, 43, 44, 45 identiﬁes nodes adjacent to the NORTH boundary. Using this convention (which is quite arbitrary), NTAGW will have a ﬁnite number for i = 2 and j = 2, 3, . . . , 7 (boundary a-b) and for i = 6 and j = 8, 9, . . . , J N − 1 (boundary c-d). Similarly, NTAGN will be ﬁnite for j = 7 and i = 2, 3, 4, 5 (boundary b-c), for j = J N − 1 and i = 6, 7, 8, 9, and again for j = 7 and i = 10, 11, . . . , I N − 1 (boundary f-g). NTAGS and NTAGE can be similarly speciﬁed. The choice of numbers 11, 12, 13, etc. in NTAGW is arbitrary but brings one advantage. That is, for near-west boundary nodes, NTAGW/10 = 1 in FORTRAN and, therefore, a WEST boundary is readily identiﬁed. Similarly, NTAGN/40 = 1 readily identiﬁes a NORTH boundary. Once this identiﬁcation is done, the actual numbers (11, 12, etc.) identify the type of boundary condition and therefore Su i, j and Spi, j for the near-boundary nodes can be set up. This facilitates speciﬁcation of different boundary conditions at the same physical boundary. Thus, if boundary a-b is a wall, a part of it may be insulated and the rest may receive heat ﬂux. Similarly, with respect to mass transfer, a part may be inert but the rest may experience a ﬁnite mass transfer ﬂux. Finally, at the inert or blocked node where NTAG (I, J) = 1, one simply speciﬁes Su i, j = 1030 desired ,

Spi, j = 1030 .

(5.80)

Examination of Equation 5.65 will show that since A Pi, j can never be very large, these settings render i, j = desired at the inert nodes. In Figure 5.6, the inert regions are outside the domain of interest. However, it is easy to appreciate that one can even have inert regions that are enclosed by the overall domain of interest (hence the term blocked region), as shown in Figure 5.7. The ﬁgure also shows how a domain with irregular boundaries may be speciﬁed by node tagging. Here, the irregular boundary is approximated by a staircase-like zigzag boundary.10 Such 10

The accuracy of the solution will of course depend on the number of steps into which the true boundary is subdivided.

128

2D CONVECTION – CARTESIAN GRIDS J = JN INERT REGION

X2

X1

INERT REGION J =1 I=1 DOMAIN OF INTEREST

TRUE IRREGULAR BOUNDARY

I = IN APPROXIMATE BOUNDARY

Figure 5.7. Domain with irregular boundary.

an approximation of the true boundary is permissible when the ﬂow is in the x3 direction (i.e., u 3 is ﬁnite but u 1 = u 2 = 0 as in the case of laminar fully developed ﬂow in a duct) because the replacement does not imply a rough wall.11 If, however, the velocity components u 1 and u 2 were ﬁnite, it would be advisable to map the domain by curvilinear or unstructured grids (see Chapter 6) so that the staircase boundary approximation does not interfere with the expected ﬂuid dynamics (see Exercises 16 and 17). Finally, note that the exit and wall boundaries may be speciﬁed in more than one way, as discussed in the previous subsection. Thus, at a wall one may specify temperature or heat ﬂux. One can introduce further identifying tags for each type. 5.4 Treatment of Turbulent Flows 5.4.1 LRE Model In multidimensional elliptic ﬂows, the concept of mixing length is not very useful. This is because it is difﬁcult to invent a three-dimensional (3D) algebraic prescription for the mixing length. As was learnt in the previous chapter, however, the LRE e– model is general and does not require any input that depends on the distance 11

The replacement will also be permissible in a pure conduction problem.

129

5.4 TREATMENT OF TURBULENT FLOWS

from the wall. The 2D elliptic version of this model can be described via Equation 5.1 for = e and ∗ with the following deﬁnitions of the source terms [9]: Se = G − ρ ∗ , S ∗ = where

The expressions for C1 and C2 are the same as those given in Chapter 4. The LRE e− ∗ model permits use of the e = ∗ = 0 condition at a wall boundary. Although this is a distinct advantage of the model, accurate predictions require a very large number of nodes, as was learnt through boundary layer predictions. In two dimensions, if more than one boundary is a wall then the number of nodes required becomes very large indeed. This is because, to resolve the inner layer near a wall, which typically spans to y + = y u τ /ν = 100, one may need 60–80 nodes with the ﬁrst node as close as y + = 1 whereas the outer layer may require no more than 20–30 nodes. Physically, the inner layer occupies a very thin region near a wall.12 Thus, computations with the LRE model in 2D and 3D elliptic ﬂows can be quite expensive. In the interest of economy of computations, therefore, it is desirable if an adaptation can be made that restricts calculations only to the outer layers. 5.4.2 HRE Model In a large majority of ﬂow situations, as is well known, the inner layer exhibits near universality with respect to velocity and temperature proﬁles – the so-called laws 12

√ In a fully developed ﬂow in a pipe (radius R), for example, R + = R u τ /ν = (Re/2) f /2. Using −0.2 + f = 0.046 Re , we estimate that at Re = 50,000 (say), R = 1,285. This shows that the inner layer is less than 10% of the radius.

These speciﬁcations are empirical but, in the range 30 < y + < 100, they are reasonably accurate. One can thus exploit this near universality to eliminate the inner layer almost completely from the calculations and compute only in the outer layers. In the outer layers, turbulence is vigorous and Ret = µt /µ is large (hence the acronym HRE for high Reynolds number model) so that ∗ → and, therefore, the source terms are given by Se = G − ρ,

S =

[C1 G − C2 ρ ] , e

(5.89)

where C1 = 1.44 and C2 = 1.92. The task now is to modify our discretised equations for the near-wall boundary node P such that the implications of the laws of the wall are embodied in the equations.14 To achieve this goal, we note the following two characteristics of the 30 < y + < 100 region in which the near-wall node P is assumed to have been placed. These are √ (5.90) u τ = Cµ1/4 e, G = ρ .

=e A further characteristic of the inner layer is that the shear stress through the layer is constant and hence equals τw . Also, experimental data demonstrate that in the 30 < y + < 100 region, ∂e/∂ y 0. Therefore, AS = 0. The implications of the law of the wall thus can be absorbed through redeﬁnition of Se for point P:

= ωk It is not clear if universal mass transfer laws exist for all mass transfer rates. Following theory developed by Spalding [73], however, it is possible to show that

eff ρ uτ ln (1 + B) = , + yP B Prt (u 1P + P F)

(5.109)

where the Spalding number B is given by B=

ωk,P − ωk,b , ωk,b − ωk,T

(5.110)

and ωk,T is the mass fraction deep inside the wall from where mass transfer is taking place. Note that as B → 0, ln (1 + B) → B. Further, P F is still given by Equation 5.88 but with Pr replaced by Schmidt number Sc. All other adjustments are the same as those for the temperature variable. 5.5 Notion of Smoothing Pressure Correction It is important to consider the notion of smoothing pressure correction introduced in our analysis of the collocated-grid calculation procedure. This is because, in the original SIMPLE-staggered grid procedure, such a smoothing correction is not required. However, its introduction is vital if zigzag pressure prediction is to be avoided on collocated grids, particularly when coarse grids are used. To understand the importance of smoothing correction, we consider computation of laminar ﬂow in a square cavity (see Figure 5.9) of side L that is inﬁnitely long in the x3 direction. The top side (the lid) of this cavity is moving in the positive x1 direction with velocity Ulid (say). Because of the no-slip condition, the linear lid movement sets up ﬂuid circulation in the clockwise direction. In this case, steady-state equations for = u 1 , u 2 , and p need to be solved. Figure 5.10 shows the computed distribution of pressure for Re = Ulid L/ν = 100. In Figure 5.10(a), solutions obtained with a 15 × 15 grid are shown at the vertical midplane (x1 /L = 0.5). The solutions are obtained using both staggered and collocated grids with identical grid dispositions. However, in the latter, smoothing pressure correction is not applied (see step 4 of the calculation procedure). It is clear that whereas the staggered-grid procedure produces a smooth pressure distribution,

134

2D CONVECTION – CARTESIAN GRIDS

U-LID

L

X2

X1

Figure 5.9. Square cavity with a moving lid.

L

the predicted pressure on the collocated grid is zigzag. Note that the zigzagness is most pronounced in regions where the staggered-grid pressure distribution considerably departs from linearity. Figure 5.10(b) shows the results obtained with a 41 × 41 grid. Notice that the pressures predicted on both grids are nearly identical and smooth. This suggests that pressure smoothing is in fact not required when ﬁne grids are used. In Figure 5.10(c), the coarse-grid solutions are repeated but now the smoothing pressure correction is applied. It is seen that the predicted pressure distribution on collocated grids is now smooth though not in exact agreement with the staggered-grid pressure distribution because of the coarseness of the grid and also because p is evaluated by multidimensional averaging. Then, what is the role of the smoothing pressure correction? This can be understood from deﬁnition (5.49). The smoothing correction represents the difference between the point value of pressure p and the control-volume-averaged pressure p. The latter is deﬁned by Equation 5.43 as the average of linearly interpolated can be ﬁnite only when spatial pressures in the x1 and x2 directions. Thus, psm variation of pressure p multidimensionally departs from linearity. This is the case at the midplane of the square cavity. On coarse grids, we observe zigzagness if → 0. That is, as a smoothing is not applied. However, when grids are reﬁned, psm continuum is approached, no smoothing should be required. The role of smoothing pressure correction is thus simply to predict smooth pressure distribution on coarse grids. We now recall the quantity λ1 ( p − p) introduced in the normal stress expression in Chapter 1. It was stated in that chapter that λ1 is trivially zero in a continuum but . is ﬁnite in discretised space. We have recovered λ1 = 0.5 in our deﬁnition of psm But, as the grid size is reﬁned, one approaches a continuum and, therefore, λ1 can be set to zero to predict smooth pressure distributions as shown in Figure 5.10(b). As a corollary, we may now view pressure zigzagness as a spatial counterpart of the oscillating compressible sphere of isothermal gas explained by Schlichting [65].

135

5.5 NOTION OF SMOOTHING PRESSURE CORRECTION

(a) 1.0 Re = 100 15 ∗ 15 GRID

0.8

Y

0.6

0.4 COLLOCATED (WITHOUT SMOOTHING) STAGGERED

0.2

P (0.5, Y) − P (0.5, 1.0)

0.0

−0.025

0.000

0.025

(b) 1.0

Re = 100 41 ∗ 41 GRID

0.8

Y

0.6

0.4

COLLOCATED (NO SMOOTHING) STAGGERED

0.2

P (0.5, Y) − P (0.5, 1.0) 0.0

−0.025

0.000

0.025

0.050

(c) 1.0

Re = 100 15 ∗ 15 GRID

0.8

0.6

Y

Figure 5.10. Pressure variation with and without smoothing.

0.4

COLLOCATED (WITH SMOOTHING) STAGGERED 0.2

0.0

P (0.5, Y) − P (0.5, 1.0) −0.025

0.000

0.025

136

2D CONVECTION – CARTESIAN GRIDS

On collocated grids, when density is constant and steady state prevails (as in our calculation of the square cavity problem), m˙ P = ρ ∇ V and thus m˙ P = 0, as was recognized in Section 5.3.2. Now, as our control volume is ﬁxed, ∇ V = 0 (which implies rate of volume change) creates dissipation in the system. It is this dissipation that generates p different from p. We had anticipated this result in Chapter = 0.5 ( p − p) discovered through our discretisation of equa1. The need for psm tions applicable to a continuum is therefore not surprising. In summary, therefore, simply accounts for the dissipation introduced in the system. introduction of psm Further discussion of smoothing pressure correction can be found in [16, 17]. Finally, we note that equation 5.41 suggests that p x1 ,P is a solution to the discretised version of ∂ 2 p = 0, ∂ x12 P

These deductions were also anticipated in Chapter 1. Before considering applications of our SIMPLE-collocated procedure, it would on the convergence rate be of interest to examine the effect of introduction of psm of the solution procedure. To do this, we plot variation of momentum and mass residuals with iteration number l for the case of 41 × 41 grid solutions shown in Figure 5.10(b). Figure 5.11 shows these variations for staggered and collocated grids. The initial guess and the underrelaxation factors are identical in the two computations. The ﬁgure shows that the convergence histories are almost identical on both types of grids. Further, computations were stopped when momentum residuals fell below 10−5 . At this stage of convergence, the mass residuals are seen to be smaller by an order of magnitude. Thus, we may conclude that our SIMPLEcollocated grid procedure is successful in mimicking the SIMPLE-staggered grid procedure in all respects. The convergence rate of an iterative procedure greatly depends on the initial guess for the relevant variables. Among the different variables, the initial guess for pressure is perhaps the most difﬁcult to provide. Further, in deriving Ai vi are set to zero. the pressure-correction equation, quantities Ai u i and Thus, the pressure-correction equation is only an approximate one. In spite of this, computational experience shows that the predicted pressure-correction distribution provides very good velocity corrections, which are proportional to the pressurecorrection gradient (see Equations 5.63 and 5.64), but a rather poor correction of pressure itself.

137

5.5 NOTION OF SMOOTHING PRESSURE CORRECTION

0.1

COLLOCATED - Ru COLLOCATED - Rv

0.01

RESIDUALS

COLLOCATED - Rm STAGGERED - Ru STAGGERED - Rv

0.001

STAGGERED - Rm

0.0001

1E-5

41

∗ 4 1 GRIDS

1E-6

ITERATIONS 50

100

150

200

250

300

350

Figure 5.11. Convergence histories.

To appreciate this experience, we consider a 1D ﬂow through a porous medium15 having porosity (= volume of ﬂuid/total volume). Then, the governing mass conservation and momentum equations are given by d (ρ ∗ u) = 0, dx

solution given here, but velocity u = 0 at all nodes. In Problem 2, p(1) = 4 × 105 and p (I N ) = 0, but p = 0 at all interior nodes of the domain. Again u = 0 at all nodes. Thus, in both problems, the guessed velocity is zero and the boundary pressures are held ﬁxed so that p (1) = p (I N ) = 0. Relaxation parameters are taken as α = β = 1. For Problem 1, by solving for u and p , the exact solutions (not shown here) for p and u are obtained in just one iteration although the initial guess for u was zero. This is because the initial guess for pressure was itself the exact solution and, therefore, required no correction. Table 5.1 shows evolutions with iteration number l for Problem 2. Notice that because of the poor initial guess for pressure, the exact velocity solution is obtained in eight iterations whereas the correct pressure prediction requires twelve iterations.

139

5.6 APPLICATIONS

8

T = 20 C h = 1. 75 0.2 0.2 0.2 0.2 0.2

1.0 0.75

STEEL

0.25

T = 80 C CONCRETE Figure 5.12. Reinforced concrete slab.

Thus, the correct velocity solution is indeed obtained earlier in the iteration process. / p and psm / p at convergence. They The last two rows in the table show values of pm are indeed small within round-off errors and become even smaller if the iterations are continued. The general lesson learnt from the example here is that, in a pure ﬂow problem, overall convergence rate is controlled by the evolution of the pressure variable for which there is no exact equation. 5.6 Applications In this section, a few problems are solved to illustrate the application of the procedure just described. The problems are solved using the generalised computer code given in Appendix C. The reader will ﬁnd it useful to read the typical USER ﬁles given in this appendix to understand the details of implementation. Conduction Problem Figure 5.12 shows a concrete slab with I-section steel beams embedded for reinforcement. The conductivities of steel and concrete are 100 and 1 W/m-K, respectively. The lower surface of the slab is at 80◦ C and the upper surface is exposed to the environment at 20◦ C with a heat transfer coefﬁcient of 1.75 W/m2 -K. It is required to determine the steady-state temperature distribution in the slab.17 In this problem, u i = 0; therefore, solution need be obtained for = T only. The governing differential equation is ∂T ∂ ∂T ∂ K + K = 0. (5.115) ∂ x1 ∂ x1 ∂ x2 ∂ x2

Equation 5.115 must be solved on the smallest domain, exploiting symmetries. Thus, the chosen domain is 0 ≤ x1 ≤ 0.5 and 0 ≤ x2 ≤ 1.0, with x1 = 0 and x1 = 0.5 taken as symmetry boundaries. The boundary conditions at the top and bottom of the slab are shown in the ﬁgure. 17

Figure 5.13 shows the computed temperature contours. Computations were carried out by employing harmonic-mean conductivities at the cell faces. This is important because conductivities of concrete and steel are different (see interfaces IB1, IB2, JB1, JB2, JB3, and JB4 marked on Figure 5.13). A 13(x1 ) × 22(x2 ) grid is employed. The ﬁgure shows that, in the middle of the slab, the temperature is almost uniform in both steel and concrete. The maximum temperature, 80◦ C, is prescribed at the lower boundary and the predicted temperature at the top convective boundary is almost uniform at 54◦ C. The heat loss through the top boundary is thus calculated at 60 W/m2 and this also equals the heat gain through the bottom boundary since steady-state conditions prevail. Note that if the I-section beams were not present, one would have 1D heat conduction through concrete alone and the heat loss would then be 38.2 W/m2 . The presence of high-conductivity I-section beams has enhanced the rate of heat transfer. Periodic Laminar Flow and Heat Transfer Compact heat exchangers often employ an offset-ﬁn conﬁguration to enhance convective heat transfer at the expense of an increased pressure drop. However, when geometric parameters are suitably chosen, the overall thermo-hydraulic performance (i.e., increased heat transfer for the same pumping power or reduced pumping power for the same heat duty) is improved, resulting in a compact heat exchanger design. Figure 5.14 shows an array of interrupted plates or blocks, which may be regarded as a 2D idealisation of the offset-ﬁn heat exchanger; the ﬂow width in the x3 direction is large. The length and the width of each block are L and t, respectively, and the transverse pitch is H.

where β is the overall pressure gradient (a constant because the ﬂow is fully developed) and po is the superposed pressure that is periodic [54]. The same situation also holds for the velocities. Thus, the boundary conditions at planes A-F and C-D are po (0, x2 ) = po (2L , x2 ),

u i (0, x2 ) = u i (2L , x2 ).

(5.117)

Note that parts of A-F and C-D are solid walls. The symmetry and wall boundary conditions require no elaboration. With the introduction of variable po , it will be appreciated that the u 1 and u 2 momentum equations are solved with source terms β − ∂ po /∂ x1 and −∂ po /∂ x2 , respectively, and the p equation will provide corrections to pressure po . In fact, the equations are solved with an assumed value of β and the average streamwise velocity is evaluated from the resulting predicted velocity ﬁeld at convergence. The total mass ﬂow through the module can be estimated at any transverse plane but we may evaluate it at plane A-F (say) so that H/2 m˙ = 0 ρ u 1 d x2 and deﬁne u av based on the frontal area, as is the practice in heat-exchanger design. Thus, ˙ (ρ H/ 2). u av = m/

(5.118)

142

2D CONVECTION – CARTESIAN GRIDS

The friction factor and Reynolds number are deﬁned as f =

2β H , 2 ρ u 2av

Re =

ρ u av 2 H . µ

(5.119)

It is difﬁcult to specify exact thermal boundary conditions at the blocks in a real heat exchanger. Nonetheless, we may assume that each block or plate delivers heat ﬂux qw (say) along its perimeter so that the total heat transfer will be Q = qw (2 L + 4 t/2) and the total bulk temperature rise across the module will be Tb = Q/(m˙ C p ). Thus, the periodic temperature boundary condition will be T (0, x2 ) = To (0, x2 ) − 0.5 Tb , T (2L , x2 ) = To (2L , x2 ) + 0.5 Tb , To (0, x2 ) = To (2L , x2 ).

and s is measured along the heated surfaces. Computations are performed for air (Pr = 0.7) with a 38(x1 ) × 36(x2 ) grid and the results are shown in Figure 5.15. In all computations, L/H = 1.0 and t/H is varied. Also plotted in the ﬁgure are experimental data of Kays and London as read from reference [54]. These data have been obtained for t/H = 0.05, L/H = 1.14 (instead of 1 in the present case), and the (x3 -direction width)/H = 5.9. Therefore, the geometric data approximate the present 2D computational domain. It is seen from the ﬁgure that the predicted friction factor data (solid lines) are in very good agreement with the experimental data (open circles). The predicted St × Pr 2/3 (dashed lines) trend, however, deviates from the experimental data (open squares). But, as indicated earlier, it is difﬁcult to approximate the exact boundary conditions of the experiment, which

involved condensing steam for heating. This condition implies a nearly uniform temperature at the blocks. However, then, the heat transfer, unlike the ﬂow, will not be periodically fully developed. According to [54], the effect of this deviation from the experimental condition on predicted St may not be greater than 10%. The reader should note that such departures from exact experimental conditions are often made in CFD analysis. The ﬁgure further shows that the effect of t/H on f is more signiﬁcant than on the Stanton number. An approximate analysis carried out in [33] shows that the effect of a ﬁnite thickness ﬁn is to create continuously disrupted laminar boundary layers on the ﬁn surface and thus achieve enhanced heat transfer. Thus, although it is important to include the effect of a ﬁnite ﬁn thickness in the analysis, the results show that ﬁn thickness must be optimised in order not to exact a severe penalty in pressure drop. To demonstrate the effect of Re, velocity vectors and temperature (T − Tmin )/(Tmax − Tmin ) contours at an interval of 0.1 are plotted for t/H = 0.3 at three different Reynolds numbers in Figure 5.16. In each case, the core ﬂow is nearly parallel to the x1 axis but the strength of ﬂow circulation in the ﬁn-wake regions increases with Reynolds number. Similarly, as Re increases, the temperature contours are seen to be closer near the heating surfaces, indicating higher heat transfer rates at higher Re.

Turbulent Flow in a Pipe Expansion We now consider turbulent ﬂow and heat transfer at a pipe expansion, as shown in Figure 5.1. The radius ratio (R2 /R1 ) of the two pipes is 2. For prediction purposes,

the HRE e– model is used. The predictions18 will be compared with the experimental data of Krall and Sparrow [36] for Pr = 3.0 and of Runchal [62] for Pr = 1,400. Krall and Sparrow made measurements in a pipe with radius R2 in which an oriﬁce of radius R1 is ﬁtted. Downstream of the oriﬁce, a constant wall heat ﬂux is supplied. Runchal employed a converging nozzle (with exit-end radius R1 ) ﬁtted in a pipe of radius R2 . He employed an electro-chemical mass transfer technique to measure variation of mass transfer Stanton number downstream of the nozzle. The technique involves use of a NaOH solution whose Schmidt number (>1,000) depends on the solution concentration. The electro-chemical technique measures transfer of ferrocyanide ions to ferricyanide ions at a cathode surface embedded in the pipe wall to estimate the rate of mass transfer. These rates are, however, very low so that the mass transfer measurements can readily simulate the heat transfer situation with Sc = Pr . The electro-chemical technique simulates a Tw = constant condition. 18

The USER ﬁle for this problem is given in Appendix C.

145

5.6 APPLICATIONS

5.0

5.0

Re 25000

Re = 24800 4.0

4.0

51500

Nu / Nuf d

3.0

50000

100000

3.0

100000

2.0

2.0

1.0

1.0

PREDICTIONS Pr = 3

EXPT DATA Pr = 3 0.0

0.0 0

5

X/D

10

15

0

5

X/D

10

15

Figure 5.17. Sudden expansion, with R2 /R1 = 2 and q w = constant.

In both cases, the domain downstream of the oriﬁce or nozzle is considered. At the inlet section, the speciﬁcations are u in = 4 × u, ein = (0.1 × u in )2 , and in is 2 /in = 0.003 Re for 0 ≤ r < R1 evaluated from the speciﬁcation µt /µ = Cµ ρ ein and u in = 0 (wall) for R1 ≤ r ≤ R2 . The Reynolds number of the larger pipe is deﬁned as Re = ρ u 2 R2 /µ. Computations are carried out with ρ = 1 and u = 1 and R2 = 1. Thus, Re is varied by varying µ. The Nusselt numbers at different axial locations are evaluated from N u x = qw 2 R2 /K (Tw − Tb ), where Tb is the bulk temperature and Tw is the wall temperature at each x. In the computations, 67 (streamwise) × 28 (radial) nodes were used with closer spacings in the recirculation region to accurately predict the point of reattachment. Because of the close near-wall spacings, it was not possible to ensure that the ﬁrst node away from the wall will have sufﬁciently large y + at all axial stations. Therefore, the two-layer wall function is active for velocity (see Equation 5.86). For the temperature equation, P F is given by Equation 5.88. In Figure 5.17, predicted N u x /N u fd are compared with the experimental data of Krall and Sparrow. Here, as per their recommendation, N u fd = 0.0123 Re0.874 Pr 0.4 . In these computations, the reattachment point is predicted at x/(2 R2 ) ≈ 1.84 at all Reynolds numbers. The predicted N u max locations (≈1.81) thus appear to coincide with the point of ﬂow reattachment. The high values of N u max /N u fd indicate that the recirculation region is by no means dead with respect

146

2D CONVECTION – CARTESIAN GRIDS

0.15

EXPT DATA Pr = 1400

St ∗ 1000

0.12

0.09

Re = 21300 56000

0.06

88800 0.03

0.00 0.0

5.0

10

15

20

Z

25

30

0.15

PREDICTIONS Pr = 1400

St ∗ 1000

0.12

0.09

50000 Re = 20000

0.06

100000 0.03 0.00

0

5

10

15

20

Z

25

30

Figure 5.18. Sudden expansion, with R2 /R1 = 2 and Tw = constant.

to heat transfer, although the ﬂow velocities are very low there. This is a special characteristic of recirculating regions in which ﬂuid mixing is enhanced. The predictions also appear to nearly match the trends shown by the experimental data, although the exact magnitudes of N u max are not well predicted. A similar comparison with the data of Runchal is shown in Figure 5.18. Here, Z = x/(R2 − R1 ) and St = N u x /(Re Pr ) so that the predicted ﬂow reattachment occurs at Z = 7.43. The predictions, however, show that the maximum St occurs at nearly Z ≈ 3.55. Thus, the point of reattachment and maximum heat transfer do not coincide. The experimental data, however, indicate that maximum St occurs at Z ≈ 6.5. Thus, clearly our wall-function treatment with respect to heat transfer is in need of further reﬁnement for very large Pr . It is possible to do so by invoking a threelayer model for heat transfer and setting different limits on the three layers. However, this is not done here to draw the reader’s attention to the need for such empirical adjustments. At the same time, it must be noted that the electro-chemical technique really simulates the Tw = constant boundary condition only over a patch occupied

147

5.6 APPLICATIONS

L

g

H t

h BRINE

WATER ω1

BRINE ω0

l Figure 5.19. Natural convection mass transfer.

by the cathode but remains inert to mass transfer on remaining portions of the wall. This may be an added reason for lack of correspondence between predictions and experiment. Modelling for separated ﬂow regions at high Pr numbers is an area in which basic research is hampered by the extremely sharp variations of temperature in the near-wall region where, although the turbulent viscosity may be negligible, turbulent conductivity may still be signiﬁcant. Thus, a constant Prt assumption may not be justiﬁed. Natural Convection Mass Transfer19 Figure 5.19 shows an open channel (width l and height h) placed inside a wider channel of width L and height H . The wider channel is closed at the top. The inner channel wall thickness is t. Both the channels are long in the x3 direction. The inner channel has water whereas the wider channel has brine at its ﬂoor (x2 = 0). The temperatures of water, brine, and the gas (air + water vapour) are the same and equal to the ambient temperature. In this isothermal case, evaporation will ensue because of the difference in vapour pressures at the water (high) and the brine (lower) surface. The vapour pressure at the brine surface can be altered by altering brine concentration. Thus, a mass transfer driving force is established. The inner channel may be viewed as the well-known Stefan tube in which the evaporation rate of water can be analytically evaluated under the assumption that 19

The USER ﬁle for this problem is given in Appendix C.

148

2D CONVECTION – CARTESIAN GRIDS

the ﬂuid inside the channel is stagnant. However, in the present case, because of the density gradient caused by the vapour-pressure difference, a mass transfer buoyancy force will induce ﬂuid motion. The objective, therefore, is to examine the range of mass transfer Grashof numbers Grm for which the stagnant ﬂow assumption may be reasonably justiﬁed. Such an inquiry has been undertaken by McBain et al. [47] in which the inner channel is a circular tube placed inside a cubical enclosure. We have modiﬁed this 3D conﬁguration to accommodate a 2D analysis in Cartesian coordinates. We deﬁne L ∗ = L/l, H ∗ = H/l, h ∗ = h/l, and t ∗ = t/l. In this case equations for = u 1 , u 2 , ω, and p must be solved. Invoking the Boussinesq approximation, except for the gravity-affected source term in the u 2 -momentum equation, we assume the density will be constant. Also viscosity and mass diffusivity are assumed constant. Thus, the governing equations can be nondimensionalised using u i∗ = u i /(ν/l), p ∗ = ( p + ρ g x2 )/ρ (ν/l)2 , ω∗ = (ω − ω0 )/(ω1 − ω0 ), and xi∗ = xi /l. The relevant source terms are Su ∗1 = −

where n is normal to the walls. The x1∗ = 0 line is the symmetry boundary and computations are performed over the domain to the right of the symmetry line. The mass transfer boundary conditions on the ﬂoor (x2∗ = 0) are u ∗1 = 0, u ∗2

For a Stefan tube, the pure diffusion mass transfer rate is given by Fdiff =

ln (1 + B) , Sc h ∗

(5.129)

where the Spalding number B = −1/(1 − ωT∗ ). Therefore, the ﬂux ratio R will be a functional given by R=

Fconv = f (Grm , H ∗ , L ∗ , h ∗ , t ∗ , Sc, B). Fdiff

(5.130)

In the present computations, h ∗ = 2, L ∗ = 16, H ∗ = 8, t ∗ = 0.1, and Sc = 0.614 are ﬁxed. Also, in a typical evaporation problem, B is small. We take ωT∗ = 50, giving B = 0.0204. Thus, with these speciﬁcations, R is a function of Grm only. Computations have been performed with 37 × 37 grid points with closer spacings near the inner channel wall and near the ﬂoor. Initially, only the mass transfer equation is solved. This corresponds to a stagnant ﬂuid case. If ω∗ = 0 at x2∗ = h ∗ then the evaporation ﬂux will be given by Equation 5.129. However, in the present conﬁguration, ω∗ = 0 at x2∗ = h ∗ because the boundary condition is applied at the brine surface. This results in R = 0.704 for this limiting case. Now, the mass transfer equation is solved together with the ﬂow equations for different values of Grm . Table 5.2 shows the results of computations. It is seen that the ratio increases with Grm . A similar trend has been observed in [47]. To ensure convergence, solutions for lower Grm were used to obtain solutions for higher Grm . The trend observed in the R ∼ Grm relation is further demonstrated in Figure 5.20 through contour and vector plots over the domain 0 < x1∗ < 2.5 and 0 < x2∗ < 5.5. The ﬁgure shows that the inner channel remains nearly stagnant at Grm = 10. For higher Grm , the region near the top of the inner channel is inﬂuenced by the recirculation outside the channel. False Diffusion in Multidimensions In Chapter 3, the question of numerical false diffusion was explored through the 1D conduction–convection equation. Here, this matter is again considered for multidimensional ﬂows through a problem devised by Raithby [57] (see Figure 5.21). We consider a square domain of unit dimensions through which a ﬂuid moves with an angle θ with the x axis. The viscosity and conductivity of the ﬂuid are zero so that transport of temperature occurs by pure convection with Peclet number P = ∞. At a certain streamline at y0 = 0.5 (1 − tan θ), a step discontinuity in temperature is imposed as shown in the ﬁgure. Thus, T = 1 above the streamline and T = 0

below it. Now, since P = ∞, the discontinuity must be preserved in the direction of the ﬂow. To examine the capability of the UDS for this large Peclet number case, the velocities are prescribed as u = U cos θ and v = U sin θ at all nodes and the temperature boundary conditions are as shown in Figure 5.21. The equation for T will read as ∂T ∂T + tan θ = 0. ∂x ∂y

(5.131)

This equation is solved for different angles θ on a 12 × 12 grid. Figure 5.22 shows the predicted T proﬁles at midplane x = 0.5. It is seen that the proﬁles are smeared. The proﬁles deviate from the exact solution; the deviation increases as θ increases and reaches maximum at θ = 45 degrees. Now, the proﬁles can be smeared only if numerical diffusion is present. This suggests that when the ﬂow inclination with respect to the grid line is large, the numerical diffusion is also large. Conversely, if θ = 0 or 90 degrees, the discontinuity in the temperature proﬁle should be predicted. This is indeed veriﬁed by numerical solutions (not shown in the ﬁgure). Wolfshtein [89] has devised a method for estimating the false diffusivity (see exercise 12). What is observed here with UDS remains valid for all convection schemes, although the proﬁle-shape-sensing CONDIF and TVD schemes demonstrate reduced deviations and, therefore, reduced numerical diffusion. However, recognising the angular dependence of false diffusion, some CFD analysts have proposed

152

2D CONVECTION – CARTESIAN GRIDS

1.0

EXACT 0.8

T (0.5, Y)

0.6

0.4

0.2

30

45

Θ = 15 EXACT

0.0 0.00

0.25

0.50

0.75

Y

1.00

Figure 5.22. Midplane temperature proﬁles – UDS.

convection schemes that sense the angle θ. In effect, they postulate ﬂow-oriented interpolations of cell-face values rather than use the nodal values straddling the cell faces. EXERCISES 1. Starting with Equation 5.8, validate the generalisations shown in Equation 5.19. Hence, show the correctness of Equation 5.17 for each convection scheme. 2. Derive the value of A in Equation 5.19 for the exponential scheme. 3. Show that if the CONDIF scheme (see Chapter 3, Exercise 10) is used then, for a nonuniform grid, the coefﬁcients AE and AW in Equation 5.12, for example, will read as dw |Pcw | − Pcw |Pce | − Pce + ∗ , AE = de 1 + 4 Rx 4 AW = dw

|Pcw | + Pcw ∗ |Pce | + Pce + de R x , 1+ 4 4

where Rx∗ = (E − P )/(P − W ) × xw /xe . (Hint: Recognise that CONDIF is essentially a CDS whose coefﬁcients are modiﬁed to take account of the shape of the local proﬁle). 4. Using the substitutions shown in Equation 5.24, derive Equation 5.25. Hence, using the IOCV method, derive Equation 5.28.

153

EXERCISES

B

C R

S

Th

P

OUTFLOW

Q M H

Y g

G

A

F E INFLOW D

X Z Figure 5.23. Long chamber of Exercise 11.

5. Starting with Equation 5.40, derive Equation 5.47. 6. Show the validity of Equations 5.55 and 5.56. 7. Identify the differences and similarities between Equations 5.57 for collocated grids and Equation 5.32 for staggered grids. 8. Conﬁrm that on collocated grids A P u 1 = A P u 2 . 9. It is of interest to derive a total pressure-correction equation for compressible ﬂows in which p = ρ Rg T . To do this, start with Equation 5.57 and write ρ l+1 = ρ l + ρm = ρ l +

) pm ( p − psm = ρl + . Rg T Rg T

With this substitution show that the p -equation takes the form of a general transport equation for $ any with appearance of convection–diffusion-like terms. Also, Vsound = γ Rg T . Hence, show the Mach number dependence in the equation. If CDS is used, can the coefﬁcients in the discretised equation (5.60) turn negative? If yes, suggest a remedy. 10. Explain the need for evaluating the mass residual via Equation 5.73 when computing on collocated grids. 11. Consider the chamber shown in Figure 5.23. The chamber is long in the z-direction so that the ﬂow and heat transfer can be considered 2D. Assume that all relevant dimensions are given. The ﬂow enters the chamber with

154

2D CONVECTION – CARTESIAN GRIDS

ζ

L

T=0

L

η

U

T = 1 Y0 T=0 X0 T = 1 Figure 5.24. Estimating false diffusion.

velocity u in (as shown) and temperature Tin . The chamber walls and the lip separating the inﬂow and outﬂow are adiabatic. Allow for the presence of a buoyancy effect, (a) Write the appropriate differential equations and the boundary conditions for all relevant variables. (b) Carry out any necessary node tagging, deﬁning clearly the convention used. For example, along AB, NTAGW (2, J) = 14 (say) to indicate the west adiabatic wall boundary. 12. Solve the problem of false diffusion discussed in the text for the case of θ = 45 degrees in which the boundary conditions are as shown in Figure 5.24. Take L = 100 and y0 = x0 = 2 S, where S = X = Y . The situation is therefore akin to that of a temperature source convected by U . Now, deﬁne orthogonal coordinates ξ and η as shown. Use UDS. Obviously, the maximum temperature Tmax will occur at η = 0 for each ξ . Now, locate the value of η1/2 corresponding to T/Tmax = 0.5. Hence, plot the computed results as T/Tmax versus η/η1/2 for different values of ξ/S > 50. Show that the proﬁes collapse on a single curve η 2 T , = exp − ln (2) Tmax η1/2 where η1/2 /S = (ξ/S)0.5 . This equation is similar to the solution to the

13. Derive Equation 5.94. 14. Consider a long furnace made from refractory brick (k = 1.0 W/m-K), as shown in Figure 5.25. The temperature of the inside surface is 600◦ C whereas the outside surface is exposed to an environment at 30◦ C with heat transfer coefﬁcient h = 10 W/m2 -K. Determine the heat loss from the furnace wall. 15. Consider two parallel plates that are inﬁnitely long in the x1 and x3 directions. Fins are attached to the plates in a staggered fashion, as shown in Figure 5.26. 2L FINS

H

2B

δ

X2 X1 Figure 5.26. Flow and heat transfer in a staggered ﬁn array.

156

2D CONVECTION – CARTESIAN GRIDS

X2

2B

DUCT BOUNDARY

X1

2A Figure 5.27. Fully developed ﬂow in an ellipse.

The ﬂow is in the x3 direction. The plates receive constant heat ﬂux qw in the ﬂow direction but, at any section x3 , their temperature Tw is constant in the x1 direction. The ﬂow and heat transfer are fully developed. (a) Assuming laminar ﬂow, identify the equations and the boundary conditions governing the ﬂow and heat transfer (b) Nondimensionalise the equations and show that H L δ kﬁn δ H L δ , , , Nu = F , , , . f Re = F B B B B B B kﬂuid H (c) Compute f and N u for B = L = 1, H = 1.2, and δ = 0.05. Take Cﬁn = kﬁn /kﬂuid = 0, 10, and 100. (Hint: Note that the ﬁn half-width δ/2 must be treated as a blocked region through which 1D heat conduction takes place.) 16. Consider fully developed laminar ﬂow in a duct of elliptic cross section, as shown in Figure 5.27. The ﬂow is in the x3 direction. (a) Write the PDE governing distribution of the u 3 velocity. Identify the smallest relevant domain, exploiting the available symmetries. (b) The duct wall boundary of the domain is curved. This boundary can be approximated by a series of steps. Hence, lay an appropriate Cartesian grid. Solve the governing equation and evaluate f × Re for B/A = 0.125, 0.25, 0.5, and 1.0. 17. Consider laminar ﬂow between two parallel plates 2B apart, as shown in Figure 5.28. The plates are inﬁnitely long in the x3 direction. Flow, with uniform axial velocity, enters at x1 = 0. At a distance S from the entrance, an inﬁnitely long cylinder of radius R is placed at the axis of the ﬂow channel. The ﬂow leaves the channel in a fully developed state. (a) Ideally, the ﬂow situation should be computed with curvilinear or unstructured grids. However, an analyst decides to compute it using a Cartesian

157

EXERCISES

X2 R

2B X1

S

Figure 5.28. Flow in a parallel-plate channel.

mesh. What is the main difﬁculty that the analyst will face if the drag offered by the cylinder is to be accurately determined. (b) Select the domain length from ﬂuid dynamic considerations. Assume that the Reynolds number based on the channel hydraulic diameter is 40 and S/R = 3 and B/R = 10. (c) How should the drag coefﬁcient CD of the cylinder be determined from the converged solution in discretised form? 18. Consider laminar ﬂow between two parallel plates separated by distance 2b. Specify the fully developed axial velocity proﬁle at the inﬂow plane and zero axial velocity gradient at exit. Adapt the 2D computer program in Appendix C for this problem and solve with and without smoothing pressure correction. Observe the predicted velocity and pressure proﬁles in the two cases. Do you notice any difference? If not, explain why. 19. Engine oil enters a tube (diameter = 1.25 cm) at uniform temperature Tin = 160◦ C. The oil mass ﬂow rate is 100 kg/hr and the tube wall temperature is maintained at Tw = 100◦ C. If the tube is 3.5 m long, calculate the bulk temperature of oil at exit from the tube and the total pressure drop. The properties of oil are as follows ρ = 823 kg/m3 , C p = 2,351 J/kg-K, ν = 10−5 m2 /s, and k = 0.134 W/m-K. Plot the axial variation of Nusselt number N u x and the bulk temperature Tb,x . Assume that the oil enters the tube with uniform velocity. (Hint: You will need to provide close grid spacings near the tube wall to capture steep variations of temperature owing to the high Prandtl number. The grid spacings along the tube axis may expand in the direction of the ﬂow.) 20. Air at 7 bar and 100◦ C enters a nuclear reactor channel (width = 3 mm, length L = 1.22 m) at the rate of 7.5 kg/s-m2 . The heat ﬂux at the channel walls is given by qw = 900 + 2,500 sin (π x1 /L) W/m2 . Plot the variation of Tw , Tb , and N u with axial distance x1 and ﬁnd the location of maximum wall temperature. Assume fully developed ﬂow and evaluate properties at 250◦ C.

158

2D CONVECTION – CARTESIAN GRIDS

SL

ST 2B

L X2 X1 Figure 5.29. Flow in a channel containing rods.

21. Consider fully developed turbulent ﬂow in a pipe of radius R. Assuming that the inner layer extends up to y + = 100 from the wall, estimate the inner layer thickness as a fraction of R for Re = 5,000, 25,000, 75,000, and 100,000. 22. Air at 30◦ C enters a tube (diameter D = 5.0 cm) of a solar air-heater with a uniform velocity of 10 m/s. The tube is 2.1 m long. The tube wall temperature is 90◦ C. Determine the exit bulk temperature and the pressure drop. Also determine the length-averaged Nusselt number. Use the HRE model. 23. Repeat Exercise 22 assuming that the tube is rough with roughness height yr /D = 0.01. Use the HRE model. For a rough surface, the velocity proﬁle near a wall is given by [65] y 1 + + 8.48. u = ln κ yr This equation can be cast in the form of Equation 5.86 so that 1 exp (8.48 κ) u + = ln E r y + , Er = . κ yr+ Thus, the wall-function treatment remains valid with E replaced by E r . Simi0.2 larly, P F (Equation 5.88) must be replaced by P Fr = 5.19 Pr 0.44 yr+ − 8.48 with Prt = 1 [22]. (Hint: You will need to modify the BOUND subroutine and STAN function in the Library ﬁle in Appendix C to account for yr .) 24. Consider steady turbulent ﬂow in a two-dimensional plane channel (see Figure 5.29) containing an array of rods (of diameter D). Flow enters at x1 = 0 with uniform velocity u 1,in . It is of interest to determine the pressure drop over length L. To reduce the computational effort in this densely ﬁlled ﬂow situation, model the ﬂow as a porous-body ﬂow in which it is assumed that the

159

EXERCISES

18 cm

VANE FAN

50 cm

66 cm

10 cm

WET PAD

FRONT GRILL

44 cm Figure 5.30. Idealised desert cooler.

channel contains no rods but the effect of their presence is captured through two artifacts: (i) The effective ﬂuid density, viscosity, and pressure are taken as , where = ρ, (µ + µt ), and p, respectively, where is the porosity deﬁned as =

ﬂuid volume . physical volume

(ii) The source terms in the u 1 and u 2 momentum equations are augmented by including local ﬂow resistance offered by the rods through experimentally determined friction factors f u 1 and f u 2 deﬁned as p S L ST =F , , ReD,tot , fui = 0.5 ρ u i |Vtot | D D % where Vtot = u 21 + u 22 and u i are superﬁcial velocities. Function F ( ) is assumed known but note that SL and ST must be re-deﬁned for the u 2 velocity. (a) Write the equations to be solved and choose an appropriate exit boundary condition assuming L/(2B) = 10. Specify the inlet conditions for all variables including the variables characterising turbulence. (b) Discuss whether the effect of ﬂow resistance terms could be accounted for through source-term linearisation. 25. Figure 5.30 shows an idealised desert cooler in which hot air (40◦ C and 10% relative humidity) enters the cooler inside through the 10-cm-wide gap with a velocity of 40 m/s. The air picks up moisture at the wet pad, which is supplied

160

2D CONVECTION – CARTESIAN GRIDS

with water at 25◦ C. The humidiﬁed air becomes cooler and leaves through the front grill. (a) State the equations governing the cooling process and identify the main variables . (b) Specify the appropriate exit boundary condition. Assume an equilibrium condition at the wet pad. The wet pad is rough with roughness height 5 mm. The top and bottom walls are smooth and may be taken as insulated. (c) Determine the average outﬂow temperature, relative humidity, humid-air velocity, and the rate of moisture pickup.

6 2D Convection – Complex Domains

6.1 Introduction In practical applications of CFD, one often encounters complex domains. A domain is called complex when it cannot be elegantly described (or mapped) by a Cartesian grid. By way of illustration, we consider a few examples. Figure 6.1 shows the smallest symmetry sector of a nuclear rod bundle placed inside a circular channel of radius R. There are nineteen rods: one rod at the channel center, six rods (equally spaced) in the inner rod ring of radius b1 , and twelve rods in the outer ring of radius b2 . The rods are circumferentially equispaced. The radius of each rod is ro . The ﬂuid (coolant) ﬂow is in the x3 direction. The ﬂow convects away the heat generated by the rods and the channel wall is insulated. It is obvious that a Cartesian grid will not ﬁt the domain of interest because the lines of constant x1 or x2 will intersect the domain boundaries in an arbitrary manner. In such circumstances, it proves advantageous to adopt alternative means for mapping a complex domain. These alternatives are to use 1. curvilinear grids or 2. ﬁnite-element-like unstructured grids.

6.1.1 Curvilinear Grids It is possible to map a complex domain by means of curvilinear grids (ξ1 , ξ2 ) in which directions of ξ1 and ξ2 may change from point to point. Also, curvilinear lines of constant ξ1 and constant ξ2 need not intersect orthogonally either within the domain or at the boundaries. Figure 6.2 shows the nineteen-rod domain of Figure 6.1 mapped by curvilinear grids. The ﬁgure shows that curvilinear lines generate clearly identiﬁable quadrilateral control volumes. When the IOCV method is used, the task is to integrate the transport equations over a typical control volume. To facilitate this, it becomes necessary to ﬁrst transform the transport equations written in Cartesian

In general, these functional relationships must be developed by numerical grid generation techniques (see Chapter 8). The grids shown in Figure 6.2 are in fact generated by numerical means. For simpler domains, however, the functional relationships can be speciﬁed by algebraic functions. The new set of transport equations in curvilinear coordinates are developed in Section 6.2. One advantage of mapping domains by curvilinear grids is that one can still retain the familiar (I, J ) structure to identify a node (or the corresponding control volume) because, as can be seen from Figure 6.2, along any curvilinear line ξ1 , the total number of intersections with constant-ξ2 lines remains constant and vice versa. Further advantages of this identifying structure will become clear in Section 6.2. 6.1.2 Unstructured Grids Another alternative for a complex domain is to map the domain by triangles or any n-sided polygons (including quadrilaterals) or any mix of triangles and polygons. Figure 6.3 shows the mapping of a nineteen-rod bundle by triangles as an example. In this case, the rods are arranged in such a way that the smallest symmetry sector ξ2

X2

ξ1 X1

Figure 6.2. Nineteen-rod bundle – curvilinear grids.

6.1 INTRODUCTION

Figure 6.3. Nineteen-rod bundle – unstructured grid.

is a doubly connected domain. Such mapping can be generated by commercially available grid generators such as ANSYS. Each triangle may now be viewed as a control volume over which the transport equations are to be integrated to arrive at the discretised equations. The process of generating the latter equations is described in Section 6.3. It will be recognized that a triangle is a very convenient elemental construct because it can map any convex intrusion or concave extrusion at the domain boundaries. More importantly, triangles can also effectively skirt any blocked region within the overall domain, as shown in Figure 6.3. Such skirting cannot be elegantly accomplished if curvilinear grids are used for mapping. The ﬂexibility offered by mapping by triangulation is thus obvious. Further, it is not necessary that all triangles be of the same size or shape. In spite of this ﬂexibility, it becomes necessary to make a signiﬁcant departure from curvilinear grid practise with respect to node identiﬁcation when unstructured grids are used. It is obvious from Figure 6.3, for example, that one cannot readily identify elements (or nodes) by employing the familiar (I, J ) structure as was possible with curvilinear grids. Elements, perforce, must be identiﬁed serially with a single identiﬁer N (say). As will be shown in Section 6.3, commercial codes such as ANSYS identify elements in any arbitrary order. Thus, an element having identiﬁer N will interact with elements having arbitrary identifying numbers without any generalisable rules. This contrasts with the case of curvilinear grids in which a control volume (I, J ) will always interact with control volumes identiﬁed by (I + 1, J ), (I − 1, J ), (I, J + 1), and (I, J − 1). This serial numbering has consequences for solution of discretised equations evolved on an unstructured grid. This will become clearer in Section 6.3. In passing, we note that there are a variety of methods for triangulation. Automatic triangulation requires detailed considerations from the subject of computational geometry. In

Comparison of Equation 6.28 with Equation 6.14 shows that the Jacobian J is nothing but element volume d V with dξ1 = dξ2 = 1. The Normal Fluxes Note that Equation 6.20 can be written in the following form:

rJ

∂ ∂ ∂(ρ ) [r qξ1 ] + [r qξ2 ] = r J S, + ∂t ∂ξ1 ∂ξ2

(6.29)

where qξ1 and qξ2 are given by ∂

eff 2 ∂ d A1 , qξ1 = ρ Uf1 − + d A12 J ∂ξ1 ∂ξ2

(6.30)

eff ∂ 2 ∂ + d A12 d A2 . qξ2 = ρ Uf2 − J ∂ξ2 ∂ξ1

(6.31)

With reference to Figure 6.4, these expressions represent total (convective + diffusive) transport of normal to the two curvilinear directions, respectively. The convective transport ρ Uﬁ is thus directed normal to the constant-ξi lines. In other words, Uﬁ is directed along the contravariant base vector a i . Note that, in general, lines of constant ξ1 and ξ2 do not intersect orthogonally. Thus, the total normal diffusive contribution is made up of two components. The ﬁrst, containing d Ai2 , is due to the property gradient along the covariant base vector direction ai , the second, containing d A12 , is due to the property gradient along the direction ξ j , j = i. If the intersection of coordinate lines were to be orthogonal, d A12 = 0. Also, from Equations 6.13, it is clear that d A12 can be both positive as well as negative.

6.2.4 Discretisation Our next task is to discretise Equation 6.20 for the general variable . To do this, we deﬁne the typical node P of a curvilinear grid as shown in Figure 6.4. The cell faces (ne-se, se-sw, sw-nw, and nw-ne), as in the case of Cartesian grids, are assumed to be midway between the adjacent nodes. In curvilinear coordinates, ξ1 = ξ2 = 1, as already explained. Then, using the IOCV method, integration1 of Equation 6.20 over the control volume surrounding node P gives rP JP

In Equation 6.39, cross-derivative terms containing d A12 are dropped. This is because the pressurecorrection equation is essentially an estimator of pm and, therefore, in an iterative procedure the truncated form presented in Equation 6.39 sufﬁces. It is of course possible to recover the effect of the neglected term in a predictor–corrector fashion. U are contravariant mean velocities.

6.2.6 Overall Calculation Procedure The overall calculation procedure on curvilinear grids is nearly the same as that on Cartesian grids. Some important features are highlighted in the following: 1. Read coordinates x1 (i, j) and x2 (i, j) for i = 1, 2, . . . , I N and j = 1, 2, . . . , J N . Hence calculate the geometric coefﬁcients β ij and areas and volumes once and for all. 2. At a given time step, guess the pressure ﬁeld pi,l j . This may be the pressure ﬁeld from the previous time step. 3. Solve, using ADI, Equation 6.20 for Cartesian velocity components = u l1 and u l2 with appropriate boundary conditions (see next subsection). 4. Evaluate Uf1 and Uf2 from Equations 6.22 and 6.23. In these evaluations, the cell-face velocities u f1 and u f2 are evaluated by arithmetic averaging. Hence, evaluate the source term of the total pressure-correction equation (6.39). Solve Equation 6.39 to obtain the pi, j ﬁeld. 5. Evaluate pi, j as described in the previous subsection. Hence recover pm,i, j to l+1 l correct pressure as pi, j = pi, j + β pm,i, j . 6. Correct Cartesian velocities as l u l+1 1,P = u 1,P −

ρ r α 1 β1 P ( pm,e − pm,w ) + β21 P ( pm,n − pm,s ) , (6.43) u AP 1

l u l+1 2,P = u 2,P −

ρ r α 2 β1 P ( pm,e − pm,w ) + β22 P ( pm,n − pm,s ) . (6.44) u 2 AP

Note that A P u1 = A P u2 . 7. Solve for other relevant scalar s.

172

2D CONVECTION – COMPLEX DOMAINS

J = JN

o

o

o

o

o

o

o

o

WEST

NORTH

o

o

o

o

5

o o o o

J=1 I=1

o

o

o

o

o

o

o

o

o

o o o

8

3

2

12

o o o

o o

IN = 31 JN = 9

16

SOUTH

o

o o

o

o

I = IN J= 1

20 30 o

o

24 o

o

o

o

o

o

o o

o o

o

o

EAST

o o

5

o

o o

o o

J = JN

o

o o

o

o

o

o

o

o

Figure 6.5. Node tagging, for a curvilinear grid with a 180◦ bend.

8. Check convergence through evaluation of residuals for momentum and scalar equations. Evaluate the mass source residual Rm as appropriate for collocated grids (see Chapter 5). 9. If the convergence criterion is not satisﬁed, treat pl+1 = pl , l+1 = l and return to step 3. 10. To execute the next time step, set all o = and return to step 2.

6.2.7 Node Tagging and Boundary Conditions Because of the applicability of the (i, j) structure on curvilinear grids, there are many features that are in common with those described for Cartesian grids. Thus, one can readily use Su and Sp in Equation 6.36 to effect underrelaxation and boundary conditions. Node tagging too can be done as described in Chapter 5. Care, however, is needed in identiﬁcation of the boundary type. To illustrate this, consider the computational domain for a ﬂow in a duct with a 180◦ bend shown in Figure 6.5. The index I increases with ξ1 and J with ξ2 . The ﬂow enters at the west boundary. The west boundary is identiﬁed with I = 1, east with I = I N , south with J = 1, and north with J = J N . Note that although in the physical domain (as drawn) the east boundary appears to the west, in the computational domain it is identiﬁed I = I N and the J index is seen to run downwards. Thus, NTAGE (I N − 1, J ), J = 2, 3, . . . , J N − 1 will be tagged with 21, 22, 23, or 24 depending on the type of boundary condition. Similarly, the south boundary in the return ﬂow channel of the bend coincides with J = 1 but, in the physical domain, it is above the north boundary.

173

6.2 CURVILINEAR GRIDS

ξ2 nw

n ∆n

(1, J)

Figure 6.6. Gradient boundary condition.

(2, J) e

Flux q

1, J

sw

ξ1 s

To illustrate implementation of ﬂux (or normal-gradient) boundary condition, consider the west boundary shown in Figure 6.6. Let q be the speciﬁed ﬂux. Then ∂ ∂

It is now possible to extract an expression for 1, j and implement the boundary condition using Su and Sp in the manner described in the previous chapter. The exit boundary condition where the second derivative of a scalar variable is set to zero can also be derived from this condition. Speciﬁcation of the exit boundary condition for velocity, however, requires care. This is because the boundary conditions are known only in terms of boundary-normal and tangential velocity components. The Cartesian velocity components are then extracted from this speciﬁcation. More discussion of this matter is presented in the next section. Boundaries at which is speciﬁed require no elaboration. Finally, the wall-function treatment for the HRE turbulence model requires special care because the wall shear stress must be evaluated from the wall-normal gradient of velocity parallel (tangential) to the wall. Details of these and other issues of discretisation can be found in Ray and Date [58].

174

2D CONVECTION – COMPLEX DOMAINS

Figure 6.7. Vertex and element numbering on an unstructured grid.

6.3 Unstructured Meshes 6.3.1 Main Task As mentioned in Section 6.1.2, a typical domain may be mapped by triangular, quadrilateral, and/or n-polygonal elements. Here, we again consider a relatively simple domain shown in Figure 6.7. The domain is mapped by triangles using ANSYS. The domain consists of two horizontal parallel plates in which a circular arc bump is provided at the bottom plate. Flow enters the left vertical boundary and leaves through the right vertical boundary. When a domain is mapped in this way, ANSYS generates two data ﬁles: 1. a vertex ﬁle and 2. an element ﬁle. The entries of these two ﬁles are shown in Table 6.1. They correspond to Figure 6.7. In this ﬁgure, there are 42 vertices and 59 elements. Note that the vertex numbering is completely arbitrary. The vertex ﬁle provides serial numbers of vertices along with their x1 , x2 , and x3 coordinates. Since the domain is two dimensional, all x3 are zero. The element ﬁle, in contrast, provides serially numbered elements (shown inside triangles) along with the identiﬁcation numbers of three vertices (since triangular elements are generated) that form the element. Like vertex numbering, element numbers are also assigned arbitrarily. There are a variety of ways in which transport equations can be discretised on an unstructured grid. The two principal ones are [83] (a) a vertex-centred approach and (b) an element-centred approach. Vertex-Centred Approach In the vertex-centred approach, the collocated variables are deﬁned at the vertices. Thus, vertices are treated as nodes. When the transport equations are discretised, a variable at node P (say) is related to variables at vertices in the immediate neighbourhood of P with which node P is connected by a line. The vertex and element ﬁles contain sufﬁcient information to identify vertex or node numbers of vertices with which node P is connected. Such a data structure needs to be generated by

writing a separate computer program. It is clear from Figure 6.7 that different vertices will have different numbers of neighbouring vertices. In this approach, to adopt an IOCV method for discretisation, one needs to construct a control volume surrounding node P. Figure 6.8(a) shows a typical vertex P along with its neighbours. Different approaches are possible for the control-volume construction, but the one adopted here is as follows: 1. Identify elements having a common vertex at P. 2. Locate centroids of each element. This can be done by using known coordinates of vertices of each element. 3. Connect the successive centroids by straight lines (shown dotted in Figure 6.8). The dotted lines will enclose P and thus form a control volume surrounding P. Such a construction at all vertices will yield a non-overlapping set of control volumes. Discretisation can now be carried out for a typical control volume. One disadvantage of this approach concerns application of boundary conditions. Thus, consider a vertex (or a node) at the junction of two boundaries as shown in Figure 6.8(b). Now, if the boundary conditions at the two boundaries of the junction are different, the boundary condition at the junction node cannot be uniquely deﬁned. It is possible to overcome this difﬁculty but only at the expense of additional bookkeeping.

176

2D CONVECTION – COMPLEX DOMAINS

T = T1

JUNCTION NODE

c3 c4 c2

T = T2

P

c1

c5

(b)

(a) Figure 6.8. Vertex-centred unstructured grid.

Element-Centred Approach In contrast to the vertex-centred approach, the element-centred approach regards each triangular (or polygonal) element itself as the control volume [see Figure 6.9(a)]. Then, node P is deﬁned at the centroid of the element such that

xi,P =

1 (xi,1 + xi,2 + xi,3 ), 3

i = 1, 2,

(6.48)

and the coordinates of vertices 1, 2, and 3 are known from the vertex ﬁle. Note that node P will be identiﬁed by the identiﬁer of the element to which it belongs because node P will always remain enclosed within its surrounding control volume. In this case, node P will have only three neighbours since triangular elements are considered. The identiﬁcation numbers of neighbouring elements are, however, not a priori known. However, these can be determined from the element ﬁle because two neighbouring elements must share the same two vertices. To establish this connectivity between elements, a separate computer program must be written.

1

3

P

P 2

1 2

3 B

(a) Figure 6.9. Element-centred unstructured grid.

(b)

BOUNDARY

177

6.3 UNSTRUCTURED MESHES

The lines joining vertices will henceforth be called control volumes or cell faces and elements will be referred to as cells. Thus, a triangular element will have three cell faces. The same logic extends to polygonal cells. Now, it is easy to recognize that when nodes are deﬁned at the centroids of cells, there is no node at the boundary to facilitate implementation of the boundary conditions. Therefore, a boundary node must be deﬁned. We adopt the convention that the boundary node shall be at the center of the cell face coinciding with the domain boundary. This is shown in Figure 6.9(b) by point B. It will be recognised that even if there is a change in boundary condition on either side of a vertex, the boundary condition can now be effected without any ambiguity. Practitioners of CFD familiar with control-volume discretisation on structured grids prefer the element-centred approach [5, 46, 20] rather than the vertex-centred approach. In the discussion to follow, therefore, the element-centred approach is further developed. 6.3.2 Gauss’s Divergence Theorem The transport equation (5.1) in Cartesian coordinates is again considered here but without the presence of r for brevity.3 The equation is rewritten as ∂(ρ ) ∂ qi ∂(ρ ) = + + div ( q ) = S, ∂t ∂ xi ∂t

(6.49)

where the vector q = i q1 + j q2 and i and j are unit vectors along Cartesian coordinates x1 and x2 , respectively. To implement the IOCV method, Equation 6.49 is now integrated over the elemental control volume shown in Figure 6.9. Thus, with the usual approximations, we have V

div ( q )d V = S V, (6.50) + ρP P − ρPo oP t V where V is the volume (i.e., the area in the 2D domain with unit dimension in the x3 direction) of the cell surrounding P. This cell volume can be calculated knowing the coordinates of the vertices. The second term on the left-hand side will now be evaluated by invoking Gauss’s divergence theorem [70] applicable to a singly connected region. Thus, div ( q )d V = q · A, (6.51)

V

C

where C is a line integral along the bounding surfaces (or lines in two dimensions) of the control volume and A is the local area vector normal (pointing outwards) to 3

This neglect in no way disqualiﬁes the developments to follow.

178

2D CONVECTION – COMPLEX DOMAINS

ξ2 n

b

ξ2

n b

c c

P

ξ1

a e

ξ1

E

E

e P

a

(a)

(b)

Figure 6.10. Typical cell face ab.

the bounding surface (line). The direction of C is anticlockwise. To make further progress, the line integral is replaced by summation. Thus, NK k, q · A = ( q · A) (6.52) C

k=1

where N K = 3 for a triangular element and k stands for the kth face of the control volume. Thus, the line integral is discretized into N K segments. To evaluate the dot product q · A at each cell face k, consider Figure 6.10, where evaluation at face ab (say) shared by neighbouring cells P and E is to be carried out. Let line PE be along the ξ1 direction and line ab be along the ξ2 direction, where the latter direction is chosen such that Jacobian J (see Equation 6.14) is positive. Let lines PE and ab intersect at e. Now, depending on the shapes of cells P and E, e may lie within ab [Figure 6.10(a)] or on an extension of ab [Figure 6.10(b)]. Further, let n be the unit normal vector to ab pointing outwards with respect to cell P as shown in the ﬁgure. Then, using Equation 6.25, we get ∂ x2 ∂ x1 1 2 − j = i β1 + j β1 , A = Aab · n = i ∂ξ2 ∂ξ2

Note that the normal diffusion is evaluated directly in terms of a normal gradient rather than in terms of resolved components in ξ1 and ξ2 directions as was done on curvilinear grids (see Equations 6.30 and 6.31). It is this feature that makes our diffusion transport evaluation equally applicable to 3D polyhedra. The convective and diffusive contributions to total transport across each cell face k must now be evaluated. In the literature [19, 46, 20], these contributions are evaluated in a variety of ways, but without invoking any line structure. The approach adopted here recognises the importance of a line structure analogous to the one available at the cell face of a structured grid. The existence of such a line structure at the cell face of an unstructured grid, however, is not obvious because the line joining cell centroids P and E intersects cell face ab in an arbitrary manner, as shown in Figure 6.10. Therefore, a line structure must be deliberately constructed. This matter is considered in the next subsection. 6.3.3 Construction of a Line Structure Our interest is to evaluate total transport (Equation 6.62) normal to the kth cell face. To carry out this evaluation, consider the more general face construction shown in Figure 6.10(b). This ﬁgure is again drawn more elaborately in Figure 6.11 to carry out the necessary construction of a line structure. The construction begins by drawing two normals (shown by dotted lines) to ab passing through e and c. Now, two lines parallel to ab are drawn passing through nodes P and E. Let the line through P intersect the face normal through e at P1 and

180

2D CONVECTION – COMPLEX DOMAINS

ξ2

NODES

b n E2

FICTITIOUS POINTS

c n P2 a

E1

e

P

ξ1 E

P1

Figure 6.11. Construction of a line structure at cell face ab.

that through c at P2 . Note that these intersections at P1 and P2 will be orthogonal. Similarly, let the face-parallel line through E intersect the two normals at E1 and E2 , respectively. With this construction, it is clear that Equation 6.62 must be evaluated along the line P2 –c–E2 . These evaluations, it will be appreciated, will now be similar to the evaluations carried out at the cell face of a structured grid control volume. In the next two subsections, the convective and diffusive contributions are evaluated separately. 6.3.4 Convective Transport Following the usual methodology, the convective transport term in Equation 6.62 is evaluated as Cck ck = Cck [ f ck P2 + (1 − f ck )E2 ]k ,

Note that this interpolation can also be performed multidimensionally as stated in Chapter 5. Thus, one may write ck =

1 1 [ f m,c E2 + (1 − f m,c ) P2 ] + ( a + b ). 2 4

182

2D CONVECTION – COMPLEX DOMAINS

In Equation 6.70, the ﬁrst term on the right-hand side represents ﬁrst-orderaccurate evaluation of the normal gradient whereas the second term imparts secondorder accuracy. In this latter term, if c is evaluated from general formula (6.66) then the term will simply vanish. To retain second-order accuracy, therefore, c must be interpolated along direction ab. Now, since point c (see Figure 6.11) is midway between a and b, ck = 0.5 (ak + bk ).

It will be recognised that dck is nothing but the familiar diffusion coefﬁcient having signiﬁcance of a conductance. The symbol Bck is introduced for brevity. 6.3.6 Interim Discretised Equation At this stage of development, it will be instructive to recapitulate derivations following Equation 6.50. Thus, the volume integral in this equation is replaced by a summation of face-normal contributions in Equation 6.52. The total (convective + diffusive) face-normal contribution at any face is then represented in Equation 6.62. The convective component of the total face-normal contribution is given by Equation 6.63 and the diffusive component by Equation 6.73. Therefore, Equation 6.50 may now be written as V

ρP P − ρPo oP t NK Cck f c P2 + (1 − f c )E2 k + k=1

−

NK

dck (E2 − P2 )k

k=1

+

NK k=1

dck Bck f m,c E2 − c + (1 − f m,c )P2 k = S V.

(6.76)

183

6.3 UNSTRUCTURED MESHES

This discretised equation, however, is of little use because the values of variables at ﬁctitious points P2 and E2 and at vertices a and b are not known. We must therefore relate values at these ﬁctitious points to the values at nodes P and E. This matter is developed in the next subsection. 6.3.7 Interpolation of Φ at P2 , E2 , a, and b If it is assumed that the variation between P and P2 is linear then to ﬁrst-order accuracy P2 = P + P = P + lPP2 · ∇ P ,

Now, let A P be the multiplier of P in Equation 6.96. Then using Equations 6.97 and 6.99, it follows that5 A P = ρP

= ρPo

=

ρPo

NK V {dck + f ck Cck } + t k=1

(6.100)

NK V {dck − (1 − f ck ) Cck } + t k=1

(6.101)

NK V AE k . + t k=1

(6.102)

Thus, Equation 6.96 can be compactly written as A P l+1 = P

NK k=1

5

o AE k l+1 Ek + S V + ρP

NK V o Dkl . P + t k=1

Note the similarity of Equation 6.102 with Equation 6.37 derived for curvilinear grids.

(6.103)

186

2D CONVECTION – COMPLEX DOMAINS

The following comments are now in order: 1. Equation 6.103 has the familiar form in which the value of P is related to its neighbors Ek . 2. Superscripts l and l + 1 are now added to indicate that terms Dk containing Cartesian derivatives of are treated as sources and therefore lag behind by one iteration. The same applies to the source term S. A method for evaluating nodal Cartesian derivatives is developed in the next subsection. 3. Equation 6.103 applies to an interior node. When the control volume adjoins a boundary, one of the cell faces will coincide with the boundary. In this case, Ek for the boundary face will take the value of B , where B is shown in Figure 6.9(b). For different types of boundaries, boundary conditions are different for different variables. Therefore, Equation 6.103 must be appropriately modiﬁed to take account of boundary conditions. This matter will be discussed in Section 6.3.10. 6.3.9 Evaluation of Nodal Gradients To evaluate the Dk terms in Equation 6.103, Cartesian gradients of must be evaluated (see Equations 6.90 to 6.93). This evaluation is carried out as follows: 1 ∂ ∂ ∂ = d V. (6.104) = ∂ xi P ∂ xi V V ∂ xi P P

The volume integral here can again be replaced by a line integral and subsequently by summation. Thus NK

The appearance of P in Equation 6.106 suggests that Equation 6.105 is implicit in ∂/∂ xi (see Equation 6.90). However, since the overall calculation procedure is iterative, such implicitness is acceptable. 6.3.10 Boundary Conditions To describe application of boundary conditions, consider a cell near a boundary (Figure 6.12) with face ab coinciding with the domain boundary. Note that

187

6.3 UNSTRUCTURED MESHES

INFLUX FB

b

n ξ1

ξ2 B=c=e

BOUNDARY FACE

P P2

a

Figure 6.12. Line structure for a near-boundary cell.

a boundary node B has already been deﬁned [see Figure 6.9(b)] such that xi,B =

1 (xi,a + xi,b ). 2

(6.107)

Thus, since the boundary node is midway between a and b, from the construction shown in Figure 6.11, it is easy to deduce that points B, c, and e will coincide on the boundary face. Therefore, to represent transport at the boundary, an outward normal (shown by a dotted line) is drawn through B. Now, let line PP2 be orthogonal to this normal and therefore parallel to ab. With this construction, the total outward transport through ab can be written as (see Equation 6.62) ∂ , (6.108) ( q · A)B = CB B − ( A)B ∂n B where

Again, the individual components u i,B can be determined from simultaneous solution of Equations 6.124 and 6.127.

190

2D CONVECTION – COMPLEX DOMAINS

6.3.11 Pressure-Correction Equation In Chapter 5, the total pressure-correction equation in Cartesian coordinates was derived to read as

∂ ρ u li ∂ ∂ρ p ∂ p + , (6.128)

i = ∂ xi ∂ xi ∂ xi ∂t where p

i =

ρ α V . A P ui

(6.129)

In this deﬁnition of p , α and A P u i are, respectively, the underrelaxation factor and the A P coefﬁcient used in the momentum equations. Invoking the Gauss theorem again, the discretised version of Equation 6.128 will read as A P pP =

NK

AE k pEk −

k=1

where A P =

N K

k=1

NK k=1

NK V

p Cck − ρP − ρPo Dk , + t k=1

(6.130)

AE k and AE k =

p dck

( p A)ck = . lP2 E2

(6.131)

Two comments are now important: p

1. The Dk term in Equation 6.130 will contain Cartesian gradients of p . However, during iterative calculation, since the pressure-correction equation is treated only p as an estimator of p , Dk is set to zero. p 2. Evaluation of ck in Equation 6.131 will require evaluation of V and A P u i at the cell face (see Equation 6.129). The evaluation of cell-face volume can be accomplished via a fresh construction at the cell face as shown in Figure 6.13. The construction involves drawing lines parallel to ab passing through P2 and E2 . Then, two lines parallel to normal n (and, hence, parallel to line P2 E2 ) are drawn through a and b. The resulting rectangle c1 –c2 –c3 –c4 will have volume Vck = lab × lP2 E2 × 1 = Ack lP2 E2 .

(6.132)

Using this equation therefore gives AE k =

α (ρ A2 )ck , A Pcku

(6.133)

where A Pcku = A Pcku 1 = A Pcku 2 can be evaluated from formula (6.66).6 6

Alternatively, one may evaluate A Pcku exactly by carrying out a structured-grid-like discretisation over the control volume c1 –c2 –c3 –c4 . This is left as an exercise.

Making these substitutions in Equation 6.136 and carrying out the summation indicated in Equation 6.135, and further separating out p x1,P = pP , we obtain an explicit equation for p x1,P that reads as p x1 ,P = A/B, where A=

NK )

β11

2

*#

( pE + pE − pP )

Vck

k=1

−

NK 1 & β1 (x2,E2 − x2,P2 ) ( pb − pa ) Vck ,

(6.137)

k=1

and B=

NK

β11

2 #

Vck ,

(6.138)

k=1

where pb and pa are evaluated using Equations 6.92 and 6.93. Similarly, we obtain an equation for p x2 ,P = A/B, where A=

NK )

β12

2

*#

( pE + pE − pP )

Vck

k=1

−

NK 2 & β1 (x1,E2 − x1,P2 ) ( pb − pa ) Vck

(6.139)

k=1

and B=

NK

β12

2 #

Vck .

(6.140)

k=1

6.3.12 Method of Solution Our interest is in solving the set of equations (6.103) for all interior nodes P. Thus, if there are N E elements, there are N E equations for each variable. Again, equations for each variable are solved sequentially (see the next subsection). It has been noted that the A P coefﬁcients will dominate over the neighbouring coefﬁcients AE k . But, the positions of AE k in the coefﬁcient matrix [A] will be arbitrary because of the manner in which neighbouring nodes are numbered during grid generation using ANSYS. This is unlike the case of structured grids (both Cartesian and curvilinear)

6.3 UNSTRUCTURED MESHES

where A P occupies the diagonal positions and the neighbouring coefﬁcients occupy the off-diagonal positions, forming a pentadiagonal matrix (in the 2D case). It is this special feature of the structured grids that permitted employment of the ADI solution method. The arbitrary [A] matrix formed on unstructured grids is called a sparse matrix. For such matrices, rapidly convergent methods such as conjugate-gradient (CG) and generalised minimal residual (GMRES) are available [3]. These methods are particularly attractive when the number of elements and, hence, the number of equations requiring simultaneous solutions are large. Description of these methods is considered beyond the scope of the present book. However, the diagonally dominant position occupied by the A P coefﬁcient in our equations still permits employment of the simple point-by-point GS procedure. Thus, the equations can be solved by a simple routine as follows:

where NK(N) stores the number of neighbours of node N, NHERE (N, K) stores the element number of the kth neighbouring node of N, and source term SU (N) and AP (N) and SP (N) have already been calculated. 6.3.13 Overall Calculation Procedure The important features of the overall calculation are described through the procedural steps that follow. Preliminaries 1. Read element and vertex ﬁles. Determine neighbouring elements of each node N to form NHERE (N , K). This is done by searching the shared vertices between neighbouring elements. Note that there will be no neighbouring elements when a boundary face is encountered. At such a face, a boundary node is created and such nodes are identiﬁed with numbers NE + 1, NE + 2, etc., where NE are the total number of elements read from the element ﬁle. The coordinates of interior nodes are calculated using Equation 6.48 and of boundary nodes using Equation 6.107. 2. Tag the boundary nodes with identiﬁcation numbers for inﬂow, symmetry, wall, and exit boundaries. Note that here boundary nodes rather than near-boundary cells are tagged. This is unlike the practice on structured grids.

193

194

2D CONVECTION – COMPLEX DOMAINS

3. Knowing coordinates of nodes and vertices, calculate β1i , l xi , dxi for i = 1, 2 and f m,c and Ac for each face of every node. This is a once-and-for-all calculation and all these quantities are stored in two-dimensional arrays (N , K). In addition, V is calculated for each cell. Solution Begins 4. At a given time step, guess the pressure ﬁeld pl . 5. Solve Equation 6.103 for = u l1 and u l2 . The solution is preceded by evaluation of AE (N , K) and AP (N), SP (N), and the entire source term SU (N) in Equation 6.103. It is assumed that SU and SP are appropriately modiﬁed to account for boundary conditions. 6. Perform a maximum of ten iterations on Equation 6.134 for p . Here AE (N , K) are evaluated from Equation 6.133 and the source term containing mass ﬂuxes is evaluated from Equation 6.65. distribution from pm = p − 0.5 ( pl − p l ), where p l is evalu7. Recover the pm ated from Equations 6.137 to 6.140. 8. Apply pressure and velocity corrections at each node. Thus , pPl+1 = pPl + β pm,P

u l+1 i,P

0 < β < 1, α V ∂ pm l , = u i,P − A P u i ∂ xi P

(6.141) (6.142)

where the pressure gradient is evaluated using Equations 6.105 and 6.106. The mass-source residual Rm is evaluated from Equation 5.73, where A P and Ak coefﬁcients are the same as in Equation 6.134. 9. Solve Equation 6.103 for all other relevant scalar s. 10. Check convergence by evaluating residual R via the imbalance in Equation 6.103 for each as explained in Chapter 5. Special care is again needed in evaluation of the mass residual Rm . This is evaluated from the imbalance in . Equation 6.134 in which p is replaced by pm 11. If the convergence criterion is not satisﬁed, treat pl+1 = pl and l+1 = l and return to step 5. 12. To execute the next time step, set all o = l+1 and return to step 4.

6.4 Applications Flow over Banks of Tubes In shell-and-tube heat exchangers, the ﬂow on the shell side takes place over a bank of tubes several rows deep. The ﬂow is aligned at various angles to the axis of the tubes. However, for preliminary design work, the ﬂow may be assumed to be transverse to the axis (i.e., a cross ﬂow). This conﬁguration has been extensively researched and experimentally determined data are available [91] for different values

195

6.4 APPLICATIONS

SL

SL

ST

ST

D

D

INLINE ARRAY

STAGGERED ARRAY

Figure 6.14. Flow across banks of tubes.

of aligned and staggered arrangement of tubes. The important geometric parameters are (see Figure 6.14) longitudinal pitch SL , transverse pitch ST , and tube diameter D. Here, we consider cases of SL /D = ST /D = 2 for the inline array and SL /D = ST /D = 1.5 for the staggered array. For the purposes of computations, however, the smallest symmetric domain must be considered. Such domains are mapped by curvilinear grids as shown in Figure 6.15. In these domains, the north and south boundaries are partly symmetric and partly occupied by tube wall but the west and east boundaries are periodic. Note, however, that in the inline array, the periodicity is even whereas a cross-periodicity occurs in the staggered array with respect to the u 2 velocity. Computations have been performed using 45 × 15 grids for the inline array and 41 × 15 grids for the staggered array. For turbulent ﬂow, the standard HRE model with two-layer wall

INLINE ARRAY

STAGGERED ARRAY symmetry

symmetry

symmetry

ST /2

wall periodic

wall

periodic

S T/2

periodic wall

periodic

SL

SL

wall

symmetry

Figure 6.15. Computational domains for inline and staggered arrays.

196

2D CONVECTION – COMPLEX DOMAINS

1000

Grimison

Zhukauskas

f x 103

Nu

100

10

INLINE ARRAY

1 10

100

1000

10000

100000

1E6

Figure 6.16. Variation of f and Nu with Re for ST /D = SL /D = 2.

functions has been used with one modiﬁcation. Thus, in Equation 5.87, (u + + P F) is replaced by [κ −1 ln (E y + ) + P F]. All predictions are performed for Pr = 0.7 and a constant wall heat ﬂux (qw ) boundary condition is assumed at the tube walls. For laminar ﬂow, global underrelaxation is used to procure convergence whereas for turbulent ﬂow, a false transient technique is used. The friction factor and Nusselt number are evaluated as f = 0.5

d p SL , 2 d x ρ Vmax

Nu =

hD qw D , = K K (T w − Tin )

(6.143)

respectively, where T w is the average wall temperature over forward and rear tubes and Tin is the bulk temperature at the inlet periodic boundary. For the chosen values of SL and ST , Vmax = u in , the bulk velocity at the inlet periodic boundary. Finally, the Reynolds number is deﬁned as Re = ρ Vmax D/µ. Since the ﬂow is periodic, the average streamwise pressure gradient is speciﬁed and Re is the output of the solution. Figure 6.16 shows the predicted f (open circles) and N u (open squares) for the inline array. For the 2 × 2 array and Re > 2,000, correlations due to Grimison [25] [N u = 0.229 Re0.632 (dotted line)] and Zhukauskas [91] [N u = 0.23746 Re0.63 for Re < 2 × 105 and N u = 0.01842 Re0.81 for 2 × 105 < Re < 2 × 106 (solid line)] are plotted in the ﬁgure. These correlations are developed for constant tube-wall temperature but are used as a reference for the constant wall heat ﬂux predictions

197

6.4 APPLICATIONS

Grimison

1000

Zhukauskas

Nu

f x 103

100

10

STAGGERED ARRAY

1 10

100

1000

Re

10000

100000

1E6

Figure 6.17. Variation of f and Nu with Re for ST /D = SL /D = 1.5.

considered here. It is well known that for near-unity Prandtl numbers, turbulent ﬂow correlations are typically insensitive to the type of boundary condition. The ﬁgure shows that the present turbulent-ﬂow N u predictions are in good agreement with the correlations. Similar agreement is also obtained by Antonopoulos [2]. The friction-factor data of Zhukauskas are read from an available graph and are shown by a solid line. The presently predicted turbulent-ﬂow friction-factor data are seen to be substantially above the experimental data. Unfortunately, predicted frictionfactor data are not reported in [2]. In the laminar range, however, the friction-factor data show the expected steeper slope with Re but no correlations are available for comparison. Figure 6.17 shows a similar comparison for the staggered array. Here again, the turbulent-ﬂow friction-factor data show gross overprediction but N u data are in excellent agreement with the correlation due to Zhukauskas. The laminar-ﬂow N u shows a peculiar decline at Re ∼ 120. This is because of the change in the ﬂow structure at this Reynolds number, which in turn alters the temperature distribution. For Re < 120, the maximum temperature occurs at the rear tube, whereas for Re > 120, the maximum temperature occurs at the forward tube. In summary, we may state that for both inline and staggered arrays, the predicted turbulent N u data are in good agreement with the experimental correlations but the predicted turbulent f data are in poor agreement with the Zhukauskas correlations. Although the latter correlations are taken as standard, it may be noted that there are other researchers whose experimental correlations for f are in much closer agreement with the present predictions.

Figures 6.18 and 6.19 show typical plots of velocity vectors and contours of 2 ) and turbulent viscosity (µt /µ). The vectors show turbulent kinetic energy (e/Vmax regions of separation and reattachment behind the forward tube. The energy contours (range: 0–0.1, interval: 0.005) show that the energy levels are high near the solid walls where the ﬂow shear is also high. The energy levels in the ﬂow separation region are not insigniﬁcant. For the inline array, the viscosity contours for Re = 12,000, (range: 0–400, interval: 20) and for Re = 81,500, (range: 0–3,000, interval: 150) show that turbulent viscosity is high near the walls, where kinetic energy is high. The levels of viscosity, however, increase with increase in Reynolds number as expected. The viscosity contours for a staggered array show similar trends. However, notice that at similar Reynolds numbers (for Re = 12,417, range: 0–200, interval: 10; for Re = 105 , range: 0–2,000, interval: 100) the viscosity levels are lower than those found for the inline array. Gas-Turbine Combustion Chamber Flow in a gas-turbine combustion chamber represents a challenging situation in CFD. This is because the ﬂow is three dimensional, elliptic, and turbulent and

involves chemical reaction and the effects of radiation. In addition, the ﬂuid properties are functions of both temperature and the composition of combustion products and the true geometry of the chamber (a compromise among several factors) is always very complex. Figure 6.20 shows an idealised chamber geometry. The chamber is taken to be axisymmetric of exit radius R = 0.0625 m and length L = 0.25 m. In actual combustion, aviation fuel (kerosene) is used but we assume that fuel is vaporised and enters the chamber with air in stoichiometric proportion. That is, 1 kg of fuel is premixed with 17.16 kg of air. Thus, the stoichiometric air/fuel ratio is Rstoic = 17.16. The fuel–air mixture enters radially through a circumferential slot (width = 3.75 mm located at 0.105 L) with a velocity of 111 m/s and a temperature of 500◦ C (773 K). Additional air is injected radially through a cylindrical portion (called casing) of the chamber through two circumferential slots.7 The ﬁrst slot (width = 2.25 mm located at 0.335 L) injects air (called secondary air) to sustain a chemical reaction in the primary zone; the second slot (width = 2.25 mm located at 0.665 L) provides additional air (called dilution air) to dilute the hot combustion products before they leave the chamber. The secondary air is injected with a velocity of 48 m/s and a temperature of 500◦ C. The dilution air is injected at 42.7 m/s and 500◦ C. The mean pressure in the chamber is 8 bar and the molecular weights of fuel, air, and combustion products are taken as 16.0, 29.045, and 28.0, respectively. The heat of combustion Hc of fuel is 49 MJ/kg. With these speciﬁcations, we have a domain that captures the main features of a typical gas-turbine combustion chamber. The top panel of Figure 6.21 shows the curvilinear grid generated to ﬁt the domain. In actual computations, the domain is extended to L = 0.8 m to effect exit boundary conditions. A 50 (axial) × 32 (radial) grid is used. In this problem, inﬂow (at three locations), wall (west, north, and part of south), symmetry, and exit boundaries are encountered. Equations for = u 1 , u 2 , p , e, , and T must be solved in an axisymmetric mode. In addition, 7

In actual practise, radial injection is carried out through discrete holes. However, because accounting for this type of injection will make the ﬂow three dimensional, we use the idealisation of a circumferential slot.

equations for scalar variables ωfu and a composite variable = ωfu − ωair /Rstoic must also be solved. The latter variable is admissible because a simple one-step chemical reaction, (1) kg of fuel + (Rst ) kg of air → (1 + Rst ) kg of products, is assumed to take place. Thus, there are eight variables to be solved simultaneously. The source terms of ﬂow variables remain unaltered from those introduced in Chapter 5, but those of T, ωfu , and are as follows: Sωfu = − Rfu ,

S = 0,

ST =

Rfu Hc , Cp

Rfu = C ρ ωfu , e

(6.144)

where the volumetric fuel burn rate Rfu kg/m3 -s is speciﬁed following Spalding [74] with C = 1. This model is chosen because it is assumed that the fuel-burning reaction is kinetically controlled8 rather than diffusion controlled. Note that in the speciﬁcation of ST , the radiation contribution is ignored. 8

Ideally, Rfu should be taken as the minimum of that given by expression (6.144) and the laminar Arrhenius expression for the fuel under consideration. Here, Equation 6.144 is used throughout the domain so that the burn rate is governed solely by the turbulent time scale /e. For further variations on Spalding’s model, see [44, 24].

6.4 APPLICATIONS

The combustion chamber walls are assumed adiabatic. The inﬂow boundary speciﬁcations, however, require explanation. At the primary slot, u 1 = 0, u 2 = 100, e = (0.005 × u 2 )2 , = Cµ ρ e2 /(µ Rµ ), where viscosity ratio Rµ = µt /µ = 10, T = 773, ωfu = (1 + Rstoic )−1 , and = 0. At secondary and dilution slots, u 2 = −48 and −42.5, respectively, and e = (0.0085 × u 2 )2 , Rµ = 29, T = 773, ωfu = 0, and = −1/Rstoic are speciﬁed. Finally, ﬂuid viscosity is taken as µ = 3.6 × 10−4 N-s/m2 and speciﬁc heats of all species are assumed constant at C p = 1,500 J/kg-K. The density is calculated from ρ = 8 × 105 Mmix /(Ru T ), −1 = ωfu /Mfu + ωair /Mair + ωpr /Mpr , where Ru is the universal gas constant, Mmix and the product mass fraction is ωpr = 1 − ωfu − ωair . In this problem, the equations are strongly coupled and an initial guess for variables is difﬁcult to determine a priori. To ensure convergence, therefore, the false-transient technique is used with t = 10−5 . Convergence is declared when residuals for all variables (except e and ) are less than 10−3 . Further, it is ensured that the exit mass ﬂow rate equals (within 0.1%) the sum of the three ﬂow rates speciﬁed at the slots. A total of 12,500 iterations are required. In the middle panel of Figure 6.21, the vector plot is shown. The plot clearly shows the strong circulation in the primary zone with a reverse ﬂow near the axis necessary to sustain combustion. All scalar variables are now plotted as ( − min )/ (max − min ) in the range 0–1 at a contour interval of 0.1. For turbulent viscosity, µt,min = 0 and µt,max = 0.029; for temperature, Tmin = 773 K and Tmax = 2,456 K (adiabatic temperature = 2,572 K); for fuel mass fraction, ωfu,min = 0 and ωfu,max = 0.055066, and for composite variable, min = −0.058275 and max = 0. The bottom of Figure 6.21 shows that high turbulent viscosity levels occur immediately downstream of the fuel injection slot and secondary and dilution air slots because of high levels of mixing. The top panel of Figure 6.22 shows that the fuel is completely consumed in the primary zone. Sometimes, it is of interest to know the values of mixture fraction f = f stoic + (1 − f stoic ), where f stoic = (1 + Rstoic )−1 . From the contours of shown in the middle panel of Figure 6.22, therefore, values of f and concentrations of air and products can be deciphered. The temperature contours shown on the bottom panel of Figure 6.22 are similar to those of . This is not surprising because although T is not a conserved property, enthalpy h = C p T + ωfu Hc , like , is conserved and ωfu 0 over a greater part of the domain. The temperatures, as expected, are high in the primary zone and in the region behind the fuel injection slot, but the temperature proﬁle is not at all uniform in the exit section. Combustion chamber designers desire a high uniformity of temperature in the exit section to safeguard the operation of the turbine downstream. Such a uniformity is often achieved by nonaxisymmetric narrowing of the exit section. However, accounting for this feature will make the ﬂow three dimensional and hence is not considered here. It must be mentioned that combustion chamber ﬂows are extensively investigated through CFD for achieving better proﬁling of the casing, for determining

geometry of injection holes to achieve high levels of mixing, for determining exact location of injection ports to minimize NOx formation, to achieve uniformity of exit temperatures, and to take account of liquid-fuel injection from burners and consequent fuel breakup into droplets.

Laminar Natural Convection in an Eccentric Annulus Kuehn and Goldstein [37] measured heat transfer in horizontal eccentric cylinders (radius ratio Ro /Ri = 2) containing nitrogen (Pr = 0.706). The inner cylinder is maintained hot at temperature Th and the outer cylinder is maintained at colder temperature Tc . The positive vertical eccentricity /L = 0.652, where L = Ro − Ri . This problem has been computed by employing curvilinear grids by Karki and Patankar [32] and Ray and Date [58] among many others. Here, the problem is computed employing triangular (1,340 cells) as well as quadrilateral (1,320 cells) meshes as shown in Figure 6.23. The symmetry about the vertical axis is exploited. Corresponding to experimental conditions, the Rayleigh number Ra = g β (Th − Tc )L 3 /(ν α) = 4.8 × 104 is chosen. At this value of Ra, the ﬂow remains laminar in all regions of the cavity between the cylinders.

In [37], the experimental data are plotted in the form of a local conductivity ratio K eq , which is deﬁned as K eq,i (θ ) =

qw,i (θ )Ri Ro , ln K (Th − Tc ) Ri

K eq,o (θ) =

qw,o (θ )Ro Ro , (6.145) ln K (Th − Tc ) Ri

where θ = 0 corresponds to the top of the cylinders and θ = 180 refers to the bottom. The heat ﬂuxes at the inner (qw,i ) and outer (qw,o ) cylinders are the output of the computed solution. Figure 6.24 shows a comparison of predicted and experimental (open symbols) data. At the inner hot cylinder, the computed data from the triangular mesh (solid lines) are in superior agreement with the experimental data than those obtained from the quadrilateral mesh (dotted lines). The reverse, however, is the case at the outer cold cylinder. The prediction of peak K eq,o at small angles (i.e., near the top) is in poor agreement with experimental data on both meshes. The cause of this discrepancy between predictions on the two meshes can be attributed to the small difference in the predicted recirculating ﬂow structure (see Figure 6.25) near the top. This difference arises because, compared to the quadrilateral mesh, there are very few cells in the triangular mesh in the top region (see Figure 6.23). Also, the orientations of cell faces with respect to the local direction of the total velocity vector on the two meshes are different. Thus, although the UDS is employed in the calculations on both meshes, false-diffusion errors can be different. The effect of ﬂow angle in causing false diffusion was discussed in Chapter 5. The disagreement with experimental data may be due to inadequate correspondence between experimentally and numerically realised boundary conditions

in this region. It must be mentioned, however, that the results with quadrilateral meshes compare extremely favourably with previous curvilinear grid predictions [32, 58]. It is for this reason that many CFD analysts prefer to use quadrilateral elements near curved surfaces while still employing triangular elements away from such surfaces. Thus, they prefer to use mixed elements for the domain as a whole. Figure 6.25 shows the vector plots on the two meshes. It is seen that there is a strong upward ﬂow near the hot inner cylinder where density is lower. Mass conservation, however, requires that circulation be set up with a downwards ﬂow near the outer cylinder. There is, however, a region of weak contrarotating circulation TRIANGULAR

near the top of the cylinders and the region near the bottom is seen to be almost stagnant. Figure 6.26 shows the predicted isotherms on the two meshes. They are nearly identical. These isotherms corroborate the interferograms measured by Kuehn and Goldstein [37]. Finally, the angularly integrated average value of K eq must be identical (so that overall heat balanced is checked) at both inner and outer surfaces of the cylinders. This value was computed at 2.68 on the quadrilateral mesh and at 2.79 on the triangular mesh. 2D Plane Convergent–Divergent Nozzle Figure 6.27 shows a convergent–divergent plane nozzle whose width in the x3 direction is large so that the ﬂow may be considered 2D. The bottom boundary represents the axis (centerline) of the nozzle whereas the top boundary is a wall. The ﬂow enters the left boundary and leaves through the right boundary. The total length L of the nozzle is 11.56 cm and the throat is midway. The halfheights of the nozzle at entry, throat, and exit are 3.52 cm, 1.37 cm, and 2.46 cm,

Figure 6.27. 2D plane convergent–divergent nozzle.

205

206

2D CONVECTION – COMPLEX DOMAINS

2.0 2.0

2.0

WALL

1.6 1.6

1.6

CENTER LINE Mach No

1.2 .2

Mach No Mach No

P P/P / Po O

0.8 0.8

1.2

P/Po

0.8

Expt Data

Expt Data Data 0.4 0.4

0.0 0.0 0.00 0.00

0.4

0.25 0.25

0.50 0.50

0.75 0.75

1.00 1.00

0.0 0.00

0.25

X/LX / L

0.50

0.75

1.00

X/L

Figure 6.28. Variation of pressure and mach number in the nozzle.

respectively. The inlet Mach number is Min = 0.232 and the exit static pressure is p / p0 = 0.1135, where p0 is the stagnation pressure. The stagnation enthalpy is assumed constant. For these speciﬁcations, experimental data are available [45]. This ﬂow has been computed by Karki and Patankar [31] using curvilinear grids and the UDS scheme with µ = 0 (i.e., Euler equations are solved). Here, the ﬂow is computed using an unstructured mesh and the TVD scheme (Lin–Lin scheme, see Chapter 3) again with µ = 0. At the inﬂow plane, since Min is known, u in , Tin , and pin are speciﬁed using standard isentropic relationships [28]. At the exit plane, except for pressure (which is ﬁxed), all other variables are extrapolated from the near-boundary node values. At the upper wall, a tangency condition is applied. This condition is the same as the symmetry condition. At the axis, the symmetry condition is again applied. The pressure distribution is determined by discretising a compressible ﬂow version of the total pressure-correction equation (see exercise 9 in Chapter 5). For velocities, equations for = u 1 , u 2 are solved and temperature is recovered from the deﬁnition of stagnation enthalpy. Finally, density is determined using the equation of state p = ρ Rg T . Computations are performed using 570 elements as shown in Figure 6.27. The implementation of the TVD scheme on an unstructured mesh needs explanation. As mentioned in Chapter 3, the TVD scheme requires four nodes straddling a cell face. Thus, in addition to ﬁctitious nodes P2 and E2 , a node W2 is selected

to the left of P2 and a node EE2 is selected to the right of node E2 . The locations of these nodes are such that lc−P2 = lP2 −W2 and lc−E2 = lE2 −EE2 where l is the length measured along the normal to the cell face (see Figure 6.11). Now, it is easy to work out the algebra of the TVD scheme in which W2 = P + l P−W2 ∇ P and EE2 = E + l E−EE2 ∇ E . Figure 6.28 shows the predicted variations of pressure (dashed line) and Mach numbers (solid line) at the upper wall and the centerline. The experimental data (open circles) for pressure have been read from a ﬁgure in [31]. It is seen that the agreement between experiment and predictions is satisfactory. Note that the predicted Mach number at the upper wall passes through M = 1 exactly at the throat (X/L = 0.5) and reaches a supersonic state M = 2.01 at exit. At the centerline, however, the M = 1 location is downstream of the throat. Computations of this type can be used to design a convergent–divergent nozzle to obtain a desired exit Mach number. Finally, Figure 6.29 shows the iso-Mach contours. Notice that the iso-Mach lines are slanted.

6.5 Closure In this chapter, procedures for solution of transport equations on curvilinear and unstructured meshes have been described. By way of a closure, it will be useful to note a few important points. 1. Both procedures require special effort to generate curvilinear or unstructured grids. Some methods for grid generation are introduced in Chapter 8. 2. On curvilinear grids, the familiar (I, J ) structure of Cartesian grids remains available. This permits adoption of the fast converging ADI method (as well as some others discussed in Chapter 9) for solution of discretised equations. 3. On unstructured grids, owing to lack of a regular node-addressing structure, a simple point-by-point GS method must be adopted for solution. It is well known that this method is slow to converge, but the convergence rate can be enhanced by adopting fast matrix-inversion techniques such as CG or GMRES.

207

208

2D CONVECTION – COMPLEX DOMAINS

b b

e

f

c

c

d

a

a d TETRAHEDRAL ELEMENT

PENTAHEDRAL ELEMENT

Figure 6.30. Some 3D polyhedral cells.

These techniques for sparse matrices become productive when the number of elements is large. 4. It may surprise the reader to note that the unstructured grid procedure is the most general. Since the procedure can handle any polygonal cells (in two dimensions), the Cartesian and curvilinear grids are already included. In the latter cases, however, the advantages of an (I, J ) structure must be sacriﬁced. 5. The procedure for unstructured grids developed in this chapter can be straightforwardly extended to 3D polyhedral cells (see Figure 6.30). The only difference in three dimensions is that all evaluations with i = 1, 2 must now be carried out over i = 1, 2, and 3. By way of illustration, consider the line structure at the triangular cell face of a tetrahedral cell shown in Figure 6.31(a). Two lines

c5

t

ξ2 t

E2

c6

c2

n E2 ξ3

r

n P2

E1 P2

c4

c

r

c

s

c3

s

P

e

E

ξ1

c1

P1 a) LINE STRUCTURE NEAR A CELL FACE

Figure 6.31. Construction at the polygonal cell face.

b) CELL FACE CONTROL VOLUME

EXERCISES

normal to the cell face are drawn through c and e. Now, imagine a plane through P parallel to the cell face. This plane will orthogonally intersect the two normals at P1 and P2 . A similar face-parallel plane through E will intersect the two normals at E1 and E2 . Necessary evaluations of face-normal transport can now be carried out along the line P2 −c−E2 . Similarly, the construction of a control volume at the cell face is shown in Figure 6.31(b) when the cell face is triangular. To evaluate β1i , while direction ξ1 is along PE, directions ξ2 and ξ3 may be chosen along any two sides of the triangle rst with origin at r, s, or, t. The actual directions are determined by requiring that Jacobian J be positive. Similarly, to affect vector boundary conditions, two tangent vectors t1 and t2 must be deﬁned at the boundary cell face. Out of these, t1 (say) may be chosen along PP2 and direction of t2 can be determined using the direction of the normal to the boundary cell face so as to form an orthogonal frame t1 , t2 , n. The reader may ﬁnd these ﬁgures useful for developing a 3D unstructured grid procedure [18]. 6. Because of its generality, commercial codes are increasingly adopting unstructured grids. Although generality is welcome, the codes must rely heavily on polyhedral mesh generators as well as on creation of special routines for processing of computed results. Such postprocessors typically create contour, vector, and/or surface plots. For comparison of computed results with experimental data, however, one often needs to resort to interpolations. The reader will appreciate this difﬁculty because whereas most detailed measurements in a ﬂow are carried out along a single straight line at a time, the grid nodes generated by packages such as ANSYS may not fall on a single line (in two dimensions) or even in a single plane (in three dimensions). 7. Despite the above-mentioned difﬁculty, unstructured grid codes are most versatile and, therefore, suitable for complex domains encountered in industrial and environmental applications.

10. Derive an exact expression for A Pcku by control-volume discretisation over cellface control volume c1 –c2 –c3 –c4 shown in Figure 6.13. 2 β1i (xi,E − xi,P )| β12 /A2c . 11. Show that x2,E2 − x2,P2 = | i=1 12. Verify Equations 6.139 and 6.140 in the evaluation of p x2 ,P . 13. Starting with Equation 6.62, derive an expression for total convective–diffusive transport at the cell face of a tetrahedral element. 14. In Exercise 13, if the cell face were a boundary face, how would you determine the tangent vector t2 if t1 is along PP2 ? 15. Carry out discretisation of convection terms using a TVD scheme on an unstructured mesh. 16. Consider node P surrounded by nodes M1 , M2 , and M3 of an unstructured mesh shown in Figure 6.32. Each element is a perfect equilateral triangle (each side 1 cm). Table 6.2 gives coordinates of vertices surrounding these nodes. In a particular problem, the ﬂuid properties (ρ = 1.2 kg/m3 and viscosity µ = 15 × 10−6 N-s/m2 ) are assumed constant so that the equations for ﬂow and energy transfer are decoupled. Steady state prevails. The converged velocity distributions (u and v) are shown in Table 6.3. Now, the energy equation is being solved and the prevailing temperatures at nodes neighbouring P are as shown in Table 6.3. Take T = µ/Pr with Pr = 0.7. The source term in the energy equation is zero. The convection Table 6.2: Coordinates of vertices.

x (cm) y (cm)

1

2

3

0.5 0.866

1.0 0.0

0.0 0.0

4

0.5 −0.866

5

1.5 0.866

6

−0.5 0.866

211

EXERCISES

Table 6.3: Current distribution of u, v, and T . Φ

u (m / s) v (m / s) T (◦ C)

P

M1

M2

M3

1.1 −0.8 ?

2.1 −1.0 65

−0.3 −1.5 80

−0.8 −0.8 72

terms are discretised using UDS. The equation is being solved with αT = 1. The objective of this problem is to determine TP . Tabulate intermediate calculations (in consistent units) to your answer in the form of Table 6.4 and, hence, determine TP . Does TP weigh heavily in favour of TM2? If yes, explain why. 17. An analyst computes ﬂow over a cylinder placed between two parallel plates as shown in Figure 5.28 using an unstructured mesh. The objective is to predict the drag coefﬁcient (CD ) of the cylinder as a function of Reynolds number. The deﬁnition of CD is CD =

Fpres + Ffric , 0.5 ρ Uo2 A

where Fpres and Ffric are net pressure and frictional forces, respectively, acting on the cylinder in the negative x1 direction, Uo is the uniform axial velocity at the channel entrance, and the cylinder projected area A = D × 1. After solving for the ﬂow, the analyst evaluates the forces as ( pB − p in )β11 , Fpres = 2 × KB

where p in is the average pressure at the channel entrance and K B are total number of cells near the cylinder boundary (see Figure 6.33). Examine whether the analyst’s evaluations are correct. 18. In Exercise 17, heat transfer from the cylinder is considered with a constant wall temperature boundary condition. How will you evaluate local and Table 6.4: Intermediate tabulation – energy equation. Face k

1 2 3

β11

β12

fm

Afk

l P2 E2

Cck

fck

dck

AEk

212

2D CONVECTION – COMPLEX DOMAINS

Cylinder Boundary P Figure 6.33. Cells near the cylinder boundary.

B

X2

X1 Symmetry Axis

averaged heat transfer coefﬁcients at the cylinder surface after a converged temperature solution is available? The temperature of the ﬂuid entering the channel is Tin whereas the channel walls are maintained at Twc . Write the expressions in discretised form. The heat transfer coefﬁcient is deﬁned as h = qw /(Tw − Tref ). What should be the relevant reference temperature Tref for this problem? 19. In the study of boundary layer development in the presence of favourable pressure gradients, an apparatus shown in Figure 6.34 is constructed. It is then assumed that in the presence of a sloping wall, the local free-stream velocity varies as U∞ (x) = Uo (1 + x/L). An analyst desires to verify this assumption by carrying out computation of the ﬂow from entry to exit as an elliptic ﬂow and allowing for the presence of the plate of thickness t. The following information is given: Uo = 1.8 m/s, L = 1 m, H = 0.7 m, and air is at 30◦ C and 1 atm. (a) Write the equations and the boundary conditions governing the ﬂow. Hence, identify the relevant s assuming turbulent air ﬂow. (b) Which turbulence model will you use? HRE or LRE? (c) Which type of grid will you prefer? Curvilinear or unstructured? Sloping Wall

H

U (x) 8

Uo

H 2 Boundary Layer Development in favourable pressure gradient

x L

Figure 6.34. Boundary layer development in a wind tunnel.

213

EXERCISES

a

Symmetry Plane

r

b Φ

Φ X2 4a Symmetry Plane a) MOON SHAPED DUCT

X1

b) CORDOID DUCT

Figure 6.35. Complex ducts.

20. Consider fully developed laminar ﬂow through the two complex ducts shown in Figure 6.35. The ﬂow is in the x3 direction. The ﬁgure shows half cross sections in both cases with symmetry planes parallel to the x1 axis. It is desired to predict f × Re for the ducts. The geometric details are as follows: Moon-shaped duct: a = b = 3 units and = 60◦ , Cordoid duct: r = 2a (1 + cos ), a = 2 units, 0 < < π. What type of grid will you prefer for computation? Curvilinear or unstructured? Draw a hand sketch to explain the reasons for your choice.

7 Phase Change

7.1 Introduction There is hardly a product that, during its manufacture, does not undergo a process of melting and solidiﬁcation. Engineering processes such as casting, welding, surface hardening or alloying, and crystallisation involve phase change. The processes of freezing and thawing are of interest in processing of foods. Phase-change materials (PCMs) are used in energy storage devices that enable storage and retrieval of energy at nearly constant temperature. The phenomenon of melting or solidiﬁcation is brought about by a process of latent heat (λ) transfer at the interface between solid and liquid phases. For a pure substance, throughout this process, the temperature Tm (melting point) of the interface remains constant whereas in the liquid and solid phases, the temperatures vary with time. Both λ and Tm are properties of a pure substance. Within each of the single phases, heat transfer is essentially governed by a process of unsteady heat conduction, although, under certain circumstances, convection may also be present in the liquid phase under the action of body (buoyancy, for example) or surface (surface tension) forces. There are two approaches to solving phase-change problems: 1. the variable domain formulation and 2. the ﬁxed domain (or ﬁxed-grid) formulation. In the ﬁrst approach, which has several variants, two energy equations are solved in the solid and the liquid phases with temperatures Ts and Tl , respectively, as dependent variables. In addition to the initial (i.e., at t = 0) and the domain boundary conditions, the following interface conditions are also invoked to match the temperatures of the two phases: Ts = Tl = Tm , ∂ Ts ∂ Tl − kl = ρλVi , ks ∂n i ∂n i 214

(7.1) (7.2)

215

7.1 INTRODUCTION

where n is normal to the interface and Vi is the instantaneous velocity of the interface in the direction of the normal. In a ﬁnite domain, the solid and liquid regions thus enlarge or contract as time progresses. Hence, we use the designation variable domain formulation. The interface, of course, moves through the domain and, at a given instant, may assume arbitrary shape. The arbitrariness may arise from the boundary shape, boundary conditions, or the presence of convection in the liquid phase. The variable domain formulation thus requires tracking of the interface location at every instant of time to effect condition (7.2). In complex three-dimensional domains, such tracking can turn out to be very cumbersome. In this chapter, only the ﬁxed domain formulation will be considered. This formulation treats enthalpy h (sensible + latent heat) rather than temperature T as the main dependent variable in the energy equation. In the absence of internal heat generation, this equation can be written as ∂ ∂ ∂(ρ h) (ρ u j h) = + ∂t ∂x j ∂x j

∂T K ∂x j

,

(7.3)

where the velocity u j may be ﬁnite only in the liquid phase and zero in the solid phase. The equation is applicable to both solid and liquid phases and, therefore, to the entire domain including the interface. Thus, the interface condition (7.2) is already satisﬁed. Equation 7.3, however, contains two dependent variables (h and T ) and a set of relations (known as the equations of state) between them must be speciﬁed. With this speciﬁcation, the equation can be readily adapted to computations on a ﬁxed grid through which the interface moves with time. Thus, the phase-change problems too can be computed with a generalised computer code. This ﬁxed-grid formulation is also referred to as the enthalpy formulation in the literature. There are a variety of phase-change problems. For example, in casting, only the total solidiﬁcation time may be of interest; the domain is ﬁnite. In such problems, the interface need not be explicitly tracked. In contrast, in problems such as welding and surface hardening, it is important to identify the heat-affected zone and interface tracking is essential. In impure materials and alloys, latent heat transfer takes place over a range of temperatures (Tm − < T < Tm + ) that demarcate what is known as the mushy zone. The properties of the mushy zone, however, must be known or modelled. There are other problems in which the thermo-physical properties of the two phases not only are different (ice water, for example) but are nonlinear functions of temperature, concentration, velocity gradients (in liquid phase), and/or local porosities. Equation 7.3 can readily capture such a variety. The problem of solving Equation 7.3 through discretised equations is not straightforward; therefore, in the next two sections, only 1D problems will be considered to explain the main ideas. This will provide sufﬁcient grounding to the reader to understand extensions to multidimensions through indicated references.

216

PHASE CHANGE

Tsup Tl SOLID

LIQUID Tm Figure 7.1. 1D phase-change problem.

Ts Tw Xi(t)

INTERFACE

X

7.2 1D Problems for Pure Substances 7.2.1 Exact Solution It is important to note that there are very few exact solutions to phase-change problems even in one dimension. To appreciate the nature of the solution, consider the problem shown in Figure 7.1. An initially (t = 0) superheated liquid (Tsup > Tm ) in a semi-inﬁnite domain is subjected to temperature Tw (< Tm ) at x = 0 and this temperature is maintained for all times t > 0. Solidiﬁcation commences instantly and the interface moves to the right. The instantaneous location of the interface X i (t) is shown in the ﬁgure. The task is to predict velocity d X i (t)/d t as a function of time and the temperature distributions in each phase as a function of x and t. The governing equation for this problem will be ∂ ∂(ρ h) = ∂t ∂x

This transcendental equation shows that C = C (Tm − Tw , Tm − Tsup , K s , K l , αs , αl ). Thus, C will be different for each initial and boundary condition and for each speciﬁcation of physical properties. The value of C must be iteratively determined to calculate d X i (t)/d t from Equation 7.7 and hence to calculate the temperature as a function of x and t from Equations 7.5 and 7.6. It can be shown that the system is governed by a dimensionless number, called the Stefan number, which is deﬁned as Cps (Tm − Tw ) . (7.9) λ The larger the value of St, the faster is the interface movement. A further point to note is that, although the temperature proﬁles show discontinuity at the interface, they are smooth within each phase and the variation of T with t at any x is also continuous and smooth. St =

7.2.2 Simple Numerical Solution It might appear that it is a straightforward matter to discretise Equation 7.4 to obtain a numerical solution. However, there is a difﬁculty associated with predicting continuous temperature histories when a numerical solution is obtained. To appreciate the difﬁculty, we assume uniform and equal properties for both phases (i.e., ρs = ρl = ρ, Cps = Cpl = C p , and K s = K l = K ). Thus, Equation 7.4 can be written as ∂ 2θ ∂ , = ∂τ ∂ X2

In these equations, L is the domain length where the boundary condition corresponding to x = ∞ is speciﬁed and h s = C p Tm is the solidus enthalpy. There are two ways to connect h to T (or to θ ) via the equations of state, as shown in Table 7.1 and Figure 7.2. In Table 7.1, h l = C p Tm + λ is the liquidus enthalpy and h ps (t) is the psuedo-enthalpy in whose deﬁnition t is not a priori known. When h = f (T ) relationships are used, clearly one would require a procedure for determining the integral constraint at the interface. Such a procedure is developed in [85]. We shall, however, consider T = f (h) relationships so that θ =

for

≤0

θ =0

for

0≤≤1

θ =−1

≥1

for

(solid),

(7.15)

(interface),

(7.16)

(liquid).

(7.17)

Now, assuming the IOCV method and using a uniform grid, it is a simple matter to show that τ l+1 l+1 l+1 o θ = − 2 θ + θ (7.18) l+1 j j+1 j j−1 + j , X 2 where superscript n is dropped for convenience, but superscript l + 1 is retained to indicate that Equation 7.18 must be solved iteratively to satisfy the equations of

hl

λ

h

Figure 7.2. Equation of state for a pure substance.

hs

SOLID

LIQUID T Tm

7.2 1D PROBLEMS FOR PURE SUBSTANCES

state. The overall calculation procedure will be as follows: 1. At τ = 0, specify initial condition θ oj for j = 1 to N . Hence, evaluate oj . Set θ j = θ oj . 2. Choose τ to begin a new step. distribution. 3. Solve Equation 7.18 once using the GS method to obtain the l+1 j l+1 4. Determine θ j using equations of state (7.15) to (7.17) and return to step 3 to carry out the next iteration. between successive iterations will be 5. After a few iterations, the change in l+1 j small and convergence is obtained. 6. Set oj = j and return to step 2 to execute the next time step.

For this problem St = 0.25 and, as evaluated from Equation 7.8, C = 5.767 × 10−4 . A numerical solution is executed with initial conditions θ (τ = 0) = 0.05 and (τ = 0) = 1.05. The boundary condition is θ (X = 0) = −0.25. The time step is determined from τ/X 2 = 0.2 and the computations are carried out till τ = 1.6 (or nearly 23 days). Two grid spacings are considered: X = 0.2 (N = 7) and X = 0.0769 (N = 15). At each time step, a converged solution is obtained in 5–11 iterations. The exact and the numerical solutions for temperature at x = 0.5 m are plotted in Figure 7.3 as a function of time. The ﬁgure shows a wavy temperature history. The waviness, however, decreases with reﬁnement of the grid size. When X is reduced still further so that N = 51 (say), the results (not shown) indicate that the exact and the numerical solutions nearly coincide. That is, the essentially wavy solution now appears smooth, albeit at the expense of signiﬁcantly increased computer time. A few comments are therefore in order: 1. The numerical procedure is very simple and can be easily extended to multidimensional problems. However, to obtain non-wavy solutions, an extremely ﬁne mesh size is required. This can be very uneconomical. 2. Why does waviness occur? This can be appreciated from Figure 7.4, where a phase-change node j is considered. When the interface resides within the control volume surrounding node j (so that 0 < j < 1), θ j = 0 (see Equation 7.16).

219

220

PHASE CHANGE

2.0

St = 0.25 T (x = 0.5 m)

1.0

∆X = 0.2 0.0

−1.0

∆X = 0.0769 EXACT

−2.0

−3.0

−4.0

DAYS 5

10

15

20

Figure 7.3. Solution for τ/X 2 = 0.2.

Thus, throughout the period of interface transit through the control volume, the nodal temperature at the phase-change node remains stationary at θ j = 0. As a result, the temperature history demonstrates a wavy pattern. However, when x → 0 (or grid spacing is reduced) the transit time itself is reduced and hence the predicted history appears smooth. 3. The calculation procedure, of course, necessitates a point-by-point GS iteration method for solution of Equation 7.18. This is because bookkeeping is required in step 4 of the procedure for each node to identify whether the node is in solid ( j < 0), in liquid ( j > 1), or undergoing phase change (0 < j < 1). This bookkeeping can again be expensive in terms of computer time. It also prevents use of a line-by-line procedure such as the TDMA.

Xi(t) SOLID j−1

LIQUID j

∆x

j+1

Figure 7.4. Typical phase-change node.

221

7.2 1D PROBLEMS FOR PURE SUBSTANCES

4. The interface location can be identiﬁed from the location of θ = 0, but, as already explained, this will again predict a wavy interface history. Instead, one may use variable to predict the interface history. This is because j is nothing but the liquid fraction of the control volume surrounding phase-change node j. Thus, at any time instant, one may simply add X for all nodes for which j < 0 (i.e., solid nodes) and further add (1 − j ) X for the node for which 0 < j < 1 and ignore all nodes for which j > 1. The sum will readily predict the instantaneous value of X i and this prediction will appear smooth but not accurate on a coarse grid. This alternative procedure will again require bookkeeping. These comments indicate that the simple procedure needs reﬁnement in terms of both economy and convenience.

It is assumed that the reader will be able to make necessary changes to the discretised equation for j = 2 and j = N − 1 nodes to account for any type of boundary condition.

222

PHASE CHANGE

introduction of the variable yields two further advantages: 1. The terms containing and o can be treated as sources. Thus, at the current iteration level, Equation 7.22 can be solved by TDMA. This can achieve considerable economy in computer time. For example, for the problem considered in the previous subsection, with N = 51, the TDMA solution turns out to be nearly 2.5 times faster than the GS solution. 2. It is easy to recognize that at each time step, when a converged solution is obtained, X i (τ ) can be estimated from the simple formula Xi =

N −1

(1 + j ) X.

(7.23)

j=2

This is because (1 + j ) represents the solid fraction for each node j. Again, the bookkeeping requirement is eliminated. Although useful for obtaining faster solutions on ﬁne grids, the introduction of the variable does not eliminate the problem of wavy temperature histories on coarse grids. This is because the replacement indicated in Equation 7.19 still renders θ = 0 at the phase-change node (0 < j < 1). In the next subsection, it will be shown that accurate solutions can be obtained even on coarser grids while still employing the TDMA procedure. Thus, we seek an economic solution that combines the beneﬁcial effects of computations at fewer nodes with the speed of the line-by-line procedure. 7.2.4 Accurate Solutions on a Coarse Grid To prevent θ from remaining stationary at zero at the phase-change node, Equation 7.19 is rewritten as θ = + ,

This equation is the same as Equation 7.22 except that is replaced by and the latter will again lag behind by one iteration. Equation 7.24 is therefore amenable to solution by TDMA. To make further progress, a procedure for evaluating or, in effect, θpc must be set out since can be evaluated from its deﬁnition (7.20). Thus, consider Figure 7.4 again and deﬁne X i = X i − X j ,

(7.27)

where X i is the location of the interface where θ is truly zero and X j is the coordinate of node j. At the time instant considered in the ﬁgure, therefore, X i is positive and we may evaluate θpc, j by linear interpolation as X i θpc, j = (7.28) θ j−1 . X i + X At another earlier time instant, X i may be negative (X i < X j ) and we may write |X i | θpc, j = (7.29) θ j+1 . |X i | + X Note, however, that for both positive or negative values of X i X i = X i − X j = (0.5 − pc, j ) X = (0.5 + pc, j ) X

In these equations, F = 0 at the single phase nodes (rendering θpc = 0) but F = 1 at the phase-change node as desired. Thus, the phase-change node temperature can be evaluated without bookkeeping. Therefore, in step 4 of our calculation procedure, j is also evaluated without bookkeeping. Problem 1 of Section 7.2.2 is now solved again for the coarse grid with N = 7 (or X = 0.2) for St = 0.25, and the predicted temperature history is shown in Figure 7.5. Now, even the coarse grid solution is nearly accurate. In the same ﬁgure, computations for St = 1 (C = 1.075 × 10−3 ) and St = 3 (C = 1.6 × 10−3 ) are also shown and the grids used are indicated in the ﬁgure. Again, smooth histories

2.5

T(0.5 m)

T(0.5 m)

5.0

−3.0

−2.0

−1.0

0.0

1.0

DAYS

5

NUMERICAL

EXACT

10

5

7.5

N = 13

St = 1.0

NUMERICAL

EXACT

Figure 7.5. Temperature history T (x = 0.5 m) including θpc .

0.0

−20

−10

0

-3.0

-2 .0

10

10.0

DAYS 15

15

0.0

−50

−40

−30

−20

−10

0

DAYS

T(0.5 m)

224 1.0

20

N=7

20

St = 0.25

2.0

3.0

DAYS

4.0

N = 15

St = 3.0

5.0

225

7.3 1D PROBLEMS FOR IMPURE SUBSTANCES

St = 3.0 St = 1.0

0.8

St = 0.25

Xi(t)

0.6

0.4

0.2

DAYS 0.0 5

10

15

20

Figure 7.6. Solutions for X i (t).

are predicted that agree with the exact solution well. In each case, solutions are obtained with τ/X 2 = 2, which is 10 times larger than that used in Figure 7.3. Thus, inclusion of θpc, j permits the use of coarse grids and allows large time steps and yet yields accurate solutions. This ﬁnding is particularly important for multidimensional problems. Figure 7.6 shows the variation of X i (as calculated using Equation 7.23) with time. It is seen that as the Stefan number increases, the interface moves faster. Notice that for St = 1 and St = 3, the computations are carried on even after the complete domain is solidiﬁed; hence, the interface location appears to remain stationary at 1 m. 7.3 1D Problems for Impure Substances In impure materials or alloys, phase change takes place over a range of temperatures Ts < T < Tl where Ts and Tl may be termed as solidus and liquidus temperature, respectively. Here, we shall permit different properties of solid and liquid phases. The h ∼ T relation, therefore, may appear as shown in Figure 7.7. In this ﬁgure, the region (also called the mushy region) between Ts and the fusion temperature Tm is shown blank because the h ∼ T relation may take a variety of forms in different materials. The energy equation (7.4) will again be applicable. To account for different properties of the two phases, however, the following dimensionless variables

For alloys, function f () may take a variety of forms. For Al–4.5% Cu alloy, for example, Voller and Swaminathan [85] have used the following general relationship: θ − θs n for θs < θ < θl (7.43) = θl − θ s

227

7.3 1D PROBLEMS FOR IMPURE SUBSTANCES

and =1

for

θl < θ < θm ,

(7.44)

where θs < θl < θm , and the values of these temperatures and n (0.2 to 0.5) are known. In another form, known as Schiel’s equation, the relationship is given by θ = θs

> 1: Although this is a single-phase region, to account for property variation,

we set

C ps . = θm − ( − 1) 1 − C pl

θpc, j

(7.51)

Thus, θpc is speciﬁed for the entire > 0 range rather than being restricted to the 0 < < 1 range. Following Voller and Swaminathan [85], computations are carried out using x = 0.01 m (or N = 52) and t = 5 so that τ = αs t/x 2 = 3.96825. Equation 7.48 is solved using TDMA at each time step. It is found that a maximum of two iterations are required to reduce the residual in the equation to less than 10−5 . Figure 7.9(a) shows the time variation of the interface. In this case, the interface location is identiﬁed with = 0 [see deﬁnition (7.34)]. The computed results are compared with the solution obtained by Voller [84] using the heat balance integral method (HBIM) since exact solution is not available for this highly nonlinear case. The present computations show some waviness that is also observed in [85] where computations are carried out using the h = f (T ) relationship rather than the T = f (h) relationship used here. Figure 7.9(b) shows the temperature histories at a few values of x. The solutions demonstrate jaggedness (typical of a highly nonlinear θ– relation) that is also observed by Chiu and Caldwell [6], who used what is called Broyden’s method. Finally, we note that the method presented in this section can also be extended to the case when phase change takes place at a unique temperature, that is, θs = θl = θm = 0. Because then, f () = 0 (see Equation 7.41) and one can readily adopt Equation 7.31 to evaluate θpc . Similarly, the present method can also be extended to multidimensional phase-change problems. The only care required is in the evaluation of θpc because several nodes can undergo phase change simultaneously. In Date [12, 13], the necessary considerations and the associated algebra are explained.

EXERCISES 1. Write a general computer program for solving transcendental equation (7.8) [63]. Hence, determine the value of C for the two materials and conditions given in Table 7.2. 2. Modify Equation 7.22 for node j = 2, when the heat transfer coefﬁcient h is speciﬁed at boundary x = 0. 3. Show the validity of Equation 7.23 in a solidiﬁcation problem. 4. With respect to Figure 7.4, demonstrate the correctness of Equation 7.30 and hence of Equation 7.31. 5. Show the correctness of Equation 7.51 for > 1.

231

EXERCISES

Table 7.2: Properties for Exercise 1. ρ

Cps

Cpl

ks

kl

λ

Tw

Tm

Tl

2,180 2,800

1,549 900

1,549 1,100

0.49 200

0.49 90

1.37 ×105 3.9 ×105

200 573

220 933

230 933

6. In an energy storage device, a PCM is sandwiched between two streams of heat transfer ﬂuid (HTF) as shown in Figure 7.10. The HTF ﬂows at 200◦ C with heat transfer coefﬁcient 300 W/m2 -K. The PCM is initially in a saturated state (Tm = 220◦ C) and its thickness is 8 cm. Estimate the time for heat (sensible + latent) recovery and the quantity recovered. The PCM properties are as follows: ρ = 2,180 kg/m3 , C p = 1,549 J/kg-K, K = 0.49 W/m-K, and λ = 1.37 × 105 J/kg. 7. Consider solidiﬁcation of a PCM contained in a spherical vessel of radius R. Initially, the PCM is at temperature Tin = Tm . The vessel wall temperature is Tw < Tm and held constant with respect to time. Assuming only radial heat transfer, the applicable energy equation is ∂ ∂T ∂(ρ h) = KA , A ∂t ∂r ∂r where A = 4π r 2 . (a) Nondimensionalise this equation assuming constant properties. (b) Discretise the equation and write a computer program to solve the discretised equations. Use of a nonuniform grid with closer spacings near r = R and r = 0 is desirable. Take ρ = C p = k = λ = 1, R = 1, and Tm = 0 and compute for Tw = −0.1, −1.0, and, 10.0. (c) Plot the variation of interface location Ri /R as a function of dimensionless time in each case and estimate total solidiﬁcation time. Compare your results with those of [7]. 8. Repeat Exercise 7 for a superheated PCM so that Tin > Tm . Take Tw = −1.0 and use three values of Tin: 0.1, 1, and 2.

h

HTF

200°C

PCM

h

HTF

8 cm

200°C

Figure 7.10. Phase-Change Energy Storage Device – Exercise 6.

232

PHASE CHANGE

9. Repeat Exercise 7 assuming that the convective heat transfer coefﬁcient h and associated ambient temperature T∞ < Tm are speciﬁed at r = R and Tw is unknown. Show that, in this problem, the interface movement is governed by two parameters: the Stefan number St = C p (Tm − T∞ )/λ and the Biot number Bi = h R/ K PCM . Assume T∞ = −1 and Tm = 0 and compute for Bi = 1, 5, and 10. Plot the variation of Tw and Ri with time in each case.

where ξ1 , ξ2 are curvilinear coordinates and x1 , x2 are Cartesian coordinates. These two functions can be generated in two ways: (1) by algebraic speciﬁcation or (2) by differential speciﬁcation. Algebraic speciﬁcation is typically employed in 1D problems but can also be employed in 2D problems when the domain is simple (Section 8.2). For complex domains, however, differential grid generation is preferred. In this type, functions (8.1) are generated by solving differential equations with dependent variables x1 and x2 . The differential equations can be of parabolic, hyperbolic, or elliptic type [81]. However, we shall consider the most commonly used elliptic grid generation technique (Sections 8.3 and 8.4) The unstructured meshes again can be generated in a variety of ways. Two types will be considered: (1) generation by exploiting structuredness and (2) automatic mesh generation (Section 8.5).

8.2 Algebraic Grid Generation 8.2.1 1D Domains The objective of grid generation is to locate nodes such that they are closely spaced in regions where the dependent variable in the transport equations is expected to have steep gradients and sparsely spaced in regions where the gradients are small. This ensures that accurate solutions are economically obtained. 233

234

NUMERICAL GRID GENERATION

(a)

(b)

1.0

1.0 N = 11

0.8

N = 11

0.8

n = 2.0

n = 0.5

0.6

n=1

0.4

X(I)/L

X(I)/L

0.6

n = 2.0

0.2

n=1 n = 0.5

0.4

0.2 GRID NUMBER

0.0

2

4

6

8

GRID NUMBER

10

0.0

2

4

6

8

10

Figure 8.1. Effect of n on a 1D grid.

Consider a 1D domain of length L with N nodes so that there are N − 2 control volumes. One may now specify either the node coordinates x(i) or the cell-face coordinates xc (i), where the latter occupies location of cell face w to the west of node P. Two useful algebraic formulas for node-coordinate determination are i −1 n x(i) = , (8.2) L N −1 and

x(i) i −1 n , =1− 1− L N −1

(8.3)

where n takes arbitrary positive value. For n = 1, these relationships are linear, implying uniform node spacing. According to relation (8.2), when n > 1, the grid is ﬁne near x = 0 and becomes progressively coarser towards x = L [see Figure 8.1(a)]. When n < 1, however, the grid is coarse near x = 0 and becomes uniformly ﬁne near x = L. Relation (8.3) is employed when these trends are to be reversed [see Figure 8.1(b)]. In either case, once the x coordinates are known, the cell-face coordinates xc can be determined by requiring that the cell face be midway between the adjacent nodes, as has been our preferred practice. Conversely, one can specify node coordinates xc (i) via formulas of this type and then determine the x coordinates. 8.2.2 2D Domains In 2D domains, often the shape of the domain boundaries as well as the coordinates can be speciﬁed by algebraic equations. One such example is that of an eccentric

235

8.3 DIFFERENTIAL GRID GENERATION

Ro Ri Figure 8.2. Eccentric annulus.

ε

Θ R∗

annulus shown in Figure 8.2. In this case, the grid coordinates can be generated from x1 = R cos θ, ∗

R = − sin θ +

%

x2 = R sin θ,

(8.4)

R02 − ( cos θ )2 ,

(8.5)

where −π/2 ≤ θ ≤ π/2 , Ri ≤ R ≤ R ∗ , and is eccentricity. When = 0, a concentric annulus is generated. Shah and London [66] have given results for fully developed laminar ﬂow and heat transfer in several ducts of noncircular cross section. The domains of such ducts (sine, ellipsoid, cordoid, etc.) can be mapped by relationships of the type given here.

8.3 Differential Grid Generation 8.3.1 1D Domains In algebraic speciﬁcation, the ﬁneness of grid spacings could be controlled using formulas (8.2) and (8.3). This can also be done by solving a differential equation. To understand the main ideas, consider the differential conduction equation q d2T + = 0, d x2 k

(8.6)

236

NUMERICAL GRID GENERATION

Table 8.1: Solution to Equation 8.7. q (x)

T

1

0

x

2

a

3

bx

4

b (1 − x)

No.

x 1− x 1− x 1−

a 2k b 6k b 3k

(1 − x)

(1 − x 2 ) 1 − x2 (3 − x)

with boundary conditions T = 0 at x = 0 and T = 1 at x = 1. The solution to the equation is x x 1 x q q T =− dx dx + 1 + d x d x x. (8.7) k k 0 0 0 0 This solution is now evaluated for different assumptions for the variation of q with x. The solutions are shown in Table 8.1 and Figure 8.3 with a = 2, b = 3, and conductivity k = 1 in all cases. Clearly, the variation of T is controlled by variation of q with x. Now, to make Equation 8.6 a determinant of grid node locations, we simply interchange the roles of x and T . Thus, the solution for q = b x, for example, is

1.0

0.8

4 2 1

T

0.6

3 0.4

0.2

0.0 0.00

0.25

Figure 8.3. Effect of q (x) function.

0.50

X

0.75

1.00

237

8.3 DIFFERENTIAL GRID GENERATION

qn = 0

T1 = 1 0.9 0.7

0.6

0.6 qn = 0

,1

0.3

0.8

0.5 0.9

0.4 0.2

qn = 0

0.1

T2 = 0

T2 = 1 qn = 0

T1 = 0

(a)

(b)

(c) Figure 8.4. Differential construction of a 2D curvilinear grid.

taken as

b 2 (1 − T ) , x = T 1− 6k

0 ≤ T ≤ 1.

(8.8)

By assigning different values to T in the speciﬁed range, we can get as many values of x(i) as desired. To generalise this idea, we may state that the appropriate equation for determination of node coordinates is d2 ξ = c (ξ ), d x2

(8.9)

where c (ξ ) is a stretching function to be speciﬁed by the analyst. To generate a solution of the form shown in Equation 8.8, Equation 8.9 must be inverted. This matter will be discussed in Section 8.3.3. 8.3.2 2D Domains To understand the extension of the aforementioned notion to 2D domains, consider the domain shown in Figure 8.4. We now consider two problems with different boundary conditions. Figure 8.4(a) shows the probable solution to the ﬁrst problem T = T1 (say) governed by q 1 ∂ 2 T1 ∂ 2 T1 + = , k ∂ x12 ∂ x22

Each isotherm (T1 and T2 ) thus represents sets of values of x1 and x2 . In Figure 8.4(c), the two solutions are superposed. The isotherms now take the appearance of a body-ﬁtted curvilinear grid. Now, as in the previous section, Equation 8.12 can also be written by simply interchanging the roles of T and x. Analogous to Equation 8.9, therefore, we may state that the appropriate equations for determination of coordinates x1 and x2 are ∇ 2 ξ1 =

∂ 2 ξ1 ∂ 2 ξ1 + = P (ξ1 , ξ2 ), ∂ x12 ∂ x22

(8.13)

∇ 2 ξ2 =

∂ 2 ξ2 ∂ 2 ξ2 + = Q (ξ1 , ξ2 ), ∂ x12 ∂ x22

(8.14)

where ξ1 and ξ2 are curvilinear coordinates and P and Q are stretching functions. 8.3.3 Inversion of Determinant Equations To make Equations 8.9 (in the 1D domain) and 8.13 and 8.14 (in 2D domains) determinants of Cartesian coordinates, they must be inverted. Thus, for the 1D domain, we have ∂ξ ∂ ∂ = . ∂x ∂ x ∂ξ

with x = 0 at ξ = 0 and x = L at ξ = 1. Grid coordinates x(i) can now be determined for various choices of C. For 2D domains, however, the matter is not so simple and requires vector analysis. Thus, we recall that a covariant base vector (tangent to coordinate

239

8.3 DIFFERENTIAL GRID GENERATION

direction ξi ) is deﬁned as ai =

d r ∂ x1 ∂ x2 ∂ x3 = i + j +k . d ξi ∂ξi ∂ξi ∂ξi

(8.17)

Similarly, the contravariant base vector (normal to coordinate surface ξi = constant) is deﬁned as a i = ∇ ξi = i

∂ξi ∂ξi ∂ξi + j + k = a j × ak /J, ∂ x1 ∂ x2 ∂ x3

(8.18)

where J is the Jacobian. Now, from Green’s theorem [70], for any quantity (vector or scalar) , ∇ =

To determine functions (8.1), therefore, Equations 8.26 and 8.27 must be solved simultaneously with the boundary conditions speciﬁed at ξ1 = 0, ξ1 = ξ1max , ξ2 = 0, and ξ2 = ξ2max . Note that Equations 8.26 and 8.27 are coupled and nonlinear because α, β, and γ are themselves functions of dependent variables x1 and x2 . Further, we note that the equations contain both the ﬁrst and second derivatives and, if −J 2 P and −J 2 Q are regarded as velocities, the equations have the structure of a general transport equation. It might appear that Equations 8.26 and 8.27 can be easily discretised and solved. However, there is a difﬁculty associated with the application of boundary conditions. The difﬁculty can be understood as follows. In ﬂuid ﬂow problems, we would often desire that the grid lines intersect orthogonally with the boundary. Thus, at the north and south boundaries, for example, we would desire that ∂ x1 /∂ξ2 = 0. However, once this speciﬁcation is made, we cannot specify x1 on these boundaries. This is because if Dirichlet and Neumann boundary conditions are speciﬁed at the same

241

8.4 SORENSON’S METHOD

ζ2

ζ 2max

∆Smax X2

X1 ∆So

θ i−1

i

i+1

ζ2 = 0 ζ1

Figure 8.5. Grid line construction – Sorenson’s method.

boundary, than the problem becomes overspeciﬁed or ill-posed. Therefore, we can specify either the value of ∂ x1 /∂ξ2 or of x1 . However, if only one of these two boundary conditions is speciﬁed then the converged solutions to Equations 8.26 and 8.27 often demonstrate grid-node clustering in some portions of the domain and highly sparse node distributions in other regions. Ideally, one would like to have complete freedom to choose x 1 and x2 locations on the boundaries and yet achieve orthogonal intersection (or at any other desired angle) of the grid lines with the boundaries. The method of Sorenson [71] allows precisely this freedom. The method is described in the next section.

8.4 Sorenson’s Method 8.4.1 Main Speciﬁcations Sorenson’s method permits coordinate and coordinate-gradient speciﬁcation for the same variable x1 or x2 at two of the four boundaries of the domain. Thus, let ξ2 = 0 (south) and ξ2 = ξ2max (north) be these two boundaries as shown in Figure 8.5. We now deﬁne 0.5 s0 = x12 + x22 ξ2 =0

(8.29)

or, in the limit, d s0 = d ξ2

∂ x1 ∂ξ2

2

+

∂ x2 ∂ξ2

2 0.5 . ξ2 =0

(8.30)

242

NUMERICAL GRID GENERATION

Note that s0 is the physical distance between boundary node 1 and its neighbouring interior node 2 in the ξ2 direction. Similar deﬁnitions are introduced at the north boundary ξ2 = ξ2max . Now, let θ0 be the angle of intersection between ξ1 and ξ2 grid lines at ξ2 = 0. Then, ∇ ξ1 · ∇ ξ2 = | a 1 | | a 2 | cos θ0 .

It will be appreciated that this liberty to specify s0 and smax can be very useful when south and north boundaries are walls and the HRE e– turbulence model is employed. One can therefore place the ﬁrst node away from the wall in the range 30 < y + < 100.

7. Use equations such as 8.43 and 8.44 to evaluate P (ξ1 , 0), Q (ξ1 , 0), P (ξ1 , ξ2max ), and Q (ξ1 , ξ2max ). 8. Using the preceding information and already chosen2 constants a, b, c, and d, evaluate P (ξ1 , ξ2 ) and Q (ξ1 , ξ2 ) at all nodes in the domain. Between iterations, underrelaxation in evaluation of P and Q is advised. 9. Specify boundary conditions for x2 at the west and east boundaries. Here, care must be taken to take account of the type of grid being generated. If an H- or C-type grid is being generated, one must specify the x2 from known equations of the west and east boundaries since x1 values are already known (see step 1). Alternatively, one may specify the ∂ x2 /∂ξ1 condition to let the ξ2 = constant line intersect the boundary at a desired angle. If an O-type grid is being generated then one speciﬁes periodic condition (0, ξ2 ) = (ξ1max , ξ2 ). 10. Solve Equation 8.45 for = x1 , x2 and check convergence. 11. If the convergence criterion is not met, go to step 6. 8.4.5 Applications H Grid Figure 8.6 shows the grid for a ﬂow between parallel plates with a constriction. South (x2 = 0) is the axis of symmetry, north is a wall, west (x1 = −8) is the 2

Typically, a = b = c = d = 0.7. If too small a value is used (0.2, say), the effect of the constants decays slowly away from the south/north boundaries. If too large a value is chosen, the effect decays very rapidly.

Although a more practical situation involves a cascade of blades, here the blade is treated as an isolated airfoil.

248

NUMERICAL GRID GENERATION

0.30 0.20

TRAILING EGDE

0.10 0.00 −0.10 −0.20

LEADING EDGE PERIODIC

−0.30

BOUNDARY

−0.40 −0.25

0.00

0.25

Figure 8.8. Example of O – grid.

stretching functions can produce different grid spacings and stretchings inside the domain. One needs to make a few trials before accepting the generated grid. A graphics package such as TECPLOT for mesh visualisation is therefore necessary. The package also has a zooming facility to permit visualisation of dense-grid regions.

8.5 Unstructured Mesh Generation 8.5.1 Main Task Unstructured mesh generation essentially involves two tasks: 1. locating vertices in the domain and 2. creating vertex and element ﬁles (as mentioned in Chapter 6). These tasks can be carried out in a variety of ways. The two most commonly used are the following: 1. Locating vertices by curvilinear grid generation so that a regular (i, j) structure is readily available for vertex numbering. 2. Locating vertices according to rules that yield arbitrary vertices without (i, j) structure. In this automatic grid generation method, node numbering requires care. These alternatives are considered next for further explanation.

In Figure 8.9, nodes are linearly numbered for a grid with I N = 9 and J N = 5. According to Equation 8.51, vertex (I N , J N ) will be referred to by NVMAX = I N × J N , whereas for vertex (1, 1), N V = 1. Now, since coordinates of vertices are known, one can readily form the vertex ﬁle. With this linear numbering, one can construct a minimum of two triangular elements out of each quadrilateral element. This formation can be of two types as shown in Figure 8.10. In each case, elements must be numbered along with the associated three vertex numbers to form the element ﬁle. This task can be

250

NUMERICAL GRID GENERATION

NV3 NV2

NV3 NV2

NE 2

NE 1 NE 2

NE 1 NV4

NV1

NV4 NV1

a) TYPE 1

b) TYPE 2

Figure 8.10. Construction of triangular elements from a quadrilateral element.

Figure 8.11 shows the element numbering for the grid shown in Figure 8.9. The numbering is carried out using the routine given here. 8.5.3 Automatic Grid Generation Automatic grid generation (AGG) is used to generate elements having desired properties and desired density (i.e., clustering). For example, when 2D triangular elements are generated, one may desire that each element has a prespeciﬁed area or

251

8.5 UNSTRUCTURED MESH GENERATION

I = IN = 9 J = JN = 5 45

64 63

44

38

39

37 50 28

52

29 33

WEST 19 10

17

18

J=1

2

53

3

60

43 41

31

42

37 38 22

21

22

20

12 21

4

5

2 3

39 23

13 7

6

24 26

16 25

14

24

15 14

29 28 12

13 7

27 15 10

23

30

16

45

34

33

56 32

31 17

26 46

44

57

40

19

11

1 I=1

30

36

34 20 35

58 55

54

51

49

59

41

40

35

61

42

32 47

25

11 6

9

8

9

18

48

62

43 NORTH

EAST 27

36

SOUTH 5

4

Figure 8.11. Unstructured mesh.

that no included angle shall exceed 90◦ . There are several ways in which this may be achieved and the subject matter is as much an art as it is a science. Fortunately, useful reviews of methods for AGG are published from time to time and the reader is referred to one such review [27] by way of an example. Methods for AGG can be classiﬁed based on element type, element shape, mesh density control, and time efﬁciency. The most popular mesh-generation methods ﬁrst create all vertices (boundary and interior) and then connect them by lines to form triangles. The question then arises as to what is the best triangulation on a given set of points. The most popular principle for triangulating is called Delaunay triangulation. To understand the scheme, consider a set of vertices on a domain as shown in Figure 8.12. In this ﬁgure, triangle A represents a Delaunay triangle because the circumcircle passing through the three vertices encloses no other vertices. This, however, is not true for triangle B, which is therefore not a Delaunay triangle. It is obvious that if the set of vertices were arbitrarily chosen, and their locations were ﬁxed, then it would be difﬁcult to meet the requirement of Delaunay triangulation. Without proof, we state that Delaunay triangulation is achieved in such a way that thin elements are avoided [27] whenever possible.

8

252

NUMERICAL GRID GENERATION

B Figure 8.12. Delaunay triangulation principle.

A

Among the many methods available for triangulation, perhaps the most convenient is the triangulation by point insertion method. The method is executed in three steps (see Figure 8.13): 1. Deﬁne and discretise domain boundaries. Straight boundaries can be discretised by employing formulas such as Equation 8.2 or by a cubic-spline technique [63]. Curved boundaries, however, require further care. 2. Triangulate the boundary points using the Delaunay triangulation principle. This creates new vertices interior to the domain. 3. Triangulate the remaining interior domain by point insertion. Starting from an existing pair of vertices (1 and 2, say), a third vertex can be searched under a variety of constraints. One such constraint is the aspect ratio A R = ri / (2 rc ), where ri is the radius of inscribed circle and rc is the radius of circumscribed circle.4 The new inserted vertex is now placed at the circumcentre of the triangle 1–2–3 with minimum AR. One can thus complete the triangulation of the entire domain. These three steps can be cast in the form of an algorithm and a computer program can be written for its implementation. A computer program based on a method by Watson [87] is available in [67]. The next task is to create the data structure. This refers to creation of vertex and element numbering to prepare the required vertex and element ﬁles. Several commercial packages for AGG are available that can create mixed elements and three-dimensional polyhedra. Using these packages, meshes can be generated 4

to describe ﬂow over an entire aircraft or over and through a car (including the engine space below the bonnet). In such applications, millions of elements are needed and the question of the efﬁciency with which an AGG algorithm is devised becomes important. The task of AGG has thus assumed considerable signiﬁcance to be recognised as a specialised branch of CFD.

The USER ﬁle should execute the ﬁrst two steps of the calculation procedure described in Section 8.4.4.) 6. It is desired to determine drag coefﬁcient of a cascade of louvres as shown in Figure 8.14. For this purpose, an analyst selects the domain a–b–c–d–e–f–g–h. Use the computer program developed in Exercise 5 to generate curvilinear grids and provide boundary conditions for x1 and x2 . Take ab = 1, L 1 = 1.5, L 2 = 1.0, S = 0.25, P = 0.5, t = 0.05, and cd = 1.5. 7. Repeat Exercise 6 for the GE90 gas-turbine blade cascade shown in Figure 8.15. The coordinates5 of the suction and pressure surface of the blade are given in Table 8.2 (30 points on the suction surface and 46 points on the pressure surface). The other dimensions are as follows: axial chord Cax = 12.964 cm, pitch P = 13.811 cm, blade inlet angle β1 = 35◦ , and blade outlet angle β2 = −72.49◦ . (Hint: If more points are required on the blade surface, their coordinates can be generated using spline interpolation [63].) 8. Consider ﬂow in a duct of square cross section in which a twisted tape has been inserted as shown in Figure 8.16. The width of the tape equals the duct-side length D. This three-dimensional ﬂow can be analysed by generating 2D grids at several cross sections along the axis at different angles from the vertical. One such section A–A at angle = 22.5◦ is shown in the ﬁgure. The thickness 5

The author is grateful to Prof. R. J. Goldstein of the University of Minnesota for providing the coordinate data.

255

EXERCISES

a

h

b

PRESSURE SURFACE

c

g SUCTION SURFACE

P

f Cax

d

e

Figure 8.15. Schematic of a gas-turbine blade cascade.

of the tape δ/D = 0.04. The ﬂow is symmetric about the tape with secondary ﬂow being transferred through the gaps c–d and e–f. Therefore, curvilinear grids may be generated over only half of the duct cross section. Select west, north, east, and south boundaries and adapt the computer program of Exercise 5 to generate the curvilinear grid. Also specify the boundary conditions for the velocity components u i , i = 1, 2, and 3. (Hint: For the purpose of generating the curvilinear grid, assume δ = 0 to avoid any sharp protrusion into the domain.) 9. The vertex ﬁle for the domain of Figure 8.9 is given in Table 8.3. Reading this ﬁle, prepare an element ﬁle using the routine given in Section 8.5.2 to generate a triangular mesh as shown in Figure 8.11. Now, with reference to Chapter 6, develop a computer program to do the following: (a) Identify neighboring element numbers of each element. Store this information in array NHERE (N, K). (b) Deﬁne boundary nodes B and assign node numbers to them.

(c) Calculate geometric coefﬁcients B11 (N , K) and B21 (N , K); cell-face area ACF (N , K); lengths LP2E2 (N , K), LX1 (N , K), LX2 (N , K), DX1 (N , K), and DX2 (N , K); and weighting factor FM (N , K). (d) Calculate the cell volume VOL (N) of each element. Including the boundary nodes, what is the total number of nodes, NMAX? 10. To dispel the idea that unstructured meshes must necessarily be triangular or polygonal, an analyst maps a complex domain with essentially a Cartesian mesh, as shown in Figure 8.17. Now, it is seen that cells with more or less than four faces occur near an irregular boundary (see the enlarged view) and the dimensions of such cells can be determined from the known coordinates of the irregular boundary. Essentially, therefore, the mesh can be generated by algebraic speciﬁcation. It is also possible to obtain any desired cell density. Of course, to do this automatically, a computer program must be written. Further,

note that cells identiﬁed by ﬁlled circles, though rectangular, may have more than four neighboring cells. (a) Identify the number of neighbouring cells for the two cells marked with ﬁlled circles. (b) Examine whether the discretisation procedure described in Chapter 6 can be employed for such a mesh. 11. It is desired to generate an essentially quadrilateral unstructured mesh for the moon-shaped duct shown in Figure 6.35.The duct shape, however, is such that in some portions of the duct the elements must be triangular to avoid unnecessary concentration of nodes. Write a computer program to generate such a mixedelement grid and generate vertex and element ﬁles.

9 Convergence Enhancement

9.1 Convergence Rate In all the preceding chapters it was shown that discretising the differential transport equations results in a set of algebraic equations of the following form: Ak k + S, (9.1) A PP = where sufﬁx k refers to appropriate neighbouring nodes of node P. In pure conduction problems ( = T ), Ak and S may be functions of T . In the general problem of convective–diffusive transport, may stand for any transported variable and Ak and S may again be functions of the under consideration or any other relevant to the system. In curvilinear grid generation, = x1 , x2 , and Ak and S are again functions of x 1 and x2 . In all such cases, if there are N interior nodes, we need to solve N equations for each variable in a prespeciﬁed sequence. An iterative solution is particularly attractive when the algebraic equations for different s are strongly coupled through coefﬁcients and sources. In an iterative procedure, convergence implies numerical satisfaction of Equation 9.1 at each interior node for each . This satisfaction is checked by the residual in Equation 9.1 at each iteration level l (say). Thus Ak lk − S. (9.2) RP = A P lP − The whole-ﬁeld convergence is declared when ) 2 *0.5 all nodes RP < CC, R = Rnorm

(9.3)

where CC stands for the convergence criterion and Rnorm is a dimensionally correct normalising quantity deﬁned by the CFD analyst. For example, in a problem with total inﬂow m˙ in and average property in , Rnorm = m˙ in × in (say). If no such representative quantity is found then Rnorm = 1. Ideally, CC must be as small as 259

260

CONVERGENCE ENHANCEMENT

the machine accuracy will permit but typically CC = 10−5 (say) sufﬁces for most engineering applications. The convergence rate C R may be deﬁned as CR = −

d R , dl

(9.4)

where l is the iteration level. Economic computations will require that C R must be as high as possible. Algebraic equation solvers such as the GS, the TDMA, and the ADI introduced in Chapter 5, however, demonstrate the following convergence rate properties: 1. Overall C R is higher when Ak and S are constants rather than when they are dependent on . 2. The initial (small l) C R is high but progressively decreases as convergence is approached. 3. C R is higher when the Ak are small (for example, coarse grids) than when they are large (ﬁne grids). 4. C R is higher when Dirichlet boundary conditions are speciﬁed at all boundaries than when Neumann (or gradient) boundary conditions are speciﬁed. This is one reason why the pressure-correction equation is slow to converge. 5. The convergence history (i.e., R ∼ l relationship) is typically monotonic when Ak and S are constants but can be highly nonmonotonic (or oscillatory) when the equations are strongly coupled. This last point is concerned with the stability of the iterative procedure. The reader may wish to relate this phenomenon with damping of waves discussed in Chapter 3. The C R of the basic iterative methods (GS and ADI for 2D problems) can be enhanced by several techniques. Here, a few of them that have the facility of being incorporated in a generalised computer code will be considered. It is important to note, however, that all convergence enhancement techniques essentially take ever greater account of the implicitness embodied in the equation set (9.1). Thus, it is recognised that P is implicitly related not only to its immediate neighbours but also to its distant neighbours. The objective, therefore, is to strengthen this relationship with the distant neighbours. The merit of this observation has already been sensed in Chapter 2, where convergence rates of GS (point-by-point) and TDMA (line-by-line) procedures were compared for a 1D problem. In this chapter, the main interest is to consider 2D problems. The enhancement techniques considered can also be extended to 3D problems.

Equation 9.5 is written such that the boundary coefﬁcients of the near-boundary nodes are zero and the boundary conditions are absorbed through Su and Sp, as explained in Chapter 5. Thus, AW2, j = AE I N −1, j = ASi,2 = ANi,J N −1 = 0.

(9.7)

The central idea of the block-correction technique is that an unconverged ﬁeld is corrected by adding uniform correction i along lines of constant i. Thus,

li, j let

i, j = li, j + i .

(9.8)

Now, the correction i is chosen such that the integral conservation over all controlvolumes on a constant-i strip is exactly satisﬁed. The equation governing i is thus obtained by a two-step procedure. First, Equation 9.8 is substituted in Equation 9.5 so that

It will be recognized that the quantity inside the summation in Equation 9.12 is simply −Ri,j (see Equation 9.2) at iteration level l. Further, Equation 9.10 can be easily solved by TDMA. In this equation, B E I N −1 = BW2 = 0 (see Equation 9.7) and hence I N and 1 are not needed. A similar exercise in the j direction will result in an equation for j . The overall procedure is as follows: 1. Solve Equation 9.5 once using ADI to arrive at the li, j ﬁeld. 2. Form the B coefﬁcients in Equation 9.10 and solve this equation by TDMA to yield i corrections. Reset i, j according to Equation 9.8. 3. Repeat step 2 to yield j corrections and reset i, j again. 4. Return to step 1 if the convergence criterion is not satisﬁed. The block-correction procedure generally produces considerably faster convergence than the ADI method but, in certain circumstances, it may produce an erroneous solution or even divergence. Such a circumstance may arise when is highly nonuniform and i or j may produce over- or undercorrections. Therefore, the block-correction procedure may be treated as an optional convergence enhancement device. 9.3 Method of Two Lines In the ADI method, two sweeps are alternately executed in i and j directions (see Chapter 5). Within each sweep, however, the TDMA is executed only along a single line so that values of that line are updated simultaneously. To enhance the convergence rate, it is possible to devise a TDMA procedure for two, three, or multiple lines. By way of illustration, we consider the method of two lines [56, 21] in which the following deﬁnition is introduced: i,∗ j+1 = i, j .

7. Go to step 1 with the next value of j (i.e., j = j + 1). 8. Repeat steps 1–7 until j = J N − 2. A similar procedure can be executed for sweep on the j direction. Finally, we note that a procedure for simultaneous solution for three, four, or more consecutive lines can also be devised but the associated algebra is very tedious. It will be realised that if a simultaneous solution procedure is devised for all lines in a given direction, one will have a procedure that is equivalent to the matrix inversion method for the whole ﬁeld. 9.4 Stone’s Method As mentioned in Section 9.1, the convergence rate is sensitive to the structure of the coefﬁcient matrix. Stone [79] devised a whole-ﬁeld procedure that reduces this sensitivity. To apply the method, it is ﬁrst necessary to change the 2D node address (i, j) to the 1D address N . Thus, N = i + ( j − 1) × I N ,

Figure 9.1 shows the fully expanded form of Equation 9.32. Note that matrix A has a maximum of ﬁve nonzero elements in each row. The main idea in Stone’s method is to represent matrix A as a product of two matrices, U and L. Thus, the L matrix (or lower matrix) is formed in such a way that all entries above the diagonal are zero. The diagonal element is occupied by 1, and positions of −AW and −AS in the A matrix are now taken by BW and B S (say). Similarly, in the U matrix (or upper matrix) all elements below the diagonal are set to zero; the diagonal elements are occupied by B P and elements occupying positions −AE and −AN are replaced by B E and B N , respectively. The L and U matrices are shown in Figure 9.2. Note that the size of L and U matrices is again Nmax × Nmax . Unfortunately, the product matrix |U | × |L| does not produce the A matrix exactly. Instead, a matrix shown in Figure 9.3 is produced. This matrix has two additional nonzero entries that occupy positions N W (i − 1, j + 1) and S E(i + 1, j − 1). In terms of elements of the U and L matrices, the elements of

and the structure of the product matrix will take the form |U | |L| || = |A + D| || = |Su|.

(9.35)

This structure is clearly not the same as that of Equation 9.32 because matrix A is augmented by D. Stone, however, postulated that Equation 9.34 will be a good approximation to Equation 9.32 if the following substitutions are made: N −1+I N = αs ( N −1 + N +I N − N ),

Now, it is expected that the product matrix will be a close approximation to the A matrix (i.e., D → 0). In actual solving, therefore, the product matrix equation is written as |A + D| |l+1 | = |A + D| |l | + |Su| − |A| |l |.

(9.44)

We now deﬁne |δ| = |l+1 | − |l |,

(9.45)

|R| = −[|A| |l | − |Su|],

(9.46)

269

9.5 APPLICATIONS

where δ is the change in over one iteration and R is the negative of the nodal residual. Therefore, Equation 9.44 can be written as |A + D| |δ| = |R| = |U | |L||δ|.

Note that the CPU times mentioned in the table depend on the processor used. The quoted times thus have no intrinsic relevance; they are mentioned for the purpose of comparison between different methods.

The results are shown in Table 9.3. Here, owing to heat transfer coefﬁcient boundary condition at Y = 0, both T0 and q0 are not a priori known. Therefore, in this problem with a nonlinear boundary condition, the computer times are greater than in Problem 1 for the I N = 33 and J N = 17 grid. However, despite the nonlinear boundary condition, GS and ADI showed monotonic convergence (not shown here) whereas the block correction, two-line TDMA, and Stone’s methods showed mildly oscillatory convergence. On both grids, Stone’s method is attractively fast. Incidentally, for such problems, Patankar [53] recommends that convergence may be checked by overall domain heat balance rather than by the magnitude of the residual. In the present problem, the overall heat balance was satisﬁed within 0.0025%. Table 9.4 shows results for Problem 4. In this problem, conductivity varies with temperature so that coefﬁcients AE, AW , AN , and AS change with iterations. Computations are carried out for a very ﬁne grid. The convergence rate now slows down compared with the rates mentioned for Problem 3. For this problem, the convergence history (Rl /R1 ) is plotted in Figure 9.4. It is seen that, in all methods, the initial C R is high but decreases with increase in l. For the block-correction procedure, however, the initial rate is almost maintained throughout the iterative process, yielding the overall fastest convergence rate . The overall heat balance was satisﬁed within 0.025%.

A.1 Introduction In the study of transport phenomena in moving ﬂuids, the fundamental laws of motion (conservation of mass and Newton’s second law) and energy (ﬁrst law of thermodynamics) are applied to an elemental ﬂuid. Two approaches are possible: 1. a particle approach or 2. a continuum approach. In the particle approach, the ﬂuid is assumed to consist of particles (molecules, atoms, etc.) and the laws are applied to study particle motion. Fluid motion is then described by the statistically averaged motion of a group of particles. For most applications arising in engineering and the environment, however, this approach is too cumbersome1 because the signiﬁcant dimensions of the ﬂow are considerably bigger than the mean-free-path length between molecules. In the continuum approach, therefore, statistical averaging is assumed to have been already performed and the fundamental laws are applied to portions of ﬂuid (or control volumes) that contain a large number of particles. The information lost in averaging must however be recovered. This is done by invoking some further auxiliary laws and by empirical speciﬁcations of transport properties such as viscosity µ, thermal conductivity k, and mass diffusivity D. The transport properties are typically determined from experiments. Notionally, the continuum approach is very attractive because one can now speak of temperature, pressure, or velocity at a point and relate them to what is measured by most practical instruments. Guidance for deciding whether the particle or continuum approach is to be used can be obtained from the Knudsen number K n = l/L, where l is the mean-free-path length between molecules and L is a characteristic dimension (say, the radius of 1

This can be appreciated from Avogadro’s number, which speciﬁes that, at normal temperature and pressure, a gas will contain 6.022 × 1026 molecules per kmol. Thus in air, for example, there will be 1016 molecules/mm3 . 273

274

APPENDIX A. DERIVATION OF TRANSPORT EQUATIONS

a pipe) of the ﬂow. When K n is very small ( 1.5, the density is calculated from the perfect gas relation ρm =

p Mg p = , Rg T Ru T

(A.17)

where Mg is the molecular weight of the gas and Ru is the universal gas constant.

Now, the total mass transfer ﬂux Ni,k is the sum of convective ﬂux due to bulk ﬂuid motion (with each species having the same velocity as the bulk ﬂuid) and diffusion ). Thus, ﬂux (m i,k . Ni,k = ρk u i + m i,k

4

(A.19)

Reduced pressure and temperature are deﬁned as pr = p/ pcr and Tr = T /Tcr , where the sufﬁx cr stands for the critical point.

280

APPENDIX A. DERIVATION OF TRANSPORT EQUATIONS

Under certain restricted circumstances of interest in this book, the diffusion ﬂux is given by Fick’s law of mass diffusion = −D m i,k

Note that when the mass transfer equation is summed over all species of the mixture, the mass conservation equation for the bulk ﬂuid (Equation A.5) is re trieved. This is because Rk = 0. That is, when some species are generated by a chemical reaction, others are destroyed so that there is no net mass generation in the bulk ﬂuid. A.5

Energy Equation

The ﬁrst law of thermodynamics, when considered in rate form (W/m3 ), can be written as E˙ = Q˙ conv + Q˙ cond + Q˙ gen − W˙ s − W˙ b ,

The mass diffusivity is deﬁned only for a binary mixture of two ﬂuids 1 and 2 as D12 . In multicomponent gaseous mixtures, however, diffusivities for pairs of species are nearly equal and a single symbol D sufﬁces for all species. Incidentally, in turbulent ﬂows, this assumption of equal (effective) diffusivities has even greater validity.

281

APPENDIX A. DERIVATION OF TRANSPORT EQUATIONS

Q˙ gen = Net volumetric heat generation within the CV, W˙ s = Net rate of work done by surface forces, and W˙ b = Net rate of work done by body forces. Each term will now be represented by a mathematical expression. Rate of Change The equation for the rate of change is

The chemical energy is positive for exothermic reactions and negative for endothermic reactions. Evaluation of Q˙ chem depends on the chemical reaction model employed in a particular situation. The Q˙ rad term represents the net radiation exchange between the control volume and its surroundings. Evaluation of this term, in general, requires solution of integro-differential equations [48]. However, in certain restrictive circumstances, the term may be represented analogous to Q˙ cond with k replaced by radiation conductivity krad as krad =

16 σ T 3 , a+s

(A.31)

where σ is the Stefan–Boltzmann constant and a and s are absorption and scattering coefﬁcients, respectively. Work Done by Surface and Body Forces Following the convention that the work done on the CV is negative, it can be shown that ∂ ∂ [σ1 u 1 + τ12 u 2 + τ13 u 3 ] + [τ21 u 1 + σ2 u 2 + τ23 u 3 ] −W˙ s = ∂ x1 ∂ x2

B.1 Structure of the Code The 1D conduction code is divided into two parts: 1. a user part containing ﬁles COM1D.FOR and USER1D.FOR and 2. a library part containing ﬁle LIB1D.FOR. The user part is problem dependent. Therefore, the two ﬁles in this part are used to specify the problem to be solved. In contrast, the library part is problem independent. Thus, the LIB1D.FOR ﬁle remains unaltered for all problems. In this sense, the library part may be called the solver whereas the user part may be called the pre- and postprocessor. This structure is central to creation of a generalised code. To execute the code, USER1D.FOR and LIB1D.FOR ﬁles are compiled separately and then linked before execution. The COM1D.FOR is common to both parts and its contents are brought into each subroutine or function via the “INCLUDE” statement in FORTRAN. Variable names starting with I, J, K, L, M, and N are integers whereas all others are real by default. The list of variable names with their meanings is given in Table B.1. The listings of each ﬁle are given at the end of this appendix.

B.2 File COM1D.FOR In this ﬁle, logical, real, and integer variables are included. The PARAMETER statement is used to specify the maximum array dimension IT and values of π , GREAT, and SMALL. The latter are frequently required for generalised coding. The variable names are given in a labelled COMMON as in COMMON/BOUND/. . . , where BOUND is the label. Here, variables of relevance to boundary conditions are included. If required, the user may add more variable names or arrays for the speciﬁc problem at hand as shown at the bottom of the ﬁle.

Array containing temperature (◦ C or K) Temperature at node 1 Temperature at node 1 at old time Logical – refers to T -boundary condition at node 1 Logical – refers to TDMA Maximum allowable time Temperature T∞ Temperature T∞ at old time Temperature T∞ near node 1 Temperature T∞ near node N Temperature T∞ near node 1 at old time Temperature T∞ near node N at old time Temperature at node N Temperature at node N at old time Logical – refers to T -boundary condition at node N Array containing temperature at old time Total current time Logical – refers to unsteady-state calculation Array containing cell volume (m3 ) Coordinate of node P (m) Logical – refers to cell-face coordinate speciﬁcation Coordinate of cell face at w Logical – refers to node coordinate speciﬁcation

B.3 File USER1D.FOR This is the main control ﬁle at the command of the user. The ﬁrst routine PROGRAM ONED is the command routine from where subroutine MAIN is called. The latter is the ﬁrst subroutine of the LIB1D.FOR ﬁle. When all operations are completed, PROGRAM ONED calls the RESULT subroutine, which is a part of the USER1D.FOR ﬁle. Following the listing of the COM1D.FOR ﬁle, listings of two USER1D.FOR ﬁles are given. They correspond to the two solved problems in Chapter 2. The reader is advised to refer to these ﬁles as well as to Table B.1 to understand the description of each routine in USER1D.FOR ﬁle. BLOCK DATA This routine at the end of the USER1D.FOR ﬁle speciﬁes all the problem-dependent data such as properties, boundary conditions, and other control parameters. It is assumed that all data are given in consistent units. Here, SI units are used except for the grid data XCF or X, which are dimensionless. The physical coordinates in meters are then evaluated by multiplying by AL (the domain length) in PROGRAM ONED. Dimensionless speciﬁcation provides better appreciation of

APPENDIX B. 1D CONDUCTION CODE

nonuniformity (if any) in the speciﬁed grid. When a nonuniform grid is speciﬁed, it is advisable to ensure that the ratio of two consecutive cell sizes does not exceed 2. Subroutine INIT In this routine, an initial guess for T at ITER = 0 in a steadystate problem or at t = 0 in an unsteady-state problem is given. In a steady-state problem, the number of iterations (and hence the computer time) greatly depends on how close the initial guess is to the ﬁnal converged solution. In the ﬁn problem (Problem 2, Chapter 2), a linear temperature proﬁle is given with T 1 = 225 (given) and TN = 205 (which is guessed) although the converged solution is nonlinear. Subroutine NEWVAL In this routine, boundary conditions at a new time (if different from the initial time) are speciﬁed. Subroutine PROPS In this routine, thermal conductivity and speciﬁc heat are given. They may be functions of x, t, or T. The density is of course constant in our formulation (see Chapter 2). Subroutine SORCE A problem-dependent source (q V ) is given in this routine. It may be a function of T , x, and/or . Subroutine INTPRI This routine prints the converged solution at the current time step. The routine can also be used to store current values in dummy arrays DUM1 and DUM2 for later printing or plotting. Here, the STOP condition may be given. Functions HPERI, AREA, and PERI These function routines calculate heat transfer coefﬁcient at node I and area and perimeter at location X or XCF as per the speciﬁcations in their arguments. Note that heat transfer coefﬁcients may be functions of T , x, and/or t. Subroutine RESULT In this last routine, the converged solution is printed along with evaluation and printing of derived parameters. For example, in Problem 2 of Chapter 2, it is of interest to calculate heat loss from the ﬁn as well as ﬁn effectiveness and compare them with the exact solutions. This routine can also be used to create ﬁles containing results for postprocessing using graphics packages such as GNUPLOT or GRAPHER.

B.4 File LIB1D.FOR Subroutine MAIN All subroutines in the code are called from this subroutine. First, subroutines GRID and INIT are called. Then, starting with TTIME = 0, an outer DO loop (3000) is initiated to begin calculations at a time step NTIME and TTIME is incremented by DELT. Subroutine NEWVAL is called to set boundary conditions at a new time step. Then, iterations are carried out in an inner loop (1000) in which subroutines PROPS, COEF, SORCE, BOUND, and SOLVE are called in turn. The SOLVE routine returns the value of FCMX. If this value is less

287

288

APPENDIX B. 1D CONDUCTION CODE

than 10−4 , the inner loop is exited; otherwise a further iteration is carried out by returning to “1000 ITER = ITER + 1.” In a steady-state problem, a minimum of two iterations are performed. If the problem is steady, there is no need to carry out calculations at a new time step and, therefore, the outer loop is also now exited and control is transferred to statement “5000 CONTINUE.” If the problem is unsteady, subroutines UPDATE and INTPRI are called and the outer loop continues. Subroutine GRID In this routine, depending on logical XCELL or XNODE, coordinates XCF or X are set and area, perimeter, and cell volume are calculated and printed. It is always desirable to check these speciﬁcations in the output ﬁle OO (see PROGRAM ONED). Subroutine COEF In this routine, coefﬁcients AE and AW are evaluated. Note that cell-face conductivities are evaluated by harmonic mean. Subroutine BOUND This routine implements speciﬁed boundary conditions at I = 1 and I = N. The implementation is carried out by updating Su and Sp at near-boundary nodes as explained in Chapter 2. Subroutine SOLVE In this routine, Su and Sp are further updated if the problem is unsteady. Also, if the stability criterion is violated, a warning message is printed. AP and Su are further augmented to take account of the underrelaxation factor. Thus, all coefﬁcients are ready to solve the discretised equations. This is done by GS or by TDMA depending on the user choice speciﬁed in the BLOCK DATA routine. Subroutine UPDATE This routine sets all new variables to their “OLD” counterparts. Subroutine PRINT The arguments of this general routine carry the variable F and its logical name “HEADER” speciﬁed from point-of-call. The routine is written to print six variables on a line. If N > 6, the next six variables are printed on the next line, and so on. The values are printed in E-format but the user may change to F-format, if desired. COMMON BLOCK COM1D.FOR C *** THIS IS COMMON BLOCK FOR 1-D CONDUCTION PROGRAM PARAMETER(IT=50,PI=3.1415927,SMALL=1E-30,GREAT=1E30) LOGICAL T1SPEC,H1SPEC,Q1SPEC,TNSPEC,HNSPEC,QNSPEC LOGICAL STEADY,UNSTEADY,GAUSS,THOMAS,XCELL,XNODE COMMON/BOUNDS/T1SPEC,H1SPEC,Q1SPEC,TNSPEC,HNSPEC,QNSPEC COMMON/STATE/STEADY,UNSTEADY,GAUSS,THOMAS,XCELL,XNODE COMMON/CVAR/T(IT),TO(IT),SPH(IT),COND(IT),RHO(IT) COMMON/COORDS/X(IT),XCF(IT),ACF(IT),PERIM(IT),VOL(IT),AL COMMON/COEFF/AP(IT),AE(IT),AW(IT),SU(IT),SP(IT),STAB(IT) COMMON/CONTRO/ITERMX,N,RP,RSU,FCMX,CC,ISTOP