INTERNSHIP REPORT

High order regularization of Dirac-delta sources in two space dimensions.

Author: Supervisors: Wouter DE VRIES Prof. Guustaaf JACOBS s1010239 Jean-Piero SUAREZ

HOST INSTITUTION: San Diego State University, San Diego (CA), USA Department of Aerospace and Engineering Mechanics Computational Fluid Dynamics laboratory Prof. G.B. JACOBS

HOME INSTITUTION University of Twente, Enschede, Netherlands Faculty of Engineering Technology Group of Engineering Fluid Dynamics Prof. H.W.M. HOEIJMAKERS

March 4, 2015

Abstract

In this report the regularization of singular sources appearing in hyperbolic conservation laws is studied. Dirac-delta sources represent small particles which appear as source-terms in for example Particle-laden flow. The Dirac-delta sources are regularized with a high order accurate based regularization technique. Instead of regularizing a single isolated particle, the aim is to employ the regularization technique for a cloud of particles distributed on a non- uniform grid. By assuming that the resulting force exerted by a cloud of particles can be represented by a continuous , the influence of the source term can be approximated by the convolution of the and the regularized Dirac-delta function.

It is shown that in one dimension the distribution of the singular sources, represented by the convolution of the contin- uous function and Dirac-delta function, can be approximated with high accuracy using the regularization technique. The method is extended to two dimensions and high order approximations of the source-term are obtained as well. The resulting approximation of the singular sources are interpolated using a polynomial interpolation in order to regain a continuous distribution representing the force exerted by the cloud of particles.

Finally the high-order approximation of the singular sources are used to solve the two-dimensional singular advec- tion equation. A Chebyshev spectral collocation method and a third order Total Variation Diminishing Runge-Kutta method are employed to approximate the spatial and temporal derivative. For a single isolated moving source and a stationary cloud of particles high-order accuracy is obtained outside the regularized zones. Inside the regularization zones the results are less satisfying and deserve more attention. The validation of these results and additional experi- ments to study the accuracy of the results, remain as future work.

Keywords: Hyperbolic conservation laws, two-dimensional advection equation, regularization, Dirac-delta, singu- lar sources, Chebyshev spectral collocation.

1

Contents

1 Introduction 5 1.1 Background ...... 5 1.2 Objective ...... 7

2 Regularization, and interpolation methods 9 2.1 Properties of Dirac-delta and Heaviside function ...... 9 2.2 Regularization of the Dirac-delta function ...... 10 2.3 Quadrature methods ...... 12 2.4 Polynomial Interpolation ...... 14 2.5 A Chebyshev spectral collocation method ...... 15 2.6 Time Integration ...... 17 2.7 Accuracy ...... 17

3 Regularization of singular sources in 1D 19 3.1 One-dimensional advection equation with singular sources ...... 19 3.2 Approximation of the singular sources in one dimension ...... 19 3.3 Conclusion on the one-dimensional results ...... 24

4 Regularization of singular sources in 2D 25 4.1 Two-dimensional advection equation with singular sources ...... 25 4.2 Approximation of the singular sources in two dimensions ...... 27 4.3 Interpolation of the singular sources ...... 33 4.4 Conclusions on the two-dimensional results ...... 35

5 Numerical results for the two-dimensional singular advection equation 36 5.1 The two-dimensional advection equation with one single isolated moving particle ...... 36 5.2 The 2D advection equation with a cloud of moving particles ...... 38 5.3 Conclusions ...... 40

6 Conclusions and future work 41

A Convergence order of quadrature rules 43

B Accuracy of the Chebyshev spectral collocation method 46

2

List of Figures

2.1 Two examples of a regularized Dirac-dela function ...... 11 2.2 The tensor-product of the regularized Dirac-delta functions ...... 12

3.1 Numerical approximation (top) and pointwise error (bottom) for case 3.1...... 21 3.2 Numerical approximation (top) and pointwise error (bottom) for case 3.2...... 22 3.3 Numerical approximation (top) and pointwise error (bottom) for case 3.3...... 23 3.4 Numerical approximation (top) and pointwise error (bottom) for case 3.4...... 24

4.1 Square grid with uniform nodes (left) and square grid with CGL-nodes (right)...... 26 4.2 Numerical approximation (left) and pointwise error on the square domain (right) for case 4.1...... 28 4.3 Numerical approximation (left) and pointwise error on the interior domain (right) for case 4.1. . . . . 29 4.4 Numerical approximation (left) and pointwise error on the square domain (right) for case 4.2...... 29 4.5 Numerical approximation (left) and pointwise error on the interior domain (right) for case 4.2. . . . . 30 4.6 Numerical approximation (left) and pointwise error on the square domain (right) for case 4.3...... 30 4.7 Numerical approximation (left) and pointwise error on the interior domain (right) for case 4.3. . . . . 31 4.8 Numerical approximation (left) and pointwise error on the square domain (right) for case 4.4...... 31 4.9 Numerical approximation (left) and pointwise error on the interior domain (right) for case 4.4. . . . . 32 4.10 Cross sections of the numerical approximation for case 4.4 ...... 33 4.11 One-dimensional polynomial interpolation of the cross sections ...... 34 4.12 One-dimensional polynomial interpolation of the diagonal ...... 34 4.13 Numerical approximation (left) and full 2D polynomial interpolation (right) for case 4.4...... 35

5.1 Numerical approximation (top-left), regularized analytical solution (top-right), pointwise error (bottom- left), heatmap of the error (bottom-right) for case 5.1...... 38 5.2 Numerical solution course grid (top left), numerical solution on fine grid (top right), pointwise error (bottom left), heatmap of the error (bottom right) for case 5.2...... 40

B.1 Two-dimensional homogeneous advection equation ...... 47 B.2 Two-dimensional weigthed L2-norm as function of N ...... 47

3

List of Tables

3.1 parameters for cases 3.1-3.4 ...... 20

4.1 Parameters for cases 4.1-4.4 ...... 27 4.2 L2-norm on the interior domain for cases 4.1-4.4...... 28

5.1 parameters for case 5.1 ...... 37 5.2 L2-norms for case 5.1 ...... 38 5.3 parameters for case 5.2 ...... 39 5.4 L2-norms for case 5.2 ...... 40

A.1 Order of convergence for the one-dimensional Simpson’s rule ...... 44 A.2 Order of convergence for the two-dimensional Simpson’s rule ...... 44 A.3 Order of convergence for the two-dimensional Newton-Cotes 7-point rule ...... 45

4

Chapter 1

Introduction

In this report the regularization of singular sources in hyperbolic conservation laws in two spatial dimensions is con- sidered. A high order regularization technique based on compactly-supported piecewise (presented in [1]) is used to regularize singular Dirac-delta sources. The present study is in continuation of the research discussed in [1], where the regularization of a single isolated particle is discussed. Instead of a single isolated particle, the aim is to regularize a dense, non-uniformly distributed cloud of particles for the simulation of particle-laden flow. The main objective is to improve the accuracy of a high-order and high-resolution particle-source-in-cell method in the simulation of particle-laden flows with shocks [3]. The aim of this chapter is to give an introduction to the problem at hand and discuss the need of a regularization method in order to approximate singular sources in particle-laden flow. Before diving into detail, a brief overview of the background of the research and a motivation for the present research is discussed.

1.1 Background

In Engineering problems involving high-speed (compressible) gas flows, such as the flow over a supersonic aircraft and flows encountered in combustion problems, the flow is desribed by the non-linear hyperbolic conservation law: ∂ Q~ (~x,t) + ∇ · F~ (Q~ ) = S~(Q,~ ~x,t) (1.1) ∂t Where Q~ are the conserved quantities and F~ is the flux function and S~ respresents the source terms. The hyperbolic nature of these equations allow for discontinuous solutions in the form of shock waves. Since hyperbolic conservation laws govern so many evolution problems in various type of scientific fields, the numerical evaluation of these problems has gained a lot of attention past few decades. The focus has been on the accurate capturing of shock waves. Several methods have been developed in order to capture non-linear shock solutions in numerical approximations accurately [16]. The non-homogenous case with (singular) sources-terms however, have been much less investigated.

Particle-laden flow The source terms in equation 1.1 play an important role in engineering problems involving high-speed gas flow inter- acting with liquid or solid particles such as combustion. The flow model describing such a flow is Particle-laden flow. Particle-laden flow is a class of two-phase fluid flow where one of the phases represents the carier gas and the other phase typically represents one or more dilute particles. The carier gas flow is governed by Navier-Stokes equations, which reduce to the Euler equations in case viscosity and heat conduction are neglected (neglecting viscosity and heat-conduction is generally a reasonable assumption in compressible gas dynamics problems). The two-dimensional Euler equations (in Cartesian coordinates) are given by: ∂ ∂ ∂ Q~ (x, y, t) + F~ (Q~ ) + G~ (Q~ ) = S~(Q,~ x, y, t) (1.2) ∂t ∂x ∂y

5 where:

Q~ = [ρ, ρu, ρv, ρE] F~ (Q~ ) = [ρu, ρu2 + P, ρuv, (E + P )u] G~ (Q~ ) = [ρv, ρuv, ρv2 + P, (E + P )u] ~ S~ = [0, ρfx, ρfy, ρf · ~u + Qv]

And: 1 P = (γ − 1)E − ρu2 (1.3) 2 Clearly equation 1.2 is a hyperbolic conservation law of the same form as equation 1.1. The particle phase is usually desribed in the Lagrangian frame where the solid particles move through space. The equations governing the parti- cle dynamics follow from Newton’s second law and are described by the following system of ordinary differential equations (ODE’s): d ~x  p = ~v  dt p (1.4) d ~vp u( ~xp, t) − ~vp  = dt τp Here the variables with subscript p denote the the variables related to the particles. The presence of the particles affect the momentum and energy contained by the carier gas. The coupling between the two frame-works can either be one-way; the carier phase affect the dynamics of the particle phase only, or two way; the particle phase affects the dynamics of the carier phase as well. Usually a one-way coupling is sufficient in case particles with low weight are considered. In that case the effect of the particles on the carier gas is neglegible. If particles with significant weight are considered one rather uses a two-way coupling . singular sources In [3] a Particle-Source-In-Cell method for the simulation of 40 k bronze particles in a shocked flow is presented for the small scale interaction between shocks and solid particles for high-speed engineering applications. Here Particle- laden flow is considered using a two-way coupling. As each particle generates momentum and energy that affects the carier phase, the influence of each particle is distributed on the carier phase using some weighing function. To model the influence of the carier phase on the particle phase, the carier phase variables are interpolated to the particle position by means of polynomial interpolation. Modelling of the flow around each single particle introduces difficulties and becomes impractical for a large number of particles due to a lack of computational resources. Therefore the particles are rather modelled as point source with a singular distribution. Although the representation of a particle as a point source is not entirely accurate, it simplifies the method since each particle can be considered as a singular source so that the necessity of modelling the flow around the particle vanishes. Instead, in order to model the influence from the particles on the carier phase, the singular distribution travels over the grid and is interpolated on surrounding grid points.

One issue that arises by introducing particles as singular sources, is the nummerical treatment of these singulari- ties. In [1] a regularization technique is presented for the modelling of the particles as singular sources. Instead of an entire cloud of particles, only one single particle is considered. The singular source is represented by the Dirac-delta distribution: δ(x + γ(t)) (1.5) Where γ(t) is some time-dependent function. In section 2 in [1] the regularization technique is presented for the Dirac-delta distribution. In section 3, the effectiveness of the regularization technique is illustrated by three examples for a single, isolated particle. The advection equation, Burger’s equation and the one-dimensional Euler equations are solved with the regularization of a single isolated particle as source term. In the continuation of this research the regularization technique is employed in order to model a non-uniformly distributed (dense) cloud of particles rather

6 than just one single isolated particle.

Let’s first consider the one-dimensional case. The source-term Sm should be thought of as a force exerted by a (dense) cloud of particles on the fluid. It is assumed that the contribution of all the individual particles is desribed by the continuous function f(x). The function f(x) typically involves the particle-variables. Hence the source can be represented as: Z Sm = f(x)dx (1.6)

This can be expressed as a Riemann sum in order to discretize the expression:

Np X Sm ≈ f(xi)∆xi (1.7) i=1 Now, if the resulting force exerted by the cloud of particles is thought of as a summation of the contribution of each single particle in the cloud, and the contribution of each single particle is given by the Dirac-delta function, the source- term can be approximated as: Np X Sm = F (xp(i)) · δ(x − xp(i))∆xi (1.8) i=1

Here x(p(i) denotes the particle position and F (xp(i)) the antiderivative of f(xp(i)). By inspecting above formulation it seems that the source-term can be expressed as the convolution of F (x) and δ(x):

Np Z b X F (x) ∗ δ(x) = F (u) · δ(x − u)du ≈ F (xp(i)) · δ(x − xp(i))∆xi (1.9) a i=1 In two space dimensions the derivation is analogous to the one in one dimension and results in the following expres- sions for the source term:

Np Mp X X Sm ≈ F (xp(i), yp(j)) · δ(x − xp(i), y − yp(j))∆xi∆yj (1.10) i=1 j=1

Where the convolution of F (x, y) and δ(x, y) can be approximated as:

Z d Z b F (x, y) ∗ δ(x, y) = F (u, v) · δ(x − u, y − v)dudv c a

Np Mp (1.11) X X ≈ F (xp(i), yp(j)) · δ(x − xp(i), y − yp(j))∆xi∆yi i=1 j=1

This means that if a cloud of particles is modelled as a summation of the singular distribution of each single particle, the source-term can be approximated by the convolution of a continuous function F with a (regularized) Dirac-delta distribution.

1.2 Objective

In this present study we are looking to model a non-uniformly (dense) distributed cloud of particles as a summation of singular distributions in two space dimensions employing the high-order regularization technique presented in [1]. Since the cloud of particles are to be interpolated to the stationary grid in order to couple the carier and particles phase in particle-laden flow, the interpolation of the particles to other grids is of great interest as well. It is assumed that the cloud of particles is spaced densely such that the source-term can be approximated as a continuous distribution

7 of singular distributions rather than single isolated distributions . This approximation holds for the general case that particles are distributed non-uniformly. Finally we are interested in how the approximation of the source-term behaves in a model equation such as the 2D advection equation and in the end in a more realistic flow model as the 2D Euler equations. The overall objective of the study is to improve the accuracy of the particle-in-source-method used to sim- ulate particle-laden flow with shocks [3].

In this research we will restrict ourselves to the approximation of the source-term and the numerical approximation of the 2D advection equation with the regularized source-term: ∂u ∂u ∂u + + = S (1.12) ∂t ∂x ∂y m In chapter 2 an overview is given of the tools needed to approximate the source-term and the singular advection equation. In chapters 3 and 4 the source-term is approximated in 1D and 2D respectively. In chapter 5 the 2D singular advection equation is approximated with the techniques presented.

8 Chapter 2

Regularization, discretization and interpolation methods

In this section the regularization technique presented in [1] is discussed briefly. The theory presented in one dimension is extended to two dimensions. Two examples are given to illustrate the method. In addition some key properties of the Dirac-delta distribution and Heaviside function are given. For the numerical evaluation of the in equations 1.9 and 1.11 two quadrature methods are presented and extended to two dimensions. In order to interpolate the resulting data in one and two dimensions, a polynomial interpolation method is discussed briefly. For the discretization of the singular advection equation a spectral method is introduced to discretize the spatial derivatives. A 3rd order Runge-Kutta time integration scheme is introduced for the time integration. At last a few tools to study accuracy and convergence are discussed.

2.1 Properties of Dirac-delta and Heaviside function

The (formally a distribution) is a so called and is used in many physical applications to model, for example, a force concentrated in ξ or an impulsive force that acts instantaneously. In the idealized concept of a particle exerting a force on a fluid, the force can be regarded as such an concentrated force in a certain point and can therefore be described by the Dirac delta function. Three key properties of the Dirac delta function are [2]: δ(x − ξ) = 0, x 6= ξ (2.1) ( Z b 0 a, b < ξ or ξ < a, b δ(x − ξ)dξ = (2.2) a 1 a ≤ ξ ≤ b and the convolution property: Z ∞ f(ξ)δ(x − ξ)dξ = f(x) (2.3) −∞ or: Z a+ f(ξ)δ(x − ξ)dξ = f(x) (2.4) a− where f(x) is a (sufficiently) smooth function. Another well known generalized function is the Heaviside function, which is defined as:  0, x < ξ  1 H(x − ξ) = 2 , x = ξ (2.5) 1, x > ξ

9 The Dirac Delta function can be viewed as the derivative of the heaviside function: d [H(x − ξ)] = δ(x − ξ) (2.6) dx These properties of the Dirac delta and Heaviside function will be employed in the remainder of the report.

2.2 Regularization of the Dirac-delta function

In order to overcome the difficulties with evaluating the Dirac-delta function numerically the function is usually reg- ularized. Section 2 in [1] provides a theoretical criterion for obtaining a high-order accurate approximation to the Dirac-Delta function. For the present study the most important result of the criterion is that the Dirac-delta function can be expressed as: ( 1 P m,k x , |x| ≤ , δm,k(x) =   (2.7)  0, |x| > 

m,k m Where P is a mixed polynomial of degree 2(b 2 c + k + 1). The polynomial is mixed in the sense that it is a product of two single polynomials controlling the number of continous derivatives k and number of vanishing moments m independently.  is the optimal scaling parameter, which determines the width of the of the polynomial, and is a function of m and k, the number of quadrature points N and the quadrature method. The delta function is (m + 1) − th order accurate with compact support [−, ]. According to Theorem 2.4 in [1], given the integers m ≥ 0 and k ≥ −1, there exist a polynomial P m,k :[−1, 1] → R which is uniquely determined by the following conditions: Z 1 (i) P m,k(ξ)dξ = 1 −1

(ii)(P m,k)(j)(±1) = 0 for j = 0, ..., k Z 1 (iii) ξjP m,k(ξ)dξ = 0 for j = 1, ..., m −1 This polynomial from equation 2.7 is controlled by the parameters m, k and  and will be used to regularize the Dirac-delta function. This approximation to the Dirac-delta function, ensures that the error made in regularizing the Dirac-delta function is of the same order as the error made in the quadrature method.

Dirac Delta regularization in 1D To illustrate the regularization of the Dirac-delta function equation 2.7 is plotted in figure 2.1

10 Figure 2.1: Two examples of a regularized Dirac-dela function

In these plots the number of grid point used is N = 10000. Two cases are distinguished, m = 1, k = 5 and m = 3, k = 8. The optimal scaling parameter is  = 0.15. The cases with these parameters will be studied more extensively in chapter 3. In the left-side plot it looks like function is indeed singular. In the right-side plot we can see however, that the function is actually a smooth polynomial.

Dirac Delta regularization in 2D For the extension to the two-dimensional case it follows from the tensor product of the 1D regularization that:

m,k m,k m,k δ (x, y) = δ (x) · δ (y) (2.8)

Here the theoretical criterion outlined in the beginning of this section is employed to regularize Dirac-delta functions.

m,k In figure 2.2 two surface plots of the tensor δ on a cartesian grid with [M × N] = [100 × 100] grid points are displayed. The plot on the left show the results for m = 1, k = 5 and  = 0.25 and the plot on the right-side show the results for m = 3, k = 8 and  = 0.25. Figure 2.2 provides a visual interpertation to illustrate how the Dirac-delta function is approximated and provide an visual interpretation.

11 Figure 2.2: The tensor-product of the regularized Dirac-delta functions

2.3 Quadrature methods

In order to approximate the singular sources the convolution of an arbitray function with the regularized Dirac-delta function is investigated. For an arbitray continuous function f(x) the convolution with the regularized Dirac-delta yields: Z ∞ m,k m,k f(x) ∗ δ (x) = f(u)δ (x − u)du (2.9) −∞ And in two dimensions: Z ∞ Z ∞ m,k m,k f(x, y) ∗ δ (x, y) = f(u, v)δ (x − u, y − v)dudv (2.10) −∞ −∞ A number of cases are given in chapter 3 and 4 for the approximation of the convolution of an arbitrary continuous function with the 1D and 2D Dirac-delta function respectively.

In order to obtain a high order approximation to an integral, one could use one of the Newton-Cotes formulas [6]. In order to integrate a function f(x) on the interval [a, b] for example, the domain in divided in n equal sub-intervals a−b such that fn = f(xn) and h ≡ n . The function fn is than approximated by Lagrange interpolating polynomials (section 2.4) which are equal to the function in the defined points. The Extension to two dimensions (multivariate) is straightforward but tedious. In the multivariate case The function f(x, y) is now to be integrated on the cartesian grid a−b [a, b] × [c, d], where the domain is divided in n, m equal sub-intervals such that fn,m = f(xn, ym) and h ≡ n and c−d k ≡ m . fn,m is the function approximated by (multivariate) Lagrangian polynomials (section 2.4) , which equals the original function in the defined points. The Quadrature methods used in the remainder of the report are described briefly, without detailed deriviation, in the remainder of this section. The convergence rate of the quadrature methods presented here are discussed in appendix A.

12 Simpson’s rule in 1D Simpson’s quadrature rule approximates an integral by replacing the integral by quadratic polynomials using the two end-points and a mid-point. The quadratic polynomials equal the original function at the end- and midpoints and can be expressed as follows: Z b hh i 5 4 f(x)dx = f1 + 4f2 + f3 + (h) | f (ξ) | (2.11) a 6 The subscript of f denotes the point where the function is evaluated (left-, right- or midpoint). Simpson’s quadrature reaches fourth order accuracy as is shown by the last term in the equation which represents the error.

Simpson’s rule in 2D In two dimensions Simpson’s rule approximates a double integral uses a 3 × 3 point stencil and can be expressed as follows:

Z d Z b hk h i f(x, y)dxdy = f1,1 + 4f1,2 + f1,3 + 4f2,1 + 16f2,2 + 4f2,3 + f3,1 + 4f3,2 + f3,3 c a 36 (2.12) 1   + h5 + k5 | f 4(ξ) | 90 The double index of f denotes the point where the function is evaluated on sub-interval. For the particular case that the interval [a, b] is equal to the interval [c, d], it can be proven that the approximation is, just as the one-dimensional case, fifth order accurate.

Newton Cotes 7-point rule in 1D The Newton Cotes 7-point rule approximates an integral by using higher order polynomials using 7-points so that the integral can be approximated as:

Z b h h i f(x)dx = 41f1 + 216f2 + 27f3 + 272f4 + 27f5 + 216f6 + 41f7 a 140 (2.13) 9 + h9 | f 8(ξ) | 1400 The last term one the right hand-side shows that the Newton Cotes 7-point rule is eighth order accurate.

13 Newton Cotes 7-point rule in 2D The extension of the Newton Cotes 7-point quadrature rule to two dimensions, using 7 × 7 points, is tedious but can be expressed as follows: Z d Z b f(x, y)dxdy = c a hk h 1681f + 8856f + 1107f + 11152f + 1107f + 8856f + 1681f 19600 1,1 1,2 1,3 1,4 1,5 1,6 1,7 +8856f2,1 + 46656f2,2 + 8532f2,3 + 58752f2,4 + 5832f2,5 + 46656f2,6 + 8856f2,7

+1107f3,1 + 8532f3,2 + 729f3,3 + 7344f3,4 + 729f3,5 + 5832f3,6 + 1107f3,7

+11152f4,1 + 58752f4,2 + 7344f4,3 + 73984f4,4 + 7344f4,5 + 58752f4,6 + 11152f4,7

1681f5,1 + 8856f5,2 + 1107f5,3 + 11152f5,4 + 1107f5,5 + 8856f5,6 + 1681f5,7

+8856f6,1 + 46656f6,2 + 8532f6,3 + 58752f6,4 + 5832f6,5 + 46656f6,6 + 8856f6,7 i 1681f7,1 + 8856f7,2 + 1107f7,3 + 11152f7,4 + 1107f7,5 + 8856f7,6 + 1681f7,7 9   + h9 + k9 | f 8(ξ) | 1400

Again, for the particular case that the interval [a, b] is equal to the interval [c, d], it can be proven that this approximation is, just as the one-dimensional case, eighth order accurate.

2.4 Polynomial Interpolation

When approximating the singular sources with the convolution, as is done in section 2.3, it is assumed that the dis- tribution of the Force exerted by the particles is known. Usually that is not the case and only the summation of the contribution of all single particles can be determined. Using polynomial interpolation to interpolate between the par- ticle points, a distribution of the force exerted by the particles can be obtained however. In this section the concept of polynomial interpolation is discussed briefly. The method presented here will be employed in chapter 4 in order to interpolate the contribution of the particles to the spatial grid.

1D polynomial interpolation

Given a set of data points (xi, yi) where both xi and yi are real, distinct numbers, [7] presents a theory that there must exist a polynomial pn of degree at most n such that:

pn(xi) = yi (0 ≤ i ≤ n)) (2.14)

Which is the interpolating polynomial of the data set (xi, yi). This interpolating polynomial expressed in Newton form is: k i−1 X Y pk(x) = ci (x − xj) (2.15) i=0 j=0

Where the constants ci can be determined from the data set as follows:

yk − pk−1(xk) ck = (2.16) (xk − x0)(xk − x1) ··· (xk − xk−1) Another way of describing the interpolating polynomial is the Lagrange form:

j=0 X pN (x) = fjlj(x) (2.17) N

14 Where lj(x) are the Lagrange interpolating polynomials:

p Y x − xi l (x) = (2.18) j x − x i=0 j i i6=j

The Lagrange form of the interpolating polynomial is employed for the interpolation of the results of the approximation in 4, for the nummerical quadrature in section 2.3 and for the spectral collocation method presented in the next section 2.5.

2D polynomial interpolation Just as in the univariate case, in case of an dataset of two variables, an interpolating polynomial of degree at most p + q − 2 can be found: p q X X Pp,q(x, y) = f(xi, yj)vj(y)ui(x) (2.19) i=1 j=1

Here f(xi, yi) is the function value evaluated on the Cartesian grid (x1, x2, . . . , xp) × (y1, y2, . . . , yq) and ui and vj are given by the Lagrange interpolating polynomials:

p Y x − xj u (x) = (q ≤ i ≤ p) (2.20) i x − x j=1 i j j6=i

p Y x − xi v (x) = (q ≤ j ≤ p) (2.21) j x − x i=1 j i i6=j

The polynomial Pp,q(x, y) interpolates the values f at all the grid points (xi, yj).

2.5 A Chebyshev spectral collocation method

For the approximation of spatial derivates a Chebyshev spectral collocation method will be used. Spectral method are widely used for discretizing PDE’s because of their outstanding error properties, i.e. exponential rate convergence of the error [8]. Many literature has been written about the theory of spectral (collocation) methods and the implementa- tion of these methods (e.g. [9], [12] and [13]). This section serves rather as an explanation how the Chebyshev spectral collocation method is implemented than as an extensive study about the theoretical background.

The Chebyshev spectral collocation method Instead of approximating the solution by a local interpolant, as is for example done in finite difference methods, spec- tral methods take on a global approach, using all neighboring points to approximate the function value. In spectral methods some different approaches can be distinguished, for example; ”Galerkin”, ”tau” and ”Collocation” methods [12]. Collocation methods are probably the most widely used because they offer the simplest treatment of nonlinear terms [13]. Typically, for non-periodic boundary value problems, expansions in orthogonal polymials are used [7]. The problems encountered in the chapter 5 are non-periodic boundary value problems. For this reason a Chebyshev collocation method is employed in order to discretize the spatial derivatives.

The Chebyshev spectral collocation method is defined as:

N N X u (x, t) = u(xj, t)lj(x) (2.22) j=0

15 Where xj are the Chebyshev Gauss-Lobatto nodes (CGL-nodes, equation 2.24). lj are the lagrange interpolation polynomials as presented in equation 2.16. It is required that equation 2.22 has to be satisfied at each node which leads to a system of N ordinary differential equations. This system of ODE’s can be solved and in order to approximate u.

Chebyshev and Chebyshev Gauss Lobatto nodes Instead of uniform grid points, Chebyshev or Chebyshev Gauss Lobatto (CGL) points are used for the collocation method. The CGL-points minimize the Runge’s phenomenon, that is, the oscillatory behavior near the edges of an interval [10]. This because of the fact that the CGL-points are more densely spaced towards the edges of an interval. The Chebyshev points are given by the formula:  k  x = cos π k = 0, 1,...,N (2.23) k N It should be noted that this set of points includes the bounding points of the interval. The Chebyshev Gauss Lobatto points are distributed similarly as the Chebyshev points only in increasing order:  k  x = −cos π k = 0, 1,...,N (2.24) k N Again, this set of points includes the bounding points of the interval.

Barycentric form of the Lagrange polynomials As presented in section 2.4 the interpolating polynomial of a set of points can be expressed in either Newton or Lagrange form. In [9] two different forms to write the Lagrange interpolation are presented. The first alternative is the so-called ”modified Lagrange interpolation”:

N X wj p (x) = ψ(x) f (2.25) n j w − x j=0 j

QN with ψ(x) = i=0(x − xi) and where the weights are defined as: 1 w = (2.26) j QN i=1(xj − xi) i6=j Because of the following equality: N X wj ψ(x) = 1 (2.27) x − x j=0 j This allows us to divide equation 2.25 by this expression and hence we obtain the Barycentric formula:

PN wj fj j=0 x−xj pn(x) = (2.28) PN wj j=0 x−xj

Where wj are referred to as the ”barycentric weights”: 1 w = (2.29) j QN i=1(xj − xi) i6=j For computational purposes it is often advantageous to express the Lagrange polynomial in this ”barycentric” form [10]. By expressing the interpolating polynomial in this way, not all Lagrange polynomials have to be re-calculated for every single node. Instead, for a certain set of points, the weights can be calculated and pre-stored and the interpolating polynomial can be evaluated on every node which is computationally cheaper [11].

16 Derivative of a interpolating polynomial The derivative of an interpolating polynomial at a set of nodes can be derived by [9]:

N N 0 0 X 0 X f (x) ≈ Dfi ≡ (IN f(x)) = fjlj(xi) = Di,jfj, i = 0,...,N (2.30) j=0 j=0

0 Here Di,j = lj(xi) is the derivative matrix and IN the global interpolant. If the derivative is to be evaluated at the nodes, the barycentric form of the interpolating polynomial can be used and the derivative matrix can be expressed as: " # w 1 Dij = j (2.31) wi xi − xj

Here wj and wi are the barycentric weights defined by equation 2.29.

2.6 Time Integration

For the treatment of the temporal derivatives in chapter 5 the following third order accurate Total Variation Diminishing Runge-Kutta scheme [14] is used:

u(1) = un + ∆tL(un) 3 1 1 u(2) = un + u(1) + ∆tL(u(1)) 4 4 4 1 2 2 un+1 = un + u(2) + ∆tL(u(2)) 3 3 3 Furthermore, in order to obtain stable results a CFL-like coefficient for spectral approximations [15] is employed:

∆t < C · N −2 (2.32)

That means that it can be proven that for spectral approximations the timestep is restricted by a constant value divided by the number of grid points squared.

2.7 Accuracy

In order to study the accuracy of an approximation several tools are employed. In case the analytical solution is known the numerical approximation can be compared with the analytical solution. For one space dimensions one typically determines the pointwise error to study the error made in each grid point. The pointwise error is defined as:

h h h Ei = |ui − u˜i | (2.33)

h h Here i is the grid index, h denotes the grid spacing , ui and u˜i denote the analytical solution and numerical approxi- mation respectively on a certain grid. The convergence rate can now be estimated by refining the grid. If p is the order of the numerical method then the error can be approximated as:

Eh = C · hp + O(hp) ≈ C · hp (2.34)

Provided that h is sufficiently small. If the grid is refined by a factor 2 for example the error ratio R is defined as: C · hp Rh = = 2p (2.35) h p C · ( 2 )

17 Hence the can be estimated by:

h p = log2(R ) (2.36)

In order to study the rate of convergence one typically uses error-norm instead of the pointwise error. For the present study the L2-norm and a weighted version of the L2-norm are employed: v u N 2 uX 2 L = t |uk| (2.37) k=1 v u N 2 uX 2 Lw = t wk|uk| (2.38) k=1 2 Here k is the grid index, N is the number of grid points and wk are the weights. The L -norm is used in case of uniform grid points. In case of non-uniform grid points the weigthed L2 norm is used. In case of CGL-points the weight-vector contains the CGL-weights (section 2.5). In order to approximate the rate of convergence of an approximation on a certain grid, one can replace the error for the L2-norm.

18 Chapter 3

Regularization of singular sources in 1D

In this chapter the regularization of singular sources in one dimension is considered. Before moving to the two- dimensional case of actual interest, this chapter provides some key understanding of the regularization technique and its key features.First the 1D advection equation will be presented as a model problem, with a singular source as right hand-side. At this point we are not looking for a nummerical approximation to the solution of the model problem but we will strictly focus on the regularization of the singular source on the right hand-side of the equation using the regularization technique from [1].

3.1 One-dimensional advection equation with singular sources

The model problem considered here is the one-dimensional singular advection equation:  h i  ∂u + ∂u = (µx + σ) H(x − a) − H(x − b)  ∂t ∂x u(x, 0) = sin(πx)  u(−1, t) = sin(π(−1 − t))

Where (x, t) ∈ [−1, 1] × [0, 2]. It can be derived by using integration by parts that the right handside of the equation can be written as: h i Z b (µx + σ) H(x − a) − H(x − b) = (µs + σ)δ(x − s)ds (3.1) a To solve this equation numerically the Dirac-delta function is regularized using the regularization technique presented in section 2.2. The integral can be evaluated using the 1D Simpson’s rule presented in section 2.3. This yields the following numerical approximation SNp to the right hand-side of equation 3.1:

Z b m,k SNp = (µxp + σ)δ (x − xp)dxp (3.2) a  Here a and b are given by a = −0.3 and b = 0.3 and the quadrature points are given by; xp(i) = 0.3 · sin π · α(i)  1 1  with α(i) ∈ − 2 , 2 for i = 1, ...Np. The spatial grid points are given by x(i) ∈ [−1, 1] for i = 1, 2, ..., N − 1,N. To determine the accuracy of the approximation the numerical approximation is compared with the analytical solution to the left hand-side of equation 3.1. In the next section four different cases are considered, each with different parameters.

3.2 Approximation of the singular sources in one dimension

To illustrate the influence of the different parameters , m and k in the regularization, four cases are presented here. In case 3.1 and 3.2 the influence of  is demonstrated. Case 3.3 and 3.4 demonstrate the influence of the parameters m

19 and k. Every case is repeated for five sets of grid points. The parameters for each case are tabulated in table 3.1.

m k µ σ Np  case 3.1 1 5 10 1 500  as in equation 3.3 case 3.2 1 5 10 1 500  ∈ [0.30, 0.24, 0.20, 0.17, 0.14] case 3.3 3 8 10 1 500  as in equation 3.3 case 3.4 3 8 10 1 500  ∈ [0.29, 0.24, 0.19, 0.16, 0.13]

Table 3.1: parameters for cases 3.1-3.4

Here the optimal scaling parameter  is defined as:

|x (N ) − x (1)|  = p p p (3.3) 4

Results case 3.1 In figure 3.1 the results for the first case are shown. The results are plotted for 5 sets of grid points N ∈ [30, 60, 120, 240, 480]. The optimal scaling parameter  is according to equation 3.3 and is equal to  = 0.15. The first plot in the figure shows the resulting approximation SNp, the second plot shows the pointwise error. Figure 3.1 shows that function is ap- proximated with high accuracy away from the discontinuity (up to 12th order accurate). Near the discontinuity the function is smoothened and for that reason a large error is induced. This region with high error, where the function is smoothened is referred to as the ”regularization zone”. It is observed that the number of spatial grid points, only affects the resolution but not the accuracy of the approximation.

Results case 3.2 In figure 3.2 the results for the second case are shown. Again the plots a displayed for five sets of grid points N ∈ [30, 60, 120, 240, 480]. For this case, is not defined by equation 3.3 but instead  is chosen as  ∈ [0.30, 0.24, 0.20, 0.17, 0.14], where  = 0.30 corresponds to N = 30,  = 0.24 to N = 60, etc. Again the resulting approximation SNp and the pointwise error are displayed. Comparing figure 3.1 and 3.2 shows that the difference in the optimal scaling parameter  influences the width of the regularization zone. However, the accuracy of the approximation outside the regulariza- tion remains unaffected.

Results case 3.3 In figure 3.2 the results for the third case are plotted for 5 sets of grid points N ∈ [30, 60, 120, 240, 480]. Just as in case 3.1  is defined according to equation 3.3 and is equal to  = 0.15. Comparing figure 3.1 and 3.3 shows that the increased m and k results in a more accurate representation of the discontinuity. Inspecting the pointwise error in figure 3.1 and 3.3 shows that the accuracy inside the regularization zone is somewhat better. Again, the accuracy outside the regularization zone remians unaffected.

Results case 3.4 In figure 3.2 the results for the fourth case are plotted for several number of grid points N ∈ [30, 60, 120, 240, 480]. For this case,  is not defined by equation 3.3 but instead  is chosen as  ∈ [0.29, 0.24, 0.19, 0.16, 0.13], where  = 0.29 corresponds to N = 30,  = 0.24 to N = 60, etc. Comparing figure 3.3 and 3.4 shows once again that varying the optimal scaling parameter affects the width of the regularization.

20 Figure 3.1: Numerical approximation (top) and pointwise error (bottom) for case 3.1.

21 Figure 3.2: Numerical approximation (top) and pointwise error (bottom) for case 3.2.

22 Figure 3.3: Numerical approximation (top) and pointwise error (bottom) for case 3.3.

23 Figure 3.4: Numerical approximation (top) and pointwise error (bottom) for case 3.4.

3.3 Conclusion on the one-dimensional results

The results from cases 3.1-3.4 show that the right hand-side in equation 3.1 can be approximated by equation 3.2. Outside the regularization zone the original function is approximated with high accuracy (up to 12th order for Np = 500). The width of the regularization zone is controlled by the optimal scaling parameter . By increasing m and k, the discontinuity can be captured more accurately. The number of spatial grid pionts only affect the resolution of the approximation but does not affect the accuracy of the approximation.

24 Chapter 4

Regularization of singular sources in 2D

In This chapter the regularization of singular sources in two dimensions is discussed. The main point of interest is to investigate if the regularization method provides the same high order accuracy outside the regularized zone as it does in the 1D case. The conclusions drawn in the one dimensional case should hold for the two-dimensional case to. In order to verify this several test cases are presented and discussed.

Similar to the one-dimensional case first the 2D singular advection equation with a singular source in the right hand- side is presented as a model problem. At this point we are only interested in the regularization of the two dimensional singular sources in the right hand-side..

4.1 Two-dimensional advection equation with singular sources

Consider the two-dimensional singular advection equation:  h i ∂u + ∂u + ∂u = f(x, y) H(x − a, y − c) − H(x − b, y − d)  ∂t ∂x ∂y  u(x, y, 0) = sin(πxy) u(−1, y, t) = sin(π(−1 − t)(y − t))  u(x, −1, t) = sin(π(x − t)(y − t))

Here the function f(x, y) is an arbitray continuous function which is projected on the heaviside function. Just as in the one-dimensional case, The right-hand side of the equation can also be expressed in terms of the Dirac-delta function:

h i Z d Z b f(x, y) H(x − a, y − c) − H(x − b, y − d) = f(u, v)δ(x − u, y − v)dudv (4.1) c a It should be noted that the integral is equal to the convolution f(x, y)∗δ(x, y). Just as in the one-dimensional case, we are looking to approximate this expression with high order accuracy using the regularization technique presented in section 2.2. Using equation 2.7 to regularize the Dirac-delta function yields the following approximation to the RHS:

Z d Z b m,k SNp,Mp = f(xp, yp)δ (x − xp, y − yp)dxpdyp (4.2) c a For the evaluation of the double integral either the Simpson’s rule or the Newton Cotes 7-point rule (discussed in section 2.3) are used. The choice for f(x, y) is arbitrary, in this present study f1 and f2 are considered:

f1(x, y) = 1 (4.3)

f2(x, y) = cos(5πxy) (4.4)

25 According to the convolution property of the Dirac-delta function from equation 2.4, the RHS in equation 4.1 is equal to the function f(x, y) itself inside the domain [a, b] × [c, d], outside this domain the RHS is equal to zero. Using this property the error in the approximation can be determined by comparing the analytical solution of f(x, y) to the nummerical approximation in equation 4.2.

2D grid In the two-dimensional case the function is projected on the a Cartesian grid. The grid points are either distribut- ed uniformly (x(i), y(j)) ∈ [x1, xN ] × [y1, yN ], i = 1, 2, ..., N − 1, N, j = 1, 2, ..., M − 1 or non-uniformly (xc(i), yc(j) ∈ [x1, xN ] × [y1, yN ], i = 1, 2, ..., N, j = 1, 2, ..., M − 1,M, where the coordinates with subscript x are the Chebyshev Gauss Lobatto points from equation 2.24. In the figure 4.1 the square grid is displayed for both the uniform points and CGL-points for N = M = 20 on the square domain [−1, 1] × [−1, 1].

Figure 4.1: Square grid with uniform nodes (left) and square grid with CGL-nodes (right).

 The quadature nodes (xp(i), yp(j)) are distributed non-uniformly xp(i) = 0.3 · sin π · α(i) and yp(j) = 0.3 · sinπ · α(i) where α(i), α(j) ∈ [−0.5, 0.5].

Optimal scaling parameter For the cases 4.1-4.4 the optimal scaling parameter is a function of m, k the number of grid points and the quadrature method: 1  = ζ m+k+2 (4.5) In this expression ζ represents the dependence of the quadrature rule. For the Simpson’s rule ζ is defined as: Np−1 1 X 5 ζS = xp(i + 1) − xp(i) (4.6) 90 i=1 For the Newton Cotes 7-point rule ζ is defined as: Np−1 9 X ζ = |x (i + 1) − x (i)|9 (4.7) N 1400 p p i=1

26 4.2 Approximation of the singular sources in two dimensions

In order to present the results for the regularization method in two dimensions, four cases are presented in this section. The parameters used for these cases are listed in table 4.2 below. The results presented here are for fixed values of m, k but the conclusions drawn can be extended to different values of m and k. As concluded in the one-dimensional case in chapter 3 the number of grid points only affects the resolution of the approximation and not the error in the approximation. In case 4.1 and 4.1 the influence of the number of quadrature points on the error is illustrated. In cas- es 4.3 and 4.4 a high-order accurate approximation on a uniform spaced grid and on a non-uniform spaced is compared.

For case 4.1 and 4.2 the 2D version of the Simpson’s rule (section 2.3) is employed for approximating the integral in equation 4.2. For case 4.3 and 4.4 the 2D version of the Newton Cotes 7-point rule (section 2.3) is used.

f(x, y) m k x, y Np×Mp N×M case 4.1 f1(x, y) 3 4 0.2392 25×25 40×40 (uniform points) case 4.2 f1(x, y) 3 4 0.2392 50×50 40×40 (uniform points) case 4.3 f2(x, y) 17 8 0.1508 250×250 40×40 (uniform points) case 4.3 f2(x, y) 17 8 0.1508 250×250 40×40 (Chebyshev points)

Table 4.1: Parameters for cases 4.1-4.4

In principle we are looking to approximate equation 4.1 on the domain [−1, 1] × [−1, 1]. However, in order to increase the resolution of the approximation and reduce the computation time, the square domain considered here is [−0.6, 0.6] × [−0.6, 0.6]. In case the CGL-points are used to discretize the domain, the points are multiplied by a factor 0.6.

Results case 4.1 In figures 4.2 and 4.3, the results for case 4.1 are shown. Just as in the one-dimensional case,  determines the size of the regularization zone. Inside the regularization zone the solution is smoothened, while outside the regularization zone the original function is approximated with certain accuracy. In figure 4.2 the nummerical approximation is displayed in the left plot. In the right plot the pointwise error on the square domain is displayed. From the left plot it can be observed that near the integration boundaries, where the discontinuity in the orginal function appears, the function is reguralized. The error plot shows that the error in the regularization zone is quite significant. Outside the regularization zone the error is much lower and reaches about fifth order in the center of the domain. In figure 4.3 a grid refinement study is carried out for the interior domain [a + , b − ] × [c + , d − ] to illustrate the error outside the regularization zone. In the left plot the numerical approximation is shown once more, in the right plot the error on this interior square domain is displayed. It can be observed that in the interior domain the error is 3rd to 5th order accurate. In table 4.2 the L2-norm (defined in section 2.7, equation 2.37) is given for the interior domain as a measure for the error.

Results case 4.2 In figures 4.4 and 4.5 the results for case 4.2 are displayed. It appears that if the number of quadrature points are doubled, the error outside the regularization zone decreases. Again, a grid refinement study is carried out for the domain [a + , b − ] × [c + , d − ]. As can be seen from figure 4.5 the error in the center of the domain reaches about eighth order accuracy. Just as for case 4.1, the L2-norm (equation 2.37) is given for the interior domain in table 4.2.

Results case 4.3 In figures 4.6 and 4.7 the results for case 4.3 are shown. In the left plot in figure 4.6 the numerical approximation to equation 4.2 is displayed. The numerical approximation is compared with the analytic solution from equation 4.4, which yields the pointwise error. The pointwise error on the square domain is displayed in the plot at the right. It

27 can be concluded that the error in the regularization zone once again is large. Since the optimal scaling parameter is smaller for this case, the regularization zone is smaller than for cases 4.1 and 4.2 and the interior domain is larger. In figure 4.7 a grid refinement is carried out for the interior domain [a + , b − ] × [c + , d − ]. It appears that the approximation outside the regularized zone is at least fifth order accurate. In table 4.2 the L2-norm (equation 2.37) is given for the interior domain.

Results case 4.4 In figure 4.8 and 4.9 the results for case 4.4 are displayed. Instead of uniform grid points (case 4.3), CGL-points are used for the spatial grid (see figure 4.1). From the figures it is concluded that the results for case 4.4 are very similar to the results for case 4.3. The only notably difference is that the resolution in the centre of the domain is lower for the CGL-points than for the uniform grid points. Figure 4.9 shows the grid refined for the interior domain. In table 4.2 the L2-norm (equation 2.37) is given for the interior domain. Once more the L2-norm is given in table 4.2.

Case number L2-norm 4.1 1.146 · 10−1 4.2 9.832 · 10−2 4.3 3.765 · 10−6 4.4 4.334 · 10−6

Table 4.2: L2-norm on the interior domain for cases 4.1-4.4.

Figure 4.2: Numerical approximation (left) and pointwise error on the square domain (right) for case 4.1.

28 Figure 4.3: Numerical approximation (left) and pointwise error on the interior domain (right) for case 4.1.

Figure 4.4: Numerical approximation (left) and pointwise error on the square domain (right) for case 4.2.

29 Figure 4.5: Numerical approximation (left) and pointwise error on the interior domain (right) for case 4.2.

Figure 4.6: Numerical approximation (left) and pointwise error on the square domain (right) for case 4.3.

30 Figure 4.7: Numerical approximation (left) and pointwise error on the interior domain (right) for case 4.3.

Figure 4.8: Numerical approximation (left) and pointwise error on the square domain (right) for case 4.4.

31 Figure 4.9: Numerical approximation (left) and pointwise error on the interior domain (right) for case 4.4.

32 4.3 Interpolation of the singular sources

In case 4.4 an high order accurate approximation of the RHS of equation 4.1 is obtained on a non-uniform grid. In case the distribution is not known, but only the contribution of all single particles, the data could be interpolated to de- termine the distribution. In this section it is verified that this result can be interpolated using polynomial interpolation. In section 2.4 a polynomial interpolation method is described for both one- and two-dimensional sets of data points. The objective is to interpolate the results from case 4.4 to a different grid. Before showing the full two-dimensional interpolant the one-dimensional interpolations of some arbitrary cross-sections are investigated.

In figure 4.10 four cross sections from the results from case 4.4 are plotted. In Figure 4.11 the results are interpolated using the interpolating polynomial from section 2.4. The interpolant is evaluated and plotted for xs(i) ∈ [−0.6, 0.6] where i = 1, 2, ..., Ns −1,Ns for Ns = 100. Although near the regularized zone some Gibbs oscillations are observed, the interpolation appears to be quite smooth. The dense spacing of the grid points near the edges of the domain pre- vents the occurence of Runge’s phenomenon. In addition the diagonal points and its polynomial interpolant are plotted in figure 4.12. The plot of the numerical approximation shows sharp edges at the end of the integration domain. It seems like the discontinuity is not regularized over the diagonal. The polynomial interpolant seems surprisingly s- mooth however.

At last the full 2D polynomial interpolation of the results from case 4.4 are plotted in figure 4.13. In the left plot the nu- merical approximation from case 4.4 is displayed and in the right plot the interpolating polynomial. The polynomial in- terpolant is evaluated on a new grid ((xc(i), yc(j)) ∈ [−0.6, 0.6]×[−0.6, 0.6], i = 1, 2, ..., N, j = 1, 2, ..., M −1,M. Once more, the subscript c refers to the CGL-points.

Figure 4.10: Cross sections of the numerical approximation for case 4.4

33 Figure 4.11: One-dimensional polynomial interpolation of the cross sections

Figure 4.12: One-dimensional polynomial interpolation of the diagonal

34 Figure 4.13: Numerical approximation (left) and full 2D polynomial interpolation (right) for case 4.4.

4.4 Conclusions on the two-dimensional results

In this chapter the convolution of a two-dimensional continuous function (equations 4.3, 4.4) and the two-dimensional regularized Dirac-delta function is evaluated for four cases with different parameters according to table 4.2. The results from case 4.1 and 4.2 show that the convolution of a continuous constant function with the regularized Dirac-delta function can be approximated using the regularization technique presented in 2.2 and the two-dimensional Simpson quadrature on a uniform grid. The discontinuity in the original function is regularized, inntroducing an error inside the regularization zone, whereas outside the regularization zone the original function is approximated with high accuracy.

The results from case 4.3 and 4.4 show that the convolution of a continuous function with the regularized Dirac-delta can be approximated using the regularization technique presented in 2.2 and the Newton Cotes 7-point quadrature rule on both a uniform and non-uniform grid. Again, the discontinuity in the original function is regularized, whereas outside the regularized zone the function is approximated with high accuracy. The obtained results on a the uniform and non-uniform grid are very similar.

At last it is concluded that the high order accurate results on the non-uniform grid can be interpolated to a differ- ent grid.

35 Chapter 5

Numerical results for the two-dimensional singular advection equation

In this chapter an nummerical approximation to the two-dimensional advection equation with singular sources is pre- sented. The results from chapter 4 can be used as a high-order approximation to the source-term in the right hand-side.

First the 2D advection equation with a single moving particle as right hand-side will be solved. Next the the 2D advection equation is solved for a cloud of particles.

5.1 The two-dimensional advection equation with one single isolated moving particle

Consider the following 2D advection equation:

 ∂u + ∂u + ∂u = δ(x, y, t)  ∂t ∂x ∂y u(x, y, 0) = sin(π(xy) + 1 · δ(x, y) 2 (5.1) u(−1, y, t) = sin(π(−1 − t)(y − t) + H(t) · δ(−1 − t, y − t)  u(x, −1, t) = sin(π(x − t)(−1 − t) + H(t) · δ(x − t, −1 − t) with (x, y, t) ∈ [−1, 1] × [−1, 1] × (0, 2]. On the right hand-side of the equation the Dirac-delta function represents the non-stationary singular source. The solution to the homogeneous equation PDE is given by:

u(x, y, t) = sin(π(x − t)(y − t)) (5.2)

The fundamental solution to this PDE is given by:

u(x, y, t) = H(t) · δ(x − t, y − t) (5.3)

Since the PDE is linear the solutions can be superposed, this gives the full solution:

u(x, y, t) = sin(π(x − t)(y − t)) + H(t) · δ(x − t, y − t) (5.4)

Discretization The Dirac-delta function and Heaviside function can be regularized by employing the regularization method discussed in 2.2. The spatial derivatives are discretized using the Chebyshev collocation method (section 2.5). The 3rd order

36 TVD Runge-Kutta scheme (section 2.6) is employed for the time integration. This yields the following approximation to the PDE in equation 5.1:

N M ˙ X (1),x X (1),y m,k u˜ + Dik u˜k,j + Djk u˜i,k = δ (xi, yj, t) (5.5) k=0 k=0

(1),x (1),x Here u˜ is the numerical approximation to u and Dik and Dik denote the first order spectral derivative matrices to the coordinates x and y respectively. The second and third term on the left hand-side are simply matrix-product of the spectral derivative matrix and the solution-matrix. In appendix B the accuracy of the spectral scheme is discussed. The problem is approximated on a square grid (xi, yj) ∈ [−1, 1] × [−1, 1] where xi and yj are the Chebyshev Gauss- Lobatto points as in equation 2.24. N and M denote the number of grid points in x- and y-direction respectively and are taken equal for convenience. In the table below 5.1 all fixed parameters all listed.

m k x, y N×M case 5.1 3 2 0.3486 40×40 (non-uniform grid)

Table 5.1: parameters for case 5.1

Here the optimal scaling parameter  depends on m, k and the number of grid points N and is given by:

( −k )  = N m+k+2 (5.6)

Results In figure 5.1 the results for t=0.5 are given. In the upper left and upper right plot the numerical approximation and (regularized) analytical solution are displayed. In the bottom left plot the pointwise error is displayed and in the bottom right a heatmap of the error on the square is displayed.From the pointwise error and the error-on-the-square plots, it can be observed that the source is approximated with a significant error at the location of the source. Away from the source the solution is approximated with certain accuracy. Especially in the region [−1, 0] × [−1, 0] the solution appears to be approximated well, i.e. the approximation reaches fifth order accuracy and higher. The approximation in the regions [−1, 0] × [0, 1] and [1, 0] × [0, −1] seems to be influenced by the presence of the source however and the approximation appears to be third order accurate at best. In the region [0, 1] × [0, 1] the error is large due to regularization of the source-term. In order to demonstrate the error in these regions, the L2-norm is listed in table 5.1.

37 Figure 5.1: Numerical approximation (top-left), regularized analytical solution (top-right), pointwise error (bottom- left), heatmap of the error (bottom-right) for case 5.1.

L2-norm domain 2.397 · 10−4 [−1, 0] × [−1, 0] 5.79 · 10−2 [−1, 0] × [0, 1] 5.79 · 10−2 [0, 1] × [−1, 0]

Table 5.2: L2-norms for case 5.1

5.2 The 2D advection equation with a cloud of moving particles

Consider the following 2D singular advection equation:

 ∂u + ∂u + ∂u = R d R b f(u, v) · δ(x − u, y − v)dudv  ∂t ∂x ∂y c a u(x, y, 0) = sin(π(xy) (5.7) u(−1, y, t) = sin(π(−1 − t)(y − t)  u(x, −1, t) = sin(π(x − t)(−1 − t) with (x, y, t) ∈ [−0.6, 0.6] × [−0.6, 0.6] × (0, 2]. The RHS represents a cloud of particles. The continuous function f(u, v) evaluated here is: f(u, v) = cos(5π · uv) (5.8) The homogeneous solution fo this equation is given by equation 5.2. The full equation does not yield an analytic solution.

38 Discretization The right-hand side in equation 5.7 is approximated by:

Z d Z b m,k RHS = cos(5πuv) · δ (x − u, y − v)dudv (5.9) c a Once again the Dirac-delta functionis regularized by the regularization technique presented in section 2.2. The spatial derivatives are discretized by the Chebyshev collocation method from section 2.5. The 3rd order TVD Runge-Kutta (section 2.6) time integration scheme is used to update the solution in time. In chapter 4 (case 4.4) an high-order approximation to this expression for certain parameters was presented. For clearity the parameters are listed one more time in 5.2. Equation 5.7 is approximated on the squared grid (xc(i), yc(i)) ∈ [−0.6, 0.6] × [−0.6, 0.6] where (xc(i), yc(i)) are the CGL-points as defined in equation 2.24. In table 5.2 N and M denote the number of grid points, Npx and Npy denote the quadrature points.

m k x, y Npx × Npy N × M case 5.1 17 8 0.1508 250×250 40×40 (non-uniform grid)

Table 5.3: parameters for case 5.2

Results In absence of the analytical solution, the solution to equation 5.7 on the course grid ([N ×M] = [40×40]) is compared h h with the solution on a finer grid (N × M = 80 × 80). Let u (i, j) denote the solution on the course grid and u 2 (i, j) the fine grid solution, h denotes the step size. The pointwise error is now defined as:

h h h 2 Ei,j = ui,j − u2i−1,2j−1 (5.10)

In figure 5.2 the numerical approximations to equation 5.7 are shown on the course grid (top left) and the fine grid (top right)for t = 0.5. The pointwise error is displayed using a surface plot (bottom left) and a heatmap (bottom right). From the error plot it can be concluded that the error between the course grid and fine grid solution is of order 10−2 or lower. The error can be split into different regions, inside the regularization zone we expect a high error and outside the regularization zone the error should be small.

The source-term is stationary, so at the domain [−0.3 ± , 0.3 ± ] × [−0.3 ± , 0.3 ± ] the error is expected to be high. However, the source seems to be non-stationary and seems to move over the diagonal instead. In addition to the error plots the L2-norm for the domain [−0.6, −0.2] × [−0.6, −0.2] and the domain [0.2, 0.6] × [0.2, 0.6] are presented in table 5.2. From the error plots and the L2-norms it can be seen that the error in the region [0, 0.6]×[0, 0.6] is significantly higher than the error in region [−0.6, −0.2] × [−0.6, −0.2].

39 Figure 5.2: Numerical solution course grid (top left), numerical solution on fine grid (top right), pointwise error (bottom left), heatmap of the error (bottom right) for case 5.2.

L2-norm domain 1.491 · 10−4 [−0.6, −0.2] × [−0.6, −0.2] 1.003 · 10−2 [0.2, 0.6] × [0.2, 0.6]

Table 5.4: L2-norms for case 5.2

5.3 Conclusions

Figure 5.1 shows that a isolated singular source can be approximated using the regularization technique. Away from the source-term the approximation is high-order accurate with errors up to order −5. The regularization of the source seems to affect the approximation of the grid points at the same height as the source though, resulting in a less accurate approximation. This may be the result of the large value for , since a large  results in a large regularization zone. At the location of the source, the the error in the approximation is significant as expected. The results from figure 5.2 are not well understood. The source should be stationary but appears to move out of the domain over the diagonal with increasing time. This results in a high error in the region [0, 0.6] × [0, 0.6] and a low errorin the region [−0.6, −0.2] × [−0.6, −0.2]. The approximation on the fine grid shows that the approximation is at least consistent with the approximaton on the course grid. Resulting in a small error away from the source-term, in region [−0.6, −0.2] × [−0.6, −0.2].

40 Chapter 6

Conclusions and future work

In this present research, the high-order Dirac-delta regularization technique presented in [1] has been employed to regularize Dirac-delta sources on a non-uniform grid. The source-term has been approximated by the convolution of a continuous function with the regularized Dirac-Delta. The resulting integral expressions are evaluated with the Simpson’s and Newton Cotes 7-point quadrature rules.

The one-dimensional results show that the number of grid points used to discretize the spatial domian does not in- fluence the accuracy of the approximation. The optimal scaling parameter influences the width of the regularization zone. Increasing the number of vanishing moments and continuous derivatives for the regularized Dirac-delta results in a smaller error in the regularization zone.

From the two-dimensional results it is concluded that the regularization technique can be employed to obtain a high- order accurate approximation for the source-term on a non-uniform grid. The obtained results have been interpolated which resulted in a smooth function.

The results for the approximation of the singular 2D advection equation with a single isolated source term seem promis- ing. Although the error outside the regularized zone is expected to be lower, the simulation of the two-dimensional source do not give problems, regarding to stability and oscillations. The results for approximation of the 2D singular advection equation with the high-order approximation of the 2D singular sources remain less understood. Although the results on the course grid are consistent with the results on the fine grid, the stationary sources seem to move out of the domain. In some regions the approximation appears to be high-order accurate though.

It is suggested that for future work additional experiments are done with the 2D singular advection equation with the high-order approximation of the 2D singular sources. Furthermore it is suggested that the high-order approxima- tion is tested in a non-linear equation and in the end in the 2D Euler equations.

41 Bibliography

[1] Article: Jean-Piero Suarez, Gustaaf B. Jacobs and Wai-Sun Don, A high-order dirac-delta regularization with optimal scaling in the spectral solution of one-dimensional singular hyperbolic conservation laws, to appear, SIAM Journal of scientific computing, 2014. [2] Book: Ram P. Kanwal (2004, third edition), Generalized Functions ”theory and technique”, product of Birkhuser Basel

[3] Article: Guustaaf B. Jacobs, Wai-Sun Don, A high-order WENO-Z finite difference based particle-source-in-cell method for computation of particle-laden flows with shocks Journal of Computational November 2008 [4] Website: http://en.wikipedia.org/wiki/Particle-laden_flows [5] Website: http://en.wikipedia.org/wiki/Lagrangian_and_Eulerian_specification_ of_the_flow_field

[6] Website: http://mathworld.wolfram.com/Newton-CotesFormulas.html [7] Book: David Kincaid and Ward Cheney (1991) mathematics of scientific omputing (page 278-281, page 385-394), The University of Texas at Austin, Brooks/Cole Publishing company

[8] Website: http://en.wikipedia.org/wiki/Spectral_method [9] Book David A. Kopriva (2009) Implementing Spectral Methods for Partial Differential Equations (pages 73-78 and 78-82) Florida State University, USA [10] Website: %http://en.wikipedia.org/wiki/Runge%27s_phenomenon

[11] Website: http://en.wikipedia.org/wiki/Lagrange_polynomial [12] Website: http://www.scholarpedia.org/article/Spectral_methods [13] Book: Lloyd N. Trefethen (1994) Finite Difference and spectral methods for ordinary and partial diferential equations Cornell University, Ithaca, USA

[14] Article: Sigal Gottlieb and Chi-Wang Shu total variation diminishing runge-kutta schemes Math. Comp., 67 (1998), pp 73-85. July 1996 [15] Article: David Gottlieb and Eitan Tadmor The CFL condition for spectral approximations to hyperbolic initial- boundary value problems Math. of Comput., 56 April 1991, pages 565-588 [16] Book: A. Bressan (2000) Hyperbolic systems of conservation laws Oxford University press, New York

42 Appendix A

Convergence order of quadrature rules

In order to verify the correctness of a numerical scheme, the order of convergence can be estimated and compared with the theoretical value. For the 1D problems the Simpson’s rule quadrature is employed. In 2D both the Simpson’s and Newton-Cotes 7-point rule quadratures are developed to evaluate a double integral numerically.

1D quadrature rules Consider the following test equations: Z 0.3 g(x) = cos(x)dx (A.1) −0.3 The order of convergence of the 1D Simpson’s quadrature rule, presented in 2.3, is estimated by comparing the analytical solution of the test equation A.1 to the nummerical approximation on finer grids. The analytical solution to this problem on a certain grid is: 0.3 h u = sin(xi) (A.2) −0.3

Where xi = 0.3 · sin(π · α(i)) with α(i) ∈ [−0.5, 0.5] for i = 1, 2, ..., N − 1,N. In case the analytical solution is known the error is defined as: Eh = |uh − u˜h| (A.3) Here u is the analytical solution, u˜ is the numerical approximation and h denotes the grid spacing. According to the derivation in 2.7 the order of convergence can be approximated as:

Eh1  p ≈ log10 h (A.4) E 2 By refining the grid and comparing the error on each grid the order of convergence can be estimated of the respective scheme.

1D simpson’s rule If equation A.1 is approximated using Simpson’s rule, the expected order of convergence is p = 4. Using equation A.4 the order of convergence is estimated. In table A the error is tabulated for a certain number of grid points N.

43 N Eh p 30 1.0729 · 10−10 3.9975 60 1.0729 · 10−12 3.9994 120 1.0729 · 10−13 4.0027 240 1.0729 · 10−14 3.7127 480 1.0729 · 10−15 -

Table A.1: Order of convergence for the one-dimensional Simpson’s rule

From table A it can be observed that the order of convergence is approximately four. For N = 480 the error almost reaches machine precision (O(10−16)) which results in a slightly different p. It is verified that simpson’s rule is fourth order accurate.

2D quadrature rules In order to estimate the order of convergence of the 2D simpson rule and the Newton-Cotes 7-point rule the same approach is taken. Consider the 2D test equation:

Z 0.3 Z 0.3 h(x, y) = cos(xy)dxdy (A.5) −0.3 −0.3

Where xi = 0.3 · sin(π · α(i)) with α(i) ∈ [−0.5, 0.5] for i = 1, 2, ..., N − 1,N and Where yj = 0.3 · sin(π · α(j)) with α(j) ∈ [−0.5, 0.5] for j = 1, 2, ..., M − 1,M. In absence of the analytical solution the error is now computed by comparing the solution on the current grid with a solution on a finer grid. The error is then defined as:

h h h E˜ = |u˜ − u˜ 2 | (A.6)

The order of convergence can now be approximated by:

E˜h1  p ≈ log10 (A.7) E˜h2 Once again, by refining the grid and comparing the error on each grid the order of convergence can be estimated.

2D simpson’s rule If equation A.5 is approximated by the 2D Simpson’s quadrature rule, the expected order of convergence is p = 4. Using equation A.7 the order of covergence can be approximated. The results are tabulated in table A.

N = M E˜h p 5 2.7233 · 10−11 4.6527 10 1.0827 · 10−12 4.3141 20 5.4429 · 10−14 4.1300 40 3.1086 · 10−14 4.8074 80 1.1102 · 10−16 -

Table A.2: Order of convergence for the two-dimensional Simpson’s rule

From the table A it appears that the order of convergence is about p ≈ 4.1 at best (since the accuracy reaches machine precision for N = 80 this the last value for p in the table might not be accurate). Since the convergence rate is estimated without the analytic value this results seems reasonable. Hence it can be concluded that the 2D simpson’s rule is fourth order accurate.

44 2D Newton-Cotes 7-piont rule If equation A.5 is approximated by the 2D Newton-Cotes 7-point rule quadrature method the expected rate of conver- gence is p = 8. Since the approximation with the 2D Newton-Cotes 7-point quadrature reaches machine precision when just a few grid points are used, equation A.5 is altered so that the solutions on finer grids can be compared. The new test equation is: Z 3 Z 3 h(x, y) = cos(5xy)dxdy (A.8) −3 −3 Aprroximating equation A.8 with the Newton-Cotes quadrature 7-point rule and using equation A.7 to estimate the order of covergence gives the results tabulated in table A.

N = M E˜h p 4 7.082 · 10−2 11.71 8 2.114 · 10−5 12.170 16 4.587 · 10−19 8.407 32 1.352 · 10−11 8.221 64 4.530 · 10−14 -

Table A.3: Order of convergence for the two-dimensional Newton-Cotes 7-point rule

From the results in table A it appears that the 2D Newton-Cotes 7-rule is eighth order accurate when the grid is refined.

45 Appendix B

Accuracy of the Chebyshev spectral collocation method

In order to verify the correctness of the 3rd order Total Variation Diminishing method and the Chebyshev collocation spectral method, the following test equation is considered:

 ∂u + ∂u + ∂u = 0  ∂t ∂x ∂y u(x, y, 0) = sin(π(xy) (B.1) u(−1, y, t) = sin(π(−1 − t)(y − t)  u(x, −1, t) = sin(π(x − t)(−1 − t)

The analytical solution which satisfies this PDE is:

u(x, y, t) = sin(π(x − t)(y − t)) (B.2)

Employing the collocation method from 2.5 and the time integration method from 2.6 the PDE can be approximated:

N M ˙ X (1),x X (1),y u˜ + Dik u˜k,j + Djk u˜i,k = 0 (B.3) k=0 k=0

(1),x (1),x Here u˜ is the numerical approximation to u and Dik and Dik denote the first order spectral derivative matrices to the coordinates x and y respectively. Both matrices are obtained by evaluating 2.31. Using the CFL-condition as in equation 2.32 for determining the time-step the accuracy of the discretization can be investigated by comparing the 2 numerical approximation to the analytical solution. By plotting the weigthed Lw-norm as in equation 2.38 as function of the number of grid points, the convergence rate can be estimated.

In figure B.1 the nummerical approximation, analytical solution and pointwise are displayed for N = 40,M = 40 and ∆t = 3.125 · 10−4. In figure B.2 the weigthed L2-norm is plotted as function of the number of grid points N. From N = 10 untill N = 20 the line is more or less straight. In other words, the weigthed L2-norm decreases exponentially with increasing number of grid points. From N = 20 to N = 40 the 3rd order convergence of the TVD Runge Kutta time integration scheme becomes the leading term in the error. It is concluded that indeed the numerical approximation converges exponentially fast untill the 3rd order TVD Runge-Kutta scheme becomes the dominant in the error approximation.

46 Figure B.1: Two-dimensional homogeneous advection equation

Figure B.2: Two-dimensional weigthed L2-norm as function of N

47