spend many more years together in Ann Arbor { I will miss you all so much now. ... Dear Neetu, you were my friend since the rst day I came here. All this ballroom.
EXPERIMENTS IN MINIMIZING NUMERICAL DIFFUSION ACROSS A MATERIAL BOUNDARY by Christian Aalburg
A dissertation submitted in partial ful llment of the requirements for the degree of Master of Science (Aerospace Engineering) in The University of Michigan 1996
Advisor: Professor Bram van Leer
To Lu Shiyong, Yange, Zhang Ge and Neetu Gupta
ii
ACKNOWLEDGEMENTS First of all I have to state that I was very glad to receive this research topic from MacNeal-Schwendler. I want to thank you herewith also for the nancial support which helped me a lot to make this work possible. My advising professor Bram van Leer has given me excellent guidance throughout the paper and I want to thank him especially for our daily meetings, which have given me lots of motivation and new ideas. It turned out, that working on a research project can indeed be more interesting than answering e-mails { but though the communication was sometimes one-way (which drove some people at home nearly crazy), I was very happy about the close contact to my family and want to thank you all for your support and endurance. A sad incident however is that my Grandfather could never see the nal result of my one-year stay at the Univeristy of Michigan. That this summer will de nitely be one of the nicest times in my life however, is owed to my so many friends who truly cared for me and with whom I would love to spend many more years together in Ann Arbor { I will miss you all so much now.
Lu (shouting mistake?), Yange (cleaning mistake?) and Zhang Ge (sleeping mistake?), my dear Chinese roommates, one gets seldomly granted the luck of making such nice friends like you are. Take my heartiest thanks for so much joy and aection you have given me. Our weekend in Chicago and the canoe trip were the nicest days I had over here. And your delicious food! Knowing that there will be at least three iii
people who nd this thesis \just great" I didn't hesitate to nally submit this nal version. Dear Neetu, you were my friend since the rst day I came here. All this ballroom dancing, iceskating, driving lessons and especially studying together late night in the libraries { you were the only one person always present for me at North Campus. Those short moments, when we helped each other, went for lunch, gave us a call or just met by coincidence, those moments can make life so much brighter and we both know what we are going to miss now. Then there is my home, the Nakamura Co-op, with such a nice group of residents during the summer. You gave me so much more than just a room. For me it was the nicest encounter with America staying in that house together with all of you. Su, you are such a pleasant person { do you remember how we fell into the water? Kristi, with your open heart for all us international students, thank you for the wonderful weekend in Boyne City. Rosalina, you are such a dear friend to me. We could talk about everything and the whole house missed you so much. Nicole and Linda, you are just nice, so nice. Then there is my roommate Phil (I can't imagine anybody less complicated), Jon (How about running the Berlin Marathon?), Mike (All those confusing Law Schools!), Tom (How about some ... meat?), Nick (Studying Russian all nights), Greg (Everybody's daddy!), Bryan etc. etc. Is anybody surprised that I am going to India now for half a year? No wonder, with such a big circle of friends from the Subcontinent! That you all have integrated me so much into your culture has made me very happy. Anjan, friend right from the beginning and partner in the \Dilwale Dulhania ..." fanclub { do you remember how we both went to see Sonali, Urmila, Mamta etc. at Hill? Sukumari, your face was shining so much whenever you saw me eating your food! Yasmin, you are iv
the adventurous person { remember our tennis games and the safari? Usha, I will always be your German translator. Osho, the cheerful chap, how was it with all these problems? Ravi (Have we ever been serious?), Shiva, Parul and Jasim,... . And what about the other parts of the world? Hiroaki, I am sure right now you must be talking again to some of your students. Thank you for so much help and fun in the oce. Your songs on the guitar, your funny pictures and stories, your hat, our long conversations { I really enjoyed having you as my oce mate. Cecile, I will always remember our spontaneous decision to travel to Paris over springbreak. Lijun
Ji, you are so jolly, whenever I met you I had to laugh. Mani (Do you remember how we compared thousands of numbers?), Konstantin and Ed { we could share so much of our problems in the computer lab.
Frank, we both will surely remember all those nights we spent in the computer labs with each 1 kg M&M's and 2 liter Coke. Though it used to take us then a little bit more time to nish our assignments... { working has never been more fun. How was it again, this function of mood, depending on work load (happiness = f[work load], see Appendix E)? Whenever we met, we both were in highest spirits, far beyond work loadcritical. I am looking forward to more team work in Berlin. To all of you who have touched my life, I thank you for the moments we could share together. I enjoyed my time in Ann Arbor so much { thanks to you.
v
TABLE OF CONTENTS DEDICATION : : : : : : : : ACKNOWLEDGEMENTS LIST OF FIGURES : : : : : LIST OF TABLES : : : : : : LIST OF APPENDICES : :
::::::::::::::::::::::::::
ii iii viii xi xii
I. Inroduction : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
1
II. Two-dimensional advection of 2nd - order accuracy : : : : : :
3
:::::::::::::::::::::::::: :::::::::::::::::::::::::: :::::::::::::::::::::::::: ::::::::::::::::::::::::::
CHAPTER
2.1 Hancock's predictor { corrector scheme 2.2 Advection of a circle and a square : : : 2.2.1 Underlying conditions : : : : : 2.2.2 Advection of a circle : : : : : 2.2.3 Advection of a square : : : : : 2.3 Problems in maintaining monotonicity :
: : : : : :
: : : : : :
: : : : : :
: : : : : :
: : : : : :
: : : : : :
: : : : : :
: : : : : :
: : : : : :
: : : : : :
: : : : : :
: 3 : 5 : 5 : 6 : 7 : 10
III. Modi cation of Hancock's scheme : : : : : : : : : : : : : : : : : 13 3.1 Putting diagonal transport into scheme 3.2 Attempt to multidimensional limiting : 3.2.1 The gradient r of a cell : : : 3.2.2 Limit the gradient r : : : : : 3.2.3 Multi-D limiting on a circle : : 3.2.4 Multi-D limiting on a square : 3.3 Nonconvex compressive limiter : : : : : 3.3.1 Design of a variable Superbee 3.3.2 1-D experiments : : : : : : : : 3.3.3 2-D experiments : : : : : : : : vi
: : : : : : : : : :
: : : : : : : : : :
: : : : : : : : : :
: : : : : : : : : :
: : : : : : : : : :
: : : : : : : : : :
: : : : : : : : : :
: : : : : : : : : :
: : : : : : : : : :
: : : : : : : : : :
: : : : : : : : : :
: : : : : : : : : :
13 14 16 17 19 23 25 25 26 27
3.4 CFL-dependent compressive limiters 3.4.1 CFL-dependent design : : 3.4.2 1-D experiments : : : : : : 3.4.3 2-D experiments : : : : : :
: : : :
: : : :
: : : :
: : : :
: : : :
: : : :
: : : :
: : : :
: : : :
: : : :
: : : :
: : : :
: : : :
: : : :
31 31 34 36
IV. Arti cial Advection : : : : : : : : : : : : : : : : : : : : : : : : : : 41 4.1 4.2 4.3 4.4 4.5
1-D formulation : : : : : : : : : : : : : : : 1st - order 1-D test results : : : : : : : : : : 2-D formulation : : : : : : : : : : : : : : : 1st - order 2-D test results : : : : : : : : : : Desirable extension: 2nd - order formulation
: : : : :
: : : : :
: : : : :
: : : : :
: : : : :
: : : : :
: : : : :
: : : : :
: : : : :
: : : : :
41 44 44 47 55
V. Conclusions : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 66 APPENDICES : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 68 BIBLIOGRAPHY : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 82
vii
LIST OF FIGURES Figure 2.1
Advection of a circle with Superbee limiters ( = 0.9, t = 0.5 [222 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
8
2.2
Dierent Limiters : : : : : : : : : : : : : : : : : : : : : : : : : : : :
8
2.3
Advection of a square with Superbee limiters ( = 0.9, t = 0.5 [222 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : :
9
2.4
Cuts parallel to x- and y-axis through the diusion zone : : : : : :
9
2.5
One-dimensional advection with Superbee limiter ( = 0.9, t = 0.5 [111 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 10
2.6
Cuts of one-dimensional advection : : : : : : : : : : : : : : : : : : : 11
3.1
Upwind biasing scheme with Superbee limiters ( = 0.9, t = 0.5 [222 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 15
3.2
Cuts of the upwind biasing scheme : : : : : : : : : : : : : : : : : : 15
3.3
Circle with Multi-D limiter ( = 31 , = 0.9, t = 0.5 [222 it. steps])
3.4
Gradient based on the horizontal neighbour ( = 1, = 0.5, t = 0.5 [400 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 21
3.5
Gradient based on the diagonal neighbours ( = 0, = 0.5, t = 0.5 [400 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 22
3.6
Limiting without considering the diagonal cells ( = 1, = 0.5, t = 0.5 [400 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 22
3.7
Square with Multi-D limiter ( = 13 , = 0.5, t = 0.5 [400 it. steps]) 24
3.8
Square with reduced limiter ( = 1, = 0.5, t = 0.5 [400 it. steps]) 24 viii
21
3.9
Variable Superbee : : : : : : : : : : : : : : : : : : : : : : : : : : : : 28
3.10
1-D advection with highly compresive limiter: = 2:0 ( = 0:9, t =0.5 [111 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : 28
3.11
1-D advection with highly compressive limiter: = 10:0 ( = 0:9, t = 0.5 [111 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : 29
3.12
Compare = 1:0 with = 10:0 for diagonal advection of a circle ( = 0.9, t = 0.5 [222 it. steps]) : : : : : : : : : : : : : : : : : : : : : : 29
3.13
Diagonal advection of a square with highly compressive limiter: = 10:0 ( = 0.9, t = 0.5 [222 it. steps]) : : : : : : : : : : : : : : : : : 30
3.14
Cuts of the highly compressive limiter : : : : : : : : : : : : : : : : : 30
3.15
A CFL-dependent variable limiter; = 0:45 : : : : : : : : : : : : : 33
3.16
CFL-dependent limiter in 1-D advection ( = 0.9, t = 0.5 [111 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 35
3.17
CFL-dependent limiter with = 5:0 ( = 0.9, t = 0.5 [111 it. steps]) 35
3.18
Contour plot of a sharp square, advected with CFL-dependent limiter and = 5:0 ( = 0:9, t = 0.5 [111 it. steps]) : : : : : : : : : : : 37
3.19
CFL-dependent limiter on diagonal advection: = 1:0 ( = 0.9, t = 0.5 [222 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : 37
3.20
Cuts of the diagonal advection with CFL-dependent limiter : : : : : 38
3.21
Development of density contours for a highly compressive and CFLdependent limiter: = 5:0 ( = 0.9) : : : : : : : : : : : : : : : : : 39
3.22
Circle diagonally advected by CFL-dependent limiter: = 1:0 ( = 0.9, t = 0.5 [222 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : 40
4.1
Compare 1st - order advection with and without artif. advection ( = 0.9, t = 0.5 [111 it. steps]) : : : : : : : : : : : : : : : : : : : : : : 45
4.2
Arti cial advection in 1-D with D = 5 ( = 0.9, t = 0.5 [111 it. steps]) 45
4.3
Arti cial advection in 1-D with D = 1 ( = 0.9, t = 0.5 [111 it. steps]) 49 ix
4.4
1st - order advection of a square ( = 0:9, t = 0.5 [222 it. steps]) : : 49
4.5
Arti cial compression on a square ( = 0:9, D = 2, t = 0.5 [222 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 50
4.6
Arti cial compression on a square ( = 0:5, D = 2, t = 0.5 [400 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 50
4.7
Cuts parallel to x- and y-axis through the diusion zone : : : : : : 51
4.8
1st - order advection of a circle ( = 0:9, t = 0.5 [222 it. steps]) : : : 51
4.9
Arti cial compression on a circle ( = 0:9, D = 2, t = 0.5 [222 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 52
4.10
Arti cial compression on a circle ( = 0:5, D = 2, t = 0.5 [400 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 52
4.11
Circular advection of a circle with arti cial advection ( = 0:5, D = 5, t = 0.5, 1.0, 1.5, 2.0 [625, 1250, 1875, 2500 it. steps]) : : : : : : : 53
4.12
Circular advection with D = 2 ( = 0:5, t = 1.0 [1250 it. steps]) : : 53
4.13
Cuts through the diusion zone ( = 0:5, D = 2, t = 1.0 [1250 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 54
4.14
Circular advection with no arti cial advection ( = 0:5, t = 2.0 [2500 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 54
4.15
2nd - order arti cial advection for all cells with < 0 ( = 0:9, t = 0.5 [111 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 63
4.16
Cuts of 2nd - order arti cial advection for all cells with < 0 ( = 0:9, t = 0.5 [111 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : 63
4.17
2nd - order arti cial advection for all cells with < 0 ( = 0:9, t = 0.5 [111 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : : : : : : 65
4.18
Cuts of 2nd - order arti cial advection for all cells with < 0 ( = 0:9, t = 0.5 [111 it. steps]) : : : : : : : : : : : : : : : : : : : : : : : 65
E.1
Above a critical level of problems, your mind just starts ying : : : 81 x
LIST OF TABLES Table 2.1
1st iteration step : : : : : : : : : : : : : : : : : : : : : : : : : : : : : 11
2.2
2nd iteration step: lower right corner : : : : : : : : : : : : : : : : : : 12
3.1
Stencil to compute the gradient vector : : : : : : : : : : : : : : : : 16
3.2
Known limiters yielded by variable Superbee : : : : : : : : : : : : : 26
xi
LIST OF APPENDICES Appendix A.
Designing a circular parcel as initial condition on a cartesian grid : : : 69
B.
Multi-dimensional limiting : : : : : : : : : : : : : : : : : : : : : : : : 72
C.
Calculations for the CFL-dependent variable limiter : : : : : : : : : : 76
D.
Arti cial advection in a 1st - order scheme : : : : : : : : : : : : : : : : 78
E.
Some thoughts about happiness and work load : : : : : : : : : : : : : 81
xii
CHAPTER I
Inroduction There are certain kinds of CFD applications, such as simulations of deep-drawing or forging, where there is a material boundary, of which the shape is changing with every timestep. The location of the boundary can be traced with a marker function, de ned as the distance to the nearest material boundary, which satis es the passive advection equation. Cells fully outside the material boundary should be empty and cells fully inside should be lled completely with material. Numerical diusion however, destroys the discontinuity by lling cells outside the boundary partly with material at the expense of cells inside the boundary, and thus causes problems with the simulation of the industrial process. The aim of this thesis is to look into possibilities to minimize the numerical diusion across a material boundary. To simulate the process we take a simple two-dimensional advection scheme of the second order of accuracy with mass conservation and a marker function. We assign dierent velocity elds and a density parcel is to be advected by them. In order to improve the performance of the standard scheme we have three main starting-points. The rst two concern the limiting process in the predictor step of Hancock's scheme [1]. Limiters like Double Minmod [2], Superbee [3], etc. are taking into account 1
2 variations among cells in one direction only. In a two-dimensional scheme they operate independently in two directions; because their properties are not uniform in both of them, this tends to deform the initial shape of boundaries. So the rst idea is to design a multi-dimensional limiter, which limits on the basis of the gradient in each cell and which uses also the diagonally neighboring cells. The second starting point is to use limiters with higher compressible properties than Superbee. Superbee is designed to be monotone for linear advection, but it could still be more compressive while remaining non-oscillatory. One can use a variable Superbee which allows to control the degree of arti cial steepening. Standard limiters make sure that the gradients in each cell are not large enough to cause overshoots with respect to the neighbouring cells. But by considering the amount of mass advected across a cell face during each timestep, which depends on the CFL-number, the gradients can actually be made steeper without creating under- or overshoots, causing even more arti cial compression. The third starting-point for reducing the numerical diusion across a material boundary is to change the initial velocity eld by overlaying it with additional velocities, directed towards the material interface. These velocities are aimed at pushing the diused material back to the inside region, where it belongs. This is a kind of arti cial compression that has the potential of better performance preserving the shape of a material boundary than ordinary one-dimensional limiters do. The technique may be called \arti cial advection" and is related to Harten's arti cial compression method [4], in which characteristic velocity elds are modi ed.
CHAPTER II
Two-dimensional advection of 2nd - order accuracy 2.1 Hancock's predictor { corrector scheme We have two primitive variables that have to be simulated: density () and distance ( ) to the next material boundary. The density advection is governed by the conservation of mass, which reads in dierential conservative fomulation for two dimensions:
@ + @ (u) + @ (v) = 0 (2.1) @t @x @y The marker function shall be de ned as the distance to the nearest material bound-
ary, reckoned positive inside the material and negative outside. We will limit it by -0.5 from below and +0.5 from above. This quantity satis es a passive advection equation,
@ + u @ + v @ = 0; (2.2) @t @x @y which, combined with the conservation law of mass, yields the conservation law @ ( ) + @ (u ) + @ (v ) = 0: @t @x @y
(2.3)
This system of equations (2.1, 2.3), of the form
@ U + @ F + @ G = 0; @t @x @y 3
(2.4)
4 shall be solved with second-order accuracy by using a method introduced by Hancock. His scheme consists of a predictor (half-time) and a corrector (full-time) step. To make it second-order accurate in space and time, the initial-value distribution has to be reconstructed linearly before the predictor step. This is done by an averaging function, further called limiter, which calculates the slopes such that the internal distributions don't over- or undershoot the average values in neighboring cells; thus the scheme remains monotone.
xUi;j = ave (Ui;j Ui 1;j ; Ui+1;j Ui;j )
(2.5)
y Ui;j = ave (Ui;j Ui;j 1; Ui;j+1 Ui;j )
(2.6)
Where there is no danger of over- or undershoots, the slope can actually be made steeper than just the algebraic average of the left-side and the right-side dierences of the conservative variables in each cell. One such limiter which makes use of this arti cial-steepening possibility is \Superbee" [3]: 8 > < minmod fmaxmod(a; b); minmod(2a; 2b)g ; ab > 0; ave(a; b) = > : 0; ab 0:
(2.7)
After the initial value distribution has been linearly reconstructed by a limiter, the predictor step advances the cell values by half a time-step and generates time-centered interface values.
U~ i;j = Ui;j
t u U + 1 U (u 2x i;j x i;j 2 i;j i+1;j ui 1;j ) t v U + 1 U (v 2y i;j y i;j 2 i;j i;j+1 vi;j 1)
U~ i+ 21 ;jL = U~ i;j + 12 xUi;j ;
U~ i;j+ 12 L = U~ i;j + 12 y Ui;j :
(2.8) (2.9) (2.10)
5 The uxes are computed by using the time-centered interface values as initial values for a and the Riemann problem; in our casethis boils down to taking the ux always from the upstream cell. In Eqs. (2.8{2.10) it is assumed that ui;j and vi;j are positive, therefore the upstream cell is the left cell (subscript L). Finally, the corrector step advances the solution by a full time-step, using the interface uxes.
8 > < u F~ i+ 21 ;jL = > : u 8 > < v G~ i;j+ 12 L = > : v
Ui;j = Ui;j xt F~ i+ 12 ;jL F~ i
1 2 ;jL
9 > = ; > ; 1 i+ ;j 9 2 > = ; > ; 1
(2.11) (2.12)
i;j + 2
t ~ ~ 1 y Gi;j+ 2 L Gi;j
1L 2
:
(2.13)
The scheme can easily be made 1st - order by omitting the predictor step. This will be helpful later to study the aect of arti cial advection on a scheme that has much diusion.
2.2 Advection of a circle and a square 2.2.1 Underlying conditions The experiments will generally be done on a ow eld of 1:0m 1:0m with a grid of 200 cells each in x- and y-direction. Two kinds of velocity elds willl be used. One is uniform in some direction of choice 1 and the other one is a half circular eld around the mid-point on the x-axis. The timestep is calculated on the basis of the following CFL-condition:
x + y < 1 1
We usually take the ow either diagonal or parallel to an axis.
6 t u + t v < 1 x y ) t = h u
i v
x + y max
:
(2.14)
The boundary condition around the ow eld will always be a soft boundary. That means the sides don't create re ections. The de nition of the marker function
as the distance to the next material
boundary makes it impossible to use densities of = 0 to simulate the outside region, which should not contain any material. The governing equation conserves the product , thus the value of cannot be obtained if = 0. We will use instead
= 0:1 for the outside region and = 1:0 for the material, whenever we want to make use of the marker function. However, as we will see later, itself is as good a marker as . In fact,
turns out to have more monotonicity problems than , so
that we actually don't really use , except in Chapter IV.
2.2.2 Advection of a circle Our rst test case for the performance of an ordinary scheme shall be the diagonal advection of a circle. As the circle is initially de ned by assigning to cells a fracture of the full density - depending on how much of the cell area is intersected by the outer radius - we won't have a discontinuity in density anyway and can't expect a sharp jump (see Appendix A). But the circle is useful to see how Superbee behaves in a two-dimensional scheme. One can see in Figure 2.1 that the circle is deformed into an octagonal shape. That means the limiter's properties are direction dependent. To understand this we have to take a look at what averaged values Superbee returns, depending on the ratio of the cell-value dierences on the right and left sides. The average a limiter returns can be de ned with regard to the algebraic
7 average as
ave (a; b) = R(#) 12 (a + b);
# = ab :
(2.15)
If the returned value of R(#) exceeds 1, the \limiter" in fact does arti cial steepening. As the average that Superbee returns, fully depends on # (see Fig. 2.2), one can imagine that if this ratio of right-side to left-side dierence is dierent in the xand y-directions, the limiter does more or less arti cial steepening in one direction than the other, thus deforming the shape of the material boundary.
2.2.3 Advection of a square The eect of nonuniform steepening in all directions doesn't show up on a squareshaped density parcel, because the gradients of the cells are nearly everywhere gridaligned, except at the corners. This can be clearly seen in Fig. 2.3, which has been computed with the same parameters as the circle. The shape of the square is preserved. What we can see better now, is how well the scheme performs in keeping the initial density discontinuity. The cuts through the diusion zones (Fig. 2.4) show that Superbee yields about ve internal states on all four sides. Our main goal is to reduce this number of internal states with the following experiments. But rst we have to make an astonishing observation. The upwind cuts show that the scheme is not fully monotone. Within the diusion zone some overshoots have been generated at the upper left and lower right corner. It seems that the traditional de nition of monotonicity for one-dimensional schemes doesn't apply for two-dimensional schemes.
8
PSI Contour 200
180
180
160
160
140
140
120
120 Y
Y
RHO Contour 200
100
100
80
80
60
60
40
40
20
20
20
40
60
80
100 X
120
140
160
180
200
20
40
60
(a)
80
100 X
120
140
160
180
200
(b)
Figure 2.1: Advection of a circle with Superbee limiters ( = 0.9, t = 0.5 [222 it. steps])
R( # ) 2
6
no monotonicity 4# #+1
no monotonicity 4
Superbee
@ R @
1
6
2 #+1
1 2
)
6
2# #+1
1
#+1
6
Double Minmod
2
Figure 2.2: Dierent Limiters
3
-
#
9 PSI Contour 200
180
180
160
160
140
140
120
120 Y
Y
RHO Contour 200
100
100
80
80
60
60
40
40
20
20
20
40
60
80
100 X
120
140
160
180
200
20
(a)
40
60
80
100 X
120
140
160
180
200
(b)
Figure 2.3: Advection of a square with Superbee limiters ( = 0.9, t = 0.5 [222 it. steps]) Downwind cuts parallel to y−axis 1
0.8
0.8
0.6
0.6
RHO
RHO
Downwind cuts parallel to x−axis 1
0.4 0.2 0 0
0.4 0.2
0.5 X
0 0
1
1
0.8
0.8
0.6
0.6
0.4 0.2 0 0
1
Upwind cuts parallel to y−axis
1
RHO
RHO
Upwind cuts parallel to x−axis
0.5 Y
0.4 0.2
0.5 X
1
0 0
0.5 Y
1
Figure 2.4: Cuts parallel to x- and y-axis through the diusion zone
10
2.3 Problems in maintaining monotonicity The fact that the Hancock scheme with Superbee limiter creates oscillations in two dimensions is troubling. Superbee has been designed to be non-oscillatory for linear equations in one-dimension. To test this, we may assign a velocity eld just in the x-direction so that our scheme equals the 1-D scheme, because there are only zero uxes in the y-direction. The experiment shows that, indeed, advection parallel to an axis does not cause any over- or undershoots (Fig. 2.5 and 2.6). To understand RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 2.5: One-dimensional advection with Superbee limiter ( = 0.9, t = 0.5 [111 it. steps]) why overshoots show up in 2-D, we have to trace the results of each time-step. It turns out, that already after the second iteration step, the scheme is not monotone anymore, according to general de nition. This is what happens: After the rst time-step, cells diagonally downwind are partly lled with material and cells diagonally upwind are partly emptied. As the ow direction is 45 we nd a line of symmetry which is the diagonal (Table 2.1). After the next predictor step already we will nd an overshoot. Let's look at the
11 Downwind cuts parallel to y−axis 1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
RHO
RHO
Upwind cuts parallel to y−axis 1
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1 0
0.1
0.2
0.3
0.4
0.5 Y
0.6
0.7
0.8
0.9
1
0.1 0
0.1
0.2
0.3
0.4
(a)
0.5 Y
0.6
0.7
0.8
0.9
1
(b)
Figure 2.6: Cuts of one-dimensional advection 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1
0.1 0.1 0.1 0.1 0.1 0.505 0.505 0.505 0.505 0.505 0.595 1 1 1 1 0.595 1 1 1 1 0.595 1 1 1 1 0.595 1 1 1 1 0.19 0.595 0.595 0.595 0.595 0.1 0.1 0.1 0.1 0.1 Table 2.1: 1st iteration step
0.1 0.1 0.505 0.505 0.505 0.505
0.1 0.1 0.1 0.1 0.1 0.1 0.505 0.1 0.1 0.1
lower right corner (Table 2.1). The bottom line of cells ( = 0:595) has a derivative in the y-direction and will be emptied a little bit during the half time-step. The right-side cells ( = 0:505) have a derivative in the x-direction and are going to be lled up. The bottom cell of this line has a smaller dierence with its left neighbour
= 0:595) than the others ( = 1:000) and therefore is going to get an increased, but lower value than the others. The monotonicity is preserved in the y-direction, but in the x-direction it turns out, that the bottom line of cells, which have decreased in value, have dropped below the value of the right-end cell, which has increased (Table 2.2).
12 1 1 0.616 0.1 1 1 0.616 0.1 0.484 0.484 0.595 0.1 0.1 0.1 0.1 0.1 Table 2.2: 2nd iteration step: lower right corner The problem lies not so much in the limiter. Even if we take Double Minmod ( Superbee without the steepening [2], see Fig. 2.2) the same overshoot will occur. The problem is that, though the corner cell is going to be lled from the left side, it should be emptied from below. But just in order to prevent overshoots, any limiter will return a zero derivative in that direction, because the cell above has the same value. We can summarize that the general de nition of monotonicity doesn't work for this advection scheme in two dimensions. The problem lies either in the scheme itself or in the de nition of monotonicity - depending on how we look at it. If we say that the results are free of oscillations in 1-D along the ow direction rather than the grid-direction, we nd the same property in 2-D. In fact, the scheme does preserve
monotonicity along the ow direction. But if we make cuts at some angle to the ow direction e.g., parallel to a coordinate axis, we nd overshoots. As we have to work with the cells, these oscillations are bad news and will cause diculties in all future experiments, that are sensitive to the gradients.
CHAPTER III
Modi cation of Hancock's scheme 3.1 Putting diagonal transport into scheme Let us rst try to get rid of the oscillations in the diusion zone. We saw that the problem with the corner cell was that the uxes it received didn't quite correspond to the actual ow situation. The ow direction is actually diagonal, but the cell was lled only from the left side and not emptied from below. This is de nintely - no matter how we de ne monotonicity - a weakness of the scheme we are using. How about a scheme that includes the diagonal cells in its update stencil? Such an upwind biased scheme of 2nd-order has been introduced by Van Leer [5, 6]. Each cell is updated in the predictor step in two dierent ways in order to get two dierent values which are to be used to calculate either the ux in the x- or the y-direction. The emphasis in each half time-step is partly on the upwind dierence and not fully on the gradient anymore. Assuming a uniform velocity eld, Eqs. 2.8 { 2.10 are now changed as follows:
U~ xi;j = Ui;j 2x xU 2y (Ui;j Ui;j 1);
(3.1)
U~ yi;j = Ui;j 2y y U 2x (Ui;j Ui 1;j );
(3.2)
U~ i+ 12 ;jL = U~ xi;j + 21 xU;
(3.3)
13
14
U~ i;j+ 12 L = U~ yi;j + 12 y U:
(3.4)
This scheme however didn't yield the results we were hoping for. It even generated greater oscilations, when applied in the standard way. The reason for the scheme's failure might be the omitting of third-order terms while deriving the formula, in order to simplify it [6]. I could improve the results by calculating the gradients again after the predictor step, the results of which are shown in Figures 3.1 and 3.2. But still, this kind of upwind biasing doesn't fully help us out, so we rather continue to work with Hancock's original method.
3.2 Attempt to multidimensional limiting We have seen in Section 2.2.2 that a problem of the limiting in Hancock's scheme is the unidirectional bias of Superbee or any other 1-D limiter: a circle was deformed into a hectogon. The reason was that the two directions x and y are decoupled when the average derivatives are being calculated. That leads to independent steepening, so that the vector of the reconstructed gradient need not point into the same direction as it did before the limiting. We want to try now to design a limiter which doesn't have this de ciency. Therefore we must calculate the gradient vector of the cell. This gradient can then be limited by a factor, which steepens or attens the slope of the plane, but keeps the ratio between x- and y-slopes constant. Basically we are going to limit the inclination of a plane with the same means as we have done with a straight line before. The rst step to design such a multidimensional limiter is to calculate the gradient of a cell.
15 PSI Contour 200
180
180
160
160
140
140
120
120 Y
Y
RHO Contour 200
100
100
80
80
60
60
40
40
20
20
20
40
60
80
100 X
120
140
160
180
200
20
(a)
40
60
80
100 X
120
140
160
180
200
(b)
Figure 3.1: Upwind biasing scheme with Superbee limiters ( = 0.9, t = 0.5 [222 it. steps]) Downwind cuts parallel to y−axis 1
0.8
0.8
0.6
0.6
RHO
RHO
Downwind cuts parallel to x−axis 1
0.4 0.2 0 0
0.4 0.2
0.5 X
0 0
1
Upwind cuts parallel to x−axis 1 RHO
RHO
1
Upwind cuts parallel to y−axis
1
0.5
0 0
0.5 Y
0.5 X
1
0.5
0 0
0.5 Y
Figure 3.2: Cuts of the upwind biasing scheme
1
16
3.2.1 The gradient r of a cell There are of course many ways to nd the gradient vector 5. The easiest way would be to take the central dierence in the x and in y directions. More elegant and robust however, is to include all may now opt to nd the weights for each cell that minimize the sum of the square errors. Our stencil to compute r looks like this: 7 8 1 6 i,j 2 5 4 3 Table 3.1: Stencil to compute the gradient vector The density value in each of the nine surrounding cells can be linearly approximated as follows:
8 > > 1 > > > > 2 > > > > 3 > > > > < 4 > > 5 > > > > 6 > > > > > 7 > > > : 8
9 8 > > > > i;j > > > > > > > > i;j > > > > > > > > i;j > > > > > > > = > < i;j = > > > > i;j > > > > > > > > i;j > > > > > > > > i;j > > > > > > > ; > : i;j
9 2 > > 66 > > 66 > > 66 > > 66 > > 66 > > 66 > > = 66 + 66 > 66 > > 66 > > 66 > > 66 > > 66 > > 66 > > > ; 4
dx
dy
dx
0
dx
dy
0
dy
dx
dy
dx
0
dx dy 0
dy
3 77 77 77 77 77 77 8 77 > < 77 x 77 > : 77 y 77 77 77 77 5
linear (~x) = i;j + (~x ~xi;j )T r A r = (linear (~x) i;j ); A T A r = A T (linear (~x) i;j );
or
9 > = ; > ;
(3.5)
17
r = (A T A ) 1 A T (linear (~x) i;j ); 8 > x : y
9 8 > = 1> < = > ; 6> :
9 = [5 + 6 + 7]) > dx ; 1 ([7 + 8 + 1] [3 + 4 + 5 ]) > ; dy 1 ([1 + 2 + 3]
(3.6)
(3.7)
n = n i;j : Hence each cell gets the weight of 61 if we want to approximate as accurately as possible. But we are free to experiment and assign any weights of our own choice. We can manipulate the gradient in order to emphasize more the diagonal cells or the horizontal cells for example.
3.2.2 Limit the gradient r Once we have the gradient r we can go ahead and limit it in a similar way we have done with the one-dimensional derivative. We will introduce a factor ' to increase or decrease r. The value of this factor ' can be determined for each direction, say horizontal, vertical and diagonal. By taking the minimum of these values we make sure that no over- or undershoots are being generated. The slopes which were originally being calculated according to equation 2.5 and 2.6 are now determined like this:
8 > < xUi;j > : y Ui;j
9 38 2 > > = 66 dx 0 77 < x ='4 5> > ; 0 dy : y
9 > = : > ;
(3.8)
We can limit in as many possible directions as we want to. Let's give the dierent
''s the names of the directions on a compass. The way ' has to be determined equals each for the E{W and N{S direction and for the NE{SW and NW{SE direction.
'E
W
can be determined as follows:
18
ab 0
ab > 0
6
6
x
x B BN "" "
i-1,j i,j i+1,j
if (x 6= 0) then 'E else 'E W = 1
-
x
W
=0
AU
i-1,j i,j i+1,j
j'E j 'E
-
x
W
dx x j ji+1;j i;j j b
W
dx x j ji;j i 1;j j a
if ab < 0 if (dx x 6= 0) else
'E
W
'E
W
=0
else
'E
W
=1
= dx1x minmod (a; b)
For the diagonal directions, 'NE
SW
if (dxx + dyy 6= 0) then 'NE j'NE j'NE
then
or 'NW SW
SE
have to be calculated like this:
= 0 else 'NE
SW
(dx x + dy y )j ji+1;j+1 i;j j b
SW
(dx x + dy y )j ji;j i 1;j 1j a
SW
=1
if ab < 0 if (dx x + dy y 6= 0) then
'NE
SW
=0
else
'NE
SW
=1
else
'NE
SW
= dx x+1 dy y minmod (a; b)
19 In the NW{SE direction the denominator becomes (dx x dy y ). In this case we have limited the gradients in the most basic way to avoid overshoots. The values inside a cell vary at most by half the smallest cell-value dierence on any side. This equals a simple Minmod limiter without any arti cial compression. We therefore can not expect good performance in the area of reducing numerical diusion. But we obviously can use any other limiter of our own choice. We just have to substitute Minmod by, e.g., Superbee. The plane can then be steepened arti cially within the limits of Superbee in all directions, while still maintaining the same gradient direction. The source code for this function can be found in Appendix B.
3.2.3 Multi-D limiting on a circle Let us rst try the most multi-dimensional version of this limiter. We calculate the gradient on the basis of a least square error on the 9-cell block and we limit the factors ' in all four directions with Superbee limiters. With this version we convect a circular parcel in the diagonal direction, as in Figure 2.1. The contour plot of density (Figure 3.3) doesn't look very promising. We nd neither a good shape of the circle nor a sharp boundary anymore. Especially in the direction othogonal to the ow diusion is very high. It seems that keeping the same ratio of derivatives and limiting them by the most restricting factor of all possible directions is a very strong condition. Or, in other words, the freedom of using independent gradients must have been greatly explored by the scheme before. It is easy to get rid of the asymmetry in diusion. Higher diusion orthogonal to the advection is built into the rst-order scheme and depends on the CFL-number (see also Section 4.4). If we choose = 0:5 the diusion will be symmetric again. We can try to experiment with the weights of the cells to determine the gradient.
20 The part which determines the gradient of a cell was implemented in my program in the following way:
x = (i+1;j i 1;j ) + 1 2 (i+1;j+1 i 1;j 1) + 1 2 (i+1;j 1 i 1;j+1 ) (3.9) 01 With dierent values for we vary the in uence of the horizontal cell compared to the diagonal cells:
= 1: gradient based solely on the horizontal cell = 31 : gradient based on the least square error = 0: gradient based solely on the diagonal cells We have just seen one result with the least square method, so let's try out the in uence of by assigning the two extreme values = 1 and = 0. The results for both cases are shown in Figure 3.4 and 3.5. There is hardly any dierence visible. It seems that for the circle it doesn't matter how we determine the gradient in detail. The in uence of can be neglected. That is not too surprising. The size of the gradient doesn't matter anyway, because it will only change the value of the factor
' in front of it. What matters is the ratio x=y and this ratio doesn't change very much if we use once the horizontal cell and once the average of the two diagonal cells to determine x. The shape of the circle has now become symmetric but not any better. Diusion is very high and instead of having eight corners (see Figure 2.1) the circle has now eight lobes and looks like a ower. These tests were done under the condition that the gradient plane doesn't overshoot any of the adjacent cells, neither the horizontal/vertical nor the diagonal neighbours. By assigning very high values to 'NE 1
The smallest value of all ''s is nally being used.
SW
and 'SE
NW 1
we can easily sup-
21
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 3.3: Circle with Multi-D limiter ( = 31 , = 0.9, t = 0.5 [222 it. steps])
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 3.4: Gradient based on the horizontal neighbour ( = 1, = 0.5, t = 0.5 [400 it. steps])
22
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 3.5: Gradient based on the diagonal neighbours ( = 0, = 0.5, t = 0.5 [400 it. steps])
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 3.6: Limiting without considering the diagonal cells ( = 1, = 0.5, t = 0.5 [400 it. steps])
23 press the diagonal cells in the limiting process and concentrate again only on the horizontal/vertical cells. All the multi-dimensional limiter does now is keeping the same ratio of x=y and trying to make it as steep as possible according to Superbee without overshooting in x- and y-direction. Figure 3.6 is the disappointing result of this idea. It makes a square out of a circle. We wanted to get improvement on the shape of the circle after advection, but keeping the same ratio of gradients obviously is not the right way to solve this problem. It is not worth it to further study all possible combinations in limiting and gradient. For completeness however we should also look at what happens to a square.
3.2.4 Multi-D limiting on a square We know already that the performance of this multi-D limiter is not that exciting, so I just want to present two experiments: the most multi-dimensional one, as in Figure 3.3, and the reduced version, which omits the diagonal cells (as in Fig. 3.6). What we get is similar to the results under Section 3.2.3. Diusion is very high; the results look more like those of a First-order scheme (Fig. 3.7). The shape is not so badly altered but one can observe now, that each time the diagonal cells are not included in the limiting process, the material boundary becomes a bit sharper at the corners (Figure 3.8: NE, SE, SW and NW corners). Overall we have to observe that our attempt to a multi-dimensional limiter didn't give us the improvements we were hoping for. Keeping the same ratio of derivatives
x=y turns out to be very restrictive and is still not enough to preserve the shape of a material boundary. There are other factors that seem to be responsible for the deformation, which we haven't studied yet and which probably are more complicated. Let's turn towards our second starting point to reduce numerical diusion across
24
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 3.7: Square with Multi-D limiter ( = 13 , = 0.5, t = 0.5 [400 it. steps])
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 3.8: Square with reduced limiter ( = 1, = 0.5, t = 0.5 [400 it. steps])
25 material boundaries, which was: using limiters with higher compressible properties than Superbee. So far we have to live with the disadvantages of a not perfectly preserved shape of the initial condition.
3.3 Nonconvex compressive limiter 3.3.1 Design of a variable Superbee We know that regular numerical diusion causes a step function, like our material boundary, to spread in time. Arti cial steepening however can put this spreading to a halt and a limiting pro le may be reached. Arti cial steepening is always achieved through the predictor step, when a value for R(#) (see Eq. 2.15) greater than one is returned by the limiter. The gradient is then greater than the average of the left-side and right-side cell dierences. Superbee (see Fig. 2.2) makes use of this possibility to some extent and yields already much better results than Double Minmod for example. The parameter region, in which the results remain non-oscillatory however allows still more arti cial compression, and we want to take advantage of this now by using a variable Superbee limiter [7]. What we are going to change is the point where the design curve of Superbee leaves the boundary of the "no monotonicity" region (currently at # = 21 and # = 2, with R(#) = 34 ). With a factor , which is to control the location of the mentioned intersection point in the designcurve of the limiter, we can rintroduce a variable Superbee as follows:
8 > < minmod f maxmod(a; b) + (1 ) minmod(a; b) ; minmod(2a; 2b)g ; ab > 0; ave(a; b) = > : 0; ab 0: (3.10)
26 The intersection point is given by 2 + (1 ) 2# ; # < 1; = #+1 #+1 4 2# 2 #+1 = #+1 + (1 ) #+1 ; # > 1: It depends on alpha and can be found as follows: 4# #+1
# 1:
(3.11)
ave(a; b) = min( a + (1 ) b ; 2 b)
nd # where function changes:
2b = a + (1 ) b, or
)
2# = (1 #) + #,
#intersec = 1 + ;
0 1:
For # > 1, #intersec is just the reciprocal. There exist three values for for which we get a limiter we already know:
0
Limiter
Minmod Double Minmod 1 Superbee Table 3.2: Known limiters yielded by variable Superbee 1 2
For our purpose the range 1 < minmod maxmod (a; b) ; minmod ( 2 a ; 1 2 b) ; ab > 0; ave(a; b) = > : 0; ab 0:
(3.12)
with = x or = y : For diagonal transport we have = CFL 2 . As we have been dealing already with a variable limiter in the previous section, we reformulate it to make full use of everything at hand: 8 8 9 > > > < maxmod (a; b) + (1 ) minmod (a; b) ; > = > > ; ab > 0; < minmod > > : minmod ( 2 a ; 1 2 b) ; ave(a; b) = > > > > : 0; ab 0: (3.13) The shape of this new function in the # - R(#)-diagram can be seen in Figure 3.15 for = 0:45. The calculations for the intersection points are done in Appendix C.
R( # ) 4
6
no monotonicity
4 1 1+#
=5
# = 1+ 1 1( 11+ )
3
4# 1 1+# 1
no monotonicity
=5 33
Figure 3.15: A CFL-dependent variable limiter; = 0:45
# = 1 + 1 [ 2 1]
2
4# 1+#
4 1+
2# #+1
2
#+1
=1
=1
1
1 3+
1 2
1
1
2
3
-
#
34
3.4.2 1-D experiments Just as for the variable Superbee we start our experiments with a one-dimensional simulation of the advection of a square. For = 1 the averaging function equals the Superbee, except that the\no monotonicity" borders are now changed. The maximum value for R( ) is now R( )max = 1:90 instead of 34 (for a CFL-number of
= 0:9). As one can guess from Figure 3.15, the point at which the limiter leaves the \no monotonicity" border will be shifted quite a bit, especially since the 1-D case has to be calculated with x = 0:9 and not with x = 0:45, for which the diagram has been drawn and which is our standard case for a 2-D simulation (diagonal advection). For # < 1 the intersection point is now # = 0:05 instead of 21 on the left side and
# = 20 instead of 2 at the right side respectively for # > 1. One has to admit that these results look much better than everything else we got so far. Only two internal states shows us Figure 3.16. This is a signi cant improvement over the performance of the normal limiters, which yielded ve internal states. It seems that increasing arti cial compression for those ratios of #, which have already some, doesn't help us much (see Section 3.3). What gives improvement is extending the range of #, for which the limiter does arti cial compression. This eect is of course much bigger for a 1-D scheme than for a 2-D scheme, because in the 2-D case the CFL-numbers x and y are only half as big as the overall CFL number . Before we are going to run the experiments in 2-D advection, I want to try out how the CFL-dependent limiter works with an = 5:0, meaning highly compressive. As Figure 3.17 shows us, this averaging function is even capable of yielding only one internal state. I would say that there is hardly anything sharper possible. If the scheme performs as good as this also for the two-dimensional case, we will have solved one of our main goals, which was: to keep the material boundary sharp.
35
Downwind cuts parallel to y−axis 1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
RHO
RHO
Upwind cuts parallel to y−axis 1
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1 0
0.1
0.2
0.3
0.4
0.5 Y
0.6
0.7
0.8
0.9
0.1 0
1
0.1
0.2
0.3
(a)
0.4
0.5 Y
0.6
0.7
0.8
0.9
1
(b)
Figure 3.16: CFL-dependent limiter in 1-D advection ( = 0.9, t = 0.5 [111 it. steps])
Downwind cuts parallel to y−axis 1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
RHO
RHO
Upwind cuts parallel to y−axis 1
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1 0
0.1
0.2
0.3
0.4
0.5 Y
(a)
0.6
0.7
0.8
0.9
1
0.1 0
0.1
0.2
0.3
0.4
0.5 Y
0.6
0.7
0.8
0.9
1
(b)
Figure 3.17: CFL-dependent limiter with = 5:0 ( = 0.9, t = 0.5 [111 it. steps])
36
3.4.3 2-D experiments The contours for diagonal advection of a square with = 1:0 look pretty much like those for 1-D ow. We nd two internal states (Fig. 3.20), but also the usual overshoots in the diusion zone (Section 2.3). For higher values of we suddenly get spurious oscillations which are so strong that after our usual time-interval of t = 0:5 the shape of the square has completely vanished. One can see the development in Figure 3.21, which shows the contour of density at dierent times. I didn't expect, that another degree of freedom would cause such severe problems. At least, we can work with = 1:0 for now, but the reason for the failure of a variable CFL-dependent Superbee in two dimensions should be studied sometime. Unfortunately even if we take a low value for , the circle is not being advected properly by this limiter. Over- and undershoots of about 30% of max occur and make the circle look as in Figure 3.22. After the quite promising results in 1-D, we unfortunately have to realise the limiter doesn't work for the two dimensional case. It would be interesting to nd out why it doesn't work; the analysis might suggest a modi cation.
37
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 3.18: Contour plot of a sharp square, advected with CFL-dependent limiter and = 5:0 ( = 0:9, t = 0.5 [111 it. steps])
RHO Contour 200
180
180
160
160
140
140
120
120 Y
Y
RHO Contour 200
100
100
80
80
60
60
40
40
20
20
20
40
60
80
100 X
(a)
120
140
160
180
200
20
40
60
80
100 X
120
140
160
180
200
(b)
Figure 3.19: CFL-dependent limiter on diagonal advection: = 1:0 ( = 0.9, t = 0.5 [222 it. steps])
38
Downwind cuts parallel to x−axis
Downwind cuts parallel to y−axis 1 RHO
RHO
1
0.5
0 0
0.5 X
0.5
0 0
1
Upwind cuts parallel to x−axis 1 RHO
RHO
1
Upwind cuts parallel to y−axis
1
0.5
0 0
0.5 Y
0.5 X
1
0.5
0 0
0.5 Y
1
Figure 3.20: Cuts of the diagonal advection with CFL-dependent limiter
39
RHO Contour 200
180
180
160
160
140
140
120
120 Y
Y
RHO Contour 200
100
100
80
80
60
60
40
40
20
20
20
40
60
80
100 X
120
140
160
180
200
20
40
60
(a) t = 0.10
80
180
180
160
160
140
140
120
120
100
80
60
60
40
40
20
20
80
100 X
120
(c) t = 0.20
160
180
200
100
80
60
140
RHO Contour 200
Y
Y
RHO Contour
40
120
(b) t = 0.15
200
20
100 X
140
160
180
200
20
40
60
80
100 X
120
140
160
180
200
(d) t = 0.25
Figure 3.21: Development of density contours for a highly compressive and CFLdependent limiter: = 5:0 ( = 0.9)
40
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 3.22: Circle diagonally advected by CFL-dependent limiter: = 1:0 ( = 0.9, t = 0.5 [222 it. steps])
CHAPTER IV
Arti cial Advection 4.1 1-D formulation All our experiments are about is to reduce the numerical diusion across a material boundary and maintain its initial shape as accurate as possible. If for once we concentrate less on the limiting process, another possibility may present itself, namely, to introduce an extra velocity eld around the material boundary, directed towards the interface. Its aim would be to continuously push the material back to the inside region, where it belongs. In the introduction I mentioned this possibility and called it a kind of arti cial compression. This compression could be made direction-independent and thus have the potential of preserving the parcel shape. In case this compression, achieved through arti cial advection, would be succesful, it might also tell us how we would have to change an ordinary limiter in order to improve its performance. The best way to test the feasibility of this idea is to try it out rst on a First-order scheme which has lots of diusion. The easiest case is one-dimensional advection, so let's start with that. Our aim is to push all material that has diused into the outside region, which actually should be empty, back to the inside region. Though we have the marker 41
42 function, which tells us the exact location of the material boundary, I prefer to use the density for now. There is nothing wrong with claiming that the interface is right there, where the value of equals the average of outside and inside . Hence all cells which have a density of
i;j < 12 (outside + inside ) have to be updated with a new velocity, directed towards the interface. This allows us to use density values of = 0 this time. If we make a linear distribution as a function of the distance to the material boundary the characteristics will look like this: 6
t
-
u0 + u linear
u0
linearu u 0
x
It is useful to have an upper limit for u and the picture shows that we can simply imply this by saying that above a certain distance to the interface the velocity should be constant. If we count the distance in terms of cell units, we can derive a following formula to calculate new velocities as follows: ! " 1 # j x( = 21 ) xij u~i = ui 1 + " min D ; sign x = 2 xi ; x max. correction:
umax = " D,
(4.1)
43 u0 (1+"D)t x
1, 0 + "D0 1
stability condition:
) " 1 0 D1
(4.2)
0
This formula has two variables to experiment with. One is " which determines how strong the superimposed velocities are. The second variable is D, which prescribes the width of the zone, in which the velocities are linearly distributed.
inside
6
u 6
outside u0(1 + "D)
(xL
-
@
@ @
D) xL
u0
@ @ @
u0(1 "D)
xR (xR + D)
-
x
While we can experiment with D, we will use a xed value for " which makes sure, that the maximum possible value for uxt is lower and not equal one:
" = 1D The program code has to nd in each time step the location of the two material interfaces, which can be achieved by linear interpolation. By taking for each cell the smaller of the two possible distances to an interface, we can make sure that the nearest interface is being used to calculate the distance.
44
4.2
1st
- order 1-D test results
To make the results better visible I decided to use a big rectangle now as initial condition. Without any arti cial advection the simple rst-order advection becomes very smooth with a broad diusion zone (see Figure 4.1 [a]). If we include the velocity update in the calculation and set D = 5 1, the outer halves of the diusion zone suddenly become sharper (Figure 4.2). The cuts show us, that the number of intermediate states is smaller for < 0:5 than for > 0:5. Hence the arti cial advection is indeed eective in pushing material back to the inside region ( > 0:5). If we reduce D to the smallest possible value of D = 1, the velocity update becomes much more eective and it is now nicely visible on the contour plot (Figure 4.1 [b]) how the scheme tries to keep the outside region as narrow as possible. There are only two states with < 0:5 (Figure 4.3) while there are numerous ones inside. Encouraged by this performance for 1-D, we should formulate the scheme now for two dimensions to see whether we still get the same kind of improvement.
4.3 2-D formulation We have to solve two problems if we want to formulate arti cial advection for two dimensions. First, \Which direction has the additional velocity to point at?" and second, \What is the distance to the nearest material bounday?". For 1-D both problems were easy to solve, because the direction was clear and the location of the interface could be determined without much diculty. But the same method would be pretty troublesome in two dimensions. How to nd the nearest interface? We can help ourselves out with the gradient vector r in each cell. The gradient is directed towards the material - which gives us the direction of the velocity to be 1
It takes ve cells from the interface to reach a maximum u.
45
RHO Contour 200
180
180
160
160
140
140
120
120 Y
Y
RHO Contour 200
100
100
80
80
60
60
40
40
20
20
20
40
60
80
100 X
120
140
160
180
200
20
40
60
80
100 X
120
140
160
180
200
(b) 1st - order + artif. advection (D = 1)
(a) 1st - order
Figure 4.1: Compare 1st - order advection with and without artif. advection ( = 0.9, t = 0.5 [111 it. steps])
Downwind cuts parallel to y−axis 1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6 RHO
RHO
Upwind cuts parallel to y−axis 1
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.1
0.2
0.3
0.4
0.5 Y
(a)
0.6
0.7
0.8
0.9
1
0 0
0.1
0.2
0.3
0.4
0.5 Y
0.6
0.7
0.8
0.9
1
(b)
Figure 4.2: Arti cial advection in 1-D with D = 5 ( = 0.9, t = 0.5 [111 it. steps])
46 superimposed - and the abolute value of it is an indicator of the location inside the diusion zone - which gives us an estimate of the distance to the interface. If we extrapolate the distance to = 0:5 with a gradient, we will in general get a result that is too big. Thus the maximum value for u will be applied earlier, which only means that the value for D is arti cially reduced. The gradient ri;j can be calculated simply with forward or central dierencing: 9 9 8 8 > > > = < i+1;j i;j = < i+1;j i 1;j > 1 or ri;j = > 2 > ; ; : i;j+1 i;j > : i;j+1 i;j 1 >
(4.3)
It turns out that this gradient calculation is norrobust, so we rather take an average over the neighboring cells:
ri;j = 14 ri;j + 81 (ri 1;j + ri+1;j + ri;j 1 + ri;j+1) + 1 ( r 16 i 1;j 1 + ri+1;j+1 + ri 1;j+1 + ri+1;j 1)
(4.4)
The distance to the nearest material boundary can be extrapolated as follows: 1 s = 2 (inside + outside ) i;j jri;j j +
(4.5)
Two velocities are to be calculated, one in the x- and one in the y-direction. If we reformulate the scheme by using the gradient, equation 4.1 becomes now:
r u = u0 + juj " min (D; j sx j) jr xji;j+ ; i;j
with
ry i;j v = v0 + juj " min (D; j sx j) jri;j j + ; q p juj = u2 + v2 and jri;j j = x2i;j + y 2i;j .
(4.6) (4.7)
The source code for this function and limiter can be found in Appendix D. As the maximum velocity correction umax has changed now, we have to calculate a
47 new formula for the maximum possible value of " (see Equation 4.2), which meets the stability condition:
! t u + v + juj " D [ x j + r] 1; x x jr y q t juj x = u20 + v02 xt ; q juj xt = x2 + y2; 0 1 B 1 x y x C " min B q @ 2 2 x y D CA : x + y jrj + jrj
(4.8)
The denominator becomes maximal if the gradient has an angle of 45o . Thus we get again the same equation as in Section 4.1:
" 1 0 Dx 0
(4.9)
The 0 in the denominator will be again omitted in the calculations.
4.4
1st
- order 2-D test results
Figure 4.4 and 4.8 are the results of First-order advection of a square and a circle without any arti cial advection. What those gures show us, is that the scheme does not have rotationally invariant diusion. The initial conditions tend to smear out especially orthogonal to the ow direction (see Section 3.2.3). This property depends on the CFL-number: if we choose 0 = 0:5, the shape will be (nearly) symmetric again. One can see what dierence the value of makes by comparing Figure 4.5 with 4.6 or Figure 4.9 with 4.10. All those computations have been done with arti cial advection as de ned in the previous section and a distance of only two cells at which the maximum additional velocities will be applied. The contour plots show
48 very nicely how the scheme creates a sharp boundary, surrounding the body, in the course of pushing all material back from ouside. Any disturbance in the shape is caused by the basic scheme itself and has nothing to do with the performance of the arti cial velocity eld. The shapes are best preserved for 0 = 0:5 . As the diagonal advection has been successful, we should also check now how our idea works for advection at all other angles - just to make sure that we didn't hit an exceptional direction. I think the best way to test this is to de ne a circular velocity eld and let the circle be advected over one full revolution. The outcome of this experiment is shown in Figure 4.11. The starting point was on the left side at 9 o'clock. One quarter of a turn was achieved at t = 21 , which equals 625 iteration
steps. So the full turn was done at t = 2 or after 2500 iteration steps. The circle certainly doesn't look as nice anymore as it did for the diagonal advection. The shape becomes worse with each quarter turn. But it should be noticed that the fully 1st - order scheme also doesn't yield a perfect circle after the full turn (Fig. 4.14). The outer part of that circle 2 diuses more than the inner part. Hence without compression it looks like a waterdrop, which is falling parallel to the x-axis from the left to the right side. This simulation was run with D = 5. We know that we should actually get better results for the smallest possible value. But in this case we can't aord to chose smaller values. If take D = 2 the circle is not monotone anymore. Figure 4.13 shows that the maximum density = 1:0 is strongly overshot. This causes the contour of the circle to lose its shape (Figure 4.12). The result becomes worse if we continue the simulation. The reason for those spurious overshoots probably lies in the discretized velocity eld. Each cell is advected by a dierent velocity and thus gets a dierent velocity 2
The part which is furthest away from the center of the circular velocity eld.
49
Downwind cuts parallel to y−axis 1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6 RHO
RHO
Upwind cuts parallel to y−axis 1
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0 0
0.1
0.2
0.3
0.4
0.5 Y
0.6
0.7
0.8
0.9
1
0 0
0.1
0.2
0.3
0.4
(a)
0.5 Y
0.6
0.7
0.8
0.9
1
(b)
Figure 4.3: Arti cial advection in 1-D with D = 1 ( = 0.9, t = 0.5 [111 it. steps])
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.4: 1st - order advection of a square ( = 0:9, t = 0.5 [222 it. steps])
50
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.5: Arti cial compression on a square ( = 0:9, D = 2, t = 0.5 [222 it. steps])
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.6: Arti cial compression on a square ( = 0:5, D = 2, t = 0.5 [400 it. steps])
51 Downwind cuts parallel to y−axis 1
0.8
0.8
0.6
0.6
RHO
RHO
Downwind cuts parallel to x−axis 1
0.4 0.2
0.4 0.2
0 0
0.5 X
0 0
1
1
Upwind cuts parallel to y−axis
1
1
0.8
0.8
0.6
0.6
RHO
RHO
Upwind cuts parallel to x−axis
0.5 Y
0.4 0.2
0.4 0.2
0 0
0.5 X
0 0
1
0.5 Y
1
Figure 4.7: Cuts parallel to x- and y-axis through the diusion zone RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.8: 1st - order advection of a circle ( = 0:9, t = 0.5 [222 it. steps])
52
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.9: Arti cial compression on a circle ( = 0:9, D = 2, t = 0.5 [222 it. steps])
RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.10: Arti cial compression on a circle ( = 0:5, D = 2, t = 0.5 [400 it. steps])
53 RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.11: Circular advection of a circle with arti cial advection ( = 0:5, D = 5, t = 0.5, 1.0, 1.5, 2.0 [625, 1250, 1875, 2500 it. steps]) RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.12: Circular advection with D = 2 ( = 0:5, t = 1.0 [1250 it. steps])
54 Downwind cuts parallel to x−axis
Downwind cuts parallel to y−axis
1
2 1.5
0.6
RHO
RHO
0.8
0.4
1 0.5
0.2 0 0
0.5 X
0 0
1
1
Upwind cuts parallel to y−axis
1
1
0.8
0.8
0.6
0.6
RHO
RHO
Upwind cuts parallel to x−axis
0.5 Y
0.4 0.2
0.4 0.2
0 0
0.5 X
0 0
1
0.5 Y
1
Figure 4.13: Cuts through the diusion zone ( = 0:5, D = 2, t = 1.0 [1250 it. steps]) RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.14: Circular advection with no arti cial advection ( = 0:5, t = 2.0 [2500 it. steps])
55 superimposed - dierent in size and direction. There is no guarantee that the velocity update would not create new extrema plateaus.
4.5 Desirable extension:
2nd
- order formulation
The idea of linear dependence between the magnitude of superimposed velocities and the distance to the material boundary is condemned to fail for a second-orderaccurate scheme. What we get are heavy under- and overshoots in a one-dimensional simulation. The reason for this is the velocity derivative appearing in the predictor step, what makes the scheme very sensitive to the newly imposed velocities. Especially plateaus of equal density are in uenced by an arti cial velocity even two cells down- or upstream. Consider the following example. The upstream side of a density package, being advected in one direction, will look approximately like this:
6
i-3 i-2 i-1
i
i+1 i+2 i+3
This time we really want to use the marker function
-
x
x
to locate the interface.
That means we have to set outisde = 0:1. If we would increase/decrease the velocities of all cells upstream/downstream of the material boundaries, the density parcel would be lled up with more material. So I try to modify only those velocities of cells, which have states in between inside and outside . Suppose the limiter returns always a zero
56 gradient { this will highlight the eect of the arti cial velocity eld. The predictor step then reduces to:
~i = i
t 1 (u 2x 2 i i+1 ui 1) :
(4.10)
For example, consider the consequence for cell i 1: if to cell i we assign an increased velocity 3 the predictor step will decrease i 1, possibly dropping it below its left neighbour. So when we will later solve the Riemann problem, i.e., use the upwind
uxes, more material will ow into the cell than out. Hence the full time-step will ll up this cell, and i 1 will never undershoot its left neighbour. But not so for cells i + 1 and i + 2. Cell i + 1 has a higher velocity to its left and thus i+1 increases during the predictor step. Because of the velocity dierences between the cells, however, it is not clear whether in the end the dierence in ux will ll the cell up or empty it. It might overshoot its right neighbour. Cell i+2 is also in danger of starting oscillations. Though it will remain unchanged during the predictor step, ~i+1 might have become greater than ~i+2, which means the entering ux is higher than the exiting ux. This will de nitely cause an overshoot. This teaches us that any arti cial velocity eld must be carefully chosen, if the scheme is to remain monotone. A linear function of distancy simply ignores the detailed material distribution in the surrounding cells. I tried out dierent relations between additional velocity and distance to nearest boundary. I thought of progressive functions which are at near the interface and increase their variation farther out, like a quadratic function etc. But any such function caused oscillations sooner or later. I nally came to the conclusion that the only way to treat this problem is to nd the limits of arti cial advection for each cell, such that just no over- or undershoots occur. 3
The ow goes to the right and that's where we nd the next material boundary.
57 For the above case of an upstream diused material boundary, I found three conditions that have to be satis ed, in order to keep the density distribution monotone under all circumstances: To calculate an upstream velocity ui: (I ) Ui 1 Ui (II ) Ui+1 Ui+2
(4.11)
(III ) Ui+2 Ui+3 Condition (I) wasn't mentioned yet, but is logic considering that our aim is to empty cell i as much as possible. For the downwind side we get the same conditions as under Eq. 4.12, only the sign of inequality has switched around:
6
i-3 i-2 i-1
i
-
i+1 i+2 i+3
To calculate a downstream velocity ui: (I ) Ui 1 Ui (II ) Ui+1 Ui+2 (III ) Ui+2 Ui+3
(4.12)
x
x
58 In order to implement those conditions we have to write out the full equations and solve them for ui. Let's do it for the upstream side. The rst condition (Eq. 4.12 [I]) yields the following inequality:
Ui Ui 1 ;
t hF 1 F 1 i t hF 1 F 3 i ; i i 1 x i+ 2 i 2 x i 2 i 2 t F 1 ( ) + t h2F 1 F 3 i ; i i 1 x i+ 2 x i 2 i 2 x ( ) + 2 1 u i+ 12 Lui i 2 L i 1 i 32 L ui 2 ; t i i 1 and, nally,
x 1 ui 1 t (i i 1) + 2i i+ 2 L
1 ui 2L
1
i
3 u 2L i
2
:
(4.13)
The interface values are
i+ 12 L i
1 2L
i
3 2L
= i + 12 i = i 1 + 12 i = i 2 + 12 i
t u + 1 (u 2x i i 2 i i+1init t 1 1 2x ui 1 i 1 + 2 i t u + 1 2 2x i 2 i 2 2 i
ui 1) ; 1 (ui
ui 2) ;
( u u ) 2 i 1 i 3 :
When the cells are being updated, the order should always be upstream cells rst and downstream cells last. In this case the velocities ui 1, ui 2 and ui 3 have already been calculated. Only the value for ui+1 is unknown and has to be estimated. To be on the safe side we take the smallest possible value, which would be the unperturbed value.
t + u + 1 t 1 (u u2i u ) i i i i i+1 init i 1 x i 2 2 x 2 t u + t 1 u 2ui 1 i 1 + 12 i 1 2 x i 1 i 1 2x 2 i 1 i 2 x ( ) + 2u t 1 u 3 u + i 1 t i i 1 2x 2 i 1 i i 2 L i 2
59 The limiting case is when the equal sign applies: 2x 1 1 1 2 ui ui t i + 2 i 2 i (ui+1init ( i 1 u i 1 2x + 2 t i 1 + 2 i 1 ui 1i i 2 2 x x 3 u + t (i i 1) 1 2 i 2L i i i t
ui 1) + ui 1i 1 1 1 + 2 i 1 ui 2 ) 2 = 0;
u2i + A1ui + B1 = 0: Using the solution to this equation we nd ui must satisfy: s 2 A1 B : A 1 ui 2 1 4
(4.14) (4.15)
(4.16)
The second condition (Eq. 4.12 [II]) can be solved as follows:
Ui+1 Ui+2 i t hF 5 F 3 i Fi+ 21 i+2 x i+ 2 i+ 2
t hF 3 i+1 x i+ 2 x 1 ) ui 1 t (i+2 i+1) + 2i+ 32 Lui+1 i+ 52 Lui+2 (4.17) i+ 2 L Though it is not fully on the safe side any more, I will replace those velocities which are still unknown - because they are downstream - by their unperturbed values. The interface densities become:
i+ 12 L i+ 23 L i+ 25 L
1 1 t = i + 2 i 2x uii + 2 i(ui+1init ui 1) ; t 1 1 = i+1 + 2 i+1 2x ui+1initi+1 + 2 i+1 (ui+2init ui) ; 1 1 t = i+2 + 2 i+2 2x ui+2initi+2 + 2 i+2 (ui+3init ui+1init ) ;
the limiting value of ui satis es
u2i + A2ui + B2 = 0;
60 leading to
ui A22
s 2 A2 B ; 2 4
(4.18)
with
1 t t 1 1 2 x A2 = t i + 2 i 2x 2 i(ui+1init ui 1) 2x ui+1init i+1 ; i 2 2 x 2 u 2 x i+1 init B2 = t (i+2 i+1) + t i+1 + 21 i+1 i i 2x 1 1 t u 2x i+1init i+1 + 2 i+1ui+2init t i i+ 52 i+2init : For the third condition (Eq. 4.12 [III]) we obtain a linear equation:
Ui+2 Ui+3 ;
t hF 5 F 3 i t hF 7 F 5 i ; i+2 i +3 i + i + 2 2 x x i+ 2 i+ 2 x ( 7 u + 2i+ 52 Lui+2; i+ 32 Lui+1 t i+3 i+2) i+ 2 L i+3 with
1 1 t i+ 32 L = i+1 + 2 i+1 2x ui+1initi+1 + 2 i+1(ui+2init ui ) ; t u 1 (u + u ) i+ 52 L = i+2 + 21 i+2 2 x i+2init i+2 2 i+2 i+3init i+1init ; 1 t u i+ 72 L = i+3 + 21 i+3 2 i+3 init i+3 + i+3 (ui+4 init ui+3 init ) x 2 ( x 2 2 2 2x ui+3 7 ) ui u ( i+3 i+2 ) t ui+1 i+ 2 ) i+1 i+1 t x ui+2 5 2x + 1 + u + u (4.19) + 2 2 i+2 : i+1 i+1 t ui+1 i+ 2 L t i+1 2 i+1
With Equations 4.16, 4.18 and 4.19 we can calculate three dierent limits for the velocity. The smallest of those limits is the velocity we can use without creating any oscillations. I have written down the square roots with the sign that makes sence. Before calculating them it has to be checked whether the sum under the square root
61 becomes negativ. When this happens it means that this condition doesn't yield any solution - there is no restriction. So in this case we can simply omit this condition. In the code we will assign a very high limit velocity to make sure it doesn't aect the choice of velocity. The downstream side yields nearly the same equations:
Ui Ui 1: t hF 1 F 1 i t hF i i 1 x i+ 2 i 2 x i
1 2
Fi
3 2
i
;
) u2i + A1ui + B1 = 0 ,
s
21 A A 1 ui 2 + 4 B1:
Ui+1 Ui+2:
(4.20)
t hF 5 F 3 i ; t hF 3 F 1 i i+1 i +2 i + i + 2 2 x x i+ 2 i+ 2
) u2i + A2ui + B2 = 0 ,
s
2 ui A22 + A42 B2:
Ui+2 Ui+3:
(4.21)
t hF 5 F 3 i t hF 7 F 5 i i+2 i +3 x i+ 2 i+ 2 x i+ 2 i+ 2 ( 2 x ui+3 7 2 ) ui u 2 xt (i+3 i+2 ) 2 t ui+1 i+ 2 i+1 i+1 ) 2 x 1 u 2 x i+2 + 2 t u i+ 52 L t i+1 + 2 i+1 + ui+1i+1 + ui+2(4.22) i+1
Now that we have a theory on how strong the arti cial advection can be, how do we implement this in the Hancock scheme? This time I am going to make use of the
62 marker function. I start out from the idea that, wherever the marker function has a gradient (returned from the limiter), the material boundary is close and an additional velocity, directed towards the interface, should be applied. After calculating the gradients in the predictor step we call the arti cial-advection function. This function has to check from the upstream side to the downstream side whether the gradient of the marker function does not equal zero and whether the value for
is lower
than zero, which means we are outside the material. If the gradient is positive, the interface is to the right and we have to use the upstream update. If the gradient is negative we use the downstream update. Let's try out the performance of this velocity updating scheme. Any steepening eect can be best observed with the square. Hence our reference result is Figure 2.6. There the diusion zone includes ve intermediate states. If we run the same problem with arti cial compression for all cells with Figure 4.15 and 4.16.
< 0 we get what can be seen in
One can observe a shift of the cell values, but only the
downwind side has one intermediate state less. If one follows what the program does each time-step, one will notice that superposition of an additional arti cial velocity is very rare. The restrictions for not over- or undershooting are pretty strong. It takes some time until there is a cell with
= 0 that can receive a compressing velocity.
The amount of advection that is being added is also very small. The upwind side in particular receives a velocity which is at most increased by 0.7%. The downwind side however is compressed by a minimum of 76% of the unperturbed speed. Considering that we are indeed using the maximum possible amount of arti cial compression of this kind, the outcome doesn't look very motivating. Nevertheless, I wanted to see what would happen if we allow more cells to be manipulated. So far we have only been pushing material from outside ( < 0) back. Knowing that
63 RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.15: 2nd - order arti cial advection for all cells with < 0 ( = 0:9, t = 0.5 [111 it. steps]) Downwind cuts parallel to y−axis 1
0.8
0.8
0.6
0.6
RHO
RHO
Upwind cuts parallel to y−axis 1
0.4 0.2 0 0
0.4 0.2
0.5 Y
0 0
1
Upwind cuts parallel to y−axis 0.5
PSI
PSI
1
Downwind cuts parallel to y−axis
0.5
0
−0.5 0
0.5 Y
0.5 Y
1
0
−0.5 0
0.5 Y
1
Figure 4.16: Cuts of 2nd - order arti cial advection for all cells with < 0 ( = 0:9, t = 0.5 [111 it. steps])
64 nothing should diuse outward from inside, we may try to ll up even those cells inside the material boundary, which have decreased their density through diusion. The most we can do is to aect all cells with < 0:5. Now the results looks much better. There is de nitely a lot of improvement to be seen in Figure 4.17 and 4.18. Only two intermediate states are left. Such good results were only achieved in Section 3.4.2 (Fig. 3.16 and 3.17). But obviously the use of a CFL-dependent limiter is much more elegant and simpler than this version. Though each time-step there are only a few cells updated with arti cial advection, there is lots of calculations to be done to get the right velocity. Furthermore, the extension to multi-dimensional advection is doubtful.
65 RHO Contour 200 180 160 140
Y
120 100 80 60 40 20
20
40
60
80
100 X
120
140
160
180
200
Figure 4.17: 2nd - order arti cial advection for all cells with < 0 ( = 0:9, t = 0.5 [111 it. steps]) Downwind cuts parallel to y−axis 1
0.8
0.8
0.6
0.6
RHO
RHO
Upwind cuts parallel to y−axis 1
0.4 0.2 0 0
0.4 0.2
0.5 Y
0 0
1
Upwind cuts parallel to y−axis 0.5
PSI
PSI
1
Downwind cuts parallel to y−axis
0.5
0
−0.5 0
0.5 Y
0
−0.5 0.5 Y
1
0
0.5 Y
1
Figure 4.18: Cuts of 2nd - order arti cial advection for all cells with < 0 ( = 0:9, t = 0.5 [111 it. steps])
CHAPTER V
Conclusions Our goal was to reduce numerical diusion across material boundaries during advection and at the same time try to preserve the shape of the material boundary shape initial as well as possible. To achieve this we had three starting points: a multi-dimensional limiter, a limiter with higher compression, and the introduction of arti cial advection to push any diused material back into the parcel. The last idea of arti cial compression by velocities sounded very interesting to me and that is where I put my emphasis on. For the First-order scheme we could de nitely demonstrate the validity of this idea. Whether circle or square, with a linear arti cial velocity pro le we could achieve a relatively sharp boundary around the density parcel, even in two dimensions. The technique is easy to implement and not expensive. However, the feasibility of this method seems to be limited only to a First-order scheme. To nd a technique of the same simplicity for Hancock's Second-order scheme appears much more complicated. I have developed a method that nds out the highest possbile value for the arti cial velocity u. No more arti cial advection is posible without creating oscillations. From the derivation of the necessary equations one can see how complicated this method already is for one dimension. For a two dimensional update we have to include the second direction 66
67 and velocity in our method, meaning we have to make sure that also no over- or undershoots are being generated in the y-direction. As each cell update involves three neighboring cells, one can imagine how extensive the equations will become, if one wants to make the same method work for another degree of freedom. We unfortunatley have to realise that this kind of arti cial compression is not feasable for a Second-order scheme. More promising have been the results with a Courant-number dependent limiter. We could achieve excellent results for 1-D advection just with some simple and cheap modi cations on the existing Superbee limiter. For some reason however this kind of averaging become non-monotone for the two-dimensional case. It might be interesting to nd how the limiter has to be modi ed to be successful. The combination of CFL-dependence and variable compression actually seems to be a quite powerful tool. Another problem looked at was how to modify Superbee to make it direction independent, so that the shape of the initial density distribution would be better preserved. Though the idea of maintaining the same ratio of gradients in x- and
y-direction before and after the linear reconstruction is easy to implement into the predictor step, it unfortunately didn't yield the results we were hoping for. The problem seems to be more complex than was thought initially. We also discovered some weaknesses built into the basic scheme, which sooner or later showed up during attempts of modi cation. There are for example the monotonicity problems of Section 2.3 and the asymmetry of the diusion, which depends on the CFL-number (Section 3.2.3). None of our experiments made a real breakthrough toward the aim of this thesis, that is, reducing diusion across a discontinuity. Though we could get good improvement for one dimension, still more work has to be done for two dimensions.
APPENDICES
68
69
APPENDIX A
Designing a circular parcel as initial condition on a cartesian grid
// ************************************************************* // ***** Constants and Variables Defined in Main Program ***** // ************************************************************* double double double double
dx, dy; roh0, u0, v0, psi0; roh1, u1, v1, psi1; r;
// // // //
width + height of cell init. values outside init. values inside radius;
// ************************************************************* // ***** Function to set a circle ***** // ************************************************************* void InitCond (void) { int i, j, k; int ri_limit, up_limit; double xL, xR, yL, yR; double A_intersect, A_segment, A_triangle; double d, alpha; up_limit = int (r/dy + 0.5); ri_limit = int (r/dx + 0.5);
// // // //
# of cells to be calc. intersection points intersected area sizes geometric values
// radius = how many cells ?
// ***** Calculate the upper right quarter of the circle ***** for (j=0; j