Open access peer-reviewed chapter

A Numerical Procedure for 2D Fluid Flow Simulation in Unstructured Meshes

Written By

António M. G. Lopes

Submitted: 23 October 2015 Reviewed: 14 March 2016 Published: 24 August 2016

DOI: 10.5772/63077

From the Edited Volume

Numerical Simulation - From Brain Imaging to Turbulent Flows

Edited by Ricardo Lopez-Ruiz

Chapter metrics overview

1,834 Chapter Downloads

View Full Metrics

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.

Advertisement

2. Basic transport equations

For the description of the transport equations, the x and z coordinates of the Cartesian system will be taken as the independent variables, to which correspond, for velocity, the u and the w components. The coordinate transformation for the generalized mesh will be presented later on the present work.

The Navier-Stokes equations describe momentum conservation and, for a 2D situation, may be stated as follows:

(ρu)t+x(ρu2)+z(ρuw)=x[Γ(2ux23divV)]+z[Γ(uz+wx)]pxE1
(ρu)t+x(ρu2)+z(ρuw)=x[Γ(2ux23diνV)]+z[Γ(uz+wx)]pxE1a

where p [N/m2] stands for pressure and I represents the buoyancy forces. The diffusion coefficient includes the contributions of the dynamic and turbulent viscosity, i.e., Γ=μ+μt[ N s/m2 ]

In turn, the conservation of mass law, or continuity equation, is

ρt+x(ρu)+z(ρw)=0E2

The energy conservation equation is obtained considering the transport equation for the enthalpy ϕ=cp T, where cp[J/kg K] is the specific heat and T [K] is its temperature. For a fluid medium, the corresponding equation is

(ρcpT)t+x(ρcpuT)+z(ρcpwT)=x[ΓTx]+z[ΓTz]+STE3

with the source term ST representing the heat generation rate per unit volume [W/m3] and Γ=(μ/Pr+μt/Prt)cp, with Pr and Prt as the laminar and the turbulent Prandtl number. For solid regions, heat transfer is governed by conduction:

(ρcpT)t=x(λTx)+z(λTz)+STE4

where λ[W/mK] is the material thermal conductivity. In a multi-component fluid flow situation, different fluids are present, sharing the same velocity, pressure, temperature and turbulence quantities. The concentration of one of the components (the secondary fluid) is computed with a normal transport equation for a scalar:

(ρϕc2)t+x(ρuϕc2)+z(ρwϕc2)=x(Γϕ2x)+z(Γϕc2z)E5

where ϕc2 is the mass fraction, or concentration, of the secondary fluid. The diffusion coefficient is given by

Γ=ρDϕc+μtSctE6

where Dϕc[m2/s] is the kinematic diffusivity that characterizes the fluids pair and Sct is the turbulent Schmidt number. The concentration of the secondary fluid plays an active role in the flow field since fluid properties depend on the concentration of each component. The mixture properties (such as viscosity, specific heat, etc.) are determined by a weighted average of the properties of the components. Thus, for a generic property X, we have

X=ϕc1X1+ϕc2X2E7

where the constraint ϕc1+ϕc2=1 holds. Exception is made for density, where a simple analysis may prove that the mixture density ρ is given by

ρ=(ϕc1ρ1+ϕc2ρ2)1E8

Advertisement

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

μt=Cμρk2εE9

The turbulence kinetic energy, k [m2/s2], and its dissipation rate, ε [m2/s3], are computed with the following transport equations:

(ρk)t+x(ρuk)+z(ρwk)=x[(μ+μtσk)kx]+z[(μ+μtσk)kz]+Pkρε+GTE10
(ρε)t+x(ρuε)+z(ρwε)=x[(μ+μtσε)εx]+z[(μ+μtσε)εz]+εk(C1PkC2ρε+C3GT)E11

The term Pk represents the production rate of k as the results of the velocity gradients:

Pk=μt[2(ux)2+2(wz)2+(uz+wx)2]E12

while the term GT accounts for the production or destruction of k and ε due to the thermal gradients:

GT=βgμtprtTzE13

with g [m/s2] being the gravity acceleration and β [K−1] being the fluid dilatation coefficient. The remaining constants are

Cμ=0.09;σk=1.0;σε=1.3;C1=1.44;C2=1.92;C3=1.44E14

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 y+ value:

y+=ρuτyμ=ρCμ0.25kyμE15

where uτ represents the friction velocity and y [m] is the distance to the wall. The utilization of wall laws does not require mesh nodes in the viscous sub-layer, which is a major advantage from the computational standpoint. The momentum flux per unit area along the direction normal to the wall is given by the wall shear stress, which is computed differently depending on the location of the wall neighbour node relatively to the transition between the viscous and the inertia sub-layers. Denoting by v the generic velocity component parallel to the wall (which may, actually, be u or w) and by y the distance to the wall, we have

y+11.63τ0=μv0vyE16
y+>11.63τ0=μρCμ0.25χkln(E*y+)(v0v)E16a

where v0 is the wall velocity, E*=9.793 for smooth walls and χ=0.4187 is the von Karman constant. In the wall neighbourhood, the production term given by Eq. (12) is computed assuming a Couette flow:

Pk=μt(vy)2E17

where, once again, v is the generic velocity component parallel to the wall and y is the generic distance to the wall. Due to its significant variations near the wall, ε is averaged for the term ρε in Eq. (10):

y+11.63ρε=ρCμ0.75k1.5y+yE18
y+>11.63ρε=ρCμ0.75k1.5ln(E*y+)χyE18a

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

ε0=Cμ0.75k1.5xyE19

As for momentum, the energy flux is computed differently depending on the y+ values. In this case, we have

y+12q˙=μcppry(T0T)E20
y+>12q˙=ρcpClμ0.25kprt[1χln(E*y+)+p*](T0T)E20a

where T0 is the wall temperature and P* is the so-called Jayatillaka function:

P*=9.24[(prprt)0.751][1+0.28exp(0.007prprt)]E21

3.2. The k-ωSST turbulence model

The k-ω SST model [3] represents a combination of the k-ε and the k-ω models. According to Menter et al. [4], the k-ω model is more accurate near the wall but presents a high sensitivity to the ω values in the free-stream region, where the k-ε model shows a better behaviour. The k-ω SST model represents a blend of the two, through a weighting factor computed based on the nearest wall distance. The governing equations are

(ρk)t+(ρuk)x+(ρwk)z=Pk¯β*ρωk+x((μ+σkμtkx))+z((μ+σkμtkz))E22
(ρω)t+(ρuω)x+(ρwω)z=x((μ+σωμtωx))+z((μ+σωμtωz))+E23
+αPk¯vtβρgω2+2(1F1)ρσω21ω(kxωx+kzωz)E23

where ω is the frequency of dissipation of turbulent kinetic energy [s-1]. The production of turbulent kinetic energy is limited to prevent the build-up of turbulence in stagnant regions:

Pk¯=min(Pk,10β*ρkω)E24

The weighting function F1 is given by

F1=tanh{{min[max(kβ*ωy;500vy2ω);4ρσω2kCDkωy2]}}E25

and

CDkω=max(2ρσω21ωkxjωxj,1010)E26

where y represents the distance to the neighbour wall and v is the laminar dynamic viscosity. F1 is zero away from the wall (k-ε model) and changes to unit inside the boundary layer (k-ω model) with a smooth transition based on y. The turbulent viscosity is computed as

vt=a1kmax(a1ω;SF2)E27

where S is the invariant measure of the strain rate given by

S=SijSij;Sij=12(uixj+ujxi)E28

and

F2=tanh{[max(2kβ*ωy;500vy2ω)]2}E29

The constants are computed as a blend of the k-ε and k-ω models by the following generic equation:

α=F1α1+(1F1)α2E30

The constants are α1= 5/9; β1= 3/40; σk1 = 0.85; σω1 = 0.5; α2= 0.44; β2 = 0.0828; σk2 = 1; σω2 = 0.856; β* = 0.09.

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 ω in the viscous (linear) and in the logarithmic near wall region are

ωvis=6v0.075y2;ωlog=μτ0.3χyE31

The imposed value for ω at the first node close to a wall is

ω1=ωvis2+ωlog2E32

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:

uτvis=U1y+;uτlog=xU1ln(Ey+)E33

with U1 being the fluid velocity relative to the wall velocity. The wall shear stress is computed as follows:

uτ=(uτvis)4+(uτlog)44E34

Advertisement

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 (x, z), describing the physical domain, are thus replaced by a boundary-fitted coordinate system (ξ, ζ), defined by the mesh lines which may have, locally, any orientation and inclination. The computational domain (as opposed to the physical domain) is the space considered in terms of the boundary-fitted coordinate system(ξ, ζ) as depicted in Figure 1. In the computational domain, the mesh spacing is considered, for convenience, as unitary, i.e., Δξ=Δζ=1, and the mesh lines are always horizontal (ξ lines) or vertical (ζ lines). The mesh arrangement is of the collocated type (as opposed to the staggered mesh) with the two velocity components and scalar quantities (temperature, pressure, turbulence kinetic energy and its dissipation rate or frequency, as well as concentrations) located at the control volume (CV) centre.

Figure 1.

The two domains. (a) Physical domain, showing the mesh lines; (b) Computational domain.

Transformation of the original equations is accomplished by replacing the independent variables, using the chain rule, which states that, generically:

ϕx=ϕξξx+ϕζζx=ξxϕξ+ζxϕζE35

The Jacobian of the transformation

J=|xξxζzξzζ|=xξzζxζzξE36

represents the ratio between the physical size of the control volume and its computational size (unitary). The derivatives ξx,ξz,ζxζz are the contravariant metrics of the transformation. They are computed from the covariant metrics, xξ,zξ,xζ,zζ as follows:

ξx=zζ/J;ξz=xζ/J;ζx=zξ/J;ζz=xξ/JE37

To obtain the strong conservative form in the boundary-fitted coordinate system (ξ, ζ), the transport equations are transformed through the application of the chain rule (35) and multiplied by the Jacobian of the transformation. The metric identity

ξ(Jξx)+ζ(Jζx)=0;ξ(Jξz)+ζ(Jζz)=0E38

is then used to recast some terms. The result, for a generic variable ϕ, is

J(ρϕ)t+ξ(JρUϕ)+ζ(JρWϕ)=ξ[ΓJg11ϕξ]+ζ[ΓJg33ϕζ]+ξ[ΓJg13ϕξ]+ζ[ΓJg13ϕζ]+JSϕE39

The terms g11, g13 and g33 are the contravariant metric relations given by

g11=ξx2+ξz2;g33=ζx2+ζz2;g13=ξxζx+ξzζzE40

The non-orthogonal term g13 is null if the mesh is locally orthogonal. U and W, in Eq. (39), are the contravariant velocities. The terms JρU and JρW represent mass fluxes through the control volume faces along the computational directions ξ and ζ, respectively, and are computed as follows:

Fξ=JρU=ρ(zζuxζw)E41
Fζ=JρW=ρ(xξwzξu)E42

Note that, in this case, the sub-index for the fluxes (such as in Fξ ) represents the flux direction (and not a derivative, such as for the metrics). Eq. (39) may be rewritten as

J(ρϕ)t+ξ(Fξϕ)+ζ(Fζϕ)=ξ[ΓJg11ϕξ]+ζ[ΓJg33ϕζ]+J(Scross+Sϕ)E43

where the cross-derivatives were incorporated into the source term Scross. A similar procedure is applied to obtain the generalized form of remaining equations, leading to the following form for the Navier-Stokes and continuity equations:

J(ρu)t+ξ(Fξu)+ζ(Fζu)=ξ[ΓJg11uξ]+ζ[ΓJg33uζ]zζpξ+zξpζ+ScrossuE44
J(ρw)t+ξ(Fξw)+ζ(Fζw)=ξ[ΓJg11wξ]+ζ[ΓJg33wζ]+xζpξxξpζ+Scrossw+IE45
Jρt+ξ[ρ(zζuxζw)]+ζ[ρ(xξwzξu)]=Jpt+ξ(JρU)+ζ(JρW)=0E46

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

J(ρϕ)t+ξ(FξϕΓJg11ϕξ)+ζ(FζϕΓJg11ϕζ)=J(Scross+Sϕ)E47

The integration of the previous equation in its control volume leads to

J(ρϕ)t+[FeϕeDe(ϕEϕP)][FoϕoDo(ϕPϕO)]+[FtϕtDt(ϕTϕP)][FbϕbDb(ϕPϕB)]=J(S1P+S2PϕP)E48

where the source term has been written as a linear combination involving ϕP. F and D represent the advective fluxes and the diffusive coefficients, respectively:

Fe=Fξe=[ρ(zζuxζw)]eFo=Fξo=[ρ(zζuxζw)]oE49
Ft=Fζt=[ρ(xξwzζu)]tFb=Fζb=[ρ(xξwzζu)]bE49
De=(ΓJg11)e;Do=(ΓJg11)o;Dt=(ΓJg33)t;Db=(ΓJg33)bE50

In the previous expressions, the subscripts indicate the location relative to the CV centre, in the computational domain, with the uppercase denoting neighbour nodes and the lowercase denoting neighbour faces: E,e: East; O,o: West; T,t: Top; B,b: Bottom. For simplicity, in Eq. (48), the subscripts ξ and ζ  were dropped from the fluxes F (in fact, fluxes across the eastern and western faces are always along the ξ direction and fluxes across the top and bottom faces are always along the ζ  direction).

For the solution of the equations, it is necessary to evaluate the values of ϕ in the CV faces (i.e., ϕe, ϕo, ϕt, ϕb). These values are computed as a function of both ϕP and the values in the neighbour nodes ϕE, ϕO, ϕT, ϕB according to the adopted advection scheme (to be described later on). Eq. (48) may, then, be written in the following standard form:

aPϕP=aEϕE+aOϕO+aTϕT+aBϕB+bE51

or, in a more compact manner,

aPϕP=nbanbunb+bE51a

with “nb” indicating that the sum is to be performed for all the neighbouring locations.

It is necessary to compute the face values ϕe, ϕo, ϕt, ϕb as a function of ϕP, ϕE, ϕO, ϕT, ϕB in order to obtain the coefficients aE, aO, aT, aB of Eq. (51). It is known that a simple arithmetic average is not a physically plausible solution since, due to the presence of a flow, the property ϕ, being advected, tends to assume a value closer to the upwind value. Several advection schemes may be adopted, being the simplest one the upwind scheme. According to this scheme, the property ϕ in the CVface takes the upwind value, i.e.,for example, Fe>0ϕe=ϕP; Fe<0ϕe=ϕE . The complete mathematical formulation for the upwind scheme is

a E = D e + F e ,0; a O = D o + F o ,0 a T = D t + F t ,0; a B = D b + F b ,0 E52

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, bquick, added to the source term as follows:

bquick=18Fe,0(ϕO2ϕP+3ϕE)18Fe,0(3ϕP2ϕE3ϕEE)+18Fo,0(3ϕO2ϕPϕE)18Fo,0(ϕOO2ϕO+3ϕP)+18Ft,0(ϕB2ϕP+3ϕT)18Ft,0(3ϕP2ϕT3ϕTT)+18Fb,0(3ϕB2ϕPϕT)18Fb,0(ϕBB2ϕB+3ϕP)+E53

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 SIMPLE [6]. Due to the non-staggered mesh arrangement (collocated mesh), the Rie-Chow interpolation procedure [10], with the modifications proposed in [11] and [12], is implemented. Let us consider the u momentum conservation Eq. (44). After integration, the evaluation of this equation leads to

aPuP=nbanbunbzζpξ+zξpζ+ScrossuE54

During the iterative process, velocities u* are computed from the available velocity field um and pressure field p* obtained at the previous step as follows:

aP(1+1E)uP=nbanbunb+aPEuPmzζpξ+zξpζ+ScrossuE55

where E is the under-relaxation factor [7]. During the iterative process, unless convergence is reached, the velocity field u* obtained from the solution of the momentum equations does not satisfy the continuity requirement unless the correct pressure field p is employed (instead of an incorrect pressure field p*). This means that, if the correct pressure field was employed, a mass-conservative velocity field would be obtained:

aP(1+1E)uP=nbanbunb+aPEuPmzζpξ+zξpζ+bE56

Thus, the pressure and velocity fields p* and u* should be corrected by a certain amount p' and u' :

p=p+p';uP=uP+uPE57

Subtracting Eq. (56) from Eq. (55) and taking into account Eq. (57), one obtains

aP(1+1E)uP'=nbanbunb'zζp'ξ+zξp'ζE58

The keystone of the SIMPLECalgorithm consists on the subtraction of the term nbanbuP' on both sides of the equation and subsequent dropping, leading to

[aP(1+1E)nbanb]uP'=nbanb(unb'uP')zζp'ξ+zξp'ζE59

or, for simplicity:

a˜PuP'=zζp'ξ+zξp'ζE60

where

a˜P=aP(1+1E)nbanbE61

The equations for the velocity correction are obtained through the pressure correction field, recurring to the previous equation:

uP'=zζa˜Pp'ξ+zξa˜Pp'ζ; wP'=xξa˜Pp'ζ+xζa˜Pp'ξE62

leading to

uP=uPzζa˜Pp'ξ+zξa˜Pp'ζ;wP=wP+xζa˜Pp'ξxξa˜Pp'ζE63

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 p’ field must be obtained from the continuity equation. The discretized form of this equation is obtained directly from the integration of Eq. (2):

JρPρP0Δt+[ρ(zζuxζw)]e[ρ(zζuxζw)]o+[ρ(xξwzξu)]t[ρ(xξwzξu)]b=0E64

As one may see, velocities are, now, needed at the control volume faces. Taking Eq. (63), for the u velocity component, at the “e “ and “o” faces and the same equation for the w component at the “t” and “b” faces, substituting into Eq. (64) and rearranging the terms leads to

JρPρP0Δt+Fe*Fo*+Ft*Fb*(ρg33a˜Pp'ξ)e+(ρg33a˜Pp'ξ)o(ρg11a˜Pp'ζ)t+(ρg11a˜Pp'ζ)b+(ρg13a˜Pp'ζ)e(ρg13a˜Pp'ζ)o+(ρg13a˜Pp'ξ)t(ρg13a˜Pp'ξ)b=0E65

The terms gij are the covariant metric relations defined as

g11=xξ2+zξ2=g33J2;g33=xζ2+zζ2=g11J2;g13=xξxζ+zξzζ=g13J2E66

The derivatives are evaluated as

(p'ξ)e=pE'pP';(p'ξ)o=pP'pO';(p'ζ)t=pT'pP';(p'ζ)b=pP'pB'E67

and, for the cross-derivatives,

(p'ξ)t=0.25(pE'+pTE'pO'pTO');(p'ξ)b=0.25(pE'+pBE'pO'pBO')(p'ζ)e=0.25(pT'+pTE'pB'pBE');(p'ζ)o=0.25(pT'+pTO'pB'pBO')E68

Introducing the discretization expressed by Eqs. (68) and 67 into Eq. (65) allows us to obtain the pressure correction equation:

aPpP'=aEpE'+aOpO'+aTpT'+aBpB'+bE69

where

aE=(g33a˜P/ρ)e;aO=(g33a˜P/ρ)o;aT=(g11a˜P/ρ)t;aB=(g11a˜P/ρ)bE70
aP=aE+aO+aT+aBE71
b=JρP0ρPΔtFe*+Fo*Ft*+Fb*(g13a˜P/ρp'ζ)e+(g13a˜P/ρp'ζ)o(g13a˜P/ρp'ξ)t+(g13a˜P/ρp'ξ)bE72

The ⟨ ⟩ symbol denotes a linear interpolation from the control volume centre (where the momentum equations are defined) to the control volume faces (where the fluxes for the continuity equations are needed). The pressure correction field p’ obtained from the solution of Eq. (69) is employed for correcting pressure and velocity corrections are obtained from Eq. (63). Note that, since these equations are defined at the control volume centre, p’ derivatives are evaluated as

(p'ξ)P=0.5(pE'pO');(p'ζ)P=0.5(pT'pB')E73

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 (Fe, Fo, Ft and Fb, in Eq. (48)), be corrected using the pressure correction p’ field (instead of being computed from the corrected control volume centre velocities). The correction equations for fluxes are obtained from the correction equations for velocities:

Fe,o=Fe,o[ρa˜P(g33p'ξg13p'ζ)]e,oE74
Ft,b=Ft,b[ρa˜P(g11p'ζg13p'ξ)]t,bE75

The “starred” fluxes F* at the control volume interfaces are obtained by interpolating the momentum equation. The keystone of the method is that the pressure gradient is not interpolated, but, instead, is obtained directly from the pressure at contiguous control volume centres. Considering Eq. (55), evaluated in terms of fluxes, one may write

Fe,o=Fe,om1+E+F^e,o+ρa˜Pe,o(g33pξg13pζ)e,oE76
Ft,b=Ft,bm1+E+F^t,b+ρa˜Pt,b(g11pξg13pζ)t,bE77

The terms F^e,o and F^t,b represent the fluxes

F^e,o=zζρu^e,oxζρw^e,oE78
F^t,b=xξρw^t,bzζρu^t,bE79

where the revised velocities û and ŵ are obtained from the momentum equations as follows:

a˜Pu^P=nbanbu^nb+aPEuPmzζpξ+zξpζ+bu^P=nbanbu^nb+ba˜PE80
a˜Pw^P=nbanbw^nb+aPEw^Pm+xζpξxξpζ+bw^P=nbanbw^nb+ba˜PE81

Note that the source term b includes all the contributions (e.g., transient term, cross-derivatives and buoyancy for the w velocity component), except the under-relaxation and pressure gradient.

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:

ϕ=fϕcomputed+(1f)ϕpreviousE82

Values of flower than unity lead to sub-relaxation, while values greater than unity over-relax the solution process. In the present code, the value f =1.1 is employed for the transport equations, while, for the pressure correction equation, the Point Successive Over Relaxation (PSOR) method [13] combined with the additive correction multigrid method [14] is employed.

The whole flow field calculation is considered to be converged when all the normalized residuals are lower that a predefined value Rconv :

Ru,Rw,Rm,RT,Rk,Rε<RconvE83

The total normalized residual for the transport equations of ϕ (ϕ=u,w,T,k,ε,ω) is determined as follows:

Rϕ=Σall(|aPϕPΣnbanbunb+b|Jap(ϕmaxϕmin))/ΣallJE84

where (ϕmaxϕmin) quantifies the amplitude of the variable ϕ in the calculation domain.

Advertisement

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 y+ values ranging from, typically, 0.1 to 6, with an average value of 1.7 all around, were obtained. Figure 3 depicts the mesh employed.

For the present simulations, both the first-order hybrid [6] and the Quick advection schemes were employed, along with the k-ε and k-ω SST turbulence models. Experimental data are reported by Abbott and Von Doenhoff [15] and Ladson [16].

Figure 2.

Domain dimensions. Airfoil cord is 1 m.

Figure 3.

Non-structured quadrilateral mesh.

Results for the dependence of the lift coefficient with the airfoil angle of attack α are shown in Figure 4. As expected, the lift coefficient presents a linear dependence with the angle of attack α up to the onset of separation, which occurs at α=16 . The two advection schemes give similar results up to separation, after which the lift drop in the stall region is more pronounced with the hybrid scheme. Separation is completely established at α=18 and for α20 the flow becomes unsteady. Both turbulence models perform very well in the linear region. After separation, data are more spread. The difficulty to obtain reliable experimental data in this circumstance is commonly recognized as the flow is unsteady and presents a 3D behaviour. Comparing the two advection schemes, the Quick scheme performs better, particularly after separation.

Figure 4.

Lift coefficient vs. angle of attack. Influence of (a) turbulence modeland (b) advection scheme.

Figure 5 depicts the relation between lift and drag coefficients. In this case, the k-ω SST turbulence model performs substantially better than the k-ε model. This is certainly due to the fact that the friction component plays an important role in drag, and thus correctly resolving the boundary layer in the very proximity of the wall is crucial for the drag computation. It is also interesting to note that the advection scheme plays a very important role, with the higher order scheme Quick showing much better than the hybrid scheme, when results are compared with the experimental data.

Figure 5.

Drag coefficient vs. lift coefficient. Influence of (a) turbulence model and (b) advection scheme.

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.

Figure 6.

Problem definition for the natural convection inside a cavity.

The problem is governed by the following non-dimensional parameters:

Prandtlnumber,Pr=vαE85

where the thermal diffusivity is α=λ/(ρcp), ν is the kinematic viscosity, λ is the thermal conductivity, ρ is the density and cp is the specific heat:

Rayleighnumber,Ra=gβΔTL3Prv2E86

where β is the thermal expansion coefficient, g is the gravity acceleration and ΔT=ThTc is the temperature difference between the vertical walls. The transition between laminar and turbulent flow takes place approximately for Ra=107 . In the present work, simulations were conducted for Ra=105 (laminar regime). Air is the operating fluid, for which Pr = 0.71. The hybrid advection scheme was used and the Boussinesq approximation was adopted. Computations were performed in a non-uniform grid, with 82 × 82 = 6400 nodes. Reference results are reported in [17] and [18] for several Rayleigh numbers in laminar regime, comparing solutions given by several authors. Results for laminar and turbulent flow are also presented in [19].

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 u and for w components of velocity

u=uLα;w=wLαE87

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 37 contributions reported in [18]. This range does not include the minimum and maximum reported values since these clearly fall outside the general trend of the remaining contributions.

Figure 7.

Isothermal lines. Ra = 105. (a) EasyCFD and (b) Dixit and Babu [19].

Figure 8.

Streamlines. Ra = 105. (a) EasyCFD and (b) Dixit and Babu [19].

EasyCFD Vahl Davis [17] Variation range [18]
34.44 34.81 34.2–41.2
68.21 68.68 65.8–70.45

Table 1.

Normalized maximum values for the u and w velocity components.

Advertisement

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. 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. 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. 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. 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. 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. 6. Patankar S. Numerical Heat Transfer and Fluid Flow. Series in computational methods in mechanics and thermal sciences; 1980. New York, McGraw-Hill.
  7. 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. 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. 9. Vertseeg HK, Malalasekera W. An Introduction to Computational Fluid Dynamics. The Finite Volume Method. Pearson Education Limited; Essex, England, 2007.
  10. 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. 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. 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. 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. 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. 15. Abbott IH, Von Doenhoff AE. Theory of Wing Sections, Including a Summary of Airfoil Data. Dover Publications; New York, 1959.
  16. 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. 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. 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. 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.

Written By

António M. G. Lopes

Submitted: 23 October 2015 Reviewed: 14 March 2016 Published: 24 August 2016