**3. Computational fluid dynamics**

Computational fluid dynamics (CFD) is the analysis of systems involving fluid flow, heat transfer, and associated phenomena such as chemical reactions by means of computer-based simulation. This methodology is very powerful and may be used in a wide range of industrial and nonindustrial application areas. For hydrodynamic simulations, CFD is the proper methodology that may be used during reactor design procedures.

### **3.1 CFD methodology**

CFD codes may be considered a series of numerical algorithms that can resolve fluid flow problems. Commercial CFD packages include sophisticated user interfaces to facilitate the process of input problem parameters and to examine the results, and our interest within this chapter is the code ANSYS® [6, 7]. Most codes contain three main elements: (a) a preprocessor, (b) a solver, and (c) a postprocessor. There are external functions that can be coded as additional or complementary functions that can add up to the calculations and results; for ANSYS Fluent® these functions are known as user-defined functions (UDFs) [8]. Briefly, the function of each of these elements within a CFD code is mentioned [1–5].

## *3.1.1 Preprocessing*

Preprocessing consists of the input of a flow problem to a CFD program by means of an interface and the subsequent transformation of this input into a data ready to use by the solver. The user activities at the preprocessing stage involve geometry definition (domain), grid generation (mesh), physical and chemical phenomena to be modeled, fluid properties, and boundary conditions.

#### *3.1.2 Processing*

There are three different schemes for numerical solution techniques: finite difference, finite element, and spectral methods. In this work only finite volume method will be considered, a special finite difference formulation that is central to the most well-established CFD codes including the program used in our case of study ANSYS Fluent®. The numerical algorithm to resolve the problem at hand consists of the following steps: governing equations, discretization, and solution of algebraic equations.

#### *3.1.3 Postprocessing*

In this step, results are available, and thanks to the visualization code tools, the data may be presented in different ways to facilitate the results analysis. The leading CFD packages are equipped with versatile data visualization tools. These may include domain geometry and grid display, vector plots, line and shaded contour plots, 2D and 3D surface plots, particle tracking, and view in perspective (translation, rotation, scaling, etc.), and more recently, animation has been included.

**89**

Pressure field:

Velocity field:

*Hydrodynamic Analysis on a Photocatalytic Reactor Using ANSYS Fluent®*

Most codes produce trusty alphanumeric output and have data export facilities for further manipulation external to the code which also represents a possibility to enhance the result analysis and solution presentation/explanation procedures.

The governing equations of fluid flow represent mathematical statements of the conservation laws of physics: (a) mass conservation, (b) momentum conservation,

The fluid will be subject to the theory of the continuum. For the analysis of fluid flows at macroscopic length scales (around 1 μm and larger), the molecular structure of matter and molecular motions may be ignored. The behavior of the fluid is described in terms of macroscopic properties, such as velocity, pressure, density and temperature, and their space and time derivatives. These may be thought of as averages over a suitable large number of molecules. We will save the mathematical development because it is beyond the scope of this chapter and recommend the

As mentioned in prior sections, the design of a chemical reactor involves several steps and disciplines, and simulation hydrodynamic calculations are the first to be carried on. Fluid kinematics deals with describing the motion of fluids without necessarily considering the forces and moments that cause the motion. In this section, we introduce fundamental kinematic concepts related to flowing fluids. We discuss briefly the material derivative and its role in transforming the conservation equations from the Lagrangian description of fluid flow (following a fluid particle)

The kinematics of experiments under the Lagrangian description involves keeping track of the position vector of each object, xA, xB,. …, and the velocity vector of each object, *VA*, *VB*, …, as functions of time. When this method is applied to a flowing fluid, we call it the Lagrangian description of fluid motion. From a microscopic point of view, a fluid is composed of billions of molecules that are subject to continuous collisions into one another, somewhat like billiard balls, but the task of following even a subset of these molecules is quite difficult, even for our biggest computers. A more common method of describing fluid flow is the Eulerian description of fluid motion. In the Eulerian description of fluid flow, a finite volume called a control volume is defined, through single piece of volume fluid flows in and out. We do not need to keep track of the position and velocity of a mass of fluid particles of fixed identity. Instead, we define field variable functions of space and time, within the control volume [3–5]. For example, the pressure field is a scalar field variable for

to the Eulerian description of fluid flow (pertaining to a flow field).

general unsteady tridimensional fluid flow in Cartesian coordinates:

→ *P*=*P*( → *x*, → *y*, →

→ *V* = *V*( → *x*, → *y*, →

Likewise, the acceleration field is also a vector field variable:

We define the velocity field as a vector field variable in a similar fashion:

*z*,*t*) (1)

*z*,*t*) (2)

*DOI: http://dx.doi.org/10.5772/intechopen.89782*

reader to consult CFD textbooks for such purpose.

**3.2 Governing equations**

and (c) energy conservation.

**4. Hydrodynamic calculations**

Most codes produce trusty alphanumeric output and have data export facilities for further manipulation external to the code which also represents a possibility to enhance the result analysis and solution presentation/explanation procedures.
