Abstract
The universal principles of fluid motion are the conservation of mass, momentum and energy. This chapter will introduce the CFD governing equations and describe how the continuity equation, component equation, Navier-Stokes equation and energy equation were derived from the principles above. With the expanding application of CFD simulation technology, some processes such as fluid-involved reactions, adsorption and permeation, which break the conservation of mass, momentum and energy for fluid phase, should be coupled to CFD model. In view of this, this chapter provided the theories about source terms for the mass equation, momentum equation and thermal energy equation. The technology for solving these governing equations remained a challenge for a long period due to the complexity. Thanks to the development of numerical methods, such as the finite difference method and the finite volume method, these equations can be solved and provide reasonable numerical results of flows, heat transfer and reactions. This chapter also demonstrates the basics of these two major numerical techniques.
Keywords
- governing equations
- finite-difference method
- finite-volume method
- reacting flow
- multiphase flow
- source term
1. Introduction
Using Computational Fluid Dynamics (CFD) simulation is of great importance in modeling reactive flows because it allows for the prediction and analysis of complex fluid dynamics and chemical reactions in a controlled and cost-effective environment [1]. In fluid reactors, the reaction rate depends on many factors such as concentrations of reactant fluid and product fluid, temperature and turbulence, and these key factors vary with time and space coordinate [2]. Knowing the evolution and distribution of the heat and mass transfer factors is important in reactor design and operating condition optimization. CFD simulations can be used to model and simulate the behavior of reactive flows, such as combustion [3], pyrolysis [4, 5, 6], gasification [7] and some other chemical reactions-driven fluid flow [8], and get detailed information on heat and mass transfer inside reactors.
There are many advantages of CFD over other traditional research methods. For example, CFD simulations can predict the behavior of combustion, which can be used to optimize combustion systems and reduce emissions. CFD simulations can also be used to optimize the design of reaction systems, such as gas combustion in turbines, boilers, and engines, pyrolysis or gasification in thermal reactors by predicting the performance of different designs and optimizing the operating conditions for maximum efficiency. Safety analysis can be performed by CFD simulations as well, by predicting the behavior of the system under different conditions and identifying potential risks. A distinct advantage of CFD simulations is that it can provide a cost-effective means of analyzing and optimizing reactive flow systems, as they can be used to simulate and analyze the behavior of the system under a wide range of conditions without the need for expensive physical testing [9].
The results of a CFD simulation are obtained through numerical methods that solve the fluid flow governing equations using a finite difference or a finite volume method. The numerical methods used in CFD simulations involve dividing the fluid domain into a grid or mesh of discrete cells and then solving the equations governing fluid flow and heat transfer at each of these grid points or cells. The numerical methods used in CFD simulations are complex and require high-performance computing resources. The accuracy of the results depends on the quality of the mesh, the numerical methods used and the convergence criteria [10]. Therefore, CFD simulations require a deep understanding of numerical methods with careful validation and verification to ensure that the results are accurate and reliable.
To better understand CFD simulations, learning the basics of CFD theory is essential for a few reasons. CFD basic theory provides a fundamental understanding of the governing equations and numerical methods used in CFD simulations. This understanding is essential for developing accurate and reliable CFD simulations. A thorough understanding of CFD theory allows for the development of more efficient and accurate simulations. This is because it enables the user to select appropriate numerical methods, grid sizes and convergence criteria. CFD simulations can be complex, and errors can arise due to various reasons. Understanding CFD theory allows the user to identify the source of the error and develop solutions to fix it. CFD theory is constantly evolving, and researchers are continually developing new methods and algorithms to improve the accuracy and efficiency of CFD simulations. A strong understanding of CFD theory is essential for contributing to the advancement of the field.
2. Governing equations
As fluid is one of the existing states of matter, it follows the laws of motion, such as mass conservation, momentum conservation and energy conservation. These laws govern the motion and force of fluid, and thus are called governing equations. These equations are generally expressed in differentiation forms.
2.1 Continuity equation
If our object is an infinitely small grid, continuity indicates that the mass of fluid entering this small grid equals the mass of fluid flowing out of this grid plus the mass of fluid accumulating in this grid. Since the continuity equation is derived from this mass conservation concept, it can also be regarded as a mass conservation equation which is expressed as Eq. (1).
where
Based on the Taylor series expansion for the
Substituting Eqs. (2) and (3) into Eq. (1), one can obtain Eq. (4).
After canceling the identical terms with opposite signs, dividing ∆
Then the continuity equation is derived. Sometimes it is also written in a concise vector form as Eq. (6).
2.2 Component balance equation
Even though the continuity equation governs the total mass balance of fluid during its flowing process, for a multi-component flow, the mass balance of each component must also be ensured. The mass transfer of a component is more complex than the total flow. In addition to convective flow, a component could also diffuse under the driving force of the concentration gradient from the high concentration region to the low concentration region.
Figure 2 is a demonstration of diffusive flow. Initially, a chamber is separated by a valve into two sub-chambers with equal volume and pressure. In the left sub-chamber, there are 8 moles of N2 and 2 moles of CO, while in the right chamber there are 2 moles of N2 and 8 moles of CO. Once the valve is open, there is no convective flow due to the equal pressure on both sides, but N2 would diffuse from left to right due to the concentration difference between the left and the right sides. In the meantime, CO would diffuse the other way around owing to the same reason. During this process, there is no convective flow at all, but the mass transfer of each component really occurred. Therefore, when considering the mass balance of a component in a multi-component flow, the diffusive flow or diffusion must be included. Generally, the diffusion follows Fick’s law [11]:
where
In multi-component flow, the
where
In addition to the convective flow depicted in Figure 3, there is also diffusive flow driven by the concentration gradient (Figure 4). According to Fick’s law, the diffusive flow of component
Substituting all the convective flow and diffusive flow expressions into Eq. (8), and canceling out the identical terms with opposite signs leads to Eq. (9).
After dividing
which is the final expression of the component balance equation. Component equation is especially important in governing the flow with chemical reactions, because the reasonable prediction of reaction rates depends on accurate information about component distribution in a reactor.
2.3 Momentum equation
Newton’s second law is the principle to express the correlation between force and motion of the fluid. Namely, the force acting on an infinitesimal control volume equals the product of its mass and acceleration, which is given as (Eq. (11)).
Actually, both force and acceleration are vectors and should be expressed by the three components in the
Taking the
According to Newton’s second law, the acceleration in the x direction should equal the quotient of the forces along the x direction divided by mass.
Basically, there are two types of forces. Namely, surface forces such as normal stress, shear stress, and body forces such as gravity force and magnetic force. Figure 5 depicts all the surface forces acting on a control volume along the x direction. Firstly, there is a pair of normal stresses imposed on the left and right surfaces that are indicated as blue arrows. This surface force is caused by internal pressure and velocity gradient in x direction. Secondly, there is a pair of shear stresses on the top and bottom surfaces that are marked as yellow arrows. This surface force is caused by the velocity gradient. Thirdly, a pair of shear stresses are also acting on the front and back surfaces shown as red arrows.
The summation of all the surface forces is
In fluid mechanics, the normal stress is related to the pressure and velocity gradient in the fluid, and is given as Eq. (18) [13]
The shear stress follows Newton’s law of viscosity as depicted in Eq. (16) [13]
Bringing Eqs. (18) and (19) to Eq. (17) yields Eq. (20) for the total surface forces in the x direction.
In most cases, the body force only includes gravity force.
Then, the total force in the x direction is
The term inside the parenthesis is the expression of the continuity equation which equals zero
Then, Eq. (23) could be further simplified to
Combining Eqs. (15) and (25), we have
Finally, Eq. (26) is the formula of the momentum equation of fluid in the x direction. Likewise, in the y direction and z direction, the momentum equations of fluid flow could also be derived in a similar way as follows:
Since Eq. (26) was progressively developed by Claude-Louis Navier and George Gabriel Stokes, this equation is generally called the Navier-Stokes Equation.
2.4 Energy equation
The heat transfer of fluid should follow the law of energy conservation. The total energy of fluid includes internal energy, kinetic energy and gravitational energy. Practically, it is not convenient to consider the total energy of fluid during the calculation. A better way to include kinetic energy and gravitational energy is by adding source terms in the energy equation. In a CFD model, the main energy form considered is thermal energy, so the thermal energy balance is usually considered for the energy equation. The thermal energy accumulated in an infinitesimal control volume equals the heat entering the control volume in terms of work, convection, conduction and radiation minus the heat going out. As a tradition, radiation is always not taken into account in the energy equation. The rate of energy change in a control volume should equal the net rate of heat added plus the net rate of work done. The heat added and work done could be either positive or negative depending on the direction of energy flow. The energy conservation is given as
where
Since we have analyzed all the x-direction surface forces on a control volume when we derived the Navier-Stokes equation, the rate of heat generation due to work done by each normal force and shear force is shown in Figure 6. Likewise, there are also same number of normal forces and shear forces along y-direction and z-direction, and they generate heat as well.
Heat conduction caused by temperature gradient is also happening in heat transfer. The thermal energy entering and exiting the control volume in x-direction is described in Figure 7. Besides this pair of heat fluxes, in the pairs of x-o-z surfaces and x-o-y surfaces the conductive heat fluxes also exist.
Bring all the work heat and conductive heat into Eq. (29) and dividing ∆
The heat flux
Then, the energy balance equation (Eq. (30)) becomes Eq. (34)
where Φ is the dissipation function which includes all terms relating to the energy due to deformation work done on the control volume. In most practical cases, dissipation function Φ can be neglected, because the term is significantly small compared with heat conduction. Then, Eq. (34) is simplified as
If the energy
Expanding the total derivative of
Eq. (37) is the final expression of the energy equation. The first term on the left-hand side is called the transient term, the second to the fourth terms are called advection terms, and the terms on the right-hand sides are diffusion terms. Energy equation related temperature to time and space coordinate. With the energy equation, obtaining the temperature evolution and distribution in a fluid field becomes possible.
2.5 Summary of the governing equations
Previously, we have derived the continuity equation, component equation, momentum equation and energy equation based on the conservation principles.
If we introduce a universal variable
where
2.6 Governing equations in cylindrical coordinate
In some common cases, fluid flows through pipes or reactors which are mostly in cylindrical shape, so it is more convenient to express the flow in a cylindrical coordinate. Writing CFD code based on the governing equations expressed in cylindrical coordinate is also more suitable than those in Cartesian coordinate [10].
The continuity equation could be derived from analyzing the mass balance in the fluid microelement as shown in Figure 8. The blue arrows represent the flow in radial direction. The red color arrows represent the flow in the tangential direction, and the yellow arrows stand for the flow in the axial direction. Therefore, the conservation of mass in the control volume in Figure 8 is given as
Dividing
The momentum equation in cylindrical coordinate is also derived from Newton’s second law.
which is then expressed by velocity vector as
In cylindrical coordinate, the velocity vector is given as
And the acceleration is then given by
The partial derivative of velocity vector with respect to time can be expressed as the summation of three vectors in radial ®, tangential (
With the definitions in Eq. (52), Eq. (50) is then transformed to
The partial derivatives of velocity vector with respect to
Particularly, in cylindrical coordinate the unit vectors in radial (
Employing the correlations in Eq. (59), Eq. (56) would become
Bringing Eqs. (51) and (62) to Eq. (55), we can obtain
Now, we took the radial direction as an example to derive its momentum equation. The acceleration in the radial direction is defined as
According to Newton’s law, the acceleration also equals to
The surface tensions in the radial direction are described in Fig. 10. The summation of all the surface tensions along the radial direction is
Taking the limit for ∆
Bringing ∆V =
Combining Eqs. (66), (67) and (70), we can obtain
In fluid mechanics, the definitions of the surface tensions in Eq. (70) are given as follows:
Combining Eqs. (70) and (71) yields
Finally, Eq. (78) is the momentum equation of fluid in the radial direction. Likewise, in the tangential and axial directions, the momentum equations of fluid flow could also be derived in a similar way as follows:
The energy equation could be derived from analyzing the energy balance in the fluid control volume as shown in Figure 11.
According to Figure 11 for cylindrical coordinate, the heat energy balance is expressed as the energy accumulated in the control volume equals the heat into this control volume minus the heat out of the control volume
Which can be further transformed to Eq. (82) by canceling out identical terms with opposite signs.
If the change of thermal energy is all induced by temperature change, then Eq. (82) is expressed as:
By applying Fourier’s law of heat conduction (Eq. 84), Eq. (89) is then derived as the energy equation in cylindrical coordinate.
3. Source and sinks
The expansion of CFD applications to the fields such as chemical engineering, environmental engineering, thermal engineering and pharmaceutical engineering was based on the development of multiscale and multiphase models which benefited from the coupling of source or sink terms to the conservation equations. A sink term is actually a negative source term, so both source terms and sink terms could be called by a joint name—source terms.
3.1 Source term for the continuity equation
Processes such as solid gasification or combustion, and gas adsorption by solid sorbents would break the mass conservation of the fluid phase. If there are reactions are generating additional fluid or remove the existing fluid in a control volume, the mass balance in this control volume must be disrupted by these reactions. The rate of fluid entering a control volume minus the rate of fluid flowing out equals the rate of fluid accumulating in this control volume and the net gain of fluid generated inside the control volume. If in the control volume there is a reaction generating fluid at a rate of
Eq. (45) could also include the case where there is a depletion of fluid by using a negative value for
where the source term is the reaction rate
3.2 Source term for component equation
Similar to the imbalance for total mass conservation, the conservation of each component in a multi-component flow with reactions could also be broken. The components participating as reactants would be deemed as sinks and the components generated as products would be regarded as sources. If a component is generated at a rate of
After a similar derivation from Eq. (7) to Eq. (9), the component equation should include a source term as expressed by Eq. (91)
where
3.3 Source term for the momentum equation
When it comes to cases with a multiphase flow such as gas-solid flow in fluidized bed, momentum conservation still holds, but interphase interactions need to be taken into account [15]. There might be extra forces between different phases, which can affect the momentum transfer between different phases. Therefore, in multiphase flow, appropriate interphase force terms need to be introduced to correct the momentum equation.
When the fluid phase and solid phase interact with each other, a reactive force that causes flow resistance is generated, known as drag force. If the drag force is expressed as
The drag force
where
Therefore, Eq. (40), the momentum equation in the x direction, is adjusted by a source term as follows
where
Similarly, the momentum equation in the y direction (Eq. 41) and the momentum equation in the z direction (Eq. 42) are adjusted as follows
3.4 Source term for the energy equation
As discussed in the energy equation section, the energy equation ensures the thermal energy conservation. In some cases, chemical reactions occur in the fluid domain, and these reactions are either exothermic or endothermic. If the reaction is exothermic, it could release heat to the surrounding fluid and increase the temperature. If the reaction is endothermic, it consumes the heat from the surrounding fluid and decreases the temperature. Even though total energy is conserved, the thermal energy is not. In order to consider the imbalance of thermal energy in fluid, the source term of heat must be included in the energy equation. By considering reaction heat, the energy balance is
where ∆
With the inclusion of source terms, processes with chemical reactions or multiphase interactions could be accurately simulated in CFD models.
4. Numerical methods to solve governing equations
The governing equations discussed above are almost impossible to solve analytically. The only feasible pathway to solve these partial differential equations is employing numerical methods. This is the reason most CFD software need to discretize the fluid domain to generate a mesh or grid. The core idea of numerical methods is transforming differential to difference quotient. The commonly used numerical methods in most CFD software include the finite difference method and the finite volume method.
4.1 Finite difference method
The finite difference method is the first method for solving partial differential equations. In finite difference method, the Taylor series is employed to generate approximations to the partial derivatives of the CFD governing equations. According to the Taylor series, the value of a general variable ϕ at node i + 1 (Figure 12) could be expressed as:
And the value of a general variable φ at node
If we subtract Eq. (104) from Eq. (103), we get
Since ∆
From Eq. (103) and assuming ∆
From Eq. (104) and assuming ∆
Eqs. (106)–(108) successfully approximated the first-order derivative by difference quotient. First-order derivative is actually a slope of a variable. Figure 13 geometrically represents the slopes by backward difference, central difference and forward difference. It is clear that the slope by central difference (blue line) is closer to the real slope (black line), so the central difference could represent the exact partial differential with a higher accuracy.
In CFD governing equations, there are second-order partial derivatives in diffusion terms, so the second-order derivatives should also be approximated by finite difference method. Adding Eqs. (103) and (104) together yields
By omitting higher-order terms, the difference quotient form in finite difference method for second-order derivative is
In a 3-D fluid domain such as Figure 14, Taylor series expansion also applies for y and z directions. The central differences for first- and second-order derivatives are:
For time term derivatives, only the first-order derivative needs to be approximated by the finite difference method. In most cases, the backward difference is used (Eq. (115)). This is because the variable value at the previous time step has already been calculated, and then, it is available to calculate the current time step in explicit expression. Since the computation performs in chronological order, the variable values at future steps are not available. Forward difference and central difference involve the variable at future steps (Eqs. (116) and (117)), so it is not recommended to be used in explicit solver. It can only be solved in an implicit solver.
As we know it is easy to transform difference quotient to linear equation. With the finite element method, all the CFD partial differential equations can be converted to linear equations. By applying the techniques of solving linear equations, the numerical solutions of fluid field could be obtained.
4.2 Finite volume method
For structured mesh (Figure 14), it is ideal to use the finite difference method introduced above. However, most CFD simulations have to use an unstructured mesh (Figure 15) due to the complexity of geometries, so it is difficult to define the node sequence
Finite volume method is derived from Gauss’s divergence theorem. In divergence theorem, the integration of a variable divergence over a body equals the integration of the variable over the surface which encloses the body.
It can also be written in x, y, z directions as follows
In CFD, we assume ∂ϕ/∂
Similarly, the variation of ϕ on a grid surface could also be neglected if we assume a grid surface is too small to have variation of ϕ. The right side of Gauss’s divergence theorem could be simplified as well
The divergence theorem correlated the ∂ϕ/∂
where
The first-order derivative with respect to y and z can be similarly obtained as follows
In the same way, the second-order derivative can be approximated by the first-order derivative
From the equations above, it is clear that the finite volume method has better conservativeness of the CFD governing equations. Meanwhile it is more adaptive to complicated geometries. In most CFD commercial software, the finite volume method is the mainstream technique to solve the CFD governing equations.
5. Conclusion
Understanding the basic theory of CFD governing equations and numerical solutions is the key to developing CFD simulation codes as well as using CFD packages. Basically, all flows can be universally described by the continuity equation, component equation, momentum equation and energy equation, because fluid follows mass conservation, momentum conservation and energy conservation. With source terms, CFD applications were broadened to a wider field like chemical engineering, environmental engineering or thermal engineering. However, these equations are almost impossible to be solved analytically, thus we have to resort to the numerical method to get the approximate results. This involves using the finite difference method and finite volume method. The numerical methods offered a feasible way to get the solutions from the governing equations, which facilitated the analysis of complex phenomena associated with fluid flow, heat transfer and chemical reactions.
Acknowledgments
Authors appreciate the financial support from teaching reform fund for postgraduate students in Dalian University of Technology (No. 20), Liao Ning Revitalization Talents Program (grant number: XLYC2007179) and the Australian Research Council (grant number DE210101549).
References
- 1.
Hasse C, Debiagi P, Wen X, Hildebrandt K, Vascellari M, Faravelli T. Advanced modeling approaches for CFD simulations of coal combustion and gasification. Progress in Energy and Combustion Science. 2021; 86 :100938. DOI: 10.1016/j.pecs.2021.100938 - 2.
Ramos A, Monteiro E, Rouboa A. Numerical approaches and comprehensive models for gasification process: A review. Renewable and Sustainable Energy Reviews. 2019; 110 :188-206. DOI: 10.1016/j.rser.2019.04.048 - 3.
Tu Q, Wang H, Ocone R. Application of three-dimensional full-loop CFD simulation in circulating fluidized bed combustion reactors – A review. Powder Technology. 2022; 399 :117181. DOI: 10.1016/j.powtec.2022.117181 - 4.
Luo H, Wang X, Liu X, Wu X, Shi X, Xiong Q. A review on CFD simulation of biomass pyrolysis in fluidized bed reactors with emphasis on particle-scale models. Journal of Analytical and Applied Pyrolysis. 2022; 162 :105433. DOI: 10.1016/j.jaap.2022.105433 - 5.
Lu L, Gao X, Dietiker J-F, Shahnam M, Rogers WA. MFiX based multi-scale CFD simulations of biomass fast pyrolysis: A review. Chemical Engineering Science. 2022; 248 :117131. DOI: 10.1016/j.ces.2021.117131 - 6.
Xiong Q, Yang Y, Xu F, Pan Y, Zhang J, Hong K, et al. Overview of computational fluid dynamics simulation of reactor-scale biomass pyrolysis. ACS Sustainable Chemistry & Engineering. 2017; 5 (4):2783-2798. DOI: 10.1021/acssuschemeng.6b02634 - 7.
Ku X, Li T, Løvås T. CFD–DEM simulation of biomass gasification with steam in a fluidized bed reactor. Chemical Engineering Science. 2015; 122 :270-283. DOI: 10.1016/j.ces.2014.08.045 - 8.
Ji G, Zhao M, Wang G. Computational fluid dynamic simulation of a sorption-enhanced palladium membrane reactor for enhancing hydrogen production from methane steam reforming. Energy. 2018; 147 :884-895. DOI: 10.1016/j.energy.2018.01.092 - 9.
Ji G, Wang G, Hooman K, Bhatia S, Diniz da Costa JC. Computational fluid dynamics applied to high temperature hydrogen separation membranes. Frontiers of Chemical Science and Engineering. 2012; 6 (1):3-12. DOI: 10.1007/s11705-011-1161-5 - 10.
Ji G, Wang G, Hooman K, Bhatia S, Diniz da Costa JC. The fluid dynamic effect on the driving force for a cobalt oxide silica membrane module at high temperatures. Chemical Engineering Science. 2014; 111 :142-152. DOI: 10.1016/j.ces.2014.02.006 - 11.
Khan M, Hussain A, Malik MY, Salahuddin T, Aly S. Numerical analysis of Carreau fluid flow for generalized Fourier’s and Fick’s laws. Applied Numerical Mathematics. 2019; 144 :100-117. DOI: 10.1016/j.apnum.2019.05.018 - 12.
Ji G, Wang G, Hooman K, Bhatia S, Diniz da Costa JC. Simulation of binary gas separation through multi-tube molecular sieving membranes at high temperatures. Chemical Engineering Journal. 2013; 218 :394-404. DOI: 10.1016/j.cej.2012.12.063 - 13.
Kundu PK, Cohen IM, Dowling DR. Fluid Mechanics. Academic Press; 2015 Amsterdam - 14.
Bernardin C, Olla S. Fourier’s law for a microscopic model of heat conduction. Journal of Statistical Physics. 2005; 121 (3):271-289. DOI: 10.1007/s10955-005-7578-9 - 15.
Zhang M, Zhang Y, Ma D, Li A, Fu W, Ji G, et al. Numerical investigation on the heat transfer of plastic waste pyrolysis in a rotary furnace. Chemical Engineering Journal. 2022; 445 :136686. DOI: 10.1016/j.cej.2022.136686