Application of a direct solver for space marching solutions

10
AIAA 90-1442 A plication of a Direct Solver for Space drching Solutions Richard J. Matus Erich E. Bender General Dynamics Fort Worth Division AIM 21st Fluid Dynamics, Plasma Dynamics and Lasers Conference June 18-20, 1990 I Seattle, WA For permission to copy or republish, contact the American Institute of Aeronautics and Astronautics 370 L’Enfant Promenade, S.W., Washington, D.C. 2MM4

Transcript of Application of a direct solver for space marching solutions

AIAA 90-1442 A plication of a Direct Solver for Space drch ing Solutions

Richard J. Matus Erich E. Bender General Dynamics Fort Worth Division

AIM 21st Fluid Dynamics, Plasma Dynamics and Lasers Conference June 18-20, 1990 I Seattle, WA

For permission to copy or republish, contact the American Institute of Aeronautics and Astronautics 370 L’Enfant Promenade, S.W., Washington, D.C. 2MM4

Application of a Direct Solver for Space Marching Solutions Richard J. Matus * Erich E. Bender **

General Dynamics Fort Wonh Division

ABSTRACT

The application of Newton iteration as a crossflow plane solver for space marching Navier- Stokes codes is examined. The Navier-Stokes equations are parablized by neglecting viscous derivative terms in the marching direction and special treatment of the pnssure term in the axial momentum equation. The resulting hyperbolic-parabolic system of equations is solved in a single sweep by marching fmm the upstream boundary to the downsaeam boundary. Newton iteration is applied on each space-marching step to obtain a converged solution on the crossflow ulane. SamuIe results are shown for a Mach I4 compression corner flow, and a Mach 8 high angle of &tack cone Row.

Introductlw

Space marching Navier-Stokes flow solvers are an efficient method for producing viscous solutions of supersonic and hypersonic flows about aerospace vehicles. Steady flowfields are obtained in a single space-marching sweep requiring much less computer time than a time asymptotic solution, and since the solution is computed one marching plane at a time, the computer memory requirements are also less than an asymptotic solution.

Recently, the space-marching philosophy has been combined with upwind, TVD, finite-volume discretizations to produce space-marching codes that can accurately compute highly complicated supersonic and hypersonic flows['1 ['I 13'. Unfortunately, these high resolution schemes are more expensive than the older centraldifference, finite-difference schemes they replace, and methods for increasing their speed need to be investigated.

This class of schemes solves the nonlinw discrete form of the governing conservation laws, so that an iterative scheme is required to obtain a solution at each marching step. Conventional implicit schemes, such as approximate factorization and LU-SSOR, were investigated and found LO be too slow. The convergence rate of these schemes is limited by their inability to

-

* *. Scnior Engincer. CFD Gmup Member AIAA Copyright a 19W by Gcncral Dynmia Corporation. AU rights

rcrerved Publiihcd by Ihe America, Inrumre of Aemauticr and Arlmnaticr, Inc. wkh permisrim.

Lead Enginncer. CFD Grmp M m k AIAA

-.

reduce low frequency errors efficiently. Even given a good initial guess. they can fake a considerable number of iterations to converge. Newton iteration is effective at reducing errors of all wavelengths, therefore, it is a good candidate for a crossflow plane solver in a space marching code. Sparse manix methods have been used succesfully as crossplane solvers for reduced Navier- Stokes equations.[4' [a Additional bene6ts are realized when the Newton iteration is modified and combined with a generalized conjugate gradient type solver.

The direct solver described here uses a Newton iteration scheme to get a converged solution on each space-marching plane161 (*I. The advantages of Newton iteration are that it will converge quadratically within some domain of attraction around the solution, and it has a residual norm reducing propeicy which may be used to construct a very robust solution algorithm. Its disadvantages are the large amounts of storage it requires and its need for an initial solution which is suitably close to the converged solution.

Fortunately, both of these disadvantages arc alleviated by combining the direct solver with a space- marching scheme. The amount of memory required k reduced because the solution is obtained one plane at a time. and a good initial solution is always available from the previous upstream plane. This makes the direct solver and the space marching solver a natural

1

"Cbmbination.

The direct matrix inversion needed in Newton's method is time and memory intensive. More efficient methods are deskable. A very robust iterative method for solving non-linear system has been developed by S a d and Schultz."' [''I. Called the Generalized Minimal Residual (GMRES) algorithm, it is a conjugate grsdient class algorithm specilically developed for solving nonsymmehic. indefinite linear systems. Wigtan, Yu, and Young["l have extended GMRES to nonlinear systems. In their implementation they show that GMRFS is an approximation of Newton's method A recent application of the method has been reported for 2-D transonic airfoils using unsmctured grids.['*1 GMRES has been succesfully applied here in the crossplane solver. In doing this the direct sparse mauix solver is replaced with an incomplete LU decomposition, resulting in an order of magnitude savings of time and memory.

The remainder of this paper discusses the method used to parabolize the Navier-Stokes equations. the Newton iteration plus conjugate-gradient approach for Aving the equations, and two test cases which have

~ - x e n performed.

Space Marching Equation Set

The governing equations are the parabolized Navier-Stokes (PNS) equations, which are mathematical statements of the conservation of mass. linear momentum, and energy. The parabolization is performed by dropping viscous terms that contain derivatives in the marching direction, E,. ?he form of the three-dimensional PNS eauations in generalized

P u = pv !i

and

e =

f =

P V

In the above equations. p is the density, u, v, and w are the velocity components in the x, y. and z directions. respectively. p is the thermodynamic pressure. T is the temperature. p is the coefficient of viscosity, and K is rhe thermal conductivity. The perfect gas equation of state and Sutherland's law for the viscosity close the system. For equilibrium chemisny air flows the curve fits of Liu and Vinokurl"' are used IO close the system, rarher than the pertiit gas equation of

2

state.

marching problem. It is j5 is needed to ensure a well-posed space-

. .

Vigneron et al.1141 have shown that the space- marching system of equations will have d, positive eigenvalues if the flow has a positive velocity component in the marching directions and the safety factor, o in the above equation is chosen less than 1. The portion of the sneamwise pressure gradient that is removed by 6 is neglected, since IO do otherwise leads to departure solutions[31.

The governing equations are reduced to a discrete approximation using a finite-volume approach. The advantage of this approach is that it is guaranteed to be conservative when consistent flux approximations are used on each finite-volume cell face. The resulting discrete equation is

a ~(ui;t)(vo'i;i) +

[ ( F - F ~ ~ ) ~ ~ + ~ ~ ~ . ~ A,+,,z.t - [ ( F - F ~ ~ ) ~ ~ - ~ , ~ ~ A , , - , ~ ~ . ~ +

- Eitl/Z/tAi+lizj t - Ei-i/z@i-liZjt +

1 I [ (Gc/,)iji+~~] Ai,i+m - [ (GG)J; ;~-I /Z] A,;~-I/Z = 0

In this discrete equation, i, j. and k are the indices in the three coordinate directions, &q, and 5. The volume of the finite-volume cell at i jk is Vd;,, and the area of the six faces that enclose it are Aic l , z j i , Aijtin.tr and A i j t t i n .

The characterisitics of the numerical algorithm are determined by the approximations used to find the fluxes E , F and Ga t each face.

Flux difference spliaing methods. such as Roe's scheme, have been shown to be desirable for the msve r se fluxes["l, while a flux vector spliuing approach is needed for the streamwise fluxes to guarantee ~onservation'~'.

The hansverse fluxes, F and G are approximated by Roe's scheme[161

F j ; + i , z . ~ = - ( F i j i + F i j + ~ . t ) - ~ ( ~ F i , + l i z t ~ ~ i , + l i Z t ) 1 1 2

where

A - --1 6Fij+l/zt = T i j + ~ / d ij+l/LkT ,,+l/z.t(Uij+l,t-Ui/t)

A

T is a mamx with columns gat-are- the righ: eigenvectors of the Jacobian mamx, B d F l a U , and T - i?: mamx with rows that are the left eigenvectors of B. A and i- are diagonal Camces of the positive and negative eigenvalues of B. The a over the above quantities denotes that they have been calculated with Roe's averaging technique at the cell face.

Higher order accuracy is obrained through the approach of Chakravarathy and Osher[ln, wherein accuracy greater than first order is obtained by adding flux increments to the !3st order fluxes. The flux increments must be limited in some manner to avoid spurious oscillations at shocks, and the particular scheme used to limit the fluxes has a large influence on the performance of the direct solver. A desirable limiter has the following propemesll*l

provide a monotone interpolation

be at least C' continuous

include filtering of small distrubances

be geometrically similar and symmetric

The limiter used for the presented calculations was developed by Thompson>"' and it has these properties.

Solutlnn Algorithm

The discretized equations for a cross plane can be represented in vector form as .

f(x) = 0

These equations can be solved using Newton's method

a t - Ax" = -(-) 'f(x.) ax %+I = x. +Ax.

ar ax

where - is the Jacobian mahix of f(x). Implementing

Newton's method requires evaluating and inverting the Jacobian mamx at each iteration. The Jacobian mamx is large and sparse and is typically invened numerically using sparse .matrix methods. While quadratic convergence is obtained, dre cost per itention is quite high for large numbers of unknowns. An effective alternative is to freeze the Jacobian at the 6rst iteration and use its inverse. in subsequent iterations. The cost per iteration is thereby reduced by more than an order of magnitude. The convergence rate becomes linear and

3

. . more iterations are required, but the time required for a converged solution is greatly reduced.

One disadvantage of freezing the Jacobian is that some of the robustness of Newton's method is lost. Our experience with this method has shown that some underrelaxation is required to insure convergence. The amount of underrelaxation necessary is difficult io determine apriori, and the underrelaxation required can vary from plane to plane. This led us to investigate methods to increase robustness and accelerate convergence.

We have had great success with the Generalized Minimal Residual (GMRES) algorithm of S a d and Schulz["'. In our implementation, we have used the approach of Wigton, et al.["l Essentially, GMRES works by generating a subspace of the solution space, defined by k orthonormal vectors P , and the best possible solution is found on this subspace. A new subspace is generated and this process is repeated iteratively until convergence is obtained. Generally, GMRES operates on a nonlinear system that has been preconditioned in order to accelerate convergence and to reduce the number of orthonormal vectors, P. If F is a

,. - preconditioned form o f f , the algorithm is as follows:

Pi=F(x.)

P1=P, / I IP , I I

for j= I , ...A- 1

Pj+, = kj fori = 1, ...j

Pj+l =pj+1 -pijpi

Pj=Pj/I lP,l I

next i

next j

I I F(x.+,) I I * GMRES, as is cast in this form, is very easy to

implement into existing codes. This is illusnated by Wigton. et al.["l. where the algorithm is applied to codes using approximate factorization and multigrid solvers. For a derailed derivation of the algorithm see Saad and Schultz["I and Wigton["].

The key to success of GMRES is the form of preconditioning that is used. A very good preconditioning is to use the frozen Jacobian inversion described above. Here the preconditioned system becomes

F = -A-l f(x)

where A is the Jacobian evaluated at the lint iteration. We have found that substantial savings could be realized by evaluating the Jacobian matrix using the first order accurate form of the equations. as the number of nonzeros in the matrix is reduced by almost a factor of two. The time and storage savings achieved more than offsets any increase in the number of iterations. In addition, incomplete LU (ILU) decomposition. rather than a complete sparse mamix LU decomposition. is used to get an approximate inverse of the Jacobian. For a complete factorization, significant fill-in occurs and the resulting L and U factors are considerably more dense than the original matrix. Using ILU factorization, the original sparsity pattern of the Jacobian is imposed on the L and U factors. and no fill-in is allowed. This results in an order of magnitude savings in storage and time. For example, for a 61 X 35 cross plane solution, a complete factorization using sparse mamx methods requires 5.7 million words of memory and 7sLO seconds of CF'U time on a Convex C-240. Using ILU decomposition, these were reduced to 0.6 million words and 1.1 seconds of CPU time. Comparisons of convergence rates for the two factorizations have shown no degradation in performance when using the lLU factorization. Typically, a plane converges in about 4-10 cycles of GMRES using k = 5. A typical convergence history is shown in Figure 1.

Typically, a good initial guess to start the solution algorithm is available from the previous cross plane. In this situation no special treatment is needed to insure convergence. In some cases. such as when a change of

The vector kj is the differential of F in the direction of Pj and can be determined numerically as:

a - - F(x+EP,)-F(x) . I - - E boundary conditions is encountered, this initial guess

may not be adequate, and the algorithm must be damped to prevent divergence. Newton's method has a local descent property that can be exploited to provide this - x.+I=x. + CajP, damping automaticallyI61. his property can be

]=I extended to GMRES, if k is sufficiently large. This

Vter the vectors P have been defined the soluuon is updated

t

method of damping has been successively applied here. where the coefficients a, are chosen to minimize

4

- Numerfenl Results

The characteristics of the described algorithm are demonsuated in two test cases: the two-dimensional, hypersonic flow over a compression ramp, and the three-dimensional flow over a cone at high angle of anack

The hrst test case is a laminar, Mach 14.1 flow over a 15 degree. compression ramp. Experimental data is available for comparison from The geometry of this pmblem is shown in Figure 2 along with the computed pressure contours and in Figure 3 with the Mach number contours. The compression angle is 15" and the freestream Mach number is 14.1. The computational grid used for this calculation is the 101 x 101 point grid generated by D. Rudy'"'. and the solution took 144 seconds on a CONVEX C-210 mini- supercomputer. The figures illustrate the shock capturing capability of the scheme and the ability to resolve phenomena such as the shock-shock interaction seen near the outflow plane of the solution. Some interesting features of this flow are the interaction between the shock off the front of the flat plate and the ramp shock, and the incipient separation at the - compression comer. The present algorithm, which produces a solution in a single space-mmhing pass does not properly model the upstream influence present in the comer region, so it is not surprising that the computed surface pressures shown in Figure 4 do not match the experiment in this area. The agreement in other areas. even downstream of the comer, is good. Figure 5 shows the surface heat rransfer for this same case, and again there is g o d agreement except in the area of the comer, where the PNS equations are not valid. The conservation capabilities of the code are checked by numerically evaluating the integral conservation laws representing the conservation of mass, the linear ,momentum equations, and the energy equation for a control volume that is the entire computational domain. The present code h a s excellent conservation properties. and the integral mass conservation, linear momentum equations, and energy equations are satisfied to within IO-"% of the flow through the inflow plane.

The second test case is the laminar, Mach 8 flow over a lo" half-angle cone at 20" angle of The grid used for this calculation contained 61 x 81 points in the crossflow plane as illustrated in Figure 6. This flowfield contains a smng bow shock. a large amount of crossflow due to the high angle of attack, and a crossflow shock on the lee side of the cone. All of these features wn be seen in Figure 7, which is a plot of computed pressure contours on a crossflow plane at the rear of the cone. The solid contour lines are boom the

PNS solution while the circles show the shock locations from the experiment All of the shocks, including the bow shock, were captured, and the agreement between the shock locations is good Figure 8 shows experimental and computed surface pressures at the same location. The angle, phi, shown in this figure is 0 at the windward centerline of the cone. Figure 9 shows velocity vectors on the leeside of the cone, indicating the vortical flow captured by the numerical scheme. The large viscous region on the leeside of the cone is shown in Figure 10. This calculation took an average of 128 seconds per axial station on a CONVEX C-240.

cooclusloos

A GMRESMewton iteration scheme has been incorporated into a space-marching Navier-Stokes flow solver. and the resulting algorithm is robust and efficient The axial stepsize does not affect the stability of the scheme, so quite large stepsizes may be used to reduce computation times. The scheme includes an automatic method for underrelaxing the Newton iteration update step which improves its robustness.

The disretization of the PNS equations used is able to capture strong shocks and resolve complex flowfield features without requiring the user adjustment of smoothing parameters or other code input. The finite- volume scheme combined with flux vector splitting ensures proper flow quantity conservation.

The basic goal of this research is to reduce the cost of obtaining high resolution CFD solutions for hypersonic flows. The present technique is a step rowards that goal, and it is now possible to obtain a solution that satisfies a non-linear discrete conservation law for close to the same cost as a naditional PNS solution with the same crossflow plane resolution.

REFERENCES

1. R.W. Newsome, R.W. Walters, and JL. Thomas, "An Efficient Iteration Strategy for Upwind/Relaxation Solutions to the Thin-Layer Navier-Stokes Equations," A I M Paper 87-1 113CP. Honolulu. HI, 1987

2.D.K. Ota, S.R. Chaloavanhy, and J.C. Darling. "An Equilibrium Air Navier-Stokes Code for Hypersonic Flow," AlAA Paper 88-0419. Reno, NV, 1988.

3.D.S. Thompson and RJ . Matus, "Conservation E m and Convergence Charactenistics of Iterative Space-Marching Algorithms," ALL4 Paper 89- 1965CP. Buffalo, NY, 1989.

5

\.,4. A. Himansu, P.K. Khosla, S.G. Rubin. "RelaxatiodSparse Manix Solver for Three- Dimensional Recirculating Flows," AIAA 89-0552, Reno, NV, 1989.

S.R. Cohen, P.K. Khmla, "Tluee-dimensional Reduced Navier-Stokes Solution for Subsonic Separated and Nonseparated Flows Using GloM Pressure Relaxation," International Journal for Numerical Methods in Fluids, vol 9, pp 1087-1098, 1989.

6. E.E. Bender and P.K. Khosla. "Application of Sparse Mamx Solvers and Newton's Method to Fluid Flow Problems," AIAA Paper 88-3700. Cincinnati, OH, 1988.

7. V. Venkatakrishnan and TJ . Banh. "Application of Direct Solvers to Unshuctured Meshes for the Euler and Navier Stokes Equations Using Upwind Schemes," AIAA Paper 89-0364, Reno, NV, 1989.

8.C.P. van Dam, M. Hafez. and J. Ahmad, "Calculation of Viscous Flows with Separation using Newton's Method and Direct Solver," A M Paper 88-0412, Reno, NV, 1988.

10. Y. Saad and M.H. Schulw, "GMRES: A Generalized Minimal Residual Algorithm for Solving Nonsymmemc Linear Systems," SIAM J. Sci. Stat. Cornput.. Vol. 7, NO. 3, July 1986, pp 856869.

11. L.B. Wigton, N.J. Yu, and D.P. Young, "GMRES Acceleration of Computational Fluid Dynamics Codes," AIAA Paper 85-1494, Cincinnati, OH, 1985.

12. V. Venkatakns ' hnan. "Preconditioned conjugate gradient methods for the Compressible Navier- Stokes Equations," AIAA 90-0586, Reno, N V , 1990

13. Y. Liu and M. Vinokur, '* Equilibrium Air Gas Flow Computations I. Accurate and Efficient Calculation of Equilibrium Gas F'ropedes," AIAA Paper 89- 1736, Buffalo, NY, 1989.

14. Vigneron. Y.C., Rakich, J.V. and Tannehill, J.C.. "Calculation of Supersonic Viscous Flow over Delta Wings with Sharp Subsonic Leading Edges," AIAA Paper 78-1 137, Seattle. WA, 1978.

15.B. Van Leer, JL. Thomas, PL. Roe. and R.W. Newsome, " A Comparison of Numerical Flux Formulas for the Euler and Navier-Stokes Equations," AIAA Paper 87-1104, Honolulu, HI, 1987.

16. PL. Roe. "Approximate Riemann Solvers, Parameter Vectors, and Differencing Schemes," J. of Comp. Phys. Vol. 43.1981, pp 357-372

17. S. R. Chabavanhy and S. Osher, '"A New Class of High Accuracy W D Schemes for Hyperbolic Conservation Laws," AIAA Paper 854363, Reno, Nevada, 1985.

18. D.S. Thompson, "A Zonal Method for Extending the Applicability of the PNS Equations," UTA CFD Report 89-05, University of Texas at Arlington, 1989.

19. D.S. Ihompson, Personal communicorwn, January.

20.M.S. Holden and JR. Moselle, "Theoretical and Expimental Studies of the Shock Wave-Boundary Layer Interaction on Compression Surfaces in Hypersonmic Flow," ARL 70M)2, Cornel1 Aeronautical Laboraunies. 1970.

21. D.H. Rudy, J.L. Thomas, A. Kumar. P.A. Gnoffo. and S.R. Chakravanhy, " A Validation Study of Four Navier-Stokes Codes for High Speed Flows," AIAA Paper 89-1838.1989.

22. R.R. Tracy. "Hypersonic Flow Over a Yawed Cone," GALClT M e m m d u m No. 69. California Institute of Technology, 1963.

1990.

0.001

E L 0 . D O O f 0 Z - o 1.OE-05 3 Q

ln -

1.OE-06 K

1 .OE-07 1 . 2 . 3 . 4 . 5 . '

GMRES c y c l e #

Figure 1. Typical convergence history for GMRES scheme

6

igureZ Pressure contours for Mach 14.1, 15 compression corner

Figure3. Mach contours for Mach 14.1, compression corner

0 . 2 - PNS

0 ,15

0. I CP 0.06

0.

-0.05 0, 0.6 1 . 1.6 2. 2.6 3 . 3.6

X , f t igure4. Surface pressure for Mach 14.1, 15”

compression corner

0.007

0.006

0 ~ 005

0.004

0 ~ 003 r V

0.002

0.001

0.

- PNS 0 0 E x p s r l n w n t

0

0.5 1 . 1 . 5 2. 2 . 6 X , f t

igure5. Surface heat transfer for Mach 14.1, 15’ compression corner

1

igure 6. Crossflow plane grid for Mach 8 , 2 0 0 a ccne

0.70

0 . 5 0

0.30

0.20

-0.10

-0. JO -0 -0 .25 0 . 0 0 0 . 2 5

1 Figure 7. Pressure contom for Mach 8 . 2 0 ' ~ cone

0 . E

0 - 4

0.3

0.2

0.1

0 .

-0.1

CP

- PNS 0 0 E x p e r

50. 100. 150. 200 0. P h i , D e g

igure 8. Surface pressure for Mach 8 , 2 V a cone

Figure9. Leeside velocity vectors for Mach 8 , 2 V a cone

8

Figure 10. Viscous layer for Mach 8,Wa cone

9