Computational Fluid Dynamics

2 downloads 0 Views 737KB Size Report
Oct 17, 2008 - ∗The author was invited by the editor ( Dr A Seidel ) of Kirk-Othmer Encyclopedia of. Chemical Technology to contribute this review article. .... where l is the mean free path length between molecules and L is the charac-.
Computational Fluid Dynamics∗ A. W. Date Mechanical Engineering Department Indian Institute of Technology Bombay Mumbai - 400076 India June 2008

Abstract This article describes the main elements of the tasks involved in Computational Fluid Dynamics ( CFD ). Partial differential equations describing conservation of mass, momentum and energy in a continuum are presented along with the empirical laws governing diffusion flux and a variety of sources that are commonly encountered in engineering practice. FiniteVolume discretization of transport equations on unstructured meshes with cell-centered colocated variables is explained in detail within the framework of the SIMPLE algorithm. By way of illustration, the algorithm is applied to a problem of fully-developed flow and heat transfer in a tube containing a twisted tape. Keywords: SIMPLE algorithm, Unstructured Meshes, Cell-Centered Colocated Variables

The author was invited by the editor ( Dr A Seidel ) of Kirk-Othmer Encyclopedia of Chemical Technology to contribute this review article. The article will be published on 17th October 2008. ∗

i

Nomenclature

AP, AEk Af bi1 C d D f k Nk Nu NV f NV T Pr p R Rg Re S t ui Y

: : : : : : : : : : : : : : : : : : : :

Coefficients in Discretised Equations Cell-Face Area Geometric Coefficients Cell-face Mass Flow Diffusion Coefficient Source Term or Diffusion Coefficient Fanning Friction Factor Thermal Conductivity Number of Neighbouring Cells of Cell P Nusselt Number Number of Vertices forming a Cell-Face Number of Vertices forming a Cell Prandtl Numbar Pressure Residual Gas constant Reynolds Numbar Source term Time Velocity in xi -direction Tape Twist Ratio

Greek Symbols

α β β1i µ ω ∆ ∆V ρ

: : : : : : : :

Under-Relaxation Factor for Velocity Under-Relaxation Factor for Pressure or Blending Factor Geometric Coefficients Dynamic viscosity Mass Fraction Incremental value Control Volume Density ii

Φ λ1 Γ σ θ ξi

: General variable : Multiplier of p − p : Exchange Coefficient : Normal stress : Helix angle of twisted tape : Local Curvilinear Coordinates at the Cell-Face

Suffixes B c f k m n P, E sm t xi

: Refers to Boundary Node B : Refers to Face-Centroid : Refers to Cell-face : Refers to Cell-Face k : Refers to Mass Conservation : Refers to Cell-face Normal : Refers to Nodes P and E : Refers to Smoothing : Refers to Turbulent : Refers to Cartesian Coordinates in i-direction

Superscripts l : o : − : 0 :

Iteration Counter Old Time Mutidimensional Average Correction

iii

1 1.1

Introduction What is CFD

Computational Fluid Dynamics ( CFD ) is concerned with numerical solution of differential equations governing transport of mass, momentum and energy in moving fluids. The CFD activity emerged and gained prominence with availability of computers in the early 1960s [1, 2, 3, 4]. Today, CFD finds extensive usage in basic and applied research, in design of engineering equipments ( such as heat exchangers, furnaces, cooling towers, internal combustion engines, gas turbine engines, hydraulic pumps and turbines, aircraft bodies, sea-going vessels and rockets and missiles etc ), in process optimisation ( such as casting, welding, alloying, mixing, drying, air-conditioning, spraying, combustion etc ) and, in calculation of environmental ( such as discharging of solid, liquid, gaseous pollutants ) and geophysical ( such as ground water flows, frictional melting during geological fault instabilities etc ) phenomena. Since early 1970s, commercial software packages ( or computer codes like PHOENICS [5], FLUENT [6], CFX [7], STARCD [8] ) became available, making CFD an important component of engineering practice in industrial, defense and, environmental organizations. Prior to availability of computer codes, researchers and designers relied principally on time-consuming and expensive experimental measurements ( direct measurement or flow visualisation ) of relevant quantities that were presented in the form of correlations or tables and nomograms or graphs. The main difficulty with such information was that it was applicable only to the limited range of scales of fluid velocity, temperature, length or time for which it was generated. Thus, to take advantage of economies of scale, for example, when a higher capacity turbine or a combustion chamber was to be designed, the new information required for design had to be generated all over again. This task was essentially performed by establishment of scaling laws because experimental generation of the new information would be very expensive. The scaling laws essentially establish dimensionless numbers ( such as Reynolds number, Nusselt number, Grasholf number etc ) by ensuring geometric, kinematic and dynamic similarities between models and full scale equipment. Perfect correspondence between a model and the prototype , however, is only established if all the three similarities are simultaneously observed. This simultaneous observance was usually found to be impossible to achieve in practice. Today, the scaling difficulties are encountered in opposite direction. For example, to take advantage of new characteristics and properties at micro and nanoscale, many well known equipments are being miniaturised. Further, processes occuring in bio-cells are naturally at very small scales. After all, there is no such thing as a laboratory scale Amoeba!. Clearly, designers need a scientific and an economic tool that is scale neutral. Fortunately, such scale neutral information is embodied in fundamental partial 1

differential equations governing transport of mass, momentum and energy which are also known as Transport Equations. As mentioned at the beginning, the main task of CFD is to solve these equations with appropriate boundary conditions over a domain of specified interest. The solutions generate distributions of velocity vectors and a large number of application dependent scalars over the domain. Such distributions can then be used either for design or for performance estimations.

1.2

Main Tasks

It is now appropriate to list main steps involved in arriving at numerical solutions to fundamental equations of motion and energy transfer. 1. Given the flow situation of interest, define the physical space ( also known as the domain of computation ) so as to identify location and type of domain boundaries. In unsteady problems, the time domain is imagined. 2. Select Transport Equations with appropriate diffusion and source laws. Define boundary conditions on segments of domain boundary for all important dependent variables ( see section 2 ) 3. Select points ( called nodes ) within the domain so as to map the domain with a grid. Construct control volumes around each node. This task is referred as Grid Generation. The grids can be structured cartesian, cylindrical polar, spherical and arbitrarily curvilinear or they may be unstructured. In this review, unstructured grids are described because structured grids are but special forms of unstructured grids. 4. Discretise the Transport Equations by integrating them over control volumes. In this process, the fundamental partial differential equations are converted to a set of Algebraic Equations. Two methods for discretization are popular:( a ) The Finite Volume Method ( FVM ), ( b ) The Finite Element Method ( FEM ) [9]. In this review, FVM is described ( see section 3 ). 5. Devise a numerical method to solve the set of algebraic equations derived for each variable at each node. In all methods, the velocity vectors are determined from momentum equations. They differ in the manner in which pressure distribution is determined because there is no explicit equation for the pressure variable. All methods however use the discretised form of the mass-conservation ( volume conservation in constant density incompressible flows ) equation to determine pressure. Such methods are called pressurebased methods. In Density-based methods, density is determined from mass conservation equation and pressure is determined from equation-of-state. 2

These methods are primarily devised for aerodynamic compressible flows but can be adapted to incompressible flows even though an equation-ofstate is not available. In pressure-based methods, an algebraic equation is set-up for the pressure variable itself or for pressure correction. Such methods are described in texts such as [11, 12, 13, 14, 15, 16]. In this review, the SIMPLE method [16, 17] which uses pressure-correction equation is described because of its usage in the most widely used commercial CFD codes. 6. Choose a Solver for the very large set of simultaneous algebraic equations. Construction of an overall calculation procedure comprising order of solving algebraic equations, choice of solver etc is called an algorithm. A very large variety of numerical algorithms are available in literature to suite the character of the set of algebraic equations that is generated on structured and unstructured meshes. Such algorithms are described in texts on numerical analysis ( see for example [10] ) 7. Devise a computer program to implement the numerical method on a computer and generate solutions. 8. Display and interpret the numerical solutions. This is the most important step of CFD that ultimately helps in design. Numerical solutions comprise numbers that can be printed in tabular form node-wise for each variable. The inconvenience of reading large tables of numbers is overcome by plotting results on a graph or by generating contour and vector plots. This activity is called post-processing of results. Success of commercial CFD codes often depends on the quality and flexibility of their post-processors. In the sections to follow, important aspects the above steps are described.

2

Transport Equations

The three conservation laws governing transport are 1. Law of conservation of mass ( Transport of Mass ) 2. Newton’s second law of motion ( Transport of Momentum ) 3. First law of Thermodynamics. ( Transport of Energy ) The above conservation laws are applied to an infinitesimally small control volume located in a moving fluid which may be a mixture of several species or a single specie. The main assumption is that fluid continuum prevails; which implies that the Knudsen number Kn is very small. That is 3

l < 10−5 ( say ) L where l is the mean free path length between molecules and L is the characteristic domain dimension ( say, the tube diameter in a pipe flow ). Thus, carrying out control-volume analysis [18], the law of conservation of mass, for example, is expressed as: Kn =

Conservation of Mass for the Mixture: ∂ρm ∂(ρm uj ) + =0 ∂t ∂xj

(1)

where ρm is the mixture density. In a single component fluid, the suffix may be dropped. For an incompressible fluid, ρm may be treated constant and the equation reduces to the so called continuity equation ∂uj /∂xj = 0. Similarly, application of the Newton’s second law of motion results in three equations in three coordinate directions i = 1, 2, 3. These equations are expressed as Momentum Equations ui ( i = 1, 2, 3 ) ∂ ∂ ∂p ∂τij [ρm ui ] + [ρm uj ui ] = − + + ρ m Bi ∂t ∂xj ∂xi ∂xj

(2)

The first term on the left hand side is invoked in transient/unsteady situations. The second term represents transport due to convective flux ρ uj ui . These terms express net rates momentum transfer. The first two terms on the right hand side express net forces due to pressure and internal fluid stress. The last term represents body forces due to gravity, buoyancy, centripetal and coriolis accelerations, resistances die to embedded obstacles or magnetic/electrical fields. In a laminar flow of a Newtonian fluid the internal stress is related to the coplanar fluid strain rate via the Stokes’s relation τij = τijl = µ (

∂ui ∂uj + ) ∂xj ∂xi

(3)

In turbulent flows, the instantaneous forms of equations 1 and 2 are time averaged to yield Reynolds Averaged equations ( also known as RANS equations ) in which all dependent variables assumed time-averaged values and the total stress is given by τijtot = τijl + τijt = µ (

∂ui ∂uj 0 0 + ) − ρ m ui uj ∂xj ∂xi 4

(4)

where τijt = − ρm ui uj is called the turbulent stress which must be modeled. There are several models of turbulence available in the literature, but the most commonly used model mimics the Stokes’s relation ( also call Bossinesqe approximation ). It reads as 0

0

− ρm ui uj = τijt = µt ( 0

0

2 ∂ui ∂uj + ) − ρm k δij ∂xj ∂xi 3 q

(5) 0

0

where µt is called the turbulent viscosity and k = ui ui /2 is the kinetic energy of turbulence. Unlike µ, µt is a property of the flow rather than the fluid and its distribution is determined from scalar quantities characterising the local state of turbulence. Thus, the total stress is expressed as τijtot = µef f (

2 ∂ui ∂uj + ) − ρm k δij ∂xj ∂xi 3

µef f = µ + µt

(6)

Using equations 3 and 5, for a general fluid flow, equation 2 can be written as ∂ ∂p ∂ ∂ [ρm ui ] + [ρm uj ui ] = − + ∂t ∂xj ∂xi ∂xj

"

µef f

#

∂ui + ρ m B i + S ui ∂xj

(7)

and, ∂ Sui = ∂xj

"

µef f

#

∂uj 2 ∂ − [ρm k] ∂xi 3 ∂xi

(8)

Finally, we note that for non-Newtonian fluids, the stress-strain relation is non-linear and often time-dependent. For a useful review, the reader is referred to Bird [19]. Equation of Mass Transfer for Specie k: In mass transfer problems, the fluid mixture may comprise several inert or reacting species k. In such problems the diffusion mass transfer is modeled by 00 Fick’s law of diffusion ( mi = − ρm Def f ∂ωk /∂xi ). Then, application of mass conservation law for each specie k yields the following equation ∂(ρm ωk ) ∂(ρm uj ωk ) ∂ + = ∂t ∂xj ∂xj

"

ρm Def f

#

∂ωk + Rk ∂xj

(9)

where ωk is the specie-mass-fraction and Rk is the volumetric rate of its generation. In a reacting system, contributions to Rk can emenate from many reactions of the assumed reaction mechanism. Analogous to µef f , Def f = D l + D t is the effective diffusion coefficient.

5

Energy Equation - Enthalpy Form: The first law of Thermodynamics expresses energy conservation as rate of accumulation of energy = Rate of heat transfer - Rate of work done by pressure forces, stresses and body forces. Application of this law to a control volume results in ∂(ρm hm ) ∂(ρm uj hm ) ∂ = + ∂t ∂xj ∂xj

"

#

Kef f ∂hm + Qvol Cpm ∂xj

(10)

where mixture enthalpy is given by

hm =

X

ω k hk

hk = h0k (Tref ) +

(11) Z

T Tref

Cpk (T ) dT

(12)

and h0k (Tref ) is the enthalpy of formation of specie k. The conduction heat transfer here is modeled by Fourier’s law ( qcond,j = − Kef f ∂T /∂xj = − (Kef f /Cpm ) (∂hm /∂xj ) ) where Kef f = K l + K t is the effective thermal conP ductivity, CPm = ωk Cpk is the mixture specific heat and Qvol represents the volumetric energy generation rate. In a general problem, there are several contributors to Qvol . Dp Qvol = Φvisc + + Qrad + Qdm + others . . . Dt ∂ui ∂uj ∂ui + ) Viscous Dissipation Φvisc = µef f ( ∂xj ∂xi ∂xj ∂qrad,j Qrad = Heat of Radiation ∂xj Dp ∂p ∂p = + uj Heat of Compression Dt ∂t ∂xj P 00 ∂ mj,k hk 00 Qdm = − Enthalpy flux due to mj,k ∂xj

(13) (14) (15) (16) (17)

Viscous dissipation is important in fluids with high viscosity ( or, Prandl number ) or in high speed flows with high velocity gradients. The Volumetric heat of radiation is important in combustion problems where the gas emits, absorbs and scatters radiation in all directions in solid angle 4π. Correct estimation of net radiation qrad,j in direction j therefore requires considerable care to obtain accuracy besides the knowledge of gas emissivity and absorption and scattering coefficients which are typically functions of temperature, gas composition and 6

wavelength. There are several approaches: the most detailed approach relies on solution of an integro-differential equation [20, 21, 22] ( called the Radiation Transfer Equation ) for radiation intensity Is in a general direction s ( say ). The task is however considerably simplified by employing the so-called six-flux model [23, 24] for three-dimensional flows. In the simplest model, qrad,j is treated like a heat conduction flux and a radiation conductivity is defined such that Krad =

16 σ T 3 a+s

(18)

where a nd s are absorption and scattering coefficients respectively, σ is StefanBoltzmann constant and T is in Kelvin. The heat of compression is of importance only in compressible flows ( in presence of shocks, for example ) where large gradients of pressure are encountered. Energy Equation - Temperature Form: In the flow of single fluid without chemical reaction, equation 10 can be conveniently expressed as ∂(ρ T ) ∂(ρ uj T ) ∂ + = ∂t ∂xj ∂xj

"

#

Q Kef f ∂T + vol Cp ∂xj Cp

(19)

with Qmd = 0.

2.1

Generalised Transport Equation

Thus, equations 1, 7, 9 and 10 represent all conservation laws in terms of a solvable set of partial differential equations. From the point of view of further discussion of numerical methods, it is indeed a happy coincidence that the above set of equations can be cast as a single equation for a general variable Φ. Thus, ∂(ρm Φ) ∂(ρm uj Φ) ∂ + = ∂t ∂xj ∂xj

"

Γef f

#

∂Φ + SΦ ∂xj

(20)

The meanings of Γef f and SΦ for each Φ are listed in Table 1. Equation 20 is called the transport equation for property Φ. When solutions to the above set of equations are sought, following quantities must be determined from appropriate equations. These are 1. Distribution of pressure p 2. Distribution of diffusion coefficients µef f , Def f and Kef f 3. Distribution of reaction rate Rk for each specie k 4. Distribution of Body forces Bi 7

Table 1: Generalised Representation of Transport Equations Equation 1 7 9 10

2.2

Φ 1 ui ωk hm

Γef f ( Exch. Coef. ) 0 µef f ρm Def f Kef f / Cpm

SΦ ( Net Source ) 0 - ∂p/∂xi + ρm Bi + Sui Rk Qvol

Distribution of Pressure

Although, pressure is an important variable, there is no independent constitutive equation for its determination. Thus, assuming that muef f and Bi are known, momentum equations 7 can be regarded as determinants of three velocity components ui and equation 1 can then be used to indirectly infer the pressure distribution. This can be done after discretisation of the momentum equations in several ways. In the SIMPLE algorithm [16, 17], the pressure is determined via 0 a mass conserving pressure-correction ( pm ) equation rather than that for pressure itself. Here, a special adaptation of this equation is used [18] that becomes necessary when velocity vectors and pressure are defined at the same location in a discretised space ( see next section ). The equation reads as ∂ ∂xi

"

0

∂p U∗ 0 Γ − i p ∂xi Rg T p

0

#

∂ = ∂xi

"

#

U∗ 0 ∂ρ ρ ui − i psm + Rg T ∂t

(21)

where 0

0

0

0

p = pm + psm = pm + 0

1 (p − p) 2

(22)

0

Γp ∂psm Ui∗ = ui − ρm ∂xi 0

Γp =

(23)

ρm α ∆V AP ui

(24) 0

In incompressible flows, Ui∗ = 0. The meanings of Γp and ui will become clear in a later section. In equation 22, the evaluation of smoothing pressure0 correction psm requires evaluation of the space-averaged pressure p. Sclichting [25] and Warsi [26] define this averaged pressure as one-third the negative sum of normal stresses ( σxi ). Date [27, 28], however, has shown that this average pressure can be expressed as 1 1 p = − (σx1 + σx2 + σx3 ) = (px1 + px2 + px3 ) (25) 3 3 where pxi are independent solutions to ∂ 2 p/∂x2i = 0. Finally, note that equation 21 can be cast in the form of equation 20.

8

2.3

Distribution of Diffusion Coefficients

In turbulent flow calculations, the effective exchange coefficients are generalised as ΓΦ,ef f =

µ µt + P rΦ P rt,Φ

(26)

where Pr and P rt are Prandtl numbers for laminar and turbulent flows respectively. Of course, for Φ = ui , P rui = P rt,ui = 1. For Φ = hm or T, P r = µ Cp/K and P rt ' 0.9 and for Φ = ωk , P r = Sc = µ/(ρ D) and again P rt = Sct ' 0.9. The generalisation in equation 26 shows that in turbulent flows µt must be determined. There are many turbulence models available in literature [29, 30, 31, 32, 33] but none an be said to be completely general and applicable to all types of flows encountered in engineering and environmental flows. Here, only one model, known as the k- model, is presented. In this model [29], µt is expressed as ρm k 2 µt = C µ 

(27)

where k is kinetic energy of turbulence and  is its dissipation rate whose distributions are governed by equation 20 but with following source terms.

Sk = G − ρ m   S = [C1 G − C2 ρm ] + E k ∂ui ∂uj ∂ui G = µt ( + ) ∂xj ∂xi ∂xj " # ∂ 2 ui E = 2 ν νt ∂xj ∂xk " # − 3.4 Cµ = 0.09 exp (1 + 0.02 Ret )2 C2 = 1.92

h

1 − 0.3 exp (−Re2t )

i

C1 = 1.44 P rt,k = 1 P rt, = 1.3

(28) (29) (30) (31) Ret =

µt µ

(32) (33) (34)

The main advantage of this model is that at a solid surface, both k and  are set to zero and that there are no distance from the wall terms invoked. The model has undergone several refinements ( see for example [34] ). The disadvantage of the model, however, is that in order to resolve very sharp gradients, extremely fine meshes are required near the wall.

9

2.4

Reaction Rate Rk

Rk represents the net effect of generation and distruction of specie k in different chemical reactions of the postulated reaction model. Typical expressions for Rk can be found in texts by Turns [35], Ranade [36] and Kuo [37]. Often, however, only a global reaction between fuel and oxidant is postulated such that 1 kg of Fuel + Rst kg of Oxidant → (1 + Rst ) kg of Product

(35)

where Rst is the stoichiometric ratio for the fuel under consideration. This reaction mechanism specifies only 3 species and the value of Rf u is then obtained from a reaction rate law Rf u = Rf u,kin = − A exp (−

E ) ωm ωn Ru T f u ox

(36)

where, pre-exponential constant A and constants E, m and n are specified for the fuel [35] and Ru is the universal gas-constant. Note that Rox and Rprod will be in stoichiometric proportions of Rf u . If turbulent reacting flow is considered then the effective Rf u is given by a variant [38] of the Eddy-Breakup model due to Spalding [39] Rf u

2.5

 = − min ρm min k 



ωox ωpr 4 ωf u , 4 ,2 , | Rf u,kin | Rst 1 + Rst 



(37)

Body Forces Bi

In practical engineering and environmental flows, body forces can arise under a variety of situations. Typical among these are listed below ρm Bi = ∗ ρref gi [1 − β (T − Tref )] Thermal Buoyancy h i ~ = −ρm Ω ~ × (Ω ~ × ~x) + 2 Ω ~ ×V ~ Centripetal, Coriolis ρm B µ Medium Resistance ρ m B i = − ui κ

(38) (39) (40)

In equation 38, β = ρ−1 ref ∂ρ/∂T is volume expansion coefficient. The buoyancy force is important in natural convection heat transfer. Equation 39 is important in rotating systems that arise in equipments such as compressor/turbine passages. ~ is the angular velocity vector. Finally, equation 40 is important in dense media Ω such as the shell side of a heat exchanger packed with tubes, packed beds or porous media. The permeability κ of such dense media, however, must be known from experimental data as a function of pitch/diameter ratio of tubes and their arrangement, shape of packing material and structure of pores respectively.

10

3

Discretization

The developments in this section are largely based on present author’s publications [18, 40].

3.1

Grid Generation

Complex domains of engineering equipments are best mapped by unstructured meshes. These meshes are formed by connecting arbitrary distribution of points ( called vertices ) within a given domain by non-intersecting lines. This results in formation of polygonal elements ( or, cells ) in 2D domains and polyhedral elements in 3D domains. To carry out finite-volume discretization, it is necessary to define a node along with a control-volume ( CV ) surrounding that node. Three approaches are possible: ( see figure 1 )

c3

E

c4 c

2

P

E

P P

c1

c5

( a ) VERTEX − CENTRED

( b ) CIRCUM − CENTRED

( c ) CELL − CENTRED

Figure 1: Typical Unstructured Grids - Filled circles are nodes

In the Vertex-Centered approach, the vertices are taken as nodes and a CV is specially constructed as shown in figure 1a for a 2D mesh. In this figure, the CV is formed by joining centroids of successive elements surrounding vertex P but, other conventions are also possible [41, 42]. Note that the line joining P to its neighbouring vertices will, in general, not be orthogonal to the control-volume faces ( shown by dotted lines ). Also, node P will not be at the centroid of the CV in general but, the CV will always enclose the node. The second, called the Circum-Centered approach, defines nodes at the circumcenter of each cell ( see figure 1b ). One advantage of this approach is that the cell-face shared by two neighbouring elements will always be orthogonal to the line joining the circumcenters which are treated as nodes. However, a serious

11

disadvantage is that the circumcenter of each cell may, in general, not lie within the cell. This is shown by node E in figure 1b. The third, and the most popular approach, defines a node at the centroid of each cell ( see figure 1c ) and the cell itself is treated as the CV. In this CellCentered approach, again the line joining neighbouring nodes, in general, will not intersect orthogonally with the cell-face shared by the neighbouring cells. In fact, in general, the point of intersection may lie on an extension of the cell-face rather than within it. This approach is followed here in the context of 3-dimensional control volumes. Unstructured mesh is generated by using commercial softwares. Here, the software ANSYS is used. Given domain boundaries, the software maps the domain and generates control-volumes to any desired level of fineness in different regions of the domain. The software then provides two data files: ( a ) A Vertex File that numbers the vertices and provides the coordinates xi , i = 1, 2, 3 and ( b ) An Element File that numbers the control-volumes ( called elements ) with their associated numbers of vertices listed n the Vertex file. These data sets are used in discretization.

3.2

Gauss Theorem

In the finite-volume formulation, equation 20 is first integrated over a cell-volume ∆V surrounding typical node P ( see figure 2 ) so that

c*

ξ1

b*

b*

E

c*

E

P d*

P

a* a*

( a ) TETRAHEDRAL CELL

( b ) HEXAHEDRAL CELL

Figure 2: Typical Neighbouring Cells P and E

12

ξ1

(ρP ΦP − ρoP ΦoP )

Z ∆V + div ~q dV = SΦ ∆V ∆t ∆V

(41)

where q~ = (~i q1 + ~j q2 + ~k q3 ) and qj = ρ u j Φ − Γ Φ ef f

∂Φ ∂xj

(42)

The node P is defined at the centroid of the cell and its coordinates are given by xi,P =

PNVT

xi,n NVT

n=1

(43)

where NVT are the number of vertices ( 4 for a tetrahedral cell and 8 for a hexahedral cell ). The coordinates of vertices xi,n are known from the vertex file. Now, to evaluate the volume integral in equation 41, Gauss’s theorem is invoked. Thus, Z

∆V

div q~ dV =

Z

Af

q~ . A~f

(44)

where Af is the surface integral and Af is the surface area. The integral is now replaced by a summation. R

Z

Af

~q . A~f =

Nk X

(~q . A~f )k

(45)

k=1

where Nk represent the number of plane surfaces ( or, the cell-faces ) enclosing the cell-volume ∆V . For a tetrahedral cell, Nk = 4 and for a hexahedral cell, Nk = 6.

3.3

Cell-face Area

To determine area of the k th cell-face, consider the triangular cell-face ( a∗ −b∗ −c∗ ) of a tetrahedral cell shown in figure 2a. Then, Af,k =

q

s (s − la∗ b∗ ) (s − lb∗ c∗ ) (s − la∗ c∗ )

s=

(la∗ b∗ + lb∗ c∗ + la∗ c∗ ) 2

(46)

where lengths l can be determined from the known coordinates of the vertices. For hexahedral cells, the quadrilateral cell-face ( a∗ − b∗ − c∗ − d∗ ) is split into two triangles and equation 46 is again applied to determine the total area. This procedure can be applied to any polygonal cell-face by splitting the polygon into appropriate number of non-overlapping triangles. 13

c* ξ

b*

ξ2

3

n c*

ξ

P

e

ξ1

E

n

2 b*

c

d*

c

ξ

e

E

ξ1

P

3 a*

a*

( a ) TETRAHEDRAL FACE

( b ) HEXAHEDRAL FACE

Figure 3: Cell-face Normal

3.4

Unit Normal Vector ~n

~ f k = Af k ~n where ~n is the unit outward normal to The area vector is given by A the cell-face. To evaluate this vector, let the line joining neighbouring nodes P and E be in ξ1 direction ( see figure 3 ) and let ξ2 and ξ3 coincide with any two adjoining sides of the face-polygon. In figure 3, the two chosen sides merge at c∗ . However, the choice of c∗ among the different vertices is arbitrary. Now, the correct directions of ξ2 and ξ3 are determined such that coordinate system ( ξ1 , ξ2 , ξ3 ) obeys the right-hand-screw rule. This obedience is observed as shown below. Let the unit normal vector be given by ~k β 1 + ~j β 2 + ~k β 3 1 1 1 ~n = ~i b11 + ~i b21 + ~j b31 = q 1 2 2 2 (β1 ) + (β1 ) + (β13 )2

(47)

where β1i =

∂xj ∂xk ∂xk ∂xj − ∂ξ2 ∂ξ3 ∂ξ2 ∂ξ3

( i, j, k cyclic )

(48)

Now, the correctness of directions ξ2 and ξ3 is ensured by requiring that the Jacobian J is positive. Thus, J = ~a1 . ~n = ( b11

∂x1 ∂x2 ∂x3 + b21 + b31 )>0 ∂ξ1 ∂ξ1 ∂ξ1 14

(49)

where ~a1 is the base-vector tangent to coordinate line ξ1 . It is now a straightforward matter to determine coefficients of normal vector bi1 and β1i once-for-all at every face of every cell.

3.5

Convective-Diffusive Transport

Making use of equations 45, 46 and 47, the total transport for the k th face can be written as (~q . A~f )k = (~q . ~n)k Af k =

3 X

(bi1 qi )k Af k = qnk Af k

(50)

i=1

The normal flux qnk is now assumed to be uniform over the cell-face area and explicitly evaluated at the centroid c of the cell-face ( see figure 3 ). The coordinates of this centroid are xic =

PNVf

xi,n NVf

n=1

(51)

where NVf represents total number of vertices forming the k th cell-face. Thus, substituting equation 42 in equation 50, it can be shown that (~q . A~f )k = (~q .~n)ck Af k = ρck Af k Φck

3 X

(bi1 ui )ck − Γck Af k

i=1

3 X i=1

"

bi1

∂Φ ∂xi

#

(52) ck

For brevity, we now introduce following notations Cck = ρck Af k

3 X

(bi1 ui )ck

Face Mass Flow

(53)

i=1

3 X ∂Φ ∂Φ |ck = bi1 ∂n ∂xi i=1

"

#

Face - Normal Gradient

(54)

ck

where n is along the face-normal. Substituting equations 53 and 54 in equation 52, therefore, ∂Φ (~q . A~f )k = Cck Φck − Γck Af k |ck ∂n

(55)

In the above expression, the first term on the right hand side represents convective transport whereas the second term represents diffusive transport normal to the k th cell-face. The replacement indicated in equation 54 may be viewed as a special feature of the present discretization practice because the normal diffusion is sought to be evaluated directly rather than through its resolved components along xi or ξi . Most previous researchers [43, 44, 45], it would appear, evaluate the normal diffusion through resolved components. 15

3.6

Construction of Line-Structure

Direct evaluation of face-normal transport requires deliberate construction of a line-structure at a cell-face. Existence of such a line-structure, however, is not obvious. The construction can be understood by considering triangular cell-face ( a∗ b∗ c∗ ) of a tetrahedral cell-face shown in figure 4. In this figure, P and E are nodes straddling the cell-face. Line PE intersects the face at e. In general, e will not coincide with the face-centroid c. In fact, e may not even lie within the cell-face in general but may lie on an extension of the face-plane. However, this matter is inconsequential to further development.

b*

n E2

n E

c* c

1

P e

E

ξ1

P 2 P1

a*

Figure 4: Construction of a Line-Structure

The construction of the required line-structure begins by drawing two cellface-normals through points c and e. Now, imagine a plane parallel to the cellface passing through P. This plane will intersect the face-normal through c at P2 and that through e at P1 . Triangle P − P1 − P2 will thus be parallel to the cell-face and the intersections at P1 and P2 will be orthogonal. Also, line P1 P2 will be parallel to the line ce. A similar face-parallel plane passing through E will yield face-parallel triangle E − E1 − E2 . It is now obvious that the face-normal transport in equation 55 must be evaluated along line P2 − c − E2 . This evaluation will now be analogous to that carried out at the cell-face of a structured grid.

16

3.7

Discretised Convection

Following the structured grid practice, the convective transport in equation 55 is evaluated as Cck Φck = Cck [fc ΦP2 + (1 − fc ) ΦE2 ]k

(56)

where fck is a weighting factor that depends on the convection scheme used [16] and Cck is evaluated from equation 53 as Cck = ρck Af k (b11 u1 + b21 u2 + b31 u3 )ck

(57)

In the above evaluation, density and velocity components are evaluated by multidimensional averaging according to the following general formula Ψck =

1 Ψck [fmc ΨE2 + (1 − fmc ) ΨP2 ]k + 2 2

(58)

PN V f

(59)

where Ψck =

Ψn NV f

n=1

and, from our construction, fmc =

lP e lP e lP 2 c = 1 = lP 2 E 2 lP 1 E 1 lP E

(60)

where lP e and lP E are evaluated from known coordinates of points P, e and E. Here, the weighting factor fck is evaluated by blending [44] of Central-Difference ( CDS ) and Upwind-Difference ( UDS ) schemes so that fck = β (1 − fmc ) +

1 |Cck | (1 − β) (1 + ) 2 Cck

(61)

where β is the blending factor. β = 1 corresponds to CDS whereas β = 0 corresponds to UDS. In compressible flows, nearly discontinuous variations of Φ may occur in the presence of a shock. In such cases, it becomes important to sense the shape of the local Φ-profile via Total Variation Diminishing ( TVD ) schemes ( see for example, [46, 47, 48] ).

17

3.8

Discretised Diffusion

For evaluating diffusion transport in equation 55, Γck can be evaluated from equation 58 or, one may use harmonic mean of values at P2 and E2 [16]. Now, since point c may in general not be midway between points P2 and E2 , using Taylor series expansion, the expression for second-order accurate face-normal gradient will read as ∂Φ Φ E 2 − Φ P2 |c = ∂n lP 2 E 2 # " fm,c ΦE2 − Φc + (1 − fm,c ) ΦP2 (1 − 2 fm,c ) − fm,c (1 − fm,c ) lP 2 E 2

(62)

where, from our construction, lP2 E2 = lP1 E1 = ~lP E . ~n = |

2 X

bi1 (xi,E − xi,P ) |

(63)

i=1

Therefore, the total diffusion transport in equation 55 can be expressed as −Γck Af k

∂Φ |ck = −dck (ΦE2 − ΦP2 )k ∂n h i + dck Bck fm,c ΦE2 − Φc + (1 − fm,c ) ΦP2

k

(64)

where dck and Bck are given by dck =

Γck Af k lP 2 E 2

Bck =

(1 − 2 fm,c ) fm,c (1 − fm,c )

(65)

Note that dck is the familiar diffusion coefficient having significance of conductance. Symbol Bck is introduced for brevity.

3.9

Interim Discretization

Using above developments ( equations 55 to 65 ), equation 41 can be written as

(ρP ΦP − −

Nk X

ρoP

ΦoP )

Nk X ∆V + Cck [fc ΦP2 + (1 − fc ) ΦE2 ]k ∆t k=1

dck (ΦE2 − ΦP2 )k +

k=1

= S ∆V

Nk X

h

dck Bck fm,c ΦE2 − Φc + (1 − fm,c ) ΦP2

k=1

i

k

(66)

In the above discretized equation, values of variables at fictitious points P2 and E2 and at vertices a∗ , b∗ , c∗ are not known. These unknown values will now be expressed in terms of values at nodes P and E. 18

Interpolation of Φ at P2 , E2 , a∗ , b∗, c∗

3.10

It is now assumed that variation of Φ in the neighbourhood of nodes P and E is multi-dimensionally linear. Then, ΦP2 , for example, can be evaluated as ΦP2 = ΦP + ∆ΦP

(67)

where ∆ΦP = ~lP P2 . grad ΦP =

3 X

(xi,P2 − xi,P )

i=1

∂Φ |P ∂xi

(68)

Now, (xi,P2 −xi,P ) is evaluated in terms of points whose coordinates are known. Thus, from the geometry of our construction, it can be shown that xi,P2 − xi,P = lxi + dxi lxi = xi,e − xi,P − lP1 e bi1 dxi = xi,c − xi,e lP1 e = ~lP e . ~n = |

3 X

(69) (70)

(xi,e − xi,P ) bi1 |

(71)

i=1

From the above developments, it follows that ΦP2 = ΦP + ∆ΦP = ΦP +

3 X

(lxi + dxi )

i=1

∂Φ |P ∂xi

(72)

Invoking similar arguments, it can be shown that ΦE2 = ΦE + ∆ΦE = ΦE +

3 X

(dxi −

i=1

∂Φ (1 − fmc ) lxi ) |E fmc ∂xi

(73)

Finally, value of Φ at each vertex of a cell-face is evaluated as average of two estimates. Thus, at vertex a∗ , for example, Φ a∗ =

i 1 h ΦP + ~lP a∗ . grad ΦP + ΦE + ~lEa∗ . grad ΦE 2

Similar estimates at other vertices enable calculation of Φ c .

19

(74)

3.11

Final Discretization

Thus, using derivation of the previous sub-section, equation 66 can be written as

(ρP ΦP − ρoP ΦoP ) −

Nk X

Nk X ∆V + Cck [fc ΦP + (1 − fc ) ΦE ]k ∆t k=1

dck (ΦE − ΦP )k = S ∆V +

k=1

Nk X

Dk

(75)

k=1

where h

Dk = −dck bck fmc (ΦE + ∆ΦE ) − Φc + (1 − fmc ) (ΦP + ∆ΦP ) + dck (∆ΦE − ∆ΦP )k − Cck [fc ∆ΦP + (1 − fc ) ∆ΦE ]k

i

k

(76)

Further Simplification Grouping terms in ΦP , equation 75 is now re-written as AP ΦP =

Nk X

AEk ΦE,k + S ∆V +

k=1

Nk ρom,P ∆V o X Dk ΦP + ∆t k=1

(77)

where AEk = dck − (1 − fck ) Cck AP =

(78)

3 X ρP ∆V + [Cck fck + dck ] ∆t i=1

(79)

Now, for Φ = 1 ( that is, mass conservation ), equation 66 gives (ρP − ρoP )

Nk X ∆V + Cck = 0 ∆t k=1

(80)

Replacing ρP ∆V /∆t in equation 79 via the above equation, it follows that AP = ρoP

Nk X ∆V + AEk ∆t k=1

(81)

20

With the above expression for AP, equation 77 suitable for computer implementation in an iterative procedure reads as AP Φl+1 P =

Nk X

l AEk Φl+1 E,k + S ∆V +

k=1

Nk X ρoP ∆V o ΦP + Dkl ∆t k=1

(82)

where superscript l denotes iteration counter. The equation shows that S and Dk terms lag behind Φ values by one iteration. Equation 82 is the main discretized transport equation for node P. The equation is valid for cells of any topology as well as any polygonal plane cell-face.

3.12

Evaluation of Cartesian Gradients

The evaluation of Dk terms requires evaluations of ∆ΦP and ∆ΦE ( see equation 76 ). The latter terms, in turn, require evaluations of cartesian gradients ( see equations 72 and 73 ) at nodal positions P. This evaluation is carried out as follows ∂Φ ∂Φ ∂Φ 1 |P = |P = |P dV ∂xi ∂xi ∆V ∆V ∂xi Z Nk 1 X 1 (bi1 Φ) dAf = = (bi Φ)ck Af k ∆V Af ∆V k=1 1 Z

(83)

where Φck is evaluated from equation 58 which again requires ∆ΦP and ∆ΦE to complete evaluations of ΦP2 and ΦE2 . This makes equation 83 implicit in ∂Φ/∂xi |P . However, since the overall procedure is iterative, such implicitness is acceptable.

3.13

Boundary Conditions

Consider a cell near a domain boundary ( figure 5 ) with the cell-face coinciding with the boundary. A boundary node B is now defined at the centroid of the cellface ( a∗ , b∗ , c∗ ) so that with our usual notation B = c = e and coordinates of B can be readily evaluated from those of face-vertices. Now, let P2 B be the outward normal to the boundary face and P P2 be orthogonal to P2 B and, therefore, parallel to the boundary face. Then, the total outward transport through the boundary face is given by ∂Φ (~q . A~f )B = CB ΦB − (Γ Af )B |B ∂n

(84)

where CB = ρB Af,B

3 X

bi1 ui,B

(85)

i=1

21

n

b*

and − F B ( INFLUX ) ξ1

c*

B=c=e

P P2

a*

t1

t2

Figure 5: Typical Near-Boundary Cell

CB ΦB = CB [fB ΦP2 + (1 − fB ) ΦB ]

(86)

(ΦB − ΦP − ∆ΦP ) (ΦB − ΦP2 ) ∂Φ = |B = ∂n lP 2 B lP 2 B

(87)

Therefore, equation 84 can be written as (~q . A~f )B = CB [fB (ΦP + ∆ΦP ) + (1 − fB ) ΦB ] − dB [ΦB − ΦP − ∆ΦP ]

(88)

where dB = ΓB Af B /lP2 B . Scalar Variables For the near-boundary cell, equation 82 is written as

AP Φl+1 = P

NX k−B

l AEk Φl+1 E,k + S ∆V +

k=1

− (~q . A~f )B

k−B ρom,P ∆V o NX ΦP + Dkl ∆t k=1

(89)

where Nk-B implies that boundary-face contribution is excluded from the summation ( the same applies to the AP coefficient, equation 81 ) and accounted through - (~q . A~f )B term. For a scalar variable, ΦB or influx FB = ΓB ∂Φ/∂n |B 22

are typically specified. In either case, employing equation 88 and source-term linearisation practice [16], equation 89 can be appropriately modified. Vector Variables At inflow and wall boundaries, the velocities ui,B are known and, therefore, equation 89 readily applies. Care, however, is needed when exit and symmetry boundaries are specified. Thus, At symmetry boundary: Un,B = 0 and ∂Ut /∂n |B = 0 At exit boundary: ∂Un /∂n |B = 0 and ∂Ut /∂n |B = 0 where, Un and Ut are face-normal and face-tangent velocities. Thus, Un = V~ . ~n =

3 X

bi1 ui

(90)

i=1

Now, to evaluate the face-tangent velocities, we construct an orthogonal coordinate system ( ~n, ~t1 , ~t2 ) where ~t1 and ~t2 are two tangent vectors parallel to the boundary-face. One of these ( say, ~t1 ) can be taken along line P P2 . The second one ~t2 will now be orthogonal to ~t1 and ~n. Thus, from equation 69 ( with dxi = 0 because B, c and e coincide ) ~t1 = ~i lx1 + ~j lx2 + ~k lx3

(91)

and ~t2 = ~n × t~1 = ~i mx1 + ~j mx2 + ~k mx3

(92)

where mx1 = b21 lx3 − b31 lx2 , mx2 = b31 lx1 − b11 lx3 , mx3 = b11 lx2 − b21 lx1 . It is now a straight forward matter to implement the symmetry boundary condition, for example, via following three equations. Symmetry Boundary

Un,B =

3 X

bi1 ui,B = 0

(93)

i=1

∂Ut1 |B = 0 ∂n 3 X i=1

lxi ui,B =

3 X i=1

Ut1 ,B = Ut1 ,P2 lxi ui,P2 =

3 X i=1

23

lxi (ui,P + ∆ui,P )

(94)

∂Ut2 |B = 0 ∂n 3 X

mxi ui,B =

i=1

Ut1 ,B = Ut1 ,P2

3 X

mxi ui,P2 =

i=1

3 X

mxi (ui,P + ∆ui,P )

(95)

i=1

The above three equations can be solved simultaneously to obtain three boundary velocities ui,B . Similarly, to implement the exit boundary condition, only equation 93 needs to be modified to read as Exit Boundary

∂Un |B = 0 ∂n 3 X

bi1 ui,B =

3 X

bi1 ui,P2 =

3 X

bi1 (ui,P + ∆ui,P )

(96)

i=1

i=1

i=1

3.14

Un,B = Un,P2

Pressure-Correction Equation

For simplicity, discretized version of the incompressible form ( Ui∗ = 0 ) of the pressure-correction equation 21 is given below. 0

AP pP =

Nk X

0

AEk pE,k −

0

l Cck − (ρP − ρoP )

i=1

k=1

where AP =

Nk X

PN k

k=1

(97)

AEk and, from equation 24

ρl α ∆V Γp A f k = m u AEk = ck lP 2 E 2 AP i 0

NX k−B 0 ∆V + Dkp ∆t k=1

"

#

ck

α A2 ρl Af k = m,ck ui f k lP 2 E 2 APck

(98)

The Dkp term contains gradients of p . However, during iterative process in 0 SIMPLE, the pressure-correction equation is treated only as an estimator of p . 0 Hence, Dkp may be set to zero. 0 Equation 97 is solved with boundary condition ∂p /∂n|B = 0. If the boundary 0 pressure is specified then pB = 0. After solving equation 97, the mass-conserving pressure-correction distribution is recovered from equation 22. This, however, 0 requires evaluation of smoothing pressure-correction psm and, hence, of pl . 0

Evaluation of pl

24

As shown in equation 25, we need to evaluate pl xi as solutions of ∂ 2 p/∂x2i |P = 0. Thus, 1 ∆V

Z

∆V

Nk h i ∂pl ∂2p 1 X i |ck = 0 b Af |P dV = k ∂xi ∂x2i ∆V k=1 1

(99)

The simplified discretised form of this equation gives PN k

pxl,P = Pk=1 Nk

k=1

A1,l A2,l

l = 1, 2, 3

(100)

where

4

(bl1 Af k )2 (pE + ∆pE − ∆pP )k ∆Vck (bl1 Af k )2 = ∆Vck

A1,l =

(101)

A2,l

(102)

Overall Calculation Procedure

The overall SIMPLE procedure for unstructured grids with cell-centered collocated variables is as follows: Preliminaries 1. Using the information from the Vertex and Element files generated by ANSYS, identify neighbouring nodes of each node N. This identification is easily carried out because the neighbouring nodes must share the same cell-face and hence, the same vertex numbers. If no shared cell-face is identified then the cell-face must be the boundary face. Hence, define a boundary node and assign a node number to it. For each node N, store the node number of neighbouring node in an array NABOR ( N , K ) where K is the kth cell-face. 2. Now, carry out identification of ξ2 and ξ3 directions as indicated in subsection 3.3 at each cell-face of every cell. 3. With the above information at hand, it is now easy to evaluate bi1 , lxi , dxi , f mck and Afk once-for-all. Also, evaluate cell-volume. Solution Begins

25

4. At a given time step, guess pressure field pl 5. Solve once equation 82 for Φ = ui to yield uli distribution. The solution is preceded by evaluation of coefficients AEk and by accounting for boundary conditions. 0

6. Perform maximum 10 iterations of p equation 97 where AEk are evaluated from equation 98. 0

7. Recover mass-conserving pressure correction pm according to equation 22 0 by evaluating psm . The latter requires evaluation of pl . This average pressure is evaluated from equation 25 where pl xi are evaluated using equation 100. This step ensures that the predicted pressures do not exhibit zig-zag behaviour [27]. 8. Apply pressure and velocity corrections at each node. Thus 0

l pl+1 P = pP + β pm,P

0