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 Engineering 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 polynomial 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 function, the influence of the source term can be approximated by the convolution of the continuous function 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, discretization 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 polynomials (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 integral 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 integrals 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 Dirac delta function (formally a distribution) is a so called generalized function 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 support 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 rate of convergence 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).