High Accuracy Non-Centered Compact Difference Schemes For Fluid Dynamics Applications
This page is intentionally left ...
6 downloads
452 Views
36MB Size
Report
This content was uploaded by our users and we assume good faith they have the permission to share this book. If you own the copyright to this book and it is wrongfully on our website, we offer a simple DMCA procedure to remove your content from our site. Start by pressing the button below!
Report copyright / DMCA form
High Accuracy Non-Centered Compact Difference Schemes For Fluid Dynamics Applications
This page is intentionally left blank
Series on Advances in Mathematics for Applied Sciences - Vol. 21
High Accuracy Non-Centered Compact Difference Schemes For Fluid Dynamics Applications
Andrei I. Tolstykh Computing Center Russian Academy of Sciences
World Scientific VW
Singapore • New Jersey • London • Hong Kong
Published by World Scientific Publishing Co. Pie. Lid. P O Box 128, Fairer Road, Singapore 9128 USA office: Suite IB, 1060 Main Street, River Edge, NJ 07661 UK office: 73 Lynton Mead, Totteridge. London N20 SDH
Library of Congress Cataloging-in-Publication Data Tolstykh, A t High accuracy non-centered compact difference schemes for fluid dynamics applications / Andrei I. Tolstykh. p. cm. - (Series on advances in mathematics for applied sciences ; vol. 21) Includes bibliographical references and index. ISBN 9310216688 I. Fluid dynamics--Mathematical models. I . Title. II. Series. QA911.T645 1994 532'.001 515625--dc20 93-46369 CfP
Copyright © 1994 by World Scientific Publishing Co. Pte. Ltd. All rights reserved. This book, or pans thereof, may not be reproduced in any form or by any means, electronic or mechanical, including photocopying, recordingor any information storage and retrieval system now known or to be invented, without written permission from the Publisher.
For photocopying of material in this volume, please pay a copying fee through the Copyright Clearance Center, Inc.,27 Congress Street, Salem, MA 01970, USA.
Printed in Singapore by Utopia Press.
Acknowledgments
I would like to pay tribute to A. A. Dorodnitsyn and my other teachers, who have introduced me to the beauty of fluid dynamics and encouraged me to go into the area of the relevant numerical methods. I would like to acknowledge the impact made by my colleagues and postgraduate students on the promotion and the realization of the ideas described in this book. In particular, I would like to thank Dr. A. P. Byrkin and Dr. A. I . Savel'yev who have performed large-scale computations using compact non-centered methods. I am grateful to Dr. K. S. Ravichandran from NAL, Bangalore, India, for his fruitful contribution to the studies relevant to the subject matter of this book. I am extremely grateful to my son, Dr. Mikhail A. Tolstykh, whose help was of inestimable value in preparing this book. Being engaged in an atmosphere numerical modelling, he also used and developed the non-centered compact methods in numerical simulation. Section 8.4 of this book has been written by him.
This page is intentionally left blank
Contents
0 Introduction
1
1
0.1
History
1
0.2
Motivations. High accuracy methods
0.3
High-order schemes . .
.
. . . .
2 6
Third-order schemes w i t h compact upwind differencing
15
1.1
Third-order compact differencing and corresponding schemes
15
1.1.1
Derivation of compact differencing formulas
15
1.1.2
Compact third-order schemes
1.2
.
. 1 7
Compact schemes as approximations of conservation laws . . . .
20
1.2.1
Equations of balance . . . .
20
1.2.2
Conservation property in the case of sonic points
. . ,
. . . .
21
1.3
Dispersion and dissipation properties of CUD-3 operators
23
1.4
Difference equations
25
1.5
1.6
1.4.1
Analysis of conditioning
1.4.2
Solution procedures
.25 28
CUD-3 with different time discretizations
29
1.5.1
Three-level schemes
29
1.5.2
Explicit forms of third-order compact schemes . 3
3
Two-level 0(T + k ) scheme
. . 32 33
vii
viii
CONTENTS 1.6.1
Derivation of two-level scheme
33
1.6.2
Estimates of stability, dissipation and dispersion
35
2 Some extensions of basic ideas 2.1
Generalizations of the CUD-3 operators
38
2.2
Applications to discontinuous solutions
41
2.2.1
Comparison of non-conservative and conservative forms .
. 41
2.2.2
Entropy-consistent forms
43
2.2.3
CUD-3 schemes with flux correction
45
2.2.4
Steady-state computations: comparisons with first- and secondorder schemes - - 48
2.3
Discretization of equations in non-divergent forms
50
2.4
Another form of third-order compact upwind differencing (CUD-H-3)
52
2.4.1
Difference operators
52
2.4.2
Some properties of CUD-11-3
54
2.4.3
Conservative forms
55
2.4.4
Some comments on CUD-II-3 schemes . . . .
58
2.4.5
Flux-splitted forms of third-order CUD
59
2.5
2.6 3
38
Symmetrization of the CUD-3 operators . . . . 2.5.1
Fourth-order compact approximations
2.5.2
CUD-3 with MacCormack-type time stepping
Third-order compact differencing as discretized Pade approximants
61 . . 61 62 . 64
Fifth-order non-centered compact schemes
66
3.1
Fifth-order compact upwind differencing
66
3.1.1
69
3.2
Properties of CUD-5 operators
Other forms of compact upwind differencings (CUD-I1-5)
72
CONTENTS
3.3
ix
3.2.1
Using Pade approximants
72
3.2.2
Families of compact differencing operators
77
3.2.3
Positivity, dispersion and dissipation
79
3.2.4
Conservation laws treatment
82
Fifth-order compact schemes for scalar conservation laws .
86
3.3.1
Explicit schemes. Numerical example: unsteady discontinuous solutions of the Burgers equation .86
3.3.2
Implicit schemes
89
3.4
Steady-state algorithms
91
3.5
Compact upwind differencing of arbitrary n-th order
95
3.5.1
Method of attack
95
3.5.2
Examples; 5-th and 7-th order compact upwind differencing without degrees of freedom
98
4 Hyperbolic systems 4.1
4.2
101
CUD-3 schemes for vector conservation laws
101
4.1.1
Matrix-difference operators obtained via diagonalization
4.1.2
Analysis of non-conservative and conservative forms
104
4.1.3
First-order upwind schemes as the generators of generalized CUD-3 for vector conservation laws
107
4.1.4
Difference equations
108
4.1.5
Non-divergent systems of equations
110
Stability analysis
. . .101
.
..110
4.2.1
Matrix-difference operators
110
4.2.2
Stability in energetic norms
114
4.3
Extensions to other forms of CUD
116
4.4
Flux-splitted forms of CUD
118
CONTENTS
x
4.5
Application to Riemann problem
'20
5 Compact upwind schemes for convection-diffusion equations 5.1
5.2
5.3
5.4
5.5
5.6
124
Discretization of diffusive terms
• 124
5.1.1
General considerations
- •
5.1.2
Schemes with tridiagonal matrices
5.1.3
Schemes with block-tridiagonal matrices . . .
5.1.4
Factored schemes
...
•
. . . .
Difference equations
- 126
.
- •
. .
128 130
•
• • . .
'24
5.2.1
Analysis of conditioning
. --
5.2.2
Boundary conditions
5.2.3
Steady-state solutions. Cell Reynolds number . . . .
...
'31 • 131 '36
. . . 138
Examples of computations for small diffusion coefficients . . .
139
5.3.1
Third-order scheme with adaptive grid
139
5.3.2
Comparison of third- and fifth-order compact schemes with low-order methods . . . . 145
Centered compact schemes for convection-diffusion equations
148
5.4.1
Using Hermite formulas
148
5.4.2
Cubic spline approximations. OCI methods
149
5.4.3
General forms of n th order centered compact approximations 151
5.4.4
Cell Reynolds number limitations
. . 152
Compact schemes for systems of equations with diffusive terms . . . . 154 5.5.1
Approximating operators. Three-point schemes
154
5.5.2
Using conjugate operators
156
Schemes with simplified implicit operators 5.6.1
Structure of the schemes . . .
5.6.2
Analysis for CUD-3 approximation
157 . 157 159
CONTENTS
xi
5.6.3
Schemes with factored operators
162
5.6.4
Comments on general approach
163
6 Multidimensional problems 6.1
6.2
6.3
6.4
165
Implicit two-level schemes
165
6.1.1
Multidimensional approximations
165
6.1.2
Stability estimates
169
6.1.3
Systems with diffusion terms
170
Approximate factorization
173
6.2.1
Structure of CUD-3 factored schemes . .
173
6.2.2
Stability estimates
176
6.2.3
Compact factored schemes in convection-diffusion problems . . 178
6.2.4
Advantages and drawbacks of factored schemes
180
An unconditionally stable method with factored operators 6.3.1
Description of method in a general form
6.3.2
Application to compact approximations
. . . 181 181 ...
Unfactored CUD schemes
190
6.4.1
Time-stepping schemes
190
6.4.2
Defect correction approach: general considerations
192
6.4.3
Defect correction approach: one-dimensional analysis
195
6.4.4
Application of one-dimensional analysis
201
7 Compressible gas flows described by Navier-Stokes equations 7.1
. 188
General formulations
205 . 206
7.1.1
Forms of the governing equations
206
7.1.2
Comments on high-order discretizations in the case of curvilinear coordinates
209
xii
CONTENTS 7.1.3 7.2
7.3
7.4
8
Stretching transformations
210
CUD-3 algorithms with adaptive grids
212
7.2.1
Outline of method
2 1 2
7.2.2
Sample calculations
214
Factored schemes for viscous gas flow computations
221
7.3.1
Factored schemes with CUD-3
221
7.3.2
Factored schemes with centered fourth-order compact approximations
224
7.3.3
Sample computations: external separated
226
7.3.4
Sample computations: internal
flows flows
Marching algorithms 7.4.1
Outlines of numerical method
7.4.2
Numerical examples
• • 231 • • 239 • - -241 244
Applications to incompressible flow problems
247
8.1
Schemes based on vorticity formulation
248
8.1.1
Algorithms with CUD-3
248
8.1.2
Numerical examples
251
8.1.3
Algorithm with CUD-5 and its application to unsteady flow about the cylinder . . 255
8.1.4
Fast method for reconstructing velocity for known vorticity in 3-D case
8.2
8.3
...
260
Compact upwind methods with pressure correction . . .
268
8.2.1
Outlines of algorithms
268
8.2.2
Application of compact approximations
271
8.2.3
Stability estimates
274
CUD schemes for steady-state solutions
276
CONTENTS
8.4
xiii
8.3.1
Schemes based on artificial compressibility .
276
8.3.2
Marching algorithms
278
Fifth-order compact approximations in atmosphere modelling
280
8.4.1
Tests with model equations
281
8.4.2
Application to moisture transport in climate modelling .
. . 285
A Solution-dependent coordinates for grid generation
289
B Some relevant mathematical topics
293
B.l
Comments on approximation and stability
.
293
B.2 Spectral method for stability analysis
294
B.3 Method of operator inequalities
297
Bibliography
301
Index
312
Chapter 0 Introduction
0.1
History
The ideas which were developed to form the building stone of this book were first suggested by the author as early as in 1972. These ideas arose while solving some problems associated with high-altitude motion of bodies. The starting point was the slightly rarefied hypersonic flow around blunted configurations. The first attempt of numerical treatment of this problem was undertaken by the author in the midsixties when he was a postgraduate student of the Moscow Institute of Physics and Technology. As a result, the simplified Navier-Stokes equations were proposed (to the author's best knowledge, it was for the first time when they were used) supplemented by the numerical scheme to solve them [107). Two basic approaches were incorporated in this scheme which was of integral relation type (i) stretching the near-surface flow region automatically in the process of solving algebraic equations; (ii) using high-order polynomials for the discretization of the differential equations written in the divergent form. The findings of an investigation into the blunt body problem impelled the author to undertake further researches. As a result, the new technique was developed which consisted of two basic parts similar to (i) and (ii). The first part was the adaptive grid 1
Introduction
2
generation technique based on the solution-dependent coordinates transformations. The second one was the third-order upwind type implicit schemes for which only three grid points were needed in each spatial direction (the so called compact upwind schemes). Though adaptive grids were used by the author for solving several CFD problems [109], [111] in the subsequent years, the main attention was paid to the further development of the third-order schemes. Many versions of these schemes were investigated. In parallel to the theoretical efforts, a large body of numerical experiments for different fluid dynamics problems described by Navier-Stokes equations was carried out. In addition to compressible flows, incompressible flows were considered using stream function - vorticity and primitive variables formulations. Turbulent flows described by many-equations semi-empirical models, stratified flows and cinematic of surface waves may also be mentioned as the cases when third-order compact schemes were used. The main results which cover the period up to 1985-1986 were summarized in the monograph [118]. Some of them were included in the teaching course for the undergraduate and postgraduate students of the Moscow Institute of Physics and Technology. In recent years some new results were obtained. In particular, the new families of third order as well as fifth-order compact upwind schemes have been discovered and successfully used. Deeper insight into the theoretical ground of the variety of non-centered compact discretizations was achieved by considering them as finitedifference forms of Pade approximants. The defect correction type of methods was elaborated for steady-state problems. At present, the information on the subject of this book is by no means complete. There are possibilities of further investigations and findings in this area. However, it is the author's opinion that the systematic treatment of compact upwind approximations is up to date. This work aims at reaching this target.
0.2
Motivations. High accuracy methods
As has been mentioned, the target problems while designing third-order compact schemes were viscous flows described by Navier-Stokes equations. In general, rather complicated flows produce in many cases sufficiently hard requirements to numerical
0.2. Motivations. High accuracy methods
3
techniques for their solving. These requirements served as main motivation for the development of numerical techniques at the earlier stages and may be summarized as follows. (i) If time stepping or iterations are used then a numerical scheme should admit sufficiently small mesh sizes without any loss of stability. Hence implicit schemes are preferable. (ii) The process of solving difference equations arising when implicit schemes are used should not be too costly. Therefore, the algorithms for the realization of which reduces to inverting tridiagonal matrices are highly desirable. (hi) The spurious oscillations which often accompany numerical solutions near the steep gradient regions should not spoil these solutions. In other words, the scheme should be sufficiently monotonous. (iv) The approximation order of convective terms should be high enough to provide high accuracy sophisticated algorithm. All these requirements were met by the non-symmetric compact schemes described in [107], [114], [110]. Indeed, they were implicit and used three-point stencil in each spatial direction. They behaved quite satisfactory in the presence of steep gradients of solution variables. Besides, they were third-order schemes which were able to provide very accurate results. It turned out that the schemes with compact approximations do not practically require additional computational efforts in onedimensional case as compared to conventional three-point implicit schemes. This was the reason why they were incorporated in the algorithms for the realization of which reduces to inverting one-dimensional operators (for example, as parts of approximate factorization methods). However, there are many other possibilities of using compact approximations. For example, they may be included in the unsteady algorithms with Runge-Kutta time stepping. Another example is defect correction type methods, where the action of the operators with compact approximation should be computed instead of their inversion. The above reasoning shows that the requirements (i), (ii) should be partly modified if all the variety of compact schemes is considered. Nevertheless, the compactness of stencil remains their important property. Its advantages not listed in (ii) are the simplicity of treating near-boundary points and relatively small number
4
Introduction
of spurious solutions of difference equations. It will also be shown that constant coefficients in the truncation errors for compact discretizations may be two orders of magnitude smaller as compared to the conventional many points formulas for the first derivative. Hence more accurate results may be expected when using such discretizations. At this point it is expedient to discuss the relation between high-order schemes and high accuracy solutions. In order to do so, let us remind of the definitions of approximation and stability in the form given in [43]. Consider an abstract problem t« = /,
u€U,
f£F,
(0.1)
L : V —• F, where u and / are unknown and given functions respectively, U and F are some linear spaces. Consider also the difference analogue of Eq. 0.1 Uu
k
= //,,
u g U, h
h IE F ,
K
(0.2)
h
where Lh and F are linear spaces the elements of which u/, and are grid function defined on the mesh Wh with mesh size h (in general, the grid functions u and / may be defined on different meshes). h
h
The difference scheme Eq. 0.2 is said to be the approximation of Eq. 0.1 with the order of approximation k if ||4[«fe-/4ft f for which C = C ' ' and C = C respectively. It may occur that for fixed h C ti < C h (0.7) k
1
m
m
2
h
2
due to C7' ' 3> (?'''. Such a situation is typical for the case of exponential behavior of the solution u (for example, in the thin viscous layers described by Navier-Stokes equations). The above reasoning shows that high-order scheme will really be a high accuracy scheme if the constant C would not increase significantly with k. It will be so if absolute values of the solution derivatives will not dramatically grow when increasing their order. The simple way to make these derivatives be bounded by some reasonable constant is to introduce suitable coordinate transformation. This transformation should "stretch" the regions with steep gradients like boundary or other viscous layers. One may then hope that if k is thought of as mesh size of some uniform mesh for transformed coordinates then the inequality Eq. 0.7 has the opposite sign. Alternatively, one may consider the uniform mesh for the transformed coordinates as a way to condense grid points in the steep gradients regions. Then the local values of h in the physical plane may be so small that in spite of large values of C the inequality Eq. 0,7 holds with opposite sign. Thinking about stretching transformation as an important part of high accuracy algorithm, we will always suppose that the proper coordinate transformation has
Introduction
6
been performed so that the uniform mesh in the computational plane provides high accuracy when high-order schemes are used. In the case of viscous flows, the transformations which stretch viscous layers (boundary layers, shocks etc.) may be constructed by making use of some information about these regions. For example, if we know approximately the thickness of boundary layer, it is not often difficult to introduce some fixed function which maps this boundary layer onto the subregion of computational domain with desired thickness. The variety of approaches to grid generation techniques with the desired condensing of grid points is described in the excellent survey [105] (see also [106]). In the computational practice one may come across the situation when localization and sizes of steep gradients regions are unknown. Separated boundary layers may serve as a typical example. To increase the accuracy of a method, the meshes which adapt to solutions may be useful in these cases. The discussion of the existing techniques for adaptive grid generation is beyond the scope of this book. Some of them may be found in [105], [106]. However, the outlines of the coordinate transformation which leads to self-adapt at ion of grids and which will be used in Chapters 5 and 7 are presented in Appendix A. As has been mentioned, this technique was proposed as part of high accuracy method with compact approximation for Navier-Stokes equations in the early seventies [107], [111]. Closing this section, we remark that the main emphasis was made here on viscous flow problems. Of course, the same reasoning is applicable to other problems of convert ion-diffusion type. As to inviscid flows and pure convection problems, the main aim of using non-centered compact approximations is to provide very accurate numerical solutions in the regions where exact solutoins are smooth. We may expect here relatively small values of C in Eq. 0.3 and therefore small norms \\u — [u]/,|| without introducing fine meshes. It is understood that the proper resolution of discontinuities should be guaranteed in the regions where solutions are not smooth. h
0.3
High-order schemes
Having discussed the role of a mesh as an essential part of high-accuracy method, we may henceforth concentrate on high-order finite-difference approximations. Not
0.3. High-order schemes
7
considering spectral or spectral-like methods, the ways of their construction may be summarized as follows: • using the stencils which contain increased number of grid points, • using additional differential equations obtained as a result of differentiation of governing equations, • applying compact approximations. Apart from high-order discretization, there are of course other methods to increase the accuracy of numerical solutions. We can mention here the use of low-order difference solutions obtained with different meshes (Richardson method) [70]. Alternatively, it is possible to form the combinations of difference solutions obtained via several basic low-order schemes (the method of parametric correction [11]). We will not dwell on these approaches restricting our consideration by the high-order approximations for the differential operators.
Using the stencils w i t h increased number of grid points
The straightforward way to increase the order of approximation of a difference scheme is to include more grid points in its stencil. Unfortunately, some difficulties may arise when exploiting this approach. For implicit schemes, the inversion of the matrices with the increased number of non-zero diagonals may be too costly. Using explicit schemes is sometimes disadvantageous due to their poor stability. In both cases, a considerable number of spurious solutions may cause a dramatic manifestation of non-physical oscillations. Besides, the question of how to deal with near-boundary grid points inevitably arises. However, the reasonable use of high-order difference formulas allows one to construct successfully third- and fourth-order schemes for hyperbolic equations and, in particular, for Euler equations ([86], [18], [129], [5]). All of them can be combined in many-parametric family of schemes based on the Runge-Kutta idea. It is also worth mentioning that the third-order scheme [5] coincides in the linear case with maximal order scheme for four-point stencil [100]. Quite a general approach to design difference schemes for a given stencil is to write them as a sum of values of grid functions over the stencil multiplied by
In troductioa
8
unknown coefficients. Using Taylor expansion series, one can then obtain these coefficients by annihilating low-order terms in truncation errors (see, e.g. [43]). It is also possible to retain one or more free parameters to control the properties of the scheme [59]. The efficient use of high-order approximations defined on many-point stencil was demonstrated in the excellent work [51], where high resolution schemes for hyperbolic conservation laws were proposed. The idea of adaptive stencil incorporated in these schemes permits to obtain the solutions of a very good quality.
Using differential consequences of governing equations
As a starting point for constructing high-order schemes, one may take advantage of the fact that the exact solution of difference equation rather than an arbitrary function is used in the definition of the approximation. This means that some terms in the truncation error may be found to be zero if the functions involved in these terms satisfy the exact problem. Two-level three-point weighted scheme which approximates heat conduction equation to the fourth order for the special choice of the weight factors is a typical example. Another approach is to make use of additional equations obtained via differentiation of the equations which are to be solved [74]. Consider for example the equation dti _ dtp(u) dt ~ dx '
(0.8)
Differentiating it with respect to z, the so called prolongated system [79] can be obtained
i^=|S> k
k
* k
k
(0-9)
where it*.*' designates d v/dx The derivative d 0, 3 m W = 3m W_. Choosing now one of the pairs Eq. 1,7 for which aSte Wi > 0 (/ is plus or minus sign), we get unconditionally stable scheme Eq. 1.10 for c-, = a > 0.5. It is worth reminding that the stability of the scheme is thought of here as its stability for frozen coefficients. WJa)
=
+
+
In nonlinear case, the simple criteria for the choice of the proper pair of operators in the grid point xj = jk is the condition ffafj&cWt
> 0.
(1.14)
We see now that usual upwinding principle should be applied here. Namely, if /'(uj ) > 0 in the grid point x — Xj the backward difference A_ (and operator A ) should be used. Similarly, if / ' ( « " ) < 0 the forward difference A and operator A - are needed. This choice of the orientation of one-side differences A_ and A leads to positive operators approximating the derivative df/dx in Eq. 1.9. Such an approximation will be called compact upwind differencing (CUD). To specify the order of truncation error, it may also be designated by CUD-3. 1
+
+
+
To formalize upwinding principle, it is convenient to present the operators A and A± as the following sums A
= At q
±
0.25A ,
T
A , = 0.5(A ^ A , ) ,
O
0
vhere «V =
+ -) A
A = f Q
i+1
- /(_!,
=
+ \l.r+
g/i+i.
A = fa - 2h + /,-.• 2
t
The operators A and A are the self-adjoint (symmetrical) components of the operators A± and A while the operator A defines their skew-symmetric part. 0
2
T
u
Third-order schemes with compact upwind differencing
20
1
Introducing the parameter s = sgn /'(uj ) and omitting indices of the operators A± and A > the CUD-3 scheme chosen from Eq. 1.12 is given by T
A"
+ ALL—lA
+|i - * ) , - ] ,
>LL = \o- ^' A
a
(i is)
where A = Ao - 0.25sA ,
A = 0.5(A - s A ) ,
o
0
2
m
a = sgn / ' ( u ) ,
a = cr„.
Setting s — 0 in Eq.1.15, we obtain centered approximations used in papers [27], [52], [81], [1], They have the fourth order truncation error with respect to the step k. Since 1
r*
=r+/'(u™)^
1
- u-) + o(\\u^'
j
- «™h ),
the linearized form of Eq. 1.15 can be presented as (A + ^ A / ' ( u " ) ) " "
+ 1 r
""'" + | A r = ^ h
m
+
l
+ (1 - *) 0 and / ' ( u j ^ ) < 0 and the non-zero term fk — fo-i arises when summing over k. If /'(fJT_,) < 0 and /'(u™) > 0 then the balance equations for the cell with the side \xt,Xk+i) are written twice which results in the non-zero term — f . It t
22
Third-order schemes with compact upwind differencing
can be shown that in both cases the numerical sources of the form u
u
Jk+i ~ Ik , . k ~ k i r ± h T arise inside the computational domain. Their intensity can be seen to have the order 0(h ). If in the vicinity of the sonic point the higher derivatives of the exact solution exist and are not too large, then such local non-conservation is expected not to influence seriously the quality of numerical solution. However, it is not the case when the exact solution is not smooth. The violation of conservation laws may then cause serious errors. Slight modifications of the operators A and A are needed to guarantee the cancellation of the fluxes of the vector a given by Eq. 1.17 through the common boundaries of cells. One may set for example 3
A = yt -0.25A s, o
o
A = 0.5[A - A _ ( T C
1 / 2
s)A ]. +
(1.20)
Here 7i denotes the shift operator along the axis x so that Tifj = f(ij + Ih). Hence, the grid function A_(T,/2s)A / at the point x = z, is given by +
A.t^^lA+Z, = s
1+1/5
(/,-
+1
- U) -
- fi-i).
(1-21)
If Si = const for ( = i then the operators Eq. 1.20 coincide with those given in Eq. 1.15. In all cases the difference scheme Eq. 1.12 with the operators Eq. 1.20 can be presented in the form m
- nf
1 + Qj+1/2 - Qj-ttf + frlU+itt ~
= 0,
where + ( ( _i) = 0
(1.29)
27
1.4. Difference equations which has the roots 3, = 4 + Rj -
/ v
2 1 + 2 ( / 7 - / i _ ) - 6 f i + fl?, i
i
l
r
J
^ = 4 + ^ 4 / 2 1 + 2 ( f l - / 7 _ , ) + 6/fj + /?J. 1
J
J
If the inequalities \q \ < 1 and |f | > 1 hold with sufficiently large /V, the systems Eqs. 1.26, 1.27 are well-conditioned in the sense of [43J, i.e. the sensitivity of their solution to the perturbations of Rj and dj does not increase with JV. More precisely, suppose that the coefficients on the LHS of Eq. 1.26 or Eq. 1.27 are bounded by some constant M independent of N. Then these systems are thought as well-conditioned if x
2
< Mmax{\if\, |V>|, m?x\dj\}, where ip and ip are the RHS of boundary conditions at j = 0 and j = JV respectively [43]. Setting k = j and I = j — I in Eq. 1.28, one may see that the inequality \q \ > 1 is satisfied due to Rj > 0. To verify the inequality < 1 it is convenient to consider two cases: 3
(i) 5 -2Rj-,
> 0 and g, < 0;
(ii) 5 - 2/?j_! < 0 and q > 0. :
Taking into account Eq. 1.28, it is easy to see that \qj \ < 1 in both cases and thus the system under consideration is well-conditioned. When computing either discontinuous solutions or solutions containing sonic points (/'(ti) =i 0) difference Holder - continuity Eq. 1.28 may be violated in some nodes, it is convenient then to use the condition [43] 8 + 2Rj > | 5 - 2ftj_i| + 1 +
6 > 0,
(1.30)
Inequality Eq. 1.30 holds for 5 - 2/t,_, > 0. If 5 - 2/tj_, < 0 then the following limitation is sufficient to meet this condition: T
max O-j-t - 0.j k 0. Thus the absolute value of the RHS of Eq. 1.41 does not exceed 1. Now let Y> 1. Writing Eq. 1.41 in the form
A
2 ± y F ( c o s p / 2 + isinp/2) —2+2R+2Si—•
=
r , *-***»"$-m/y]* 2
one may deduce after simple manipulations that the inequality \X\ < 1 holds if 2
/!
*,, (y-, R) = Y - V=f4[(l -2R + Y)/2\' 2
+ 4 + 16R > 0.
This condition is met for I. Consider now $ j . Taking into account that R > 0, Y > 1, we deduce that ^(V^O) > 0, since 3
1 /
v -) w = 2 V - l, - [ (f,, l +, K / 2o]l"- ^ > 0
dy
and $,(1,0) = 0 . The positivity of $i(F,0) certainly results in positivity of *i(K, R) by virtue of - 16 + 2[(1 - 2R + Y)/2]
OR
> 0.
Thus three-level scheme Eq. 1.40 is unconditionally stable. Using the weight coefficients cr,- ( i = 0,1,2) in Eq. 1.40, the scheme with truncation error 0(r + h ) can be constructed. The weight factors c , C\ and cr which cancel 0 ( r ) and 0 ( T ) terms in the Taylor expansion series for Eq, 1.40 can be easily found to be 3
3
0
2
s
2
2
1
It can be shown that the scheme Eq. 1.40 with such coefficients is conditionally stable.
32
Third-order schemes with compact upwind differencing
1.5.2
Explicit forms of third-order compact schemes
The unconditionally stable schemes defined by Eq. 1.10 can he used to obtain both steady and unsteady solutions. In the former, the first-order two-level scheme with a — 1 can be quite efficient. If unconditional stability is not of prime importance when solving unsteady problems then explicit schemes based on CUD-3 approximations may be of interest.
It should be noted that explicitness means here only that the discretization of space derivatives is performed at m-th rather than at (m + l)-th time level. Several considerations should be emphasized in context of CUD-3 explicit schemes.
(i) Formally, all known explicit time stepping may be combined with CUD-3 approximation. Due to the positivity of this approximation, one may count on the conditional stability of such schemes if the same time stepping provides conditional stability for usual space discretizations. (ii) The inversion of three-point operators is still needed for obtaining the solution at m, 4- 1-th time level. Just for the sake of illustration, consider the simplest explicit scheme for Eq. 1.9 m+l
m
2 + -A-'Afiu ") 1
=g J
m
(1.42) m
To implement Eq, 1,42, the grid function z = A~ Af(u ) should be evaluated as a result of solving tridiagonal system Az = A / . Though the inversion of A may be preferable as compared with that of implicit operator A + ( r / / i ) A / ( u ) , the operation count in both cases is approximately the same. m
(iii) The dispersion and dissipation properties of CUD-3 may be somewhat masked by first- and second-order time stepping if unsteady solutions are of interest. Consider for example, two-level scheme Eq. 1.12 with er = a, Oj = 1 — a and f(u) — cu, c = const, g — 0. Substituting the function = X exp(ion), a = kh,, we obtain 0
m
(1.43)
1.6. Two-level 0(r 3 where
l,xl
+ h3 )
scheme
33
and () are given by
l,xl
= [1 - 2(1 - O')KWo - (1 - 0')2K2(Wc?
(1 1
() = -
o
+ O'KWo)2 + 0'2K2Wl
+ Wn]1/2
KWI [1 - (1 - 20')KWo - 0'(1 - 0')K2(Wd
'
arctan -;:---;-;----::-~=;:_-~'--__;_=7:':':;;_____:c=
+ Wnl '
In these expressions the functions Wo(o) and WI(o) are defined by Eq. 1.24 while K = cr / h is the CFL number. Comparing Eq. 1.43 with relative evolution of the exact solution Eq. 1.22 which IS
u(t + r)/u(t) = e- ickT = e- iKo , the relative phase speed c' / c = () / K may be estimated for small
0
as (1.44)
For these values of
0
the estimate ( 1.45)
also holds. Upon inspecting Eq. 1.44 and Eq. 1.45 one may see that the phase and amplitude errors are greater than those for semi-discretized Eq. 1.24. However, they are minimal for Crank-Nicolson scheme (0' = 0.5) for which
The estimates Eqs. 1.44 and 1.45 are obtained setting Wo = 0(0 4 ) and WI = 0+0(05 ). To preserve the fourth-order phase and amplitude errors of CUD-3 approximations, one should use at least third-order time stepping. One of the possible options is the combination of CUD-3 and Runge-Kutta method.
1.6
Two-level 0(7 3 + h3 ) scheme
1.6.1
Derivation of two-level scheme
The above considered three-level schemes with truncation error O( r3 + h3 ) are only conditionally stable. However an unconditionally stable scheme which is based on
Third-order schemes with compact upwind differencing
34
high-order space and time discretizations may be of interest. Such scheme can be particularly useful when constructing marching algorithm for steady problems in which one of the space coordinates plays the role of time. To derive such a scheme [116], we begin with approximating Eq. 1.9 by J
m
m
+ A (A- Af) /h
=A ,
t
(1.46)
ig
where A is the operator defined on the mesh ui similar to the operator A on the mesh wj,: A,g = ( 5 — + 8g )/12. t
T
1
+
m
defined
m + 1
9
f l
In fact the operator A is adjoint to the operator A, from three-level scheme Eq. 1.38. Obviously, the scheme Eq, 1,46 has truncation error 0 ( r + ft ). But at the same time it contains undesirable term A~' Af * j\2k which makes its implementation difficult. To overcome this obstacle, we need only to use any second-order scheme to exclude this term without any loss of accuracy. For this purpose, let us choose the Crank-Nicolson scheme written in the form t
3
m
m
1
.,m+i _ , , - l
] 1
1+ where F
m
m
= Tlf A,g , 2
m
(/
1
(1.47)
7 $ being the shift operator defined by T§[g(l) = j ( i + r/2).
= A~ Af(u'")/h
and combining Eq. 1.46 with Eq. 1.47 we
1
+
1
A / " " + A-' A / - + ) = F »
,
Denoting Lu obtain
3
x
?rl)u--(/--|rL)u- -^[(/
l
+
£)- (/-rL) "
T
U
+
2r(/ + r L ) - V "
m
= TA g
(1.48)
t
m
m + 1
To evaluate u one should first find preliminary value of u from Eq. 1.47. Substituting it into Eq. 1.46, it is sufficient then to invert the operator [ / + 2/3TZ-] . More precisely, the algorithm is as follows (i) Solve m 1
(l + TL)V ={l - rL)u -
+ 2rF".
(ii) Solve (/ + ITL)U-
=
m
(!-^rL)u ~'
+ ~Lv + TA g™. s
3
3
1.6. Two-level 0{T + k ) scheme
35
While performing the steps (i) and (ii), some linearization is needed for nonlinear operators L . Supposing that it has been accomplished, the inversion of the operators I+TL and / + (2/3)rL reduces to solving tridiagonal systems. Hence, two tridiagonal inversions are needed here instead of one inversion in the case of three-level schemes. To verify third-order accuracy of the scheme Eq. 1.48, we note that it differs from the £>(r + h } scheme Eq. 1.46 by the term 3
3
0=^(l«-Lti" 12
+ 1
),
where v is the solution resulting from step (i). This expression may be cast in the form
W
12
(1.49)
12 1
Multiplying Eq, 1,49 from the left side first by L
,/2 = / + 2 / J « + 0 ( T ) ,
and then by (/ + T L ) , we get
A, = I - - D
2
t
+
2
0(T ),
where D is the operator of the first derivative with respect to t, it is easy to verify that Tp and hence Eq, 1.49 have the order of 0(T ). This means that the scheme Eq. 1.48 is really 0 ( r + k ) scheme. t
3
3
1.6.2
Estimates
3
of stability, dissipation and dispersion
Supposing f{u) = Q U , a = const, one may use the spectral method to prove the unconditional stability of the scheme Eq, 1,48, Performing tedious algebraic manipulations, the following expression for eigenvalues of transition operator can be obtained
_ 1 1
1 + 1**+
£(I V -
- iK v(v + 3
2
l + f A V + f (13*» + 37*») + * A ' M 5 ^ + V )
where K =at(k,v
+ !(,* + + J(»'
a
0) whereas the stronger one encounters at transitive conditions due to spurious oscillations near the sonic point (/'(u) = u = 0). This certainly leads to the loss of conservation property of the scheme. Another observation is that some wiggles may exist ahead of the shocks. It is also understandable since phase velocity of the short wave harmonics may exceed the exact one if CUD-3 operators are used. It may be noted that the wiggles generated by the scheme are well localized and do not prevent the interpretation of the results.
The example presented in Fig. 2.1 as well as other computations of [120] shows that one should avoid using CUD-33 -NC for computing discontinuous solutions. The good choice then is the conservative option of CUD-33 based on Afs) defined by Eq. 2.2. It is designated in [120] by CUD-33-C. Fig. 2.2 presents the results for the same initial data Eq. 2.10 obtained while using CUD-33-C. The positions of the leading and trailing shocks are seen to be absolutely correct. The numerical experiments
2.2. Applications to discontinuous solutions
43
T3 In ilia I dala Solution with 6=0.2 Solulion with 6=0.01
Fig. 1.1: Results for Burgers equation and initial distribution Eq. 2.10 while using conservative scheme CUD-33-C. show that they are independent of CFL and t. However these parameters may influence the amplitudes of spurious oscillations.
2.2.2
Entropy-consistent
forms
It is well known that weak solutions of nonlinear problem Eq. 2.3 are not unique when sonic points exist in rarefaction regions. However, uniqueness is guaranteed if these solutions satisfy the entropy inequality. They are often referred to as physically relevant solutions. The simplest example of the solution which is not physically relevant is rarefaction shock defined by
with constant U. While using CUD-33-C in the double-shock case, there were no problems with the existence of spurious rarefaction shocks. It is clear however that the generating operators Eq. 2.1, 2.2 and therefore the corresponding CUD-3 schemes admit the exact solution of the type Eq. 2.11. Hence, one can expect that prohibited solutions may be obtained with these schemes for some special initial data.
Some extensions of basic ideas
44
Initial dais Solution with CFL=I. Solution with CFL=0.S
F i g . 2.3: Results for Burgers equation and initial distribution E q . 3.12 while using conservative scheme C U D - 3 3 - C .
The example of computations extracted from [120] is presented in Fig. 2.3 for the following initial data if |jf| < 1/2 otherwise.
(2.12)
The results were obtained for diiferent values of CFL and e, the shock positions being insensitive to these values. The computed solution as expected shows a steady-state rarefaction shock at i = —1/2. It generates in turn spurious compression shock moving leftward. Note that wiggles are practically absent for this particular choice of t. The entropy consistency of the first-order schemes is well investigated. For example, Godunov's scheme is entropy-consistent. Osher [73] introduced a family of so-called E-schemes which were known to converge to the physically relevant solutions. Tadmor [101] showed that any scheme with numerical viscosity which is not less than that of entropy-consistent scheme is also entropy-con si stent. In all these and other results rather strong numerical viscosity non-vanishing in the sonic points plays the role of the sufficient condition for entropy inequality to be satisfied. However, the presence of the first-order viscosity terms is far from being a necessary condition for existing physically relevant solution in the case of sonic rarefaction. The examples are CUD-3-type schemes with some entropy fixers. To construct entropy-consistent versions of CUD-3, one can adapt the following
2.2.
Applications to discontinuous solutions
45
strategy: e
c
(i) Entropy-consistent first-order operator A should be chosen instead of Eq. 2.1 or 2.2. The action of this operator on the grid function of the type Eq. 2.12 should not vanish which implies its non-zero numerical viscosity at a sonic transition. EC
EC
EC
4
(ii) Three-point operator A which gives [A )-'A = kD + 0[k ) is needed. It can be readily obtained as a special case of the generalized operator A described in Section 2.1. z
G
Following this strategy we chose the first-order operator as the operator defined by Eq. 2.7. To prevent vanishing numerical viscosity at the sonic point, we set if Uj < u j+i otherwise.
(2.13)
Clearly, f,+i
if
Uk
=
— U,
k
J. EC
CUD
3
CUD
3
As was explained in Section 2.1, A = A ~, where A ~ is the operator from CUD-3 conservative pair generated by the operator Eq. 2.2. Of course, (A )~* A f is the third-order differencing of f(u) if /'(u) does not change its sign while its local truncation error is of the second-order in the vicinity of sonic points. EC
BC
Fig. 2.4 shows the results of computations for a rarefaction shock as initial data. It can be seen that rarefaction fan, the physically relevant solution, is obtained instead of the spurious stationary rarefaction shock. Another entropy fixer and numerical examples are presented in [120].
2.2.3
CUD-3
schemes with flux correction
In the numerical examples presented above, wiggles are seen near the compression shocks, their amplitude being dependent on the type of CUD-3 scheme and initial data. This fact is quite understandable because CUD-3 is high-order differencing
Some extensions of basic ideas
46 j3
Initial dflla Solution with C F L - ] . Solution with C F L - 0 . 5
Fig.
2.4:
Results for Burgers equation and initial distribution E q . 2.12 while using entropy-
consistent scheme C U D - 3 3 - E C .
without any artificial devices like additional numerical viscosity, limiters etc. Due to well-known Godunov's theorem, it cannot be absolutely monotone. The presence of wiggles is not embarrassing in many practical cases. They are well localized near discontinuities and do not usually spoil numerical solutions. Moreover, they are practically absent while numerically simulating viscous flows provided that Mach numbers are not too high. Neglecting artificial filtering of wiggles seems to be quite reasonable if one wants to have "pure" solutions without any cosmetics. No questions arise in this case whether some details of the phenomena under investigation are masked and if so, to what extent they are masked. However, there are situations when CUD-3 schemes fail to operate while dealing with nonlinear problems. Such situation may be encountered if high Mach number problem is to be solved. The negative values of density and/or internal energy in one or two grid points may be rather embarrassing in this case. The idea of flux correction introduced by Boris and Book [14] and developed further by Zalesak [133) seems to be quite suitable if wiggles removing is badly needed. Using CUD-3 schemes in the flux form, it is possible to compute high-order
2.2. Applications to discontinuous solutions
47
T3
Fig.
2.5: Results for Burgers equation and initial distribution E q . 2.10 while using entropy-
consistent scheme C U D - 3 3 - E C with flux correction.
fluxes 9ji_i/2 defined by u™
+1
1
—u 1
-
m
+ my*
-
=%
i?-i/2
i < j < N
- 1 ,
where
After introducing low-order explicit flux 1^ ^ from a monotone scheme +l
—
"
-
+ vj+l/2
the antidiffusive flux ff /2
2
L
9j -1/2 = ° .
c a n
u
9j+I/2 = 9 j ' - H / 2 ( j -
1 1
j+l)'
°e defined by
+L
9J+1/2 — 9 > 1 / Z ;
9j+]/2'
Using Zalesak's interpretation of the original idea of Boris and Book, this flux is then limited by the following formula jf+i/a
=
3
i+i/2
m a
0
4 '
m i n
1
2
s
1
J
i
a
f e
a
[l^ / l' -'+ / ^ '+5 " /+i) . j-i/s(«i
(2.14) where s
j + 1 / 2
= sgn^
+ ] / 2
and uj" =
fif*'.
Some extensions of basic ideas
is
The flux-corrected CUD-3 solution is now given by +
u™ > =u?-T( f - f_ ). a +l/2 q
(2.15)
l/2
Fig. 2.5 shows the results of flux correction Eqs. 2.14, 2.15 for the double-shock case Eq. 2,10. The scheme used is the conservative form of CUD-3, namely CUD-33EC. We see that pre- and post-shock oscillations have been completely annihilated without smearing the shock. We also note that the action of the flux correction is limited to the several grid points only where wiggles are noticeable.
£.2.4
Steady-state computations: comparisons with first- and secondorder schemes
Some information about the accuracy of CUD-3 scheme as compared with several well-known methods was obtained in [77], In this work, the computations were carried out for the following problem
t
M u(0,i)=A
-*•>+•£•
«(;i,i) = B,
M
u(x,o) = (z). Wo
where A , B and 0 are some constants. The exact steady-state solutions of Eq. 2.16 were obtained in [77] for the cases " = 0, 0 ^ 0 and f j t Q, 0 = 0 with some constraints imposed on input data A , B , 0. Using the exact solution as reference one, the accuracy of numerical methods was investigated by evaluating L error defined by 2
1/2
E = 2
Lj=l and the maximum norm E
m
= max|u(ij) — t>j|.
Here N is the total number of grid points, u(xj] and Vj are the exact solution at the grid point Xj and computed solution respectively. Since only steady-stale solutions were of interest, CUD-3 approximation of nonlinear terms was used with first-order time-stepping, i.e. the scheme Eq. 1.16 with tr = i . The other methods were
49
2.2. Applications to discontinuous solutions
10"
0 01
0.O2
0.04 F i g . 2.6: L j - error,
E,.
(i) Godunov, first-order scheme (ii) Jameson, second-order scheme [55] (iii) MacCormack, second-order scheme [69] (iv) Harten, TVD2, second-order scheme [50] If u = 0 then as it was shown in [77], the exact solution exists if „
2
2
1 B - A 2G(1)-G(0)'
G(1)-G(0)/0,
where G(x) — / g(x)dx. For the proper choice of A and B, it has the form of the jump from one branch of smooth function to another, the branches being defined by l/a « ± 0 ) = ± 20(C{x) - G(0)) + A'Depending on the initial data, a discontinuity occurs at x £ [0, 1] as a jump between the positive to negative branches of the exact solutions.
50
Some extensions of basic ideas
The computations reported in [77] were carried out for k = 1/25, 1/50, 1/100 and g(x) — sin JTI, X It was noted that oscillation completely vanish when steady state was obtained using CUD-3. The reason is quite obvious: the grid function u in this case satisfies 3
where A(s) is two-point backward and forward difference for positive and negative branches respectively. Numerical data extracted from [77] are presented in Fig. 2.6 and Fig. 2.7 respectively in the form of convergence curves Ei(h) and E (k). One can observe the striking difference in the accuracy achieved for a given mesh between CUD-3 and other schemes. As it was stated in [77], with 25 grid points four digit decimal accuracy is realized from CUD-3 calculations. m
2.3
Discretization of equations in non-diver gent forms
The use of the conservative form of initial equations is natural and convenient when constructing difference schemes on the basis of the above considered operators. Such
2.3. Discretization of equations in non-divergent forms
51
schemes turn out to be three-point which facilitates solving difference equations. For equations presented in non-divergent form, the straightforward application of the operators A± and A does not result in the system with three-diagonal matrix. Consider the equation T
du %
d (2.17)
Using CUD-3 operators A±, A with the simplest discretization of the derivative du/dt, one can write the following scheme for Eq. 2.17 with truncation error 0(k } with respect to the step h T
3
"
m +
' "
U m
r
+
,
m+,
+aZ 'Ai A u /h
= /„
T
m + !
(2.18)
When a = const, this scheme coincides with the above considered CUD-3 scheme. Hence the choice of the pair of the operators A and A is regulated by the parameter s = sgn a. When the coefficient a(x,t) in Eq. 2.17 is variable, simple multiplying both sides of Eq. 2.18 by the operator A does not allow to obtain three-point equations. In this case, we introduce a new grid function q„ = A~ Au™ */h satisfying the equation i
4(S»)ft, = A ( s > :
+ 1
+
A
(2-19)
in which s = sgno„. The scheme Eq. 2.18 becomes now n
u
m
+ 1
+
r Q
-+lg
n
=
r
( u
+
£-+1)
(2.20)
+1
Substituting the function u™ expressed from Eq. 2.20 into the R.HS of Eq. 2.19, the difference system with respect to q reads n
Aq + (r/h)A(a- ) n
= ( r / f t ) A « + /"+').
Qn
(2.21)
Inverting the tridiagonal operator on the LHS of Eq. 2.21, one can obtain the grid function q . The solution function u™ ' can then be extracted from Eq. 2.20. +
n
52
2.4
Some extensions of basic ideas
Another form of third-order compact upwind differencing (CUD-II-3) Difference
operators
So far we have been considering compact differencing of the form 1
kD ^
A- (s)A(s)
x
4
+ Olh ).
Another possible type is k D ^ ^
4
+ R^Q. + Olh ),
(2.22)
where ifj, and QK are three-point operators. To obtain these operators, we start with the Taylor expansion series for A(s) which can be cast in the form D = h-A(s) x
+ ^D 1
2 T
- § 2 £ + 0(h% b
(2.23)
where s is supposed to be a constant. Instead of straightforward discretization of D\ and D^, we make use of the chain of equalities
2
All we need now is to discretize D and D at least with the first and second order respectively. Of course, some arbitrariness exists while choosing these discretizations. T
Approximating D by A(s )//i with the other constant parameter Si, we represent Eq. 2.23 as x
:
where £3
=
A(s) + ^ ( / + ^ A { s , ) ) " ' A jh 2^ 3s ;
(2.25)
and TE stands for truncation error. Hence, R
H
= / + f A(s,),
QH= -&2. S
For any grid function u the action of the operator L can be computed in the following way: 3
2.4. Another form of third-order compact upwind differencing (CUD-ll-3)
53
(i) Solve the tridiagonal system (/+^A(3i))w = A > ;
(2.26)
(ii) Compute L u - { A ( S ) U + 0.5su)//i. 3
3
Using Taylor expansions, it is easy to verify that TE = 0(/i ). Moreover, the following estimate holds for a sufficiently smooth tlfxj du £swj = 3-
,1s, 1 \, d*u T2~7 ll^Td* 3
+
I=I.
a
I
< I.
+
(2.27)
Upon inspecting Eq. 2,27, we observe that the truncation error for L is greater than that for CUD-3 if \s\ = 1. However, it can be decreased by increasing |s| and decreasing S,. 3
The next important point is the ability of L to act as a positive operator in difference schemes. To estimate 4 ° ' , the self-adjoint part of L , we calculate the inner product (L u, u). In doing so, let us consider again Eq, 2,26 setting R\ — I + ( l / 3 i ) A ( s i ) . We use then the chain of equalities 3
3
3
h(L u, 3
«)
= (R~ ' [fl A(s) + i & j l u , «) = ([jfeAjft + f A a k R,v) h
A
(2.28) =
([RlR A(s)+iR^}v, ), h
V
where v = R^u and therefore u = R v. h
To verify the positivity of L , one should calculate the self-adjoint part of R' RhA(s) + (s/2)i?jA;. It can be readily accomplished to give 3
h
(2.29)
where it = S i / s . We observe now that if k > 0, then the first term in the brackets on the RHS of Eq. 2.29 is a positive operator since ( — A ) > 0, The second one is also a positive operator due to ( — A ) < 4. Hence, the inner product in Eq. 2,29 is positive and sgn(L u, uj =sgns. 2
2
3
54
Some extensions of basic ideas The above results can now be summarized in the form of
Theorem 2.1. Let L be defined by Eq. 2.26. Then it is a third-order differencing operator with truncation error given by Eq. 2.27. Let further that sgnS] = sgns. Then i is positive (negative) if s > 0 (s < 0). 3
3
The differencing formula Eq. 2.25 with the proper choice of sgns when applied to the convection-type equations will be referred to as the third-order compact upwind differencing of the second type (CUD-II-3).
t4.2
Some properties
of
CUD-II-3
Difference equations. The linear system with three-diagonal matrices is to be solved for computing the action of L on the known grid function (Eq. 2.26). It can be written in index notation as 3
^{l-*l)%+t-r- (l +
3 7 ) % - = A f l &
'j = U-,N-\.
(2.30)
Boundary conditions are needed to solve Eq, 2.30. To provide them, it should be noted that vj — h D + 0(h ). It means that some approximations of D at the end points x = x and x = IJV are admissible. 2
2
3
2
a
It can be deduced from Eq. 2.30 that this system is well conditioned since |l +
^j>
+
moreover, its matrix is M-matrix if Si > 1. Thus we see that solving Eq. 2.30 creates no problems, the quality of the solutions being expected quite satisfactory. Dispersion and dissipation. The phase errors for semi-discretized convection equation — + a L u = 0, a = const at namely the ratio of the scheme phase velocity to the exact one, can be easily calculated as 3m W(a)fa, where H7(a) is defined by 3
kL exp(ian) 3
= W(a)exp(ian),
n = 0 q=l, q = 2 , 0 < a < 2JT,
a = kh.
2.4. Another form of third-order compact upwind differencing (CUD-II-3)
55
The result is SinW(a)
sine*/
jjj
),
21
1
\
, , a 1 . 1 = sin' - .
J
Using Taylor expansions for sine* and sin (o/2), we observe that
As in the case of CUD-3, the phase errors are seen to be quite small for small dimensionless wave numbers a = kh. The attenuation of harmonics due to the action of £ per time hja may be characterized by exp(—d), where 3
2a/ d= dleW(a) =
2
where / = sin (a/2). The use of Taylor expansion yields d=
4
12
18|a
a
+ 0(Q ), 6
thus indicating negligible amplitude errors for small a. The graphs of 3 m W(a)/a and 3ie W(a) are shown in Fig. 2.8. Comparing this figure with Fig. 1.1, we see that CUD-3 and CUD-II-3 curves give approximately the same range of a for which difference solutions are very close to the exact one (0 < a < T/4). Note that the shortest wave dissipation d(ir) is equal to 4sk/(3 + 2k) as compared with 2s for CUD-3.
2.4-3
Conservative
forms
The action of the operator L at any internal grid point x = Xj can be presented for 3
S\ — s — const
as
where _ u hq /2j+l
i+1
+ Uj ^
s, 2^
„-l\Uj+l ~ ttj ' *~~2
_ '
1 3~7 *
Some extensions of basic ideas
56
2 0
T c'/c, d
1.5
F i g . 2.8: Dispersion and dissipation of C U D - U - 3 for Gi = s = 1 (solid line), s j = 0.5, # = 2 (dashed line) and s i = 0 . 2 5 , s = 4 (dotted line).
Thus we can see that b is suitable for the approximation of conservation laws provided that the slope of characteristics does not change its sign. In a general case some modifications are needed to provide the conservation property of CUD-II-3. It can be accomplished in the following way. First we replace the operator sAj by A ( 7 _ i / s ) A _ . We remind that the latter looks in the index form as 3
,
+
2
A (r_ +
1 / 2
s)A_/, = s
J + 1 / 2
( / j i - / , ) - s,_, (/ - / , _ , ) . +
/2
;
As a consequence, Eq. 2.2 should be used instead of Eq. 2.1 when defining A(s) in Eq. 2.22. The next step is to modify the inverse operator in Eq. 2.22. Following the strategy of Section 2.2 we write down the Taylor expansion for the conservative A(s), namely A ( s ) , to obtain c
Di =
+ \DZSD:
- jDl
3
+ 0(k }.
(2.31)
Eq. 2.31 may then be cast in the form D - j-A (s) = ^ D ( / + y^Y'D; l
x
c
l S
3
+ Oik ).
(2.32)
Our aim now is to construct second-order conservative discretization of the operator on the RHS of Eq. 2.32, thus preserving 0(h ) truncation error for D approximai
x
2.4. Another form of third-order compact upwind differencing (CUD-II-3)
57
tion. It can be done in several ways. For example, we may write 0
0
~ ST *)"' *
=
C
*-*&+{T_ s)(l
+ ^A (S,,S))~'A_ +
m
0(k*)
and c
hLi = A ( s ) + i A ( J - _ +
c
1/jS
)(7 + iA (s,,s))"'A.,
(2.33}
where A {&%,a) is given in the index form by (Li \s s)v ,/2 u
—
1+
c
c
We note that A ( s i , s ) in contrast to A ( s ) acts on the grid functions which are defined in the mid-points of our mesh wj,. We designate the set of these mid-points by Let Uh and (A be sets of grid functions defined on ui^ and i i respectively. Then A_ and A in Eq. 2.33 may be considered as the operators which perform the mappings £//, —1 t/j, and Uh —• Uh through the relations i*j_i/2 = A _ U j = tij — u,., and wj = A U j _ = v - i > j _ respectively. n
+
+
1 / 2
1 / 2
j+l/2
Now we have c
l
(7'_ s)[/ + A / 3 ] " A - :
~ ) -
T
-N Nf{vT) a
= 0.
(2.49)
2
One can easy verify that its truncation error is equal to 0 ( T 4- h*). The second order with respect to T arises because the last term in Eq. 2.49 approximates (r/2) ( c ' u / 3 i ] _ in Taylor expansion of the solution u(x,t). 2
2
i
(
Since N = —JV", the inequality (-NN) > 0 holds. The scheme Eq. 2.49 is explicit scheme with a positive operator, hence it is conditionally stable. To implement this scheme one should invert the operators A and A with constant coefficients.
2.6
Third-order compact differencing cretized Pade approximants
as dis-
At this point, it is worth emphasizing that close relations exist between compact differencing and Pade approximants. CO We remind that Pade approximant of the Y, C** is given by
*=°
1 + E ****
2.6. Third-order compact differencing as discretized Pade approximants
65
the truncation error being The coefficients a* and dj, can be readily obtained from the relation ( l + E hz") £ « « * = £ li=l
Jr=0
+ 0(*" " ) +
+ l
*=0
which gives the linear system with (m + n + 1) X (m + n + 1) Toeplitz matrix. To derive third-order compact differencing, we start from the expansion for the operator A. Writing it in the form D, = A-'A(s) + ^Dl
- |iC5 +....
D, = ±
t
(2.50)
we formally set Co — n A , ci — [sj2)D and c = —(1/6)Z? . Suppose now that one wants to approximate Eq. 2.50 to the third order by _ 1
3
x
2
2
(l + b,h + b h y'a , 2
(2.51)
0
where 6j and b are some differential operators. Using standard procedure to evaluate a , 6| and b as a coefficients in Pade approximants, we obtain 2
a
Since c =
2
2
A(s) = D - (sh)/Z Dl + 0(h ), one can easily verify that x
f +U + M
1
= 1- y f i - + f ^
+
3
0(h ).
2
Approximating now D and Dl by 0.5A /'» and A j / n respectively, we finally get x
£„=[/-
o
3
A + ^ A , ) " ' A(s)/A + 0(fc ). 0
The operator in the parentheses is readily recognized as CUD-3 operator A(s). To derive CUD-II-3 formula, we use again the expansion Eq. 2.50. This time, however, we want to apply Pade approximants to
&«-{«+. to obtain Eq. 2.25.
Chapter 3 Fifth-order non-centered compact schemes
This Chapter deals with the fifth-order compact approximations generated by upwind differences. Their main properties are very similar to that of CUD-3 described in the previous chapters. However, they have an advantage of possessing higher order truncation errors with small numerical coefficients before them. This makes them significantly more accurate than any conventional six-point approximation. The fifth-order compact upwind differencing (CUD-5) was proposed by the author in 1985 [115]. The first CFD application of CUD-5 was described in [37]. Other forms of CUD-5 derived via Pade approximations were presented in 1991 [119]. Their testing was carried out for several model problems. The aim of this Chapter is to give the reader the initial information concerning this type of little-known discretization. The author hopes that the ideas presented here may be useful for constructing high-order sophisticated algorithms.
3.1
Fifth-order compact upwind differencing
Let u(x) be a sufficiently smooth function restricted to the mesh ^ : {xj = jh], h — const. As a direct extension of the CUD-3 relation A{ )m S
}
= A(s)u /h, 3
f%i =
+ 0{h%
C7
3.1. Fifth-order compact upwind differencing
where {A(s), A(s)} is the CUD-3 pair defined by Eq. 1.15 in Chapter 1, we will find a triad of three-point operators -4i(s), 0 (the case s < 0 can be treated in the same manner). Then the following inequalities hold: C>0, (3.10)
Fifth-order non-centered compact schemes
70
B'C > 0,
(3-11)
B~'C>0.
(3.12)
The first of them is obvious because s ( - A )((3/8)7 + (1/16)A }, the self-adjoint part of C, is positive as the product of two positive self-adjoint commutative operators s(—A ) and ((3/8)/+(1/16) A ) . In order to establish Eq. 3.11 it is sufficient to calculate the product B'C and consider the self-adjoint part of it, (B'C?)' '. In doing so, one should use the properties of A and A and the equality A , = 4 A + A in particular. The final result is 2
2
2
2
0
2
0
2
2
2
2
By virtue of ( - A ) > 0 and A , < 4 ( - A ) we have 2
2
3
(-A )>0,
& 0,
l
where v = B~ u. We summarize now the obtained results in the form of
X
Theorem 3.2. The operator i = B~ C, where B and C are denned by Eq. 3.9 is positive or negative for s > 0 and s < 0 respectively. 6
*
It is clear now that stable schemes can be constructed using the operator L with the proper choice sgns. Let us consider, for example, semi-discretization of the equation du du a = const. (3.14) dt + dx = 0, It has the form du — + ai u = 0 (3.15) s
b
3.1. Fifth-order compact upwind differencing
71
with sgn s = sgn a. The stability of the scheme Eq. 3.15 in the L norm is evident. It can be established for the maximum norm as well. 2
Henceforth the use of the operator i defined by Eq. 3.9 will be called the fifth-order compact upwind differencing (CUD-5). 6
The dispersion and dissipation properties of the CUD-5 can be easily seen from the exact solution of Eq. 3.15 with initial data u(0,Zj) = exp(ifcfej); ,ai
Uj = u(t)e ,
a = kh, j = 0,^1,^2,...,
o < a < 2JT.
(3.16)
Substituting Eq. 3.16 into Eq. 3.15, we obtain Uj{t) = cexp(—Z()exp(iaj), where Z(o) are eigenvalues of L% corresponding to its eigenfunctions exp( — ioj): hL exp(—iaj)= b
Z(a) exp(—iaj).
Then the phase errors for Eq. 3.15 can be estimated as c" Sim Z(ct) — = —, C
,, a = kh,
O
,„ , (3.17
where c" is the ''scheme" phase velocity and 9m(Z) is given by ^ a )
= s i n
Q
( l - ^
+
^ - ^ p ) / 2
f
l
(3.18,
with
After using some algebra, one may deduce from Eq. 3.17, 3.18 that 6
^ = 1 + 0(a ). It means that phase errors are negligible for sufficiently long waves as compared to the mesh step h. The calculation of the measure of the dissipation d = |s|Sfe Z(a) which characterizes the attenuation of the harmonics per time hj\a\ gives / respectively to obtain the linear systems for unknown a; and 6; (i = 1,2). The solutions of these systems are given by 2
2A
O, = a
2 1
= -2/15*,
2
2
1
a = a ' = (5s - 4)/60s ,
6, = b]' = l/5s
2
(3.22)
and 2
2
2
6, = | ' = (21s - 20)/15s , Q
b\ = b\ = 2s/5 ,
S
1
5
2
2
b = b / = (5s - 4)/20o,
g = 4 - 3s .
2
(3.23)
2
Here we assume that 4 — 3s ^ 0 for Eq. 3.23. Now the expansion Eq. 3.19 may be replaced by 0 , = h-'A(s) + (s/2)/ (AO )AD + 0(h% J
2
I
where l
P = R- Q,
fi-J
+
fcC'^W*. jt=]
k
Q = I + Za^(kD ) I
(3.24)
k=l
and m, n. are 2, 1 or 1, 2. k
The next step is to discretize (hD ) in Eq. 3.24. We observe that it is sufficient to approximate hD and h?D\ with the third and second order respectively to preserve 0(h ) truncation error for P However, there is some arbitrariness in the choice of difference operators Ri, and Q^, which are the approximations of R and Q. Using this arbitrariness, we restrict ourselves with those discretizations which require three-point inversions for computing the action of the operator R^Qht
T
4
Fifth-order non-centered compact schemes
74
To derive the final forms of Q and Rh, suppose now that Q^K the fourth-order approximation of Q, is already obtained. Then we have to find the fourth-order approximation of the equality h
Rf = Qu,
(3.25)
J
where / = Pu = R~ Qu and u is a sufficiently smooth function. In doing so, we want to obtain a three-point operator fly,. This leads us to the equality (/ + 0.5Ar' A + C " A ) / N
O
2
N
=
flfW
(3-26)
Here h denotes the restrictions of the functions u and / . Unfortunately, Eq. 3.26 is only third-order approximation of Eq. 3.25 due to A / = hD f + 0(h ). Hence, an additional term is needed on the RHS of Eq. 3.26 to compensate the third-order term on the left-hand side. This term can be obtained from the estimate 3
0
x
4
hDJ^^h-^Dlh+Oih ), 2
where / = / > « = ( / - (k/Zs)D^u + 0(h ). Now the modified RHS of Eq. 3.26 can be written as (Q{^ + ^ A ^ + OO ), (3.27) 1
where /\ u>,fk
3
3
is any approximation of D u.
3
Equation 3.26 is not a unique discretization of Eq. 3.25 with three-point operator Ru, It follows from the fact that one can add the terms 71 A / ; , and 7 J A J / / , to the LHS of Eq. 3.25 and compensate them by adding some terms to the RHS, preserving 0(k ) truncation error. The compensation can be carried out using the following relations which are valid for / = Pu A
4
A „ / = ^kDt-Z-h'Dl
4
+ ^Dlju
F T
2
l
A . / * = {h Dl-
3
3
h Dlj
+ Oik ),
4
U
+ 0(h ).
(3.28)
(3.29)
Taking into account Eqs. 3.27, 3.28 and 3.29, Eq. 3.26 can be rewritten in the form 7 + (0.5&7'" + 7 . ) A + ( A r + 7 , A 0
2
7i
72
2
,1
7+( r'"+270^,+K'"+7 -^7 )" ^+(y-g+^r'")A D. a
2
1
2
3
uh, (3.30) h
3.2. Other forms of compact upwind differencings (CVD-II-5)
75
where [•](, is the discretization of [-] and 71, 72 are arbitrary constants. Now using Taylor expansions, it can be shown that Eq. 3.30 is the fourth-order approximation of Eq. 3.25. To derive the fourth-order accurate difference form of the RHS of Eq. 3.30, one should use the third-, the second- and the first-order formulas for hD , h D\ and h?D\ respectively. The following expressions for the operators R and Q can be written as a final result: 2
x
h
Kk = I+ (0.567'" +
7 l
) A + (!?'" + -ft) A , 0
2
QK = I + ( o T + 2 , U - i > i ) A ( s ) + L £ - ~ n
h
,
7
1
+
1
2
- £
7 l
) A
2
(3.31) 6
+(^-i7 +l r)A A{s ). 2
3
Here the third-order compact differencing is used for hD with the parameter S\ while h?D is approximated by A A ( s ) with the parameter s . r
3
3
2
2
The constants 71 and 72 in Eq. 3.31 have the following remarkable property: the coefficients oj* , 6;' in these formulas can be replaced by a-' , b{ with special choice of *yj and 73. For example, let 71 and 72 be determined from the equations 2
l
+ 0.56|' = 0.5if ,
7 l
% +
which is equivalent to using if" and with 71 = 72 = 0 in the operator R&. Then simple calculations give the following result: 1
La , „
oj' +
27,
2,1
= a, ,
a
1,2 2
,
+
2,1
2
72
-
r-7i
= a
2
>
Ti
"2"
72
~ 37
,
6 '
=
6
1,2.1 1
This means that 0 ' , b ' can be used with 71 = 72 = 0 instead of a]' , b}' with j , and 72 defined above. s
of
1
2 1
2
2
Keeping in mind this property, we will henceforth assume that the constants and S f a r e defined by Eq. 3.22 with the superscript of af \ of' being omitted. 1
Upon inspecting Eq. 3.31, one can see that /?/, and Qt, depend on the five parameters s, si, S j , 71, 7 . Of course, the number of free parameters can be increased while using other ways of discretization of (hD ) , k = 1,2,3 in the operator Q. Supposing that ftfc and Qh are defined by Eq. 3.31, it is possible to use the existing degrees of freedom to impose some additional requirements to the pair R/,, Qh- But before doing so, let us consider another approach to discretizing the operators R and Q given by Eq. 3.24. 2
k
I
76
Fifth-order non-centered compact schemes
Up to now, we have used the third-order compact differencing to approximate hD„ only in the operator Q, Another possibility consists of using it in the operator R as well. In this case [R-'Q]^
l
Inserting I — A~'(s)A(s) J
1
= (l + b,A-'{s )A(s )y\l+
i]
[R~ Q}[
a A- (s,)A(s,)
1
+
l
a A ). 2
2
between the operators R^' and Qh, we obtain
= (A( )
+ hAiti))'
Bl
1
(A{si) + a,A(s )
+
s
a A(s,)A ). 2
2
Now the pair of operators Rh, Qh can be written as
Q h
=
1 +
( t - ?) ° { y a
+
+
-
* )
A
i
-
s
j
A
?
j
A
j j 2
2
as a necessary condition of i j , > 0. The derivation of the sufficient conditions for Lh > 0 can be carried out by further analysis of the real parts of the L eigenvalues. The same results can be obtained by calculating the scalar product (L^u, u), where u E L . Rewriting L as K
2
hU
- \&o + | { i - ^ ' Q A ) ( - A ) , 2
R = (l + A / 1 2 ) % , h
2
ft
(3.40)
it can be seen that by virtue of ( — A ) > 0 and the commutativity of all operators 2
involved, 7./, > 0 for s > 0 if and only if / — Ffj^Qh > 0, The latter inequality means that
Fifth-order non-centered compact schemes
80
((ft, - Q )v, km) =
(3.41)
- RlQ>,)v, v) > 0,
k
where v — R^'v. Here again we have used the commutativity of the operators in Eq. 3.40. It should be noted now that and R are polynomials with respect to A and A and that A^ = —4A + A | . Taking into account these facts and neglecting the skew-symmetric part of RlRh — R'^Qh, it may be shown that Eq. 3.41 reduces to the operator inequality h
3
0
2
3
(\C(-A )
k
+
2
£c (-A ) } ,v)>0, k
2
(3.42)
V
where C is defined by equation 3.35 or 3.36 and c = c*(s, Si, s , fx, 72), k = 4,5,6. k
a
Introducing the eigenvalues of ( —A ), it can be easily seen that Eq. 3.42 will be satisfied if C and are such constants that 2