Diagram Design and Analysis of Aerodynamics Problems With Mathematica
Diagram Design and Analysis of Aerodynamics Problems With Mathematica
Diagram Design and Analysis of Aerodynamics Problems With Mathematica
Selcuk Journal of
Vol. 1, No. 1, pp. 21{46, 2000 Applied Mathematics
1. Introduction
The increase in the eciency of using the computers at the numerical
simulation of various uid ows is the central problem of computa-
tional uid dynamics (CFD). There are several ways to increase this
eciency.
Correspondence to : Dr. Victor G. Ganzha, Fax: +49/ 89 289 22022
22 V.G.Ganzha and E.V. Vorozhtsov
?
Euler
equations
2D Euler 3D Euler
? Navier{Stokes
equations
Parabolized
Navier{Stokes equations
Complete compressible
Navier{Stokes equations
Discretization
methods
;;
? @@R
Finite Finite Finite
dierence volume element
methods methods methods
@@
R ? ;;
Approximation investigation
?
Stability investigation
Spatial grids
? @@
Logically
rectangular
@R
Triangular
P
grids
) ? PPPPq
grids
;; @@R
Single- Multi- Solution- Unstruct-
Structured
block block adaptive ured
grids
grids grids grids grids
Visualization
? HHHj
Isolines Solution Integral
proles functionals
3. Analytic tests
One of the important constituent parts of the development of a CFD
program package is the debugging and validation of new comput-
er codes. The validation problem is often solved by comparing the
numerical solutions with some particular analytic solutions. The self-
similar solutions can often be reduced to ordinary dierential equa-
tions (ODEs). The analytic solutions of many ODE classes can be
obtained successfully with Mathematica 19{21,1].
In the case of relatively simple test problems involving the par-
tial dierential equations, the analytic solutions can also be obtained
with Mathematica 21]. The group methods implemented in CAS en-
vironment enable one to obtain the particular solutions of much more
complex equations, such as the Navier{Stokes equations 2].
4. Discretization
The construction of the discretizations of the governing partial dif-
ferential equations mentioned in Fig. 1 can be implemented by the
method of indeterminate coecients with the aid of CAS Mathemat-
ica 5].
After a numerical discretization scheme has been constructed, it
is necessary to investigate its approximation and stability properties.
In the next two subsections, we show how these two tasks can be
implemented with CAS Mathematica 4.0.
j k +1
3
q
;1 4
j k
q
2 q
j k
j + 1 k
1
q
j k ;1
Fig. 5. The centered scheme
Let us take an arbitrary cell of curvilinear grid (Fig. 5). Let the
values of w at the cell center be denoted by wjk , and let ;jk and Vjk
be the cell contour and the control volume bounded by contour ;jk .
The Euler equations (1) can be written in integral form for the region
Vjk with boundary ;jk as
@ ZZ I
(4) @t Vjkw dx dy + ;jk(f dy ; g dx) = 0:
In the result of discretization of (4) we can obtain the semi-discrete
equation 9]
(5) d (A w) + Qw = 0
dt jk
28 V.G.Ganzha and E.V. Vorozhtsov
where Ajk is the cell area, and the operator Q represents an approx-
imation to the boundary integral dened by the second term of (4).
For example, the ux balance for the x momentum component is
represented in (5) as
(6) @ (A u) + X4
(Qk uk + yk pk ) = 0
@t jk k=1
where the ux velocity
(7) Qk = yk uk ; xk vk
and the sum in (6) is over four sides of the cell, see Fig. 5. The values
xk and yk in (6) and (7) are the increments of x and y along side
k of the cell, with appropriate signs. Each quantity in (6) and (7)
such as u2 or (u)2 is evaluated as the average of the values in the
cells on the two sides of the face,
(8) (u)2 = 21 (u)jk + (u)j +1k ]:
The scheme (6){(8) reduces to a central dierence scheme on a
Cartesian grid, therefore, it is second order accurate in space. As
is known, the second-order schemes produce spurious oscillations of
the numerical solution at the shock wave fronts and in their vicinity.
In this connection it was proposed in 10] to introduce the articial
dissipation terms in the nite volume scheme in order to damp the
spurious oscillations. These terms are added to (5) as follows:
(9) dw + (Qw=A ) ; Dw = 0
dt jk
where D is a dissipative operator the structure of which is similar for
each of the four dependent variables:
(10) Dwjk = Dxwjk + Dy wjk
where
(d ;d )
(11) Dxwjk = j+1=2kA j;1=2k
jk
(djk+1=2 ; djk;1=2)
(12) Dy wjk = Ajk
and
Analysis of Aerodynamics Problems with Mathematica 29
; "(4)
j +1=2k (wj +2k ; 3wj +1k + 3wjk ; wj ;1k )]
Here Fx , y ] = f (w(x y )), (xc, yc) is the user specied center of the
Taylor series expansion,
Fx = @f (w(x y ))=@x Fxxy = @ 3 f (w(x y ))=@ 2x@y
etc. In the particular case of an uniform rectangular spatial grid the
Taylor expansion gives the second order of approximation. But in
the case of a general logically rectangular curvilinear grid, the ap-
proximation order reduces to the rst order. The corresponding ap-
proximation error is presented in 5] for the approximation of the
x-derivative we will not reproduce it here because of its bulky form.
The expression for this error involves the derivatives @ 2f (w)=@x2,
@ 2f (w)=@x@y, and @ 2f (w)=@y2.
cial dissipator:
"2x = "(2)
j 1=2k = const "4x = "j 1=2k = const
(4)
(26)
"2y = "(2)
jk1=2 = const "4y = "jk1=2 = const:
(4)
p
where c is the sound speed, c = p= for a perfect gas. The entries
of matrix G can be eciently expressed in terms of the parameters
36 V.G.Ganzha and E.V. Vorozhtsov
1 + R2 (tm ") m
(30) 8 0
< m =
sin m = : 2R(tm ") 6=
1 + R2 (tm ") m
where R(tm ") =RationalizeNtm 10;(e+1) ], "], m = 1 2 and
tm = tan(m =2) " = 10;(e+1) , e 0, is the user-specied accura-
cy with which the built-in Mathematica function Rationalize...]
converts a oating-point number tm into a rational number. It is
important that the calculation of cos m and sin m by (30) always
ensures the satisfaction of the relation cos2 m + sin2 m = 1.
The values of nondimensional parameters (26) and (27) were al-
so computed in (19) as the rational numbers. As a result, the co-
ecients cj of equation (19) are exact for any complex numerical
method. Therefore, we can compute the zeroes of (19) exactly, be-
cause the Mathematica function Solve...] implements the exact
solution formulas at m = 4.
For the verication of the above symbolic/numeric method we
have used the analytic solution 6] for the necessary stability condi-
tion of the linearized Runge{Kutta scheme, which can be obtained
from (23) in the particular case where d3 = 0, i.e., "2x = "4x = "2y =
"4y = 0:
(31) j2j + j24j + j36j + j35j
+ (j1j + j14 j)2 + (j16 j + j1 5 j)2]0:5 f (
1
2)
38 V.G.Ganzha and E.V. Vorozhtsov
where
2 0:5 0:5
(32) f (
1
2) =
1 2
1 ;
2 + (
2(2
2 ; 4
1 + 8
1)) :
1 2
1 1
0.8 0.8
0.6 0.6
0.4 0.4
0.2 0.2
0.5 1 1.5 2 2.5 3 0.5 1 1.5 2 2.5 3
4
4
2
2
2 4 6 8
2 4 6 8
-2
-2
-4
-4
(a) the grid obtained by multi-surface (b) the grid obtained by the method
method 3] of 15]
Fig. 7. The curvilinear C-type grids of 65 15 nodes around the NACA 0012
airfoil
6. Visualization
Owing to the availability of numerous powerful and versatile comput-
er graphics functions, the Mathematica user cn display graphically
any one-dimensional plots, isolines, and surfaces obtained as a result
of numerical simulation of a uid dynamics problem.
In Fig. 8 we present the computational results obtained on the
curvilinear grid of Fig. 6, (b). As a criterion for the numerical solu-
tion convergence to a stationary limit we have checked the inequality
42 V.G.Ganzha and E.V. Vorozhtsov
2 M
1
0.8 1.8
0.6
0.4 1.6
0.2
1.4
0.5 1 1.5 2 2.5 3
1.2 x
0.5 1 1.5 2 2.5 3
(a) predicted Mach number contours (b) predicted Mach number proles
along lower wall (solid line) and up-
per wall (dashed line)
-1 Log10(Rn )
-2
-3
-4
n
-5
0 100 200 300 400
0 -0.2-0.4-0.6-0.8
Cp
Log10 Rn
1
0
-1
-2
-3
-40 n
200 400 600 800
(a) the distributions of the pressure (b) convergence history
coecient Cp along the upper (|-)
and lower ( ) airfoil surfaces
0.0004
0.0003
0.0002 60
0.0001
0 40
5 20
10
(c) the Mach number contours (d) the surface j(njk ; njk;1 )=jk
n;1 j,
n = 800
Fig. 9. The computational results for the problem of transonic ow around the
airfoil NACA 0012 at M1 = 0:80 and zero angle of attack
7. Conclusions
We have shown above that the current general-purpose CASs may
be used as the basis for the development of big program packages
intended for a rapid solution of multi-dimensional uid dynamics
problems. The incorporation of the ideas and principles of the object-
oriented programming should result in more reliable and exible pro-
gram packages. This work needs further big eorts and is now in
progress. The purpose of the present paper was to outline a number
of the directions toward the solution of the problem of the develop-
ment of such a exible OOP based package within the framework of
a general-purpose CAS.
A further objective would be the incorporation of some elements of
the expert systems and articial intelligence to automatically choose
the best methods for numerical grid generation and subsequent nu-
merical solution of a specic ow problem.
References
1. G. Baumann (1999): Symmetry Analysis of Dierential Equations Using
Mathematica, Springer-Verlag, New York.
2. V.V. Bublik (2000, in press): Group classication of the Navier{Stokes
equations for compressible viscous heat-conducting gas, in: Computer Al-
gebra in Scientic Computing / CASC'00, V.G.Ganzha, E.W.Mayr and
E.V.Vorozhtsov (Eds.), Springer-Verlag, Berlin.
3. P.R. Eiseman (1979): A multi-surfce method of coordinate generation,
J. Comput. Phys. 33, 118{150.
4. C.A.J. Fletcher (1996): Computational Techniques for Fluid Dynamics, Vols.
I, II, 3rd Edition, Springer-Verlag, Berlin, Heidelberg, New York.
Analysis of Aerodynamics Problems with Mathematica 45
5. V.G. Ganzha and E.V. Vorozhtsov (1996): Numerical Solutions for Partial
Dierential Equations: Problem Solving Using Mathematica, CRC Press, Boca
Raton, New York, London.
6. V.G. Ganzha and E.V. Vorozhtsov (1996): Computer-Aided Analysis of
Dierence Schemes for Partial Dierential Equations, Wiley-Interscience,
New York.
7. V.G. Ganzha and E.V. Vorozhtsov (1999): Application of computer algebra
systems for stability analysi of dierence schemes on curvilinear grids, J. Sym-
bolic Computation 28, 401{433.
8. V.G. Ganzha, E.V. Vorozhtsov, and M. Wester (2000, in press): An assessment
of the eciency of computer algebra systems in the solution of scientic com-
puting problems, in: Computer Algebra in Scientic Computing / CASC'00,
V.G.Ganzha, E.W.Mayr and E.V.Vorozhtsov (Eds.), Springer-Verlag, Berlin.
9. A. Jameson and W. Schmidt (1985): Some recent developments in numerical
methods for transonic ows, Computer Methods in Applied Mechanics and
Engineering 51, 467-493.
10. A. Jameson, W. Schmidt, and E. Turkel (1981): Numerical solution of the
Euler equations by nite volume methods Using Runge Kutta time stepping
schemes, AIAA Paper 81-1259.
11. P. Knupp and S. Steinberg (1994): Fundamentals of Grid Generation, CRC
Press, Boca Raton, Ann Arbor.
12. R. Liska and L. Drska (1990): FIDE: A REDUCE package for automation of
nite dierence method for solving PDE, in: Proc. Int. Symp. on Symbolic
and Algebraic Computation, ISSAC'90, August 20{24, 1990, Tokyo, Japan,
Eds. S. Watanabe and M. Nagata, ACM Press, New York, 169{176.
13. R. Maeder (1991): Programming in Mathematica, 2nd Edition, New York,
Addison-Wesley.
14. R.D. Richtmyer and K.W. Morton (1967): Dierence Methods for Initial-
Value Problems, 2nd Edition, Wiley-Interscience, New York.
15. A. Rizzi (1981): Computational mesh for transonic airfoils, in: Numerical
Methods for the Computation of Inviscid Transonic Flows with Shock Waves,
A GAMM Workshop, Eds. A. Rizzi and H. Viviand, Vieweg, Braunschweig,
222{263.
16. P.J. Roache (1976): Computational Fluid Dynamics, Hermosa, Albuquerque.
17. S. Steinberg and P. Roache (1993): Finite-dierence algorithm design and
automatic code generation, in: Computer Algebra and Its Applications to
Mechanics, CAAM'90. Proc. Int. Seminar, Novosibirsk, August 28{31, 1990
Irkutsk, September 1{3, 1990, Eds. V.G. Ganzha, V.M. Rudenko and E.V. Vo-
rozhtsov, Nova Science Publishers, Inc., New York, 15{29.
18. S. Steinberg, R.L. Akers, E. Kant, C.J. Randall, and R.L. Young (1997):
SciNapse: A problem-solving environment for partial dierential equations,
IEEE Computational Science an Engineering 4, 32{42.
19. W. Strampp and V.G. Ganzha (1995): Dierentialgleichungen mit Mathemat-
ica, Braunschweig, Vieweg.
20. W. Strampp, V.G. Ganzha, and E.V. Vorozhtsov (1997): Hohere Mathematik
mit Mathematica. Band 3: Dierentialgleichungen und Numerik, Braun-
schweig, Vieweg.
21. W. Strampp, V.G. Ganzha, and E.V. Vorozhtsov (1997): Hohere Mathematik
mit Mathematica. Band 4: Funktionentheorie, Fourier- und Laplacetransfor-
mationen, Braunschweig, Vieweg.
46 V.G.Ganzha and E.V. Vorozhtsov
22. S. Wolfram (1999): The Mathematica Book, 4th Edition, Cambridge Univer-
sity Press, Cambridge, UK
New York.