**2. Governing equations in computational fluid dynamics**

The governing equations in computational fluid dynamic mathematically express the three fundamental physical principles that describe the movement of any fluid. These equations are as follows:


A fluid is a substance that, due to molecular distances, does not present a defined form and adopts the form of the vessel that contains it. Therefore, it is difficult to analyze a fluid from the universal approach used for solids. In general, a fluid can be defined as a substance that deforms continually under the action of a shear stress. If a fluid is in movement, the velocity can be different at different positions within the studied domain, and their particles can rotate and deform at the same time. Considering the fluid as a continuum, there are two ap‐ proaches that can be used to understand its movement, making it susceptible to be analyzed using the fundamental principles: The first one is based on the study of a volume element of infinitesimal size and fixed in the space with the fluid flowing through it (known as the Eulerian approach) and an infinitesimal fluid element that moves along a streamline with a velocity equal to the local velocity of the flow at each point (Lagrangian approach) [5].

When a differential element of a fluid moving along a streamline, and considering the motion of a particle with a defined velocity through a differential volume defined in a Cartesian space, the governing equations for a compressible viscous flow are as follows:

**(a)** Continuity equation:

A CFD model has three sequential stages known as preprocessing, solving, and post-process‐ ing. In the first stage or preprocessing, the governing equations, properties, and boundary conditions are defined within a domain composed by small interconnected volumetric elements to model the fluid movement. During the second stage or solving process, the adequate selection of discretization schemes (temporal and spatial) for the governing equa‐ tions is carried out. Also, the convergence criteria or number of iterations, relaxation factors, and pressure and velocity coupling algorithm are set up at this stage. Finally, the postprocessing stage involves the analysis and interpretation of the obtained solutions using flow,

Nowadays, there are different commercial codes developed in a friendly interface, such as ANSYS FLUENT, OPEN FOAM, CFX, X-FLOW, and COMSOL. All of them are capable of helping researchers and engineers at the three aforementioned CFD stages. Generally, the modules of these commercial softwares have been validated comparing the results obtained for specific information such as separation point, circulation length, drag and lift coefficients, and velocities, with experimental and/or analytical results. Very often, the experimental results used for comparison are obtained from carefully controlled experiments about topics such as flow around circular cylinders, flow over forward or backward facing step, flow over a venture, and jet flow, among others [4]. Respecting the programming languages commonly used to develop the CFD codes used in commercial software, the most frequently used are C++,

The governing equations in computational fluid dynamic mathematically express the three fundamental physical principles that describe the movement of any fluid. These equations are

A fluid is a substance that, due to molecular distances, does not present a defined form and adopts the form of the vessel that contains it. Therefore, it is difficult to analyze a fluid from the universal approach used for solids. In general, a fluid can be defined as a substance that deforms continually under the action of a shear stress. If a fluid is in movement, the velocity can be different at different positions within the studied domain, and their particles can rotate and deform at the same time. Considering the fluid as a continuum, there are two ap‐ proaches that can be used to understand its movement, making it susceptible to be analyzed using the fundamental principles: The first one is based on the study of a volume element of infinitesimal size and fixed in the space with the fluid flowing through it (known as the Eulerian approach) and an infinitesimal fluid element that moves along a streamline with a velocity equal to the local velocity of the flow at each point (Lagrangian approach) [5].

**2. Governing equations in computational fluid dynamics**

**•** Continuity equation or mass conservation principle.

**•** Newton's second law or momentum conservation principle.

**•** The first law of thermodynamics or energy conservation principle.

temperature, and pressures fields [3].

316 Numerical Simulation - From Brain Imaging to Turbulent Flows

FORTRAN, and lately MATLAB.

as follows:

$$\frac{\partial \rho}{\partial t} + \nabla \cdot \left(\rho \vec{V}\right) = 0\tag{1.1}$$

**(b)** Navier-Stokes equations:

x-direction component (*î*)

$$\frac{\partial(\rho u)}{\partial t} + \nabla \cdot \left(\rho u \vec{V}\right) = -\frac{\partial P}{\partial \mathbf{x}} + \frac{\partial \tau\_{xx}}{\partial \mathbf{x}} + \frac{\partial \tau\_{yx}}{\partial \mathbf{y}} + \frac{\partial \tau\_{xz}}{\partial \mathbf{z}} + \rho f\_x \tag{1.2}$$

y-direction component (Ĵ)

$$\frac{\partial(\rho v)}{\partial t} + \nabla \cdot \left(\rho v \vec{V}\right) = -\frac{\partial P}{\partial \mathbf{y}} + \frac{\partial \tau\_{xy}}{\partial \mathbf{x}} + \frac{\partial \tau\_{yy}}{\partial \mathbf{y}} + \frac{\partial \tau\_{xy}}{\partial \mathbf{z}} + \rho f\_y \tag{1.3}$$

z-direction component (*k* ^ )

$$\frac{\partial(\rho \boldsymbol{w})}{\partial t} + \nabla \cdot \left(\rho \boldsymbol{w} \, \vec{V}\right) = -\frac{\partial P}{\partial \boldsymbol{z}} + \frac{\partial \boldsymbol{\tau}\_{\rm x}}{\partial \boldsymbol{x}} + \frac{\partial \boldsymbol{\tau}\_{\rm y}}{\partial \boldsymbol{y}} + \frac{\partial \boldsymbol{\tau}\_{\rm z}}{\partial \boldsymbol{z}} + \rho f\_{\boldsymbol{z}} \tag{1.4}$$

Energy equation:

$$\frac{\partial}{\partial t}\left[\rho\left(e+\frac{u^{2}+v^{2}+w^{2}}{2}\right)\right]+\nabla\cdot\left[\rho\left(e+\frac{u^{2}+v^{2}+w^{2}}{2}\right)\vec{V}\right]=\rho\dot{q}+\frac{\partial}{\partial x}\left(k\frac{\partial T}{\partial x}\right)+\frac{\partial}{\partial y}\left(k\frac{\partial T}{\partial y}\right)+\left(\omega y\right)\left(\omega y-\frac{\partial T}{\partial x}\right)$$

$$\frac{\partial}{\partial z}\left(k\frac{\partial T}{\partial z}\right)-\frac{\partial\left(uP\right)}{\partial x}-\frac{\partial\left(\nu P\right)}{\partial y}-\frac{\partial\left(\nu P\right)}{\partial z}+\frac{\partial\left(u\pi\_{xx}\right)}{\partial x}+\frac{\partial\left(u\pi\_{yx}\right)}{\partial y}+\frac{\partial\left(u\pi\_{zx}\right)}{\partial z}+\frac{\partial\left(\nu\pi\_{zy}\right)}{\partial x}+\frac{\partial\left(\nu\pi\_{zy}\right)}{\partial x}+\tag{1.5}$$

$$\frac{\partial\left(\nu\pi\_{yz}\right)}{\partial y}+\frac{\partial\left(\nu\pi\_{zy}\right)}{\partial z}+\frac{\partial\left(\nu\pi\_{zx}\right)}{\partial x}+\frac{\partial\left(\nu\pi\_{zx}\right)}{\partial y}+\frac{\partial\left(\nu\pi\_{zx}\right)}{\partial z}+\rho\vec{f}\cdot\vec{V}$$

where *e* is the internal energy per unit of mass, *f* <sup>→</sup> represents the body forces that act on the centroid of the fluid element (like gravitational, electrical or magnetic forces), "k" is thermal conductivity, P is the static pressure, *q*˙ is the heat transfer rate per unit of mass in the vol‐

ume element (it can be heat that is a combustion product, a chemical reaction, or an electron flow), *t* is time, *T* is temperature, *ρ* is density, τ are viscous stresses, and ∇ <sup>=</sup> <sup>∂</sup> <sup>∂</sup> *<sup>x</sup> i* <sup>→</sup> <sup>+</sup> <sup>∂</sup> <sup>∂</sup> *<sup>y</sup> j* <sup>→</sup> <sup>+</sup> <sup>∂</sup> <sup>∂</sup> *<sup>z</sup> k* <sup>→</sup> is the DEL vector operator for Cartesian coordinates. It is necessary to point out that viscous stresses (normal and shear stresses) are related to the deformation rate of the fluid element. Shear stresses are related to the temporal deformation caused by the constant shear force acting on the fluid element. Conventionally, *τij* represents a stress in the "j" direction, exerted on a plane perpendicular to *i*-axis. Normal stresses are related to the volume change rate in the fluid element (compression or tension); these stresses have in general a lower value than shear stresses.

At the end of the seventeenth century, Isaac Newton established that the shear stress in a fluid is proportional to its temporal deformation rate (velocity gradients, for example). Fluids that follow this behavior are known as Newtonian fluids, and they have many applications in fluid dynamics. For this kind of fluids, Stokes found, in 1845, the following relationships:

$$\begin{aligned} \boldsymbol{\tau}\_{xy} &= \boldsymbol{\tau}\_{yx} = \mu \left( \frac{\partial \boldsymbol{v}}{\partial \mathbf{x}} + \frac{\partial \boldsymbol{u}}{\partial \boldsymbol{\eta}} \right) & \boldsymbol{\tau}\_{xx} &= \lambda \left( \boldsymbol{\nabla} \cdot \boldsymbol{V} \right) + 2\mu \frac{\partial \boldsymbol{u}}{\partial \boldsymbol{\alpha}} \\ \boldsymbol{\tau}\_{xz} &= \boldsymbol{\tau}\_{zx} = \mu \left( \frac{\partial \boldsymbol{w}}{\partial \boldsymbol{x}} + \frac{\partial \boldsymbol{u}}{\partial \boldsymbol{\varpi}} \right) & \boldsymbol{\tau}\_{yy} &= \lambda \left( \boldsymbol{\nabla} \cdot \boldsymbol{V} \right) + 2\mu \frac{\partial \boldsymbol{v}}{\partial \boldsymbol{\eta}} \\ \boldsymbol{\tau}\_{yz} &= \boldsymbol{\tau}\_{zy} = \mu \left( \frac{\partial \boldsymbol{w}}{\partial \boldsymbol{\eta}} + \frac{\partial \boldsymbol{v}}{\partial \boldsymbol{\varpi}} \right) & \boldsymbol{\tau}\_{zz} &= \lambda \left( \boldsymbol{\nabla} \cdot \boldsymbol{V} \right) + 2\mu \frac{\partial \boldsymbol{w}}{\partial \boldsymbol{\varpi}} \end{aligned} \tag{1.6}$$

where *μ* is the molecular viscosity and *λ* is the second viscosity (which is not a term of common use in engineering). For gases, a good approximation can be obtained using the value *λ* = −2/3*μ*.

Non-Newtonian fluids are those that do not present a linear relationship between stresses and deformation rates due to shear stresses (velocities gradients). A non-Newtonian fluid can present viscoelastic and thixotropic properties as well as different kinds of relationships among density, pressure, and temperature in comparison with a Newtonian fluid. This kind of fluid requires a more specialized treatment to study them, which is out of the scope of this document.

The governing equations presented (1.1)–(1.5) contain seven unknown flow variables expressed in a set of five differential equations. For practical applications, additional equa‐ tions can be used to "close" the system (equal number of equations and unknowns). For example, in the study of an aerodynamic phenomenon, it is in general possible to assume that a gas behaves as an "ideal gas". For an ideal gas, the state equation is = *ρRT*, where R is the gas constant. This equation provides the equation system with a sixth equation. It can also be considered a seventh equation to close the equation system using a thermodynamic relation‐ ship among state variables, for example: *e* = *e*(*T*, *P*) For an ideal gas (with constant specific heats), this relationship becomes*e* = *CvT* where *Cv* is the constant volume-specific heat.

Finally, applying the substantial derivative definition for Cartesian coordinates*D*/*Dt* = *∂*/*∂t* + *u* ∂ <sup>∂</sup> *<sup>x</sup>* <sup>+</sup> *<sup>v</sup>* <sup>∂</sup> <sup>∂</sup> *<sup>y</sup>* <sup>+</sup> *<sup>w</sup>* <sup>∂</sup> <sup>∂</sup> *<sup>z</sup>* Eqs. (1.1)–(1.5) can be written as follows:

Computational Fluid Dynamics in Turbulent Flow Applications http://dx.doi.org/10.5772/63831 319

$$\frac{\partial \rho}{\partial t} + \nabla \cdot (\rho V) = 0 \tag{1.7}$$

$$
\rho \frac{Du}{Dt} = -\frac{\partial P}{\partial \mathbf{x}} + \mu \left[ \frac{\partial^2 u}{\partial \mathbf{x}^2} + \frac{\partial^2 u}{\partial \mathbf{y}^2} + \frac{\partial^2 u}{\partial z^2} \right] + \rho f\_\mathbf{x} \tag{1.8}
$$

ume element (it can be heat that is a combustion product, a chemical reaction, or an electron

the DEL vector operator for Cartesian coordinates. It is necessary to point out that viscous stresses (normal and shear stresses) are related to the deformation rate of the fluid element. Shear stresses are related to the temporal deformation caused by the constant shear force acting on the fluid element. Conventionally, *τij* represents a stress in the "j" direction, exerted on a plane perpendicular to *i*-axis. Normal stresses are related to the volume change rate in the fluid element (compression or tension); these stresses have in general a lower value than shear

At the end of the seventeenth century, Isaac Newton established that the shear stress in a fluid is proportional to its temporal deformation rate (velocity gradients, for example). Fluids that follow this behavior are known as Newtonian fluids, and they have many applications in fluid

( )

2

 m

2

 m

2

 m

( )

( )

dynamics. For this kind of fluids, Stokes found, in 1845, the following relationships:

æ ö ¶ ¶ ¶ = = + = Ñ× + ç ÷

 tl

*xy yx xx*

 m

tt

318 Numerical Simulation - From Brain Imaging to Turbulent Flows

ttm

ttm

*xz zx yy*

*yz zy zz*

æ ö ¶ ¶ ¶ = = + = Ñ× + ç ÷ è ø ¶ ¶ ¶

 t l

æ ö ¶ ¶ ¶ = = + = Ñ× + ç ÷

 tl

è ø ¶ ¶ ¶

*v u <sup>u</sup> <sup>V</sup> x y x*

*w u <sup>v</sup> <sup>V</sup> x z <sup>y</sup>*

*w v <sup>w</sup> <sup>V</sup> y z z*

è ø ¶ ¶ ¶

where *μ* is the molecular viscosity and *λ* is the second viscosity (which is not a term of common use in engineering). For gases, a good approximation can be obtained using the value *λ* = −2/3*μ*.

Non-Newtonian fluids are those that do not present a linear relationship between stresses and deformation rates due to shear stresses (velocities gradients). A non-Newtonian fluid can present viscoelastic and thixotropic properties as well as different kinds of relationships among density, pressure, and temperature in comparison with a Newtonian fluid. This kind of fluid requires a more specialized treatment to study them, which is out of the scope of this document.

The governing equations presented (1.1)–(1.5) contain seven unknown flow variables expressed in a set of five differential equations. For practical applications, additional equa‐ tions can be used to "close" the system (equal number of equations and unknowns). For example, in the study of an aerodynamic phenomenon, it is in general possible to assume that a gas behaves as an "ideal gas". For an ideal gas, the state equation is = *ρRT*, where R is the gas constant. This equation provides the equation system with a sixth equation. It can also be considered a seventh equation to close the equation system using a thermodynamic relation‐ ship among state variables, for example: *e* = *e*(*T*, *P*) For an ideal gas (with constant specific

heats), this relationship becomes*e* = *CvT* where *Cv* is the constant volume-specific heat.

<sup>∂</sup> *<sup>z</sup>* Eqs. (1.1)–(1.5) can be written as follows:

Finally, applying the substantial derivative definition for Cartesian coordinates*D*/*Dt* = *∂*/*∂t* +

<sup>∂</sup> *<sup>x</sup> i* <sup>→</sup> <sup>+</sup> <sup>∂</sup> <sup>∂</sup> *<sup>y</sup> j* <sup>→</sup> <sup>+</sup> <sup>∂</sup> <sup>∂</sup> *<sup>z</sup> k* <sup>→</sup> is

(1.6)

flow), *t* is time, *T* is temperature, *ρ* is density, τ are viscous stresses, and ∇ <sup>=</sup> <sup>∂</sup>

stresses.

*u* ∂ <sup>∂</sup> *<sup>x</sup>* <sup>+</sup> *<sup>v</sup>* <sup>∂</sup>

<sup>∂</sup> *<sup>y</sup>* <sup>+</sup> *<sup>w</sup>* <sup>∂</sup>

$$
\rho \frac{D\mathbf{v}}{Dt} = -\frac{\partial P}{\partial \mathbf{y}} + \mu \left[ \frac{\partial^2 \mathbf{v}}{\partial \mathbf{x}^2} + \frac{\partial^2 \mathbf{v}}{\partial \mathbf{y}^2} + \frac{\partial^2 \mathbf{v}}{\partial \mathbf{z}^2} \right] + \rho f\_y \tag{1.9}
$$

$$
\rho \frac{Dw}{Dt} = -\frac{\partial P}{\partial z} + \mu \left[ \frac{\partial^2 w}{\partial x^2} + \frac{\partial^2 w}{\partial y^2} + \frac{\partial^2 w}{\partial z^2} \right] + \rho f\_z \tag{1.10}
$$

$$\frac{D}{Dt}\left[\rho\left(e+\frac{u^{2}+v^{2}+w^{2}}{2}\right)\right]=\rho\,q+\frac{\partial}{\partial x}\left(k\frac{\partial T}{\partial x}\right)+\frac{\partial}{\partial y}\left(k\frac{\partial T}{\partial y}\right)+\frac{\partial}{\partial z}\left(k\frac{\partial T}{\partial z}\right)$$

$$-\frac{\partial\left(uP\right)}{\partial x}-\frac{\partial\left(\nu P\right)}{\partial\mathbf{\hat{\mathcal{V}}}}-\frac{\partial\left(\nu\nu P\right)}{\partial\mathbf{\hat{\mathcal{Z}}}}+\frac{\partial\left(\nu\boldsymbol{\tau\_{x}}\right)}{\partial\mathbf{x}}+\frac{\partial\left(\nu\boldsymbol{\tau\_{y}}\right)}{\partial\mathbf{\hat{\mathcal{V}}}}+\frac{\partial\left(\nu\boldsymbol{\tau\_{z}}\right)}{\partial\mathbf{z}}+\frac{\partial\left(\nu\boldsymbol{\tau\_{z}}\right)}{\partial\mathbf{z}}+\tag{1.11}$$

$$\frac{\partial\left(\nu\boldsymbol{\tau\_{x}}\right)}{\partial\mathbf{x}}+\frac{\partial\left(\nu\boldsymbol{\tau\_{y}}\right)}{\partial\mathbf{\hat{\mathcal{V}}}}+\frac{\partial\left(\nu\boldsymbol{\tau\_{z}}\right)}{\partial\mathbf{x}}+\frac{\partial\left(\nu\boldsymbol{\tau\_{z}}\right)}{\partial\mathbf{x}}+\frac{\partial\left(\nu\boldsymbol{\tau\_{y}}\right)}{\partial\mathbf{y}}+\frac{\partial\left(\nu\boldsymbol{\tau\_{z}}\right)}{\partial\mathbf{z}}+\rho\bar{f}\cdot\boldsymbol{V}$$

The governing equations presented (1.1)–(1.5) or (1.7)–(1.11) are widely known as the Navier– Stokes equations to honor the French physicist Claude Louis Navier and the English mathe‐ matician George Gabriel Stokes, who in an independent way, both obtained the equations in the first half of the nineteenth century. Originally, the Navier–Stokes equations terminology was only defined for the momentum equations. However, current CFD literature has been expanded to include the equations of mass and energy conservation. It should be noted that the governing equations can be also expressed in cylindrical and spherical coordinates, or even in generalized curvilinear coordinates.

It has to be kept in mind that these equations were originally formulated to reproduce the physics present in single-phase and non-reactive Newtonian flows. The governing equations for reactive flow systems with multiple components (like the ones found in combustion and multiphase flow problems) can be also established. However, they are more complex be‐ cause they involve multiple species and phases. It is necessary to note that for this complex flow systems, it becomes a necessity to include approximation models or empirical correla‐ tions because several terms are not constant anymore and they become functions for exam‐ ple of temperature, pressure, location, introducing new nonlinearities in the diffusive terms.

The governing equations constitute a coupled nonlinear partial differential equations system; therefore, an analytical solution is difficult to obtain. At the present time, there is not a general

solution in a closed form for this equation system. In fact, this is one of the most important reasons of the use of CFD, since it provides numerical approximations to the equations solutions, which have not been found yet using analytical methods, except for idealized cases for one-dimensional or two-dimensional flows in laminar or creeping flows.

The mathematical character of the equations has a significant impact on CFD. First of all, it is very important that the problem is adequately posed, and it means that the solution of the problem exists and it is unique. Furthermore, this solution is only affected by initial and boundary conditions. It is also important to classify the governing equations as elliptical, parabolic, or hyperbolic. Elliptical equations have to be solved simultaneously in the com‐ plete flow domain, whereas hyperbolic and parabolic equations propagate from one posi‐ tion to another one.

Mathematically, parabolic and hyperbolic equations are susceptible to be solved using time steps. On the other hand, for the elliptical equations, the flow variables in a given point should be solved simultaneously with the flow variables in other positions. It can be stated that the Navier-Stokes equations have, in general, a mixed nature. They are parabolic in the time domain and elliptical in the space domain [1, 3].

As it was mentioned before, the governing equations can be applied for laminar and turbu‐ lent flows by means of the use of additional terms to represent the influence of the fluctuat‐ ing eddies. In a basic and rigorous way, direct numerical simulation (DNS) works solving numerically these equations to a desired accuracy degree without any additional model or correlation. However, its application is still limited because of the large quantity of resour‐ ces required to solve the majority of the existent problems, which exceed the capacity of conventional computers.

For turbulent flows, there is a wide spectrum of time and length scales that have to be solved that increase the computational time in DNS simulation. However, from a scientific point of view, the information obtained using DNS is very valuable because it is considered a valida‐ tion means for turbulent models (with less complexity). The traditional performance of the CFD methods for turbulent flows has been focused on predicting the average influence of the main characteristics of turbulence. Very often, such influence is approached including new transport equations to replicate the effects of generation or dissipation of Reynolds stresses , which represent the transport of momentum in the streamwise direction (x-direction) caused by the turbulent eddies in the "i" and "j" directions. Frequently, average stress models adjust to semi-empirical models, which depend on a number of constants obtained using experi‐ mental correlations. These correlations are very often obtained from experiments where the working fluid is air or water, and very frequently, the experimental setup includes a flat plate. In the literature, this kind of closing model is known as a Reynolds Average Navier–Stokes (RANS) turbulence model. This kind of model is the most frequently used for engineering applications today. Unfortunately, for complex turbulent flows there is not a "universal" model that can be applied to any kind of flow, since boundary layer effects can be very different. In fact, the description of what happens within the boundary layer is the main weakness of the RANS models. For many years, RANS models have had success reproduc‐ ing turbulent zones far away from the wall for fully developed flows. However, they still have

problems reproducing unsteady flows or flow separation phenomena (as a result of an adverse pressure gradient) [6, 7]. Even though it is true that for very complex turbulent flows, there exists new and more powerful RANS models, capable of giving useful information to make decisions in an industry for example. Nevertheless, in the scientific world, those models do not seem to have universal validity. Due to that, alternative approaches such as large eddy simulation (LES) and DNS, with the help of the technological evolution of computers, have gained more attention in the last three decades.
