Applied Mathematics and Mechanics Computations of ... - Springer Link

2 downloads 0 Views 354KB Size Report
Tucker[4] proposed a method for the calculation of wall distances. According to this ..... 4.4 Titan IV rocket. The geometry of Titan IV rocket is complex enough.
Appl. Math. Mech. -Engl. Ed., 32(2), 141–150 (2011) DOI 10.1007/s10483-011-1401-8 c Shanghai University and Springer-Verlag Berlin Heidelberg 2011

Applied Mathematics and Mechanics (English Edition)

Computations of wall distances by solving a transport equation∗ Jing-lei XU (), Chao YAN ( ),

Jing-jing FAN ()

(National Laboratory for Computational Fluid Dynamics, Beihang University, Beijing 100191, P. R. China) (Communicated by Jian-zhong LIN)

Abstract Computations of wall distances still play a key role in modern turbulence modeling. Motivated by the expense involved in the computation, an approach solving partial differential equations is considered. An Euler-like transport equation is proposed based on the Eikonal equation. Thus, the efficient algorithms and code components developed for solving transport equations such as Euler and Navier-Stokes equations can be reused. This article provides a detailed implementation of the transport equation in the Cartesian coordinates based on the code of computational fluid dynamics for missiles (MICFD) of Beihang University. The transport equation is robust and rapidly convergent by the implicit lower-upper symmetric Gauss-Seidel (LUSGS) time advancement and upwind spatial discretization. Geometric derivatives must also be upwind determined to ensure accuracy. Special treatments on initial and boundary conditions are discussed. This distance solving approach is successfully applied on several complex geometries with 1-1 blocking or overset grids. Key words

wall distance, numerical simulation, overset grid

Chinese Library Classification V211.3 2010 Mathematics Subject Classification

1

35L82

Introduction

Wall distance, a simple parameter reflecting naturally the near wall features of turbulence, noted as d, plays a key role in many Reynolds averaged Navier-Stokes (RANS) equations and large eddy simulation (LES) modeling approaches. For example, the shear stress transport (SST) model[1] relies on d to determine the interface between the computation regions of k-ε and k-ω, while the Spalart-Allmaras model[2] just simply treats d as the model length scale. It is clearly and accurately calculated that d is essential for the correct implementations of these models. The definition of d in the models is the minimum distance from every grid point or cell-center within the integration domain to the solid surfaces. Under crude search procedures, required operations are in the order O(M × N ), where M and N are the numbers of grid points in the 2 whole domain and on the solid surfaces, respectively. N could be in the order O(M 3 ) or even larger, because the number of grid points in the wall normal direction is usually smaller than ∗ Received Oct. 22, 2010 / Revised Dec. 3, 2010 Project supported by the National Basic Research Programme of China (No. 2009CB724104) and the Post-Doctoral Science Foundation of China (No. 20090450285) Corresponding author Jing-lei XU, Ph. D., E-mail: [email protected]

142

Jing-Lei XU, Chao YAN, and Jing-Jing FAN

those in the other two directions. Considering a mesh with 1 million grid points which is a typical magnitude in 3D numerical simulations, N could be in the order 104 . In other words, the CPU consumption in such search procedures is like that in solving differential equations: iterating as many as 104 steps in the whole domain but with only one operation in every iteration. It is clear that the cost of calculating d with search procedures grows dangerously with increasing grid amounts. As reported, even with Cray C90 class computers and time invariant meshes, it would take 3 hours just to gain d in a large 3D case[3] . Moreover, for overset meshes with relative movements or deforming/adaptive meshes, d needs to be repeatedly calculated without any benefit from previous calculations. Suffering from the expense of search procedures, people break a new path by solving differential equations for d. The most efficient differential equations for d in the literature can be classified into three types: Poisson, Eikonal, and Hamilton-Jacobi equations[4–6] . These equations are composed of gradient and/or Laplacian operators that are typical components of computational fluid dynamics (CFD) solvers. Thus, they can be written in advection/diffusion terms, allowing the reuse of algorithms and code components of a mature CFD solver. The approach of solving differential equations is found to be easy implemented, stable, and economical especially with nonstationary meshes. 1.1 Poisson equation method Tucker[4] proposed a method for the calculation of wall distances. According to this method, a Poisson equation is first solved, i.e., ∇2 L = C, where C =1, and at solid walls L =0. Then, gradients of L are used to gain d, i.e.,      ∂L 2   ∂L   ± d=−   + 2L.  ∂xj  ∂xj j=1,3 j=1,3

(1)

(2)

Tucker[7] gave a detailed presentation of it, and Tucker et al.[6] commented that it was the easiest to be implemented, but only for those that are accurately close to walls. 1.2 Eikonal equation method According to the definition of d, the distribution of d can be considered as a potential field, whose gradient is 1, |∇d| = 1.

(3)

Equation (3) is called Eikonal, and the unit propagating velocity |∇d| ensures that the first arrival time is equal to exact d. The second restriction is that the gradient of d is normal to the solid surface, which is automatically fulfilled by setting d on the surface to zero. This boundary condition will be further discussed in Section 3.5. 1.3 Hamilton-Jacobi equation method A diffusion analogous term is added into the Eikonal equation. Thus, the Hamilton-Jacobi (HJ) equation is obtained in order to take the convex and concave effects into account. For example, near a wire or a convex corner, exact d is larger than the true turbulence length scale, exaggerating the wall damping effects, while the near concave corner, exact d cannot represent the increased turbulence damping effect from “multi-surface”. The HJ equation can be written in the following form: |∇d| = 1 + Γ(d)∇2 d.

(4)

Although the additional term does alleviate turbulence modeling, the coefficients in Γ(d) are not clearly suggested in the literature, and the study of a further modeling may be necessary.

Computations of wall distances by solving a transport equation

143

Moreover, it definitely takes much more time due to computations of the diffusion analogous term. In the code of computational fluid dynamics for missiles (MI-CFD), we prefer to incorporate the von Karman length scale into the models as the second length scale, leading to scale adaptive simulation (SAS) models[8] . The SAS model can adjust its length scale according to the local flow topology. Therefore, the convex/concave effects can be well explained. In this situation, exact d must be accurately calculated to serve as the first length scale. Thus, for the Eikonal equation, the exact equation for d is of special interest.

2

Transport equation for d

In order to efficiently gain d in 3D complex meshes, it would be a good idea to inherit the precious numerical schemes developed for the Euler and Navier-Stokes equations and the code of grid techniques. Since it is difficult to directly solve the Eikonal equation, we define the following distance vector: U = ∇d.

(5)

Then, (3) can be written in the following advection form: U · ∇d = 1.

(6)

An artificial time term is added to the left side of (6) so that efficient time advancement schemes such as the LUSGS[9] and approximate factorization (AF) can be utilized as follows: ∂d + U · ∇d = 1. ∂t

(7)

When a steady solution is obtained or the residual ∂d ∂t is small enough, the transport equation (7) is equivalent to (6), and thus d is accurately computed. In the present work, the conservative form of (7) is not considered because the transformation-induced diffusion term introduces significant operations in calculating second-order derivatives, although it is favorable to convergence.

3

Numerical methods

It is very convenient to integrate this transport-equation-formed Eikonal equation into industrial codes. MI-CFD, a CFD code that is under active development in the State Laboratory for CFD of Beihang University, is used as the numerical platform. It solves three-dimensional Reynolds averaged Navier-Stokes equations for structured 1-1 blocking and overset grids in the finite-volume formulation. Seventeen spatial discretization schemes, five time advancement algorithms, four turbulence models, and four RANS-LES hybrid approaches are integrated into it. Notably, MI-CFD is designed to be an object oriented code written in Fortran 90, making it very convenient for code modifications and expansions. The detailed process of solving the Eikonal equation in three-dimensional Cartesian coordinates is demonstrated blow. 3.1 Eikonal equation in generalized coordinates It is difficult to directly solve equations in Cartesian coordinates. Thus, the transport equation is solved in generalized coordinates (ξ, η, ζ). From the chain-rule, the following “convective” term in (7) is transformed: Uj

∂d ∂d ∂d ∂d = Uj ξxj + Uj ηxj + Uj ζxj ∂xj ∂ξ ∂η ∂ζ ∂d ∂d ∂d + Uj ηxj + Uj ζxj = Uj ξxj ∂ξ ∂η ∂ζ    = U dξ + V dη + W dζ ,

(8)

144

Jing-Lei XU, Chao YAN, and Jing-Jing FAN

where ⎧  = ξx U1 + ξy U2 + ξz U3 , ⎪ U ⎪ ⎪ ⎨ V = ηx U1 + ηy U2 + ηz U3 , ⎪ ⎪ ⎪ ⎩ W = ζx U1 + ζy U2 + ζz U3 are the contravariant velocities, and ⎧ U1 = dξ ξx + dη ηx + dζ ζx , ⎪ ⎪ ⎪ ⎨ U2 = dξ ξy + dη ηy + dζ ζy , ⎪ ⎪ ⎪ ⎩ U3 = dξ ξz + dη ηz + dζ ζz ,

(9)

(10)

in which the geometric derivatives ξx , ξy , ξz , ηx , ηy , ηz , ζx , ζy , and ζz are calculated on the cellfaces by the CFD solver as a prior. 3.2 Spatial discretization Unlike the elliptical Poisson equation of a good temper, the numerical discretization of the hyperbolic Eikonal equation is challenging. This Euler-like equation needs some numerical dissipation to help the convergence. Advection terms are discretized using the first-order upwind method because central discretization leads to divergence. Just consider the ξ direction,  dξ = U  + ui−1 + U  − ui+1 , U

(11)

⎧  ± = 0.5(U  ± |U  |), ⎪ U ⎪ ⎪ ⎨ ui−1 = di − di−1 , ⎪ ⎪ ⎪ ⎩ ui+1 = di+1 − di .

(12)

where

 upwind difference is necessary in order to match the above For the calculation of dξ inside U, discretization. The first-order upwind difference formula suggested by Tucker et al.[6] is utilized, dξ = ni−1 ui−1 + ni+1 ui+1 ,

(13)

where

ni−1 = 0.25(1 + sign(1, (ui−1 + ui+1 ))(1 + sign(1, ui−1 )), ni+1 = 0.25(1 − sign(1, (ui−1 + ui+1 ))(1 − sign(1, ui+1 )).

(14)

In (14), sign is an internal function of Fortran, i.e., sign(a, b) = |a| for b 0, while sign(a, b) = −|a| for b < 0. Take geometric derivatives G in the i index direction (ξx , ξy , ξz ) for an example. For many CFD codes, G is evaluated as a prior at the interfaces normal to the i index direction (Gi and Gi+1 ). G at the cell centers Gi are unknown and must be upwind determined to prevent an overestimate of d for grids with high stretching rates in the boundary layers, Gi = ni−1 Gi + ni+1 Gi+1 .

(15)

Computations of wall distances by solving a transport equation

145

3.3 Time advancement 3.3.1 Implicit LUSGS The implicit LUSGS method of excellent stability is employed. Since Δd = dn+1 − dn as d increases, the linearized implicit scheme for (7) can be written as    δ upwind + ΔtV δ upwind + ΔtW  δ upwind Δd = R, 1 + ΔtU (16) η ξ ζ where

⎧  +   (Δdi − Δdi−1 ) + U  − (Δdi+1 − Δdi ) ,  δ upwind Δd = Δt U ΔtU ⎪ i i ξ ⎪ ⎪ ⎪ ⎨   ΔtV δηupwind Δd = Δt Vj+ (Δdj − Δdj−1 ) + Vj− (Δdj+1 − Δdj ) , ⎪ ⎪ ⎪ ⎪  +  ⎩  upwind  (Δdk − Δdk−1 ) + W  − (Δdk+1 − Δdk ) , ΔtW δζ Δd = Δt W k k

in which

(17)

⎧    ± = 0.5(U  ± U  ), ⎪ U ⎪ ⎪ ⎨   V ± = 0.5(V ± V ), ⎪ ⎪ ⎪   ⎩±  ±  W = 0.5(W W ),

and the reasidual is  n  n    n  ∂d + 1 .  ∂d − V ∂d − W R = Δt −U ∂ξ ∂η ∂ζ

(18)

Then, (16) can be written in the form of (D + L + U )Δd = R,

(19)

where D, L, and U are entries of diagonal, lower, and upper block-tridiagonal matrices, respectively, i.e.,  +  ⎧  −U  − + V + − V − + W + − W − , D = 1 + Δt U ⎪ ⎪ ⎪ ⎪ ⎪   + ⎪ ⎪  Δdi−1 + V + Δdj−1 + W  + Δdk−1 ⎪ LΔd = −Δt U ⎪ ⎪ ⎪ ⎨  +   + V + + W  + Δd, = −Δt U ⎪ ⎪ ⎪ ⎪  −  ⎪ ⎪  Δdi+1 + V − Δdj+1 + W  − Δdk+1 U Δd = Δt U ⎪ ⎪ ⎪ ⎪ ⎪  −  ⎩  + V − + W  − Δd. = Δt U

(20)

According to the approximate factor decomposition, D + L + U = D(I + D−1 L + D−1 U ) ∼ = D(I + D−1 L)(I + D−1 U ) = D(I + D−1 L)D−1 D(I + D−1 U ) = (D + L)D−1 (D + U ),

(21)

146

Jing-Lei XU, Chao YAN, and Jing-Jing FAN

and finally the implicit LUSGS scheme is achieved as n (D + L)D−1 (D + U )Δd = Ri,j,k ,

(22)

which can be inverted into two steps to gain Δd. 3.3.2 Local time step For steady computations or time-accurate computations with pseudo time steps, a local time step technique can be used to accelerate the convergence. The time step is modeled to advance locally in each grid cell related to the input ICFL number (typically 1∼5) and the minimum grid spacing in all the three directions, Δt = ICFL · min(Δx, Δy, Δz).

(23)

3.4 Initial conditions Previous studies indicate that 1 dinitial < ∞ is adequate. However, we propose the following equation as a precondition to provide a favorable initial gradient for d: dinitial =

 x2 + y 2 + z 2 .

(24)

It can be seen from Figs. 1 and 2 that the convergence speed of the double cone case described in Section 4.2 is considerably slower without the precondition (dinitial =1).

Fig. 1

Convergence history of residual

Fig. 2

Convergence history of averaged |∇d|

3.5 Boundary conditions There are four typical boundary conditions to be discussed in this section. The boundary condition at the solid walls is naturally written as dwall = 0.

(25)

It is recommended that the Eikonal equation should be solved on the grid points due to this Dirichlet condition. For a finite-volume code such as MI-CFD, we suggest that d at cellcenters adjacent to solid walls should be directly calculated using geometric derivatives rather than solving the equation. The special treatments can enhance convergence, and can reduce d prediction errors at cells close to those do not participate in solving the equation. At the far field boundaries, ∂d =0 ∂n

(26)

Computations of wall distances by solving a transport equation

147

can be used, where n is the boundary-normal direction. This approximation helps provide a stable solution, and hardly influence the accuracy of d near the wall. The 1-1 blocking means that the faces shared by two blocks (for example, A and B) are exactly the same. The cells of B adjacent to the interface are simply treated as the ghost cells of A, and vice versa. The concept of the overset grid is first explained for the grid-overset boundaries. The overset grid method[10] divides a complex domain into small and simple regions, which communicates with each other via interpolations at overlapped surfaces to achieve independent and easier mesh generation. The hole-cutting and donor search processes will create a composite overset grid which marks the hole points and fringe points. The hole-cutting process uses the hole-map algorithm, and the hole surface optimization employs the iteration technique based on the grid size[11] . An array bblank is used to mark the point status: bblank =0 for hole points, bblank=0.5 for fringe points, and bblank =1 for field points. Then, eventual wall distances for meshes involve overset blocks, which can be written as doverset = bblank · dsingle block .

4

(27)

Test cases

4.1 Flat plate To examine the accuracy of this d-solving approach, it is natural to choose a flat plate with wall normal stretching grids as typical near wall grids. The mesh size is 129 in the streamwise direction, and 49 in the wall-normal direction, and the stretching rate is 1.25 very near the wall. Errors with and without upwind G (geometric derivatives) is revealed in Figs. 3 and 4, and the employment of upwind determined G in (15) can significantly reduce d prediction errors compared with the central determined G.

Fig. 3

Predicted d for a flat plate

Fig. 4

Error in d for a flat plate

4.2 Double cone For a double cone, the first cone half angel is 25◦ , and the second cone half angel is 50◦ . The mesh of two blocks with 1-1 blocking connection is illustrated in Fig. 5, and it has about 1 million cells. It takes 41.5 min for search procedures while it only takes 3.3 min for iterating the d-solving equation and 500 steps on a single core of Intel Q6600 CPU. The convergence history is illustrated in Figs. 1 and 2, from which it is seen that even with convex and concave corners, a quick and fine convergence is still achieved. Figure 6 gives a contour view of correctly calculated d, from which we can judge that this d-solving approach does not suffer from multiple vector directions of gradient d near the convex and concave walls.

148

Jing-Lei XU, Chao YAN, and Jing-Jing FAN

Fig. 5

4.3

1-1 blocking grid for double cone

Fig. 6

d contours of the double cone

Three-element airfoil with overset grids

For a three-element airfoil, the mesh generation is a challenge utilizing only 1-1 blocking technique for block connection. Therefore, the 2D mesh is designed to consist of six blocks that communicate with one another employing overset grid technique, and it has about 0.14 million cells shown in Fig. 7. It takes 5.7 min for search procedures while it only takes 0.55 min for iterating the d-solving equation and 500 steps on a single core of Intel Q6600 CPU. The convergence rate versus iteration steps for overset grids is slightly lower than that for an ordinary grid. Figure 8 shows correctly calculated d, indicating that the employment of the overset boundary condition for solving the Eikonal equation is applicable.

Fig. 7

4.4

Overset grid for a multielement airfoil

Titan IV rocket

The geometry of Titan IV rocket is complex enough. It is chosen to be a test case of engineering significance. The 3D mesh employing 1-1 blocking and overset grid technique is composed of 54 blocks that communicate with each other. The total number of grid elements is about 2.4 million. It takes 131 min for search procedures while it only takes 8.3 min for iterating the d-solving equation and 500 steps on a single core of Intel Q6600 CPU. The grid and contour of d are shown in Figs. 9 and 10, respectively. It is seen from the computation result that for a mesh with such complexity, the d-solving approach is still of considerable efficiency and accuracy.

Computations of wall distances by solving a transport equation

Fig. 8

5

149

d contours of the airfoil

Fig. 9

Overset grid for Titan IV rocket

Fig. 10

d contours of the Titan IV rocket

Conclusions

A transport equation for solving wall distance is derived from the Eikonal equation. The transport equation is composed of advection terms. Thus, it is easy to integrate it into industrial CFD codes to gain the wall distance for 3D complex meshes. The transport equation is found to have robust and rapid convergence using the implicit LUSGS time advancement and upwind spatial discretization. Special treatments of initial and boundary conditions can enhance the convergence. Wall distances can not be accurately computed unless geometric derivatives are

150

Jing-Lei XU, Chao YAN, and Jing-Jing FAN

upwind determined. The overset technique is successfully implemented in the transport equation and demonstrated in the test cases, extending applicability of this wall distance solving approach.

References [1] Menter, F. R. Improved Two-Equation k-ω Turbulence Models for Aerodynamic Flows, NASATM-103975, NASA (1992) [2] Spalart, P. R. and Allmaras, S. A One-Equation Turbulence Model for Aerodynamic Flows, AIAA1992-0439, AIAA (1992) [3] Wigton, L. B. Optimizing CFD codes and algorithms for use on Cray computer. Frontiers of Computational Fluid Dynamics, World Scientific Publishing, Sigapore (1998) [4] Tucker, P. G. Differential equation-based wall distance computation for DES and RANS. Journal of Computational Physics, 190, 229–248 (2003) [5] Sethian, J. A. Fast marching methods. SIAM Review, 41(2), 199–235 (1999) [6] Tucker, P. G., Rumsey, C. L., Spalart, P. R., Bartels, R. E., and Biedron, R. T. Computations of Wall Distances Based on Differential Equations, AIAA-2004-2232, AIAA (2004) [7] Tucker, P. G. Assessment of geometric multilevel convergence and a wall distance method for flows with multiple internal boundaries. Applied Mathematical Modelling, 22, 293–311 (1998) [8] Menter, F. R. and Egorov, Y. A Scale-Adaptive Simulation Model Using Two-Equation Models, AIAA-2005-1095, AIAA (2005) [9] Yoon, S. and Jameson, A. Lower-upper symmetric-Gauss-Seidel method for the Euler and NavierStokes equations. AIAA Journal, 26(9), 1025–1026 (1988) [10] Benek, J. A., Steger, J. L., and Dougherty, F. C. A Flexible Grid Embedding Technique with Applications to the Euler Equations, AIAA-1983-1944, AIAA (1983) [11] Fan, J. J., Yan, C., and Zhang, H. Improvement and application of hole-surface optimization technique in overlapping grid (in Chinese). Acta Aeronautica at Astronautica Sinica, 31(6), 1127– 1133 (2010)

Suggest Documents