Normalized maximum values for the
Abstract
The present work addresses the numerical simulation of fluid flow for 2D problems. The physical principles and numerical models implemented in the software package EasyCFD are presented in a synthetic and clear way. The 2D form of the Navier-Stokes equations is considered, using the eddy-viscosity concept to take into account turbulence effects upon the mean flow field. The k-ε and the k-ω Shear Stress Transport (SST) turbulence models allow for the calculation of the turbulent viscosity. The numerical model is based on a control volume approach, using the SIMPLEC algorithm on an unstructured quadrilateral mesh. The mesh arrangement is a non-staggered type. The coordinate transformation, integration discretization and solution method for the governing equations are fully described. As an example of application, the airflow around a NACA 0012 airfoil is calculated and the results for the aerodynamic coefficients are compared with available experimental data.
Keywords
- CFD
- SIMPLEC
- unstructured mesh
- fluid flow
- 2D simulation
1. Introduction
The software EasyCFD [1] is a 2D simulation tool aimed at an initiation in the field of computational fluid dynamics. The main guiding lines on its development were the simplicity and the intuitiveness of utilization, in a self-contained package. The physical domain is discretized with quadrilateral unstructured meshes, allowing the simulation to deal with complex geometries of any configuration virtually. The present work synthesizes the main physical principles and numerical models implemented for the solution of 2D fluid flow problems, including heat transfer, in arbitrarily shaped geometries.
2. Basic transport equations
For the description of the transport equations, the
The Navier-Stokes equations describe momentum conservation and, for a 2D situation, may be stated as follows:
where
In turn, the conservation of mass law, or continuity equation, is
The energy conservation equation is obtained considering the transport equation for the enthalpy
with the source term
where
where
where
where the constraint
3. Turbulence modelling
Two of the most popular turbulence models are presented next.
3.1. The k-ε turbulence model
The standard formulation of this turbulence model is described in, e.g., [2]. The turbulent viscosity is given by
The turbulence kinetic energy,
The term
while the term
with
In the proximity of a wall, the previous equations should be modified to account for the viscous effects that become predominant. Wall functions ensure the connection between the viscous sub-layer and the inertia layer, at a location established by the
where
where
where, once again,
For the turbulence kinetic energy, a zero flux along the direction perpendicular to the wall is assigned. For the dissipation rate, Eq. (11) is not employed in the node adjacent to the wall. Instead, the dissipation rate is given by
As for momentum, the energy flux is computed differently depending on the
where
3.2. The k-ω SST turbulence model
The
where
The weighting function
and
where
where
and
The constants are computed as a blend of the
The constants are
The near wall treatment for momentum and turbulence equations follows the proposal described in [5]. The basic principle behind the automatic wall functions is to switch from a low-Reynolds number formulation to a wall function based on the grid nodes proximity to the wall. According to these authors, the automatic wall treatment avoids the deterioration of results typical of low-Reynolds models when applied on too coarse meshes.
The known solutions for
The imposed value for
For the turbulence kinetic energy, a zero flux along the direction perpendicular to the wall is assigned. In turn, for the momentum equations, a similar reasoning applies, with expressions for the shear velocity in the viscous and in the logarithmic region:
with
4. Numerical method
4.1. Transformation of coordinates
Discretizationand integration of the transport equations described previously are performed using a non-orthogonal generalized mesh as shown in Figure 1. The independent Cartesian coordinates (
Transformation of the original equations is accomplished by replacing the independent variables, using the chain rule, which states that, generically:
The Jacobian of the transformation
represents the ratio between the physical size of the control volume and its computational size (unitary). The derivatives
To obtain the strong conservative form in the boundary-fitted coordinate system (
is then used to recast some terms. The result, for a generic variable
The terms
The non-orthogonal term
Note that, in this case, the sub-index for the fluxes (such as in
where the cross-derivatives were incorporated into the source term
4.2. Integration
The integration and solution method for the transport equations are entirely based on the methodology in [6], with some of the suggestions described in [7] and incorporating the necessary modifications for the generalized mesh approach. The general Eq. (43) may be written as
The integration of the previous equation in its control volume leads to
where the source term has been written as a linear combination involving
In the previous expressions, the subscripts indicate the location relative to the
For the solution of the equations, it is necessary to evaluate the values of
or, in a more compact manner,
with “
It is necessary to compute the face values
Due to its first-order character, the upwind scheme is often not used due to associated numerical diffusion. The Quick scheme is third-order accurate. The deferred correction version of Hayase [8] combines the first-order upwind scheme with a third-order correction,
The Quick scheme, although third-order accurate, presents oscillations that may lead to some unrealistic behaviour. Total variation diminishing (TVD) schemes, also implemented in the present code, were developed to provide second-order accurate solutions that are free or nearlyfree from oscillations. For further information on this, please refer to, e.g., [9].
4.3. Pressure-velocity coupling
EasyCFD adopts the SIMPLEC algorithm (Semi-Implicit Method for Pressure-Linked Equations-Consistent) [7], which is based on the original formulation
During the iterative process, velocities
where
Thus, the pressure and velocity fields
Subtracting Eq. (56) from Eq. (55) and taking into account Eq. (57), one obtains
The keystone of the SIMPLECalgorithm consists on the subtraction of the term
or, for simplicity:
where
The equations for the velocity correction are obtained through the pressure correction field, recurring to the previous equation:
leading to
4.4. The pressure correction equation
As previously stated, the objective of the pressure correction is to produce a pressure field such that the solution of the momentum equations is a mass-conservative velocity field. Consequently, the equations for solving the
As one may see, velocities are, now, needed at the control volume faces. Taking Eq. (63), for the
The terms
The derivatives are evaluated as
and, for the cross-derivatives,
Introducing the discretization expressed by Eqs. (68) and 67 into Eq. (65) allows us to obtain the pressure correction equation:
where
The
One may note that pressure values at the control volume centre are not included in the evaluation of these derivatives (the same applies for the pressure derivatives in the momentum equations). This may lead to the well-known checkerboard pattern for the pressure field. To avoid this effect, the Chie-Row interpolation method proposes that the mass fluxes, to be evaluated at the control volume interfaces for all the transport equations (
The “starred” fluxes
The terms
where the revised velocities
Note that the source term
4.5. Solution of the equations
The solution of the equations previously described is carried out with an iterative procedure. For accelerating the convergence rate, two relaxation factors (described next) are applied.
The solution of the equation is sub- or over-relaxed in the following manner:
Values of
The whole flow field calculation is considered to be converged when all the normalized residuals are lower that a predefined value
The total normalized residual for the transport equations of
where
5. Examples of application
To exemplify the numerical method described previously, two test cases are presented next along with a comparison of results with published data.
5.1. Flow past an airfoil
A calculation was performed to compute the aerodynamic coefficients of a NACA 0012 airfoil operating at a Reynolds number of 6×106. The obtained values for the drag and lift coefficients are compared with existing experimental data. The first step is to define the calculation domain, which should be large enough in order to avoid numerical blockage effects. Figure 2 represents the domain, for a 1 m airfoil cord length. Lateral boundaries are assigned a free slip condition and a uniform velocity profile with 5% turbulence intensity is imposed at the inlet. A mass conservative condition is applied at the outlet boundary. After a mesh independency study, a total of approximately 250,000 mesh nodes were employed, with three mesh refinement regions. Particular care was taken near the airfoil surface, were
For the present simulations, both the first-order hybrid [6] and the Quick advection schemes were employed, along with the
Results for the dependence of the lift coefficient with the airfoil angle of attack
Figure 5 depicts the relation between lift and drag coefficients. In this case, the
5.2. Natural convection inside a cavity
The natural convection flow in a cavity is a classical test for numerical methods in fluid dynamics. The cavity is a square shape (cf. Figure 6) with adiabatic horizontal walls. A constant temperature is imposed in each the vertical wall.
The problem is governed by the following non-dimensional parameters:
where the thermal diffusivity is
where
Figure 7(a) and (b) displays isothermal lines generated using a constant value spacing between the minimum and the maximum verified within the domain. Figure 8(a) and (b) shows the flow streamlines. The flow, in the steady-state situation, is characterized by a large vortex filling the cavity, rotating in the clockwise direction. Two small vortices rotating in the same direction are located near the cavity centre. For this case, the minimum and the maximum streamline values used in the visualization do not correspond to the total amplitude of the stream function within the domain. These values were, instead, adjusted in EasyCFD to correspond to those employed in [19]. The agreement between the calculations and those reported in the literature is very good. Vahl Davis and Jones [18] present normalized maximum values for the
occurring in the vertical and horizontal symmetry lines, respectively. Table 1 shows the results obtained with EasyCFD, the reference values in [17] and the range of variation for the
6. Concluding remarks
The numerical simulation of fluid flow for 2D problems was addressed. The physical principles and numerical models here presented correspond to the implementation in the software package EasyCFD. Transformation of the original equations to cope with a non-orthogonal generalized mesh is described in detail, along with the coupling of momentum and continuity with an adapted SIMPLEC algorithm for non-staggered meshes. Although not addressed in the present chapter, this software package was developed entirely based on a graphical interface, aiming at an easy and intuitive utilization. With a fast learning curve, this package is very suitable for learning the principles and application methods in computational fluid dynamics and has a great value both as a didactic and an applied tool. Although, at first, the restriction to 2D situations may seem very limitative, a great number of practical situations may be addressed with this approach.
References
- 1.
Lopes AMG. A 2D software system for expedite analysis of CFD problems in complex geometries. Computer Applications in Engineering Education. 2015; 3 (2):27–38. DOI: 10.1002/cae.21668. - 2.
Launder BE, Spalding DB. The numerical computation of turbulent flows. Computer Methods in Applied Mechanics and Engineering. 1974; 3 (2):269–289. DOI: 10.1016/0045-7825(74)90029-2. - 3.
Menter FR. Zonal two equation kappa-omega turbulence models for aerodynamic flows. AIAA Paper 1993–2906, 24th Fluid Dynamics Conference, 6–9 July 1993; Orlando, Florida. - 4.
Menter, Kuntz M, Langtry R. Ten years of industrial experience with the SST turbulence model. Turbulence, Heat and Mass Transfer. 2003;4:625–632. - 5.
Menter FR, Ferreira JC, Esch T. The SST turbulence model with improved wall treatment for heat transfer predictions in gas turbines. International Gas Turbine Congress. 2003;(1992):1–7. - 6.
Patankar S. Numerical Heat Transfer and Fluid Flow. Series in computational methods in mechanics and thermal sciences; 1980. New York, McGraw-Hill. - 7.
Van Doormaal JP, Raithby GD. Enhancements of the SIMPLE method for predicting incompressible fluid flows. Numerical Heat Transfer. 2007; 7 (2):147–163. DOI: 10.1080/01495728408961817. - 8.
Hayase T, Humphrey JA, Greif R. A consistently formulated QUICK scheme for fast and stable convergence using finite-volume iterative calculation procedures. Journal of Computational Physics. 1992; 98 (1):108–118. DOI: 10.1016/0021-9991(92)90177-Z. - 9.
Vertseeg HK, Malalasekera W. An Introduction to Computational Fluid Dynamics. The Finite Volume Method. Pearson Education Limited; Essex, England, 2007. - 10.
Rhie CM, Chow WL. Numerical study of the turbulent flow past an airfoil with trailing edge separation. AIAA Journal. 1983; 21 (11):1525–1532. DOI: 10.2514/3.8284. - 11.
Majumdar S. Role of underrelaxation in momentum interpolation for calculation of flow with nonstaggered grids. Numerical Heat Transfer. 1998; 13 (1):125–132. DOI: 10.1080/10407788808913607. - 12.
Shen WZ, Michelsen JA, Sørensen NN, Sørensen JN. An improved SIMPLEC method on collocated grids for steady and unsteady flow computations. Numerical Heat Transfer: Part B. 2003; 43 :221–239. DOI: 10.1080/713836202. - 13.
Ehrlich LW. An ad hoc SOR method. Journal of Computational Physics. 1981; 44 (1):31–45. DOI: 10.1016/0021-9991(81)90036-X. - 14.
Hutchinson BR, Raithby GD. A multigrid method based on the additive correction strategy. Numerical Heat Transfer. 1986; 9 (5):511–537. DOI: 10.1080/10407788608913491. - 15.
Abbott IH, Von Doenhoff AE. Theory of Wing Sections, Including a Summary of Airfoil Data. Dover Publications; New York, 1959. - 16.
Ladson CL. Effects of independent variation of Mach and Reynolds numbers on the low-speed aerodynamic characteristics of the NACA 0012 airfoil section. NASA TM 4074, October 1988. - 17.
Vahl Davis GD. Natural convection in a square cavity: a benchmark numerical solution. International Journal for Numerical Methods in Fluids. 1983; 3 :249–264. - 18.
Vahl Davis GD, Jones IP. Natural convection in a square cavity: a comparison exercise. International Journal for Numerical Methods in Fluids. 1983; 3 :227–248. - 19.
Dixit HN, Babu V. Simulation of high Rayleigh number natural convection in a square cavity using the lattice Boltzmann method. International Journal of Heat and Mass Transfer. 2006; 49 :727–739.