Keywords

These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

1 What Is Computational Fluid Dynamics (CFD)

We are literally at a significant point in history. A third branch of the scientific method, computer simulation, is emerging as a day-to-day tool. It is taking its place next to experimental development and mathematical theory as a way to new discoveries in science and engineering”. This was part of the speech of John Rollwagen, chairman and CEO of Cray Research, to the opening session of Supercomputing 89.

While it is common to refer to this or similar statements about the importance of simulation tools and techniques to the advancement of science and technology in general, it is now very clear that the use of simulation tools has become crucial to the development of a wide range of everyday technologies. In fact, numerical simulation tools nowadays play the role of technology enablers.

Computational Fluid Dynamics (CFD) is one such tool. Even though the impetus to its development was initially provided by some sections within the aeronautics and aerospace industry, it has grown to become an essential tool in a range of other design intensive industries such as the automotive, power generation, chemical, nuclear, and marine industries, to cite a few. Over the past decade newer industries have joined the ranks of heavy CFD users: for example in the electronics industry CFD is employed to optimize energy systems and heat transfer for the cooling of electronic devices, in the biomedical industry CFD is now a core development and validation tool for medical applications, and in the building industry CFD is used in HVAC (heating, ventilating, and air conditioning), in fire simulation, and in air-quality assessment.

This has happened in little over two decades since the statement of John Rollwagen was made and over four decades since the development of the seminal SIMPLE algorithm by the CFD group of Brian Spalding at Imperial College in the early 70s.

Computational Fluid Dynamics is just one of the later Computer Aided Engineering tools that has gone mainstream. It has joined a well-established set of tools, such as the Finite Element Analysis (FEA) for Solid Mechanics and Vibration that has been part of the engineering design cycle since the mid 80s. The reason for this delay is the complexity of the equations that need to be solved. At their center is the Navier-Stokes equation that amazingly enough models accurately a whole set of flow phenomena from turbulent or laminar single phase incompressible flows, to compressible all-speed flows, and all the way to multiphase flows.

Amongst the numerical methods used to implement CFD, the Finite Volume Method has come to play a unique role.

2 What Is the Finite Volume Method

The Finite Volume Method (FVM) is a numerical technique that transforms the partial differential equations representing conservation laws over differential volumes into discrete algebraic equations over finite volumes (or elements or cells). In a similar fashion to the finite difference or finite element method, the first step in the solution process is the discretization of the geometric domain, which, in the FVM, is discretized into non-overlapping elements or finite volumes. The partial differential equations are then discretized/transformed into algebraic equations by integrating them over each discrete element. The system of algebraic equations is then solved to compute the values of the dependent variable for each of the elements.

In the finite volume method, some of the terms in the conservation equation are turned into face fluxes and evaluated at the finite volume faces. Because the flux entering a given volume is identical to that leaving the adjacent volume, the FVM is strictly conservative. This inherent conservation property of the FVM makes it the preferred method in CFD. Another important attribute of the FVM is that it can be formulated in the physical space on unstructured polygonal meshes. Finally in the FVM it is quite easy to implement a variety of boundary conditions in a non-invasive manner, since the unknown variables are evaluated at the centroids of the volume elements, not at their boundary faces.

These characteristics have made the Finite Volume Method quite suitable for the numerical simulation of a variety of applications involving fluid flow and heat and mass transfer, and developments in the method have been closely entwined with advances in CFD. From a limited potential at inception confined to solving simple physics and geometry over structured grids, the FVM is now capable of dealing with all kinds of complex physics and applications.

3 This Book

This book is about the Finite Volume Method and Computational Fluid Dynamics. It incorporates the basic know how of the method as acquired by the authors over almost three decades of work in the area. The terminology was carefully chosen, and vector notation was used whenever possible to ensure conciseness and consistency across all topics covered. Derivations are presented in a step by step fashion and illustrations are used extensively in the book to clarify concepts. In addition, a number of solved examples and exercises are also provided. Each chapter ends with a section denoted by “Computational Pointers” that provides pertinent details on implementation issues for two codes. The first, denoted by uFVM, is a Matlab®-based unstructured finite volume CFD educational code developed by the authors; while the second is OpenFOAM®, an open source finite volume code written in C++ capable of solving industrial type problems. Generally the numerics in each chapter are first presented for a one dimensional grid and progress towards two and three dimensional unstructured grids, to ease the introduction of difficult techniques.

The material presented allows the book to be utilized in a variety of ways. It can be used as a textbook for a senior undergraduate course covering the fundamentals of the finite volume discretization. It can also be deployed as a textbook for a graduate course on the application of the finite volume method and its use in computational fluid dynamics. It is also a handy reference book for workers in CFD, numerical heat transfer, and transport phenomena in general.

The content of the book falls into 20 chapters that may be grouped under the following four categories: (i) Foundation (Chaps. 2 through 7), (ii) Numerics (Chaps. 8 through 14), (iii) Algorithms (Chaps. 15 and 16), and (iv) Applications (17 through 19). Chapter 20 presents some closing remarks.

The uFVM Matlab® computer program, the OpenFOAM® developed routines, and the prepared lecture presentations can be downloaded from the book webpage at the following URL: “https://feaweb.aub.edu.lb/research/cfd

A summary of the material covered in the forthcoming chapters is presented next.

3.1 Foundation

This part, covered in Chaps. 2 through 7, provides the necessary background for introducing the FVM.

Chapter 2 presents a short introduction of the elements of linear algebra including vectors, matrices, tensors, and their practices. This is in addition to an examination of the fundamental theorems of vector calculus.

Chapter 3 overviews the conservation principles governing fluid flow and related transport phenomena. It describes the derivations of the continuity, momentum, and energy equations (collectively known as the Navier-Stokes equations). This is followed by the development of a typical conservation equation for a general scalar, vector, or tensor quantity. This equation forms the cornerstone for the developments presented in the numerics section. The conservation equation is shown to be composed of a transient, convection, diffusion, and source term. The discretization of each of these terms is presented in a separate chapter.

Chapter 4 summarizes the various steps of the discretization process, which include: (i) modeling the geometric domain and the physical phenomena, (ii) the discretization of the modeled geometric domain into a grid system, (iii) the discretization of the partial differential equation into an equivalent system of algebraic equations defined over each of the elements of the computational domain, and (iv) the solution of the system of equations.

Chapter 5 transforms the partial differential equation into a set of semi-discretized equations and presents a broad review of the numerical issues pertaining to the finite volume method. This provides a solid foundation for the chapters that follow.

Chapter 6 is devoted to the finite volume mesh. It starts with mesh discretization that replaces the geometric domain by a set of non overlapping elements. Then it proceeds with the computation of geometric information relevant to the various entities of the computational mesh in addition to the topological information that describes the arrangement and inter-relations of these entities.

Chapter 7 outlines the design decisions that shape the implementation of the two CFD codes, uFVM and OpenFOAM®. First the data structure and memory management schemes of the two codes are presented, then a sample test case is presented. Finally the format of the system of equations generated by each of the two codes are detailed.

3.2 Numerics

The material relevant to this part is covered in Chaps. 8 through 14. Each chapter specializes in the discretization of one of the terms in the general conservation equation derived in Chap. 2, with the exception of Chap. 10, which deals with linear solvers of algebraic systems of equations.

Chapter 8 describes the discretization of the diffusion term. The developments start on a structured Cartesian mesh and progress to unstructured non-orthogonal grid, while explaining the adopted treatment of the non-orthogonal cross-diffusion term. The chapter continues with a discussion on the used interpolation profiles and the rules that should be satisfied by the coefficients of the discretized system of algebraic equations. It also details the implementation of boundary conditions in addition to the under-relaxation procedure needed for highly non-linear problems.

Chapter 9 describes several techniques for evaluating gradients on a general mesh topology following either the Green-Gauss or the least square approach. It also presents methods to interpolate the gradient to element faces.

Chapter 10 deals with solvers of systems of algebraic equations. Both direct and iterative solvers are discussed with emphasis on iterative solvers because direct solvers are rarely used in CFD applications. The direct methods presented include the Gauss elimination and LU factorization. The concept of preconditioning is presented and the performance and limitations of some iterative methods are reviewed. This include the Jacobi, Gauss-Siedel, Incomplete LU factorization, and the conjugate gradient methods. The chapter also introduces the algebraic multigrid method, which is generally used in combination with iterative solvers to accelerate their convergence.

Chapter 11 proceeds with the discretization of the convection term assuming a known flow field. The shortcomings of using a symmetrical linear profile for the discretization of the convection term are delineated and a remedy is suggested through the use of an upwind profile. The high diffusion error associated with the upwind scheme is pointed out and upwind-biased higher order schemes are suggested.

Chapter 12 continues the developments of convection schemes and discusses approaches by which the dispersion error (unboundedness of the interpolation profile) affecting High Order (HO) schemes is resolved. This is achieved by enforcing a Convection Boundedness Criterion (CBC) on the HO profiles resulting in the group of High Resolution (HR) schemes. The Normalized Variable Formulation (NVF) and the Total Variation Diminishing (TVD) frameworks for constructing these HR schemes are presented. The commonality between the two approaches is explained through the Normalized Variable Diagram (NVD) and Sweby’s diagram used in the NVF and TVD formulation, respectively. Many schemes are presented in the context of both formulations. Techniques for the implementation of HR schemes in structured and unstructured grids are reported.

Chapter 13 focusses on the discretization of the unsteady term that arises in the simulation of transient problems. Several transient schemes are developed following two different approaches. In the first, a finite difference approximation (via Taylor expansion) is used. In the second approach, the finite volume method is used on a temporal element in a similar fashion to what was done to the convection term.

Chapter 14 is devoted to a number of “small” numerical details that may have “big” effects on the convergence behavior. First the linearization of the source term when it is solution dependent is discussed. Then explicit and implicit techniques for under relaxing the algebraic equations are presented. The chapter ends with an examination of convergence indicators.

3.3 Algorithms

The previous chapters solved the general conservation equation assuming a given flow field. In general, the flow field is not known and has to be computed. This is the subject of Chaps. 15 and 16.

Chapter 15 is concerned with the prediction of incompressible flows. The difficulties associated with resolving the strong coupling between pressure and velocity, with the absence of an equation for pressure, are overcome by the SIMPLE algorithm with the derivation of a pressure correction equation. The Rhie-Chow interpolation is then introduced to allow realizing solutions to flow problems on collocated grids. Finally the implementation of a number of frequently encountered boundary conditions is detailed.

Chapter 16 extends the SIMPLE algorithm into compressible flows. The dependence of density on pressure and temperature is accounted for in the pressure correction equation through a density correction, giving rise to a convection-like term that transforms the mathematical nature of the equation from elliptic (for incompressible flows) to hyperbolic. Implementation details for a number of boundary conditions are also provided.

3.4 Applications

This part describes the implementation and application of the numerical techniques developed in the previous chapters.

Chapter 17 applies these numerical techniques to address some of the challenges faced when solving turbulent flow problems. It introduces several two-equation turbulence models and details the treatment of the near wall region.

Chapter 18 reviews the implementation of boundary conditions in OpenFOAM® and provides the needed information for adding new boundary conditions in the code. The no-slip wall boundary condition is described in some details.

Chapter 19 outlines the solution procedure of a reference test case in which solvers and boundary conditions are applied to solve a turbulent incompressible flow problem.

Finally, Chapter 20 presents some closing remarks.

4 Closure

The chapter discussed the growing role played by Computational Fluid Dynamics (CFD) as a core design tool in a whole class of applications and provided a general overview of the Finite Volume Method (FVM). It also clarified the purpose of the book, its intended use, and a summary of its content. The next chapter will give a brief review of the mathematical operations that will be used throughout the book.