modified stencils for boundaries and subgrid scales in the...

46
Modified Stencils for Boundaries and Subgrid Scales in the Finite-Difference Time-Domain Method JON H ¨ AGGBLAD Doctoral Thesis Stockholm, Sweden 2012

Upload: others

Post on 15-Mar-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Modified Stencils for Boundaries and Subgrid Scales inthe Finite-Difference Time-Domain Method

JON HAGGBLAD

Doctoral ThesisStockholm, Sweden 2012

Page 2: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

TRITA-CSC-A 2012:07ISSN-1653-5723ISRN-KTH/CSC/A--12/07--SEISBN 978-91-7501-417-3

KTH School of Computer Science and CommunicationSE-100 44 Stockholm

SWEDEN

Akademisk avhandling som med tillstand av Kungl Tekniska hogskolan framlaggestill offentlig granskning for avlaggande av teknologie doktorsexamen i tillampadmatematik och berakningsmatematik med inriktning mot numerisk analys, fredagenden 15 juni 2012 klockan 10.00 i F3, Lindstedtsvagen 26, Kungl Tekniska hogskolan,Stockholm.

c© Jon Haggblad, maj 2012

Tryck: E-print AB

Page 3: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

iii

Abstract

This thesis centers on modified stencils for the Finite-Difference Time-Domain method (FDTD), or Yee scheme, when modelling curved boundaries,obstacles and holes smaller than the discretization length. The goal is toincrease the accuracy while keeping the structure of the standard method,enabling improvements to existing implementations with minimal effort.

We present an extension of a previously developed technique for consis-tent boundary approximation in the Yee scheme. We consider both Maxwell’sequations and the acoustic equations in three dimensions, which require sep-arate treatment, unlike in two dimensions.

The stability properties of coefficient modifications are essential for prac-tical usability. We present an analysis of the requirements for time-stablemodifications, which we use to construct a simple and effective method forboundary approximations. The method starts from a predetermined staircasediscretization of the boundary, requiring no further data on the underlyinggeometry that is being approximated.

Not only is the standard staircasing of curved boundaries a poor approx-imation, it is inconsistent, giving rise to errors that do not disappear in thelimit of small grid lengths. We analyze the standard staircase approximationby deriving exact solutions of the difference equations, including the staircaseboundary. This facilitates a detailed error analysis, showing how staircasingaffects amplitude, phase, frequency and attenuation of waves.

To model obstacles and holes of smaller size than the grid length, wedevelop a numerical subgrid method based on locally modified stencils, wherea highly resolved micro problem is used to generate effective coefficients forthe Yee scheme at the macro scale.

The implementations and analysis of the developed methods are validatedthrough systematic numerical tests.

Page 4: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

iv

Page 5: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Preface

This thesis is divided into two parts. The main contributions are presented in thesecond part, which consists of five papers listed below. The first part of this thesisserves as an introduction to these.

Paper IB. Engquist, J. Haggblad, and O. Runborg. On energy preserving consistent bound-ary conditions for the Yee scheme in 2D. BIT Numerical Mathematics (to appear,2012). TRITA-NA 2011:5.

The author of this thesis contributed to the ideas, developed the method, provedthe theorems, performed the computations and wrote the manuscript.

The results in this paper is also part of the Licentiate thesis [17].

Paper IIJ. Haggblad and O. Runborg. Accuracy of staircase approximations in finite-difference methods for wave propagation. Technical report (2012). TRITA-NA2012:10.

The authors of the manuscript developed the theory, proofs and wrote themanuscript in close collaboration.

Paper IIIJ. Haggblad and B. Engquist. Consistent modeling of boundaries in acoustic finite-difference time-domain simulations, Submitted to J. Acoust. Soc. Am., (2012).TRITA-NA 2012:1.

The author of this thesis formulated most of the ideas, developed the numericalalgorithm, performed the computations and wrote the manuscript.

v

Page 6: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

vi PREFACE

Paper IVB. Engquist, J. Haggblad, O. Runborg, and A.-K. Tornberg. On Consistent Bound-ary Conditions for the Yee Scheme in 3D. Technical report (2012). TRITA-NA2012:11.

The author of this thesis contributed to the ideas, developed the numericalmethod, performed the computations and wrote the manuscript.

Some of the results are also part of the Licentiate thesis [17].

Paper VB. Engquist, J. Haggblad, and O. Runborg. Numerical subgrid scale models for theYee scheme. Technical report (2012). TRITA-NA 2012:12.

The author of this thesis contributed to the ideas and the development of thenumerical method, performed the computations and wrote most of the manuscript.

Page 7: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

vii

To Marie

Page 8: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl
Page 9: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Acknowledgements

First and foremost I would like to thank my advisors, Prof. Bjorn Engquist andProf. Olof Runborg for their continued guidance and support. It has been a priv-ilege to benefit from their vast knowledge and mathematical intuition. Olof hasalways inspired me with his incredibly sharp mind and ability to see vital details. Ithank Bjorn for arranging several visits for me to the University of Texas at Austin,as well as inviting me to his family home.

Of course, I would also like to thank my colleagues at the Department of Nu-merical Analysis for providing such a pleasant work atmosphere, I always felt athome.

I thank Jesper Oppelstrup for reading through this thesis and providing valuableinput, and also Anna-Karin Tornberg for all the helpful discussions.

Also I would like to thank my loving wife, Marie, for her patience and under-standing.

Financial support has mainly been provided by SSF through CIAM, but alsoby Wallenbergsstiftelserna, and is gratefully acknowledged.

ix

Page 10: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

x ACKNOWLEDGEMENTS

Page 11: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Contents

Preface v

Acknowledgements ix

Contents xi

1 Introduction 1

2 Maxwell’s equations 32.1 Reduction to two dimensions . . . . . . . . . . . . . . . . . . . . . . 5

3 Computational Electromagnetics 73.1 The Finite-Difference Time-Domain method . . . . . . . . . . . . . . 73.2 Other techniques . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

4 Relation to acoustic waves and the wave equation 134.1 The FDTD method and acoustics . . . . . . . . . . . . . . . . . . . . 14

5 Staircase approximations of boundaries 175.1 Locally conformal methods . . . . . . . . . . . . . . . . . . . . . . . 185.2 Unstructured grids and hybrid methods . . . . . . . . . . . . . . . . 19

6 Modelling small geometric features 216.1 Thin wires . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216.2 Narrow slots . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

7 Summary of appended papers 257.1 Time-stable modifications of the Yee scheme . . . . . . . . . . . . . . 257.2 Accuracy of staircase approximations . . . . . . . . . . . . . . . . . . 267.3 Consistent boundary approximations in three dimensions . . . . . . 277.4 A numerical subgrid model . . . . . . . . . . . . . . . . . . . . . . . 30

References 31

xi

Page 12: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl
Page 13: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Chapter 1

Introduction

In the age of telecommunications, the numerical computation of electromagneticwaves is of rapidly growing interest, spurred on by the fields of antenna design,wireless communications and electromagnetic compatibility, among others [40]. Alarge variety of methods with different levels of sophistication and complexity havebeen developed and successfully applied to real-world problems. Yet, one of the ear-liest and simplest methods, the Finite-Difference Time-Domain method (FDTD),or Yee scheme [50], is still one of the main workhorses in industry. Furthermore, itis a method that has been generalized to many forms of wave propagation problems,including acoustics [29, 5] and elastic waves [46, 47, 35].

Against this backdrop we study how to improve two weaknesses of the Yeescheme: the inability to cope with boundaries not aligned with the grid, especiallycurved boundaries; and small geometric features, such as obstacles and holes, thatare of smaller size than the grid spacing. These weaknesses stem from the use of astaggered Cartesian grid which is coincidently, also a major reason for the popularityof the method. It gives relatively low dispersion, a low memory footprint, and allowseasy implementation on distributed memory architectures.

Our approach has therefore been to stick to the Yee grid structure as muchas possible and primarily modify the coefficients in the method to achieve thedesired improvements. The research also contributes to the general developmentand analysis of boundary and interface conditions in connection to structured grids.See e.g. [31].

In a sequence of papers [42, 44, 43] new boundary approximations and consis-tent formulations were studied. It was pointed out that the standard Yee schememay already generate O(1) errors locally after the first timestep. This develop-ment, however, lacked rigor in some aspects and the technique was not satisfactoryin higher dimensions. The research in this thesis aims to resolve many of thesedifficulties.

The technique developed in [43] for curved boundaries removes the inconsisten-cies of staircasing by analyzing the expansion of the truncation error. We general-

1

Page 14: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

2 CHAPTER 1. INTRODUCTION

ize this method to three dimensions both for electromagnetics and acoustics. ForMaxwell’s equations this includes the added difficulty of divergence preservation.The types of boundaries covered by this approach are perfect electric conductors(PEC) for electromagnetics and perfectly rigid boundaries in acoustics. For pres-sure release boundaries in acoustics we propose a mixed interpolating-extrapolatingtechnique to obtain second order accuracy without CFL reduction.

Stability is of utmost importance for numerical methods. We present an anal-ysis of the requirements for time-stable coefficient modifications. We use this toconstruct a simple and effective method to reduce the errors generated by staircaseapproximations, which does not rely on the underlying geometry from which thestaircasing is derived, making the technique almost trivial to implement.

Furthermore, we have studied the errors generated by standard staircasing indetail by rigorously deriving exact modal solutions to the difference equations of theYee scheme. These exact solutions allow a detailed error analysis, showing how thestaircasing affects the amplitude, phase, frequency and attenuation of waves. Wealso characterize the evanescent waves of magnitude O(1) and frequency O(1/h)that are triggered at the boundary. These end up preventing convergence in L∞,and reducing convergence to O(

√h) in L2.

Finally, for subgrid size geometric features, such as holes and slits, we develop anumerical subgrid method based on locally modified update stencils, where we pre-compute the coefficients of the stencils by solving a highly resolved local problem.Computations using the method are performed in one, two, and three dimensions.

The structure of this first part of the thesis is as follows. We start with a briefoutline of Maxwell’s equations and the necessary electromagnetics in Chapter 2. InChapter 3 we give an overview of the field of computational electromagnetics. TheYee scheme is presented, as well as an outline of other methods. The parallels withacoustic waves are illustrated in Chapter 4. In Chapter 5 staircase approximation ofboundaries in the Yee scheme is discussed, as well as some of the methods commonlyused to improve accuracy. Subgrid methods to model small geometric featuresare presented in Chapter 6. Following this, we summarize our contributions inChapter 7.

Page 15: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Chapter 2

Maxwell’s equations

Maxwell’s equations, see e.g. [22], are usually written in SI units as

∂tB +∇×E = 0, (2.1)∂tD−∇×H = −Jf , (2.2)

∇ ·D = ρf , (2.3)∇ ·B = 0. (2.4)

We have two equations—Faraday’s law (2.1) and Ampere’s law (2.2)—governingthe time evolution, and two related to charge sources, Gauss’s law (2.3) and thecondition for the absence of free magnetic poles (2.4). Here E is the electric field[V/m], D is the electric displacement field [C/m2], B is the magnetic flux density[T] = [Wb/m2], H is the magnetic field [A/m], ρf is the free charge density [C/m3]and Jf is the free current density [A/m2]. These fields are related through

D = ε0E + P, (2.5)

H = Bµ0−M, (2.6)

where ε0 = 1/(c20µ0) ≈ 8.854187817 · 10−12F/m is the vacuum permittivity, µ0 =4π · 10−7Vs/Am is the vacuum permeability and c0 = 299792458m/s is the speedof light in vacuum. These are all defined constants, see ISO 31-5 [1] or ISO/IEC80000-6 [2]. Furthermore, in these expressions we have P, which is the polarization[C/m2] and M, which is the magnetization [A/m]. For the case of linear isotropicand non-dispersive materials—which is the case we will restrict ourselves to—thesetwo relations (2.5)–(2.6) can be simplified to

D = εE,B = µH,

where ε = ε0εr and µ = µ0µr. The quantities εr and µr are referred to as therelative permittivity and relative permeability, respectively. These depend on the

3

Page 16: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

4 CHAPTER 2. MAXWELL’S EQUATIONS

spatial variable, i.e., ε = ε(x), µ = µ(x). For conductive materials we also haveattenuation of the E fields, creating a current density

Jf = σE + J′f ,

where σ is the electric conductivity. Here we introduce J′f as the free currentdensity arising from sources other than conductivity [48]. Using these expressionsand simplifications we can write the system as

µ∂tH = −∇×E,ε∂tE = ∇×H− σE− J′f ,

∇ · (εE) = ρf ,

∇ · (µH) = 0.

Note that from (2.1)–(2.4) the equation of continuity of free electric charge,

∂ρf∂t

+∇ ·Jf = 0,

follows by taking the divergence of Ampere’s law (2.2) and inserting Gauss law(2.3).

From the perspective of time evolution, the two divergence equations (2.3)–(2.4) are best viewed as initial conditions for the fields, since the two time evolutionequations (2.1)–(2.2) preserve these conditions. We will mainly consider the vacuumcase σ = 0, J′f = 0,

µ∂tH = −∇×E, (2.7)ε∂tE = ∇×H, (2.8)

where µ = µ(x), ε = ε(x).The conditions at a surface of discontinuity between two different regions, de-

noted 1 and 2 with the normal vector n directed from region 1 to region 2, followsdirectly from Maxwell’s equations and are given by

n · (ε2E2 − ε1E1) = σf ,

n× (E2 −E1) = 0,n · (µ2H2 − µ1H1) = 0,n× (H2 −H1) = Kf .

The important special case of boundary conditions along a perfect electric conductor(PEC), is given by

n · εE = σf , (2.9)n×E = 0, (2.10)n ·µH = 0, (2.11)

n×H = Kf . (2.12)

Page 17: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

2.1. REDUCTION TO TWO DIMENSIONS 5

Here σf denotes the surface charge and Kf the surface currents. The normal ispointing away from the PEC surface. Note that (2.9) and (2.12) are not reallyboundary conditions, since the surface charge and currents are unknowns. Also,(2.11) can be shown to be a consequence of (2.10). Thus the defining relation for aPEC is (2.10), which states that the tangential electric field is always zero.

Another way to formulate the two time evolution equations (2.1) and (2.2), isas the hyperbolic system

ut = Aux +Buy + Cuz,

where u =(Ex, Ey, Ez, Hx, Hy, Hz

)T . Observe that the symbol Aξ1 + Bξ2 + Cξ3for ‖ξ‖ = 1 has six eigenvalues λ = −c,−c, 0, 0, c, c, corresponding to the wavepropagation with velocity c and stationary divergence free fields.

For a more detailed discussion of Maxwell’s equations we refer to a textbook onelectromagnetics, such as [22, 48, 39].

2.1 Reduction to two dimensions

In two dimensions the system (2.7)–(2.8) reduces to two independent sets of equa-tions. These are the transverse magnetic (TM) polarization

ε∂tEz = ∂xHy − ∂yHx, (2.13)µ∂tHx = −∂yEz, (2.14)µ∂tHy = ∂xEz, (2.15)

and the transverse electric (TE) polarization

µ∂tHz = ∂yEx − ∂xEy, (2.16)ε∂tEx = ∂yHz, (2.17)ε∂tEy = −∂xHz, (2.18)

where ε = ε(x, y) and µ = µ(x, y). Here we assumed that there are no variationsalong the z-axis, which is why these two polarizations are usually referred to asTMz and TEz.

Page 18: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl
Page 19: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Chapter 3

Computational Electromagnetics

Computational electromagnetics (CEM) is, broadly speaking, the study of con-structive methods for Maxwell’s equations (2.1)–(2.4). In other words, this meansthe construction (computation) of approximate solutions.

There are many different numerical methods to compute the fields, each withits own strengths and weaknesses. The basic concern is to balance accuracy andcomputational effort, where computational effort also includes associated difficultiessuch as the construction of a suitable mesh, as well as implementation (program-ming) complexity.

Possible applications include any type of electromagnetic phenomena, e.g., an-tennas, radars and wireless communications, electronics, photonics, electromagneticcompatibility (EMC), and medical imaging. In this treatment we are mainly inter-ested in wave type situations, which we solve using uniform spatial and temporaldiscretizations and finite difference approximations. Due to the equivalences andsimilarities discussed in Section 4, our realm of interest also covers acoustic waves.

3.1 The Finite-Difference Time-Domain method

The Finite-Difference Time-Domain method (FDTD), commonly referred to as theYee scheme after its inventor [50], is the application of centred differences on astaggered grid together with explicit leapfrog time updates on the full Maxwellequations in time domain. Leapfrog in time means we update according to

Hn+ 12 = Hn− 1

2 − ∆tµ∇×En,

En+1 = En + ∆tε∇×Hn+ 1

2

where tn = n∆t and Hn+ 12 , En approximates H and E at tn+1/2 and tn, respec-

tively.

7

Page 20: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

8 CHAPTER 3. COMPUTATIONAL ELECTROMAGNETICS

If we then replace the partial derivatives in the curl operators with discretedifferences, we obtain in component form the complete set of equations for the Yeescheme according to1,

Hx

∣∣n+ 12

i,j+ 12 ,k+ 1

2= Hx

∣∣n− 12

i,j+ 12 ,k+ 1

2+ ∆t

µ

(D+zEy

∣∣ni,j+ 1

2 ,k−D+yEz

∣∣ni,j,k+ 1

2

)(3.1)

Hy

∣∣n+ 12

i+ 12 ,j,k+ 1

2= Hy

∣∣n− 12

i+ 12 ,j,k+ 1

2+ ∆t

µ

(D+xEz

∣∣ni,j,k+ 1

2−D+zEx

∣∣ni+ 1

2 ,j,k

)(3.2)

Hz

∣∣n+ 12

i+ 12 ,j+

12 ,k

= Hz

∣∣n− 12

i+ 12 ,j+

12 ,k

+ ∆tµ

(D+yEx

∣∣ni+ 1

2 ,j,k−D+xEy

∣∣ni,j+ 1

2 ,k

)(3.3)

Ex∣∣n+1i+ 1

2 ,j,k= Ex

∣∣ni+ 1

2 ,j,k− ∆t

ε

(D+zHy

∣∣ni+ 1

2 ,j,k−12−D+yHz

∣∣ni+ 1

2 ,j−12 ,k

)(3.4)

Ey∣∣n+1i,j+ 1

2 ,k= Ey

∣∣ni,j+ 1

2 ,k− ∆t

ε

(D+xHz

∣∣ni− 1

2 ,j+12 ,k−D+zHx

∣∣ni,j+ 1

2 ,k−12

)(3.5)

Ez∣∣n+1i,j,k+ 1

2= Ez

∣∣ni,j,k+ 1

2− ∆t

ε

(D+yHx

∣∣ni,j− 1

2 ,k+ 12−D+xHy

∣∣ni− 1

2 ,j,k+ 12

)(3.6)

where the mesh is defined as

Ex∣∣ni+ 1

2 ,j,k, i = 0, . . . , Nx − 1, j = 0, . . . , Ny, k = 0, . . . , Nz,

Ey∣∣ni,j+ 1

2 ,k, i = 0, . . . , Nx, j = 0, . . . , Ny − 1, k = 0, . . . , Nz,

Ez∣∣ni,j,k+ 1

2, i = 0, . . . , Nx, j = 0, . . . , Ny, k = 0, . . . , Nz − 1,

Hx

∣∣n− 12

i,j+ 12 ,k+ 1

2, i = 0, . . . , Nx, j = 0, . . . , Ny − 1, k = 0, . . . , Nz − 1,

Hy

∣∣n− 12

i+ 12 ,j,k+ 1

2, i = 0, . . . , Nx − 1, j = 0, . . . , Ny, k = 0, . . . , Nz − 1,

Hx

∣∣n− 12

i+ 12 ,j+

12 ,k, i = 0, . . . , Nx − 1, j = 0, . . . , Ny − 1, k = 0, . . . , Nz,

where n = 0, . . . , Nt and Nx, Ny, Nz are the number of cells in each direction. Theunit cell is illustrated in Figure 3.1. Each component has the coordinates

(xi, yj , zk) = (ihx, jhy, khz) ,

which is valid also for half indices. The difference operator D+x is simply a forwarddifference along the specified coordinate, i.e.,

D+xEz∣∣i,j,k+ 1

2=Ez∣∣i+1,j,k+ 1

2− Ez

∣∣i+1,j,k+ 1

2

hx.

Although this is a forward difference, the way it appears in the FDTD algorithm(3.1)–(3.6) makes the differences centred.

1Note that we move the sign, −∇ × E → +(−∇ × E), ∇ × H → −(−∇ × H), this is byconvention.

Page 21: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

3.1. THE FINITE-DIFFERENCE TIME-DOMAIN METHOD 9

Ex

Ey

Ez

Hx

Hy

Hzx

y

z

Figure 3.1: Unit cell for the Yee scheme

The FDTD algorithm is explicit, and hence for stability has an upper bound onthe timestep, i.e., a Courant–Friedrichs–Lewy (CFL) condition, which is given by

cλ ≤ 1√d,

where d is the dimension, λ = ∆t/h and c is the wave speed.A central topic for wave propagation is dispersion. To analyse the numerical

dispersion for three-dimensional FDTD we eliminate H to get the curl-curl equationfor E,

1c2∂2E∂t2

+∇×∇×E = 0.

Together with a plane wave ansatz we are able to state the matrix equationD2y +D2

x −D2t /c

2 −DxDy −DxDz

−DxDy D2x +D2

z −D2t /c

2 −DyDz

−DxDz −DyDz D2x +D2

y −D2t /c

2

exeyez

= 0,

where

Dt = 2i∆t sin ω∆t

2 ,

Dx = 2ih

sin kxh2 ,

Dy = 2ih

sin kyh2 ,

Dz = 2ih

sin kzh2 .

Page 22: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

10 CHAPTER 3. COMPUTATIONAL ELECTROMAGNETICS

This has nontrivial solutions when the determinant is zero, giving

D2t = c2

(D2x +D2

y +D2z

).

Expanding this in the discrete derivative operators we get

sin2 ω∆t/2(c∆t)2 = sin2 kxh/2

h2 + sin2 kyh/2h2 + sin2 kzh/2

h2 .

This relation determines the wave speed for the different frequencies, and will beof central importance in Paper 2 [18]. Note that we recover the exact dispersionrelation

ω2 = c2(k2x + k2

y + k2z

),

in the limit Dt → iω, Dx,y,z → ikx,y,z.The FDTD method has proven to be very successful and is still extremely pop-

ular despite its age. Reasons for this include high memory efficiency due to thestaggered grid points, exact divergence (charge) conservation as well as 2nd orderaccuracy in both time and space. Furthermore, the uniform grid gives low dis-persion for wave-like problems and makes it easy to implement on modern (e.g.multi-core) architectures. For further information on the FDTD method we referto [40].

3.2 Other techniques

There are many techniques for solving Maxwell’s equations other than the FDTDmethod. They include higher order approximations of the derivatives on the Yeegrid, see e.g. [16]. The higher order means that a coarser grid can be employedwhile still achieving sufficient accuracy. Although it is fairly straightforward todevise a higher order method for the inner domain, constructing a robust highorder method for the internal boundaries and interfaces is harder. Hence thesemethods are usually not used in applications, yet.

An alternative is to use Discontinuous Galerkin (DG) methods. These are widelystudied in the academic community, see e.g. [19, 9], and are now starting to findtheir way into use in industry.

One approach is to reduce the domain by either going to frequency (Fourier)domain, and/or restricting the problem to the boundary giving a boundary inte-gral formulation over surface charges and currents. This last method is in the CEMcommunity referred to as the Method of Moments (MoM) [14], and can be acceler-ated by a multipole expansion, giving the much celebrated Fast Multipole Method(FMM) [36, 15, 12]. The equations solved are the electric field integral equation(EFIE),

Eitan = iωµ0

∫∂Ωc

e−ikR

RJs(r′)dS′

∣∣∣∣∣tan

+ i

4πε0ω∇∫∂Ωc

e−ikR

R∇′ ·Js(r′)dS′

∣∣∣∣∣tan

,

(3.7)

Page 23: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

3.2. OTHER TECHNIQUES 11

and the magnetic field integral equation (MFIE)

−Hitan = 1

2 n× Js(r) + 14π

∫∂Ωc

−∇(e−ikR

R

)× Js(r′)dS′

∣∣∣∣∣tan

. (3.8)

Here a smooth PEC scatterer is assumed. For scattering problems with large seg-ments of free space, this is very efficient and the method of choice in industry whendoing, for example, radar cross section (RCS) calculations. The downside is thatthe implementation can be very technical, as there is a large number of subtletiesand special cases which need to be taken care of. For example, sometimes internalresonances occur which requires that we solve both (3.7)–(3.8) in a suitable linearcombination [4].

One of the major obstacles in wave propagation is dealing with high frequencies,since fast oscillations give rise to a large number of unknowns, i.e., the spatialextent is large relative to the wavelength. If the frequencies are sufficiently high,then one can use asymptotic techniques such as Geometric Optics (GO) [37, 11],the Geometric Theory of Diffraction (GTD) by Keller [24], the extension to UnifiedTheory of Diffraction (UTD) introduced by Kouyoumjian and Pathak in [25], orGaussian beam methods [32, 26]. In the integral formulation one can use PhysicalOptics as well as high frequency asymptotics, see e.g. [6, 7]. Thus for very highfrequencies the problem becomes even simpler.

Page 24: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl
Page 25: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Chapter 4

Relation to acoustic waves and the waveequation

The two sets of equations (2.13)–(2.15) and (2.16)–(2.18) for different electromag-netic polarizations are of similar structure in that the only difference is the notation.This equivalence provides an opportunity to use a cleaner notation,

pt = a (ux + vy) , (4.1)ut = bpx, (4.2)vt = bpy, (4.3)

which we will make liberal use of. Substitute a = 1/ε, b = 1/µ together withp = Ez, v = −Hx, u = Hy or p = Hz, u = −Ey, v = Ex to get the TMz andTEz mode, respectively. If instead a = −κ and b = −1/ρ, we get another set ofequations which shares this structure,

∂p

∂t+ κ∇ ·u = 0, (4.4)

ρ∂u∂t

+∇p = 0. (4.5)

This system governs the propagation of sound waves in acoustics. Here p(x, y, t)represents the pressure and the vector u(x, y, t) = (u, v) the velocity field. Thecoefficients specify density ρ, and bulk modulus κ of the medium. The equation(4.4) is the mass balance, and (4.5) is the momentum balance.

We note that substituting (4.2)–(4.3) into (4.1) we see that p satisfies the usualsecond order wave equation

ptt = a∇ · (b∇p).

One could ask if the equivalence between the acoustics and electromagneticsholds in three dimensions as well. Here however, the similarity is not as straight-

13

Page 26: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

14 CHAPTER 4. RELATION TO ACOUSTIC WAVES AND THE WAVE EQUATION

forward, as the three dimensional generalization of (4.1)–(4.3) is

pt = a (ux + vy + wz) , (4.6)ut = bpx, (4.7)vt = bpy, (4.8)wt = bpz, (4.9)

which is a 4-component system, compared to the 6 components of (2.7)–(2.8). Al-though the components of the solutions to the acoustic equations and Maxwell’sequations all satisfy wave equations, taken as a whole the solution space differs [22].In particular, the large null-space of Maxwell’s equations can easily create problemsof spurious solutions contaminating the spectrum [4]. Both the acoustic equationsand Maxwell’s equations however, admit very similar numerical discretizations.

4.1 The FDTD method and acoustics

Discretizing the acoustic equations (4.6)–(4.9) in a similar way as for Maxwell’sequations gives

pn+ 1

2i+ 1

2 ,j+12 ,k+ 1

2= p

n− 12

i+ 12 ,j+

12 ,k+ 1

2

+ ∆ta(D+xu

ni,j+ 1

2 ,k+ 12

+D+yvni+ 1

2 ,j,k+ 12

+D+zwni+ 1

2 ,j+12 ,k

),

un+1i,j+ 1

2 ,k+ 12

= uni,j+ 12 ,k+ 1

2+ ∆tbD−xp

n+ 12

i+ 12 ,j+

12 ,l+

12,

vn+1i+ 1

2 ,j,k+ 12

= vni+ 12 ,j,k+ 1

2+ ∆tbD−yp

n+ 12

i+ 12 ,j+

12 ,k+ 1

2,

wn+1i+ 1

2 ,j+12 ,k

= wni+ 12 ,j+

12 ,k

+ ∆tbD−zpn+ 1

2i+ 1

2 ,j+12 ,k+ 1

2.

Here the mesh is defined by cells centred on p, i.e.,

pn− 1

2i+ 1

2 ,j+12 ,k+ 1

2i = 0, . . . , Nx − 1, j = 0, . . . , Ny − 1, k = 0, . . . , Nz − 1,

uni,j+ 1

2 ,k+ 12

i = 0, . . . , Nx, j = 0, . . . , Ny − 1, k = 0, . . . , Nz − 1,vni+ 1

2 ,j,k+ 12

i = 0, . . . , Nx − 1, j = 0, . . . , Ny, k = 0, . . . , Nz − 1,wni+ 1

2 ,j+12 ,k

i = 0, . . . , Nx − 1, j = 0, . . . , Ny − 1, k = 0, . . . , Nz,

which is illustrated in Figure 4.1. Sometimes it is convenient to think of the dis-cretization in terms of unit cells given by

cell(i, j, k) =

x ∈ R : x

∆x ∈ [i, i+ 1), y

∆y ∈ [j, j + 1), z

∆z ∈ [k, k + 1).

We see that the main difference compared to the three dimensional discretizationof Maxwell’s equations is the centred placement of the pressure field point.

Page 27: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

4.1. THE FDTD METHOD AND ACOUSTICS 15

u

v

w

p

x

y

z

Figure 4.1: Unit cell for the Yee scheme applied to the acoustic equations

v

p u

v

p u

v

p u

v

p u

v

p u

v

p u

v

p u

v

p u

v

p u

v v v

u

u

u

S

N

W E

Figure 4.2: The notation used for the p-update stencil.

In the two-dimensional setting we shall use a simplified notation for the updatestencil for p, the compass notation uj+1,l+1/2 = uE, uj,l+1/2 = uW, vj+1/2,l+1 = vN,uj+1/2,l = vS, illustrated in Figure 4.2.

Page 28: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl
Page 29: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Chapter 5

Staircase approximations of boundaries

While using a uniform grid is very efficient for computing the inner domain forhomogeneous media, when modelling curved interfaces and boundaries the approx-imation becomes coarse since it is difficult to properly resolve the geometry usingonly horizontal and vertical planes. This gives rise to the so called “Lego effect”,where objects modelled obtain a distinct block-shaped look. The term staircasingis also used frequently, especially for the two-dimensional case. Accurate boundarytreatment is of course not only important for the accuracy along the edges, but ofgreat concern for the entire computation since the errors generated near the bound-ary can propagate into the domain. In a commonly cited paper by Cangellaris andWright [8], staircasing of a boundary angled by π/4 relative to the grid and theevanescent waves generated are rigorously analysed. A numerical investigation ofthe errors generated was done by Holland [20].

An example of the inconsistencies generated by staircasing is given in [43].Consider the domain in Figure 5.1, given by

Ω = (x, y) | 2x+ y < h/4, ∂Ω = (x, y) | 2x+ y = h/4,

Then the normal vector is n = (2, 1)/√

5 and the boundary condition n · (u, v) = 0becomes 2u+ v = 0. If we assume a(x) = b(x) = 1 then this boundary admits theexact solution u = 1, v = −2 and p = P , where P is an arbitrary constant. Considerthe stencil where p is at the grid point (0, 0), which is the situation depicted inFigure 5.1 where the u value at (−h/2, 0) and the v value at (0,−h/2) is inside thedomain, while u at (h/2, 0) and v at (0, h/2) is set to zero. If the field is initializedto the exact constant solution previously mentioned, then the update formula forp becomes

p1/2 = p−1/2 + ∆th

((0− u0)+

(0− v0)) = P + ∆t

h6= P.

Hence we see that the truncation error is O(1/h) and we get an immediate O(1)error in L∞ after the first update. This is a worst-case scenario, but still clearlyillustrates the possible errors that can occur.

17

Page 30: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

18 CHAPTER 5. STAIRCASE APPROXIMATIONS OF BOUNDARIES

v

p u

v

p u

v

p u

v

p u

v

p u

v

p u

v

p u

v

p u

v

p u

v v v

u

u

u

u=

0

v = 0

x

y

0

0

Figure 5.1: Example of discretization where the boundary is to the right. The (u, v)components are zero on the dashed staircased boundary.

There are many techniques to improve the situation, a few of which are de-scribed below. We divide them into two groups, locally conformal methods andmethods involving unstructured grids. The locally conformal methods often havethe advantage of keeping the grid structure of the Yee scheme, making them efficientand simple.

5.1 Locally conformal methods

One of the first methods that improves on simple staircasing without introducingnon-orthogonal coordinates or totally unstructured grids is the contour-path FDTDmethod (CP-FDTD) [23]. This method in its initial form is plagued by late-timeinstabilities, regardless of the timestep used [27]. This can be fixed by e.g. addinga term to the update equations [33].

Later another scheme was introduced by Dey and Mittra [10], usually dubbedlocally conformal FDTD (CFDTD), which is much simpler. Since then there havebeen many contributions to the topic [13, 34]. This class of methods involve weight-ing the update stencil according to the fraction of the sides of the unit cube whichare inside the domain. Dey-Mittra style conformal FDTD methods modify Fara-

Page 31: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

5.2. UNSTRUCTURED GRIDS AND HYBRID METHODS 19

day’s law according to

Hz

∣∣n+ 12

i+ 12 ,j+

12 ,k

= Hz

∣∣n− 12

i+ 12 ,j+

12 ,k

+ ∆tµ ·Az

∣∣i+ 1

2 ,j+12 ,k

×(lx∣∣i+ 1

2 ,j+1,k ·Ex∣∣ni+ 1

2 ,j+1,k − lx∣∣i+ 1

2 ,j,k·Ex

∣∣ni+ 1

2 ,j,k

− lx∣∣i+1,j+ 1

2 ,k·Ey

∣∣ni+1,j+ 1

2 ,k+ lx

∣∣i,j+ 1

2 ,k·Ey

∣∣ni,j+ 1

2 ,k

),

where l and A are the length and area of the edges and faces of the cells inside thedomain.These methods reduce the errors along the boundary, but at the cost of astricter CFL-condition, usually around 0.5 − 0.7 of that of standard FDTD. Thisrestriction has motivated much of the later improved variants [51], which tries toloosen the CFL restriction, usually at the cost of complexity.

5.2 Unstructured grids and hybrid methods

Instead of modifying the update stencil, one can modify the grid along the bound-aries. One way to do this is by using a hybrid FEM-FDTD method, with anunstructured grid to resolve the boundary. A number of such methods have beendevised [49, 30], but it was first in [38] that a stable such method without any dissi-pation or timestep reduction was constructed. In this method the FDTD-cells andthe unstructured mesh is joined by a layer of pyramidal elements. Here symmetryis crucial in avoiding late time instabilities and some care must be taken in how toupdate the cells joining the structured and unstructured meshes.

Page 32: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl
Page 33: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Chapter 6

Modelling small geometric features

The structured grid in the FDTD method also carries the added downside of notbeing able to resolve geometric features smaller than the uniform discretizationlength h. In electromagnetic simulations, these are often thin wires, cracks orholes, and are important in electromagnetic compatibility (EMC), and antennaproblems [3].

Increasing global grid resolution such that the small scale of the holes or wiresis adequately resolved, is very costly. Essentially there are two main ways out:

One is a variable lattice to precisely model the geometry. This can be done byusing a Cartesian subgrid, or wrapping an unstructured grid around the area ofinterest and using a hybrid method, such as coupling to a Finite Element Method(FEM) or Finite Volume Method (FVM). While better than a global refinement,this becomes costly when the wires and gaps are very small. Another potentialissue is mesh interface reflections.

The other way is to use a uniform mesh and incorporate the fine spatial detailinto the local mesh cell immediately adjacent. This approach we refer to as subcellmethods, and is our main interest in this thesis.

6.1 Thin wires

For thin wires there are two common approaches of incorporating the effects of athin wire in an FDTD simulation. One is to solve a separate equation in parallelfor the wire that mutually interacts with the FDTD mesh. The advantage is thatarbitrarily oriented wires can be handled. See e.g. the model by Holland et al. [21].The other is exemplified by the contour path model of Umashankar et al. [45],where the effects of the wire are included in the update stencil of the global mesh.A refined method was presented in [28].

To give an example of the update stencils produced by the method we considerthe case shown in Figure 6.1. Here a wire is shown along the z-axis, indicated bythe two vertical lines. The magnetic field looping the wire is the Hy component.

21

Page 34: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

22 CHAPTER 6. MODELLING SMALL GEOMETRIC FEATURES

Hy

∣∣h/2,y0,z0

Ez

∣∣0,y0,z0

Ez

∣∣h,y0,z0

Ex

∣∣h/2,y0,z0−h/2

Ex

∣∣h/2,y0,z0+h/2

Thin wire

x = 0

x

z

Figure 6.1: Illustrating the contour path model given by (6.1)–(6.2). A wire is shownalong the z-axis, with its axis centered on x = 0. The component Ez|0,y0,z0 is locatedinside the wire.

For these we have the update stencil

Hy

∣∣n+ 12

h/2,y0,z0= Hy

∣∣n− 12

h/2,y0,z0+ ∆tµ0h

(Ex∣∣nh/2,y0,z0−h/2

− Ex∣∣nh/2,y0,z0+h/2

)+ 2∆tµ0h ln h/r0

Ez∣∣nh,y0,z0

. (6.1)

For the electric field in the radial direction we instead have

Ex∣∣n+1h/2,y0,z0−h/2

= Ex∣∣nh/2,y0,z0−h/2

+∆tε0h

(Hy

∣∣n+ 12

h/2,y0,z0−h−Hy

∣∣n+ 12

h/2,y0,z0

)+ ∆tε0h

(Hz

∣∣n+ 12

h/2,y0+h/2,z0−h/2−Hz

∣∣n+ 12

h/2,y0−h/2,z0−h/2

). (6.2)

There are corresponding expressions for the other components and other orienta-tions of the wires. The ends of wires are dealt with in a similar fashion [40].

6.2 Narrow slots

For narrow slots it is also possible to use a contour path model [41]. As in thecase of contour path wire models, this is accomplished by starting from the integral

Page 35: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

6.2. NARROW SLOTS 23

slot gap g

HzEy Ey

Ex

Ex

Figure 6.2: Contour path approximation of narrow slot.

formulation of Faraday’s law. It should be noted that the approach is very similarto the locally conformal methods for approximations of curved boundaries.

This way of thinking where one deforms the contour path as required by thegeometry is very appealing to an engineer, since it means we are dealing withphysical quantities such as electro- and magnetomotive forces.

An example is

Hz

∣∣n+ 12

x0,y0−Hz

∣∣n− 12

x0,y0

∆t

=Ex∣∣nx0,y0+h/2g − Ex

∣∣nx0,y0−h/2

h

µ0 ((h/2 + α)h+ (h/2− α)g) +

(Ey∣∣nx0−h/2,y0

− Ey∣∣nx0+h/2,y0

)(h/2 + α)

µ0 ((h/2 + α)h+ (h/2− α)g) ,

where g is the width of the slot and α the distance. See Figure 6.2 for an illustration.

Page 36: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl
Page 37: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

Chapter 7

Summary of appended papers

Below is a summary of the main contributions in the appended papers.

7.1 Time-stable modifications of the Yee scheme

For staircase approximated boundaries we analyse the conditions necessary to ob-tain time-stable modifications of the Yee update stencils. We do this by consideringthe generalized discretization,

pn+ 1

2j+ 1

2 ,l+12

= pn− 1

2j+ 1

2 ,l+12

+ ∆ta(1)j+ 1

2 ,l+12D+x

(1)j,l+ 1

2unj,l+ 1

2

)+ ∆ta(2)

j+ 12 ,l+

12D+y

(2)j+ 1

2 ,lvnj+ 1

2 ,l

),

(7.1)

un+1j,l+ 1

2= unj,l+ 1

2+ ∆tb(1)

j,l+ 12D−x

(1)j+ 1

2 ,l+12pn+ 1

2j+ 1

2 ,l+12

), (7.2)

vn+1j+ 1

2 ,l= vnj+ 1

2 ,l+ ∆tb(2)

j+ 12 ,lD−y

(2)j+ 1

2 ,l+12pn+ 1

2j+ 1

2 ,l+12

), (7.3)

for which we derive conditions when the energy is suitably bounded by its initialdata.

Theorem 7.1 (Stability). The discretization (7.1)–(7.3)) is time-stable, i.e.,

‖pn− 12 ‖h + ‖un‖h + ‖vn‖h ≤ C

(‖p− 1

2 ‖h + ‖u0‖h + ‖v0‖h),

with C independent of n, if

β(1)j+ 1

2 ,l+12

a(1)j+ 1

2 ,l+12

(2)j+ 1

2 ,l+12

a(2)j+ 1

2 ,l+12

, ∀j, l ∈ ΩpN ,

andλ maxi∈1,2

maxj,l

c(i) ≤ 1− δ√2, δ > 0,

25

Page 38: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

26 CHAPTER 7. SUMMARY OF APPENDED PAPERS

x/π

y/π

0.6 0.8 1 1.2

1.1

1.2

1.3

1.4

1.5

−2

0

2

4

(a) u field, standard Yee

x/π

y/π

0.6 0.8 1 1.2

1.1

1.2

1.3

1.4

1.5

−2

0

2

4

(b) u field, modified coefficients

Figure 7.1: Close-ups of the computed field for the scattering of harmonic waves againsta solid sphere.

are satisfied.

We refer the reader to paper I for the precise definition of all quantities involved.Taken together with the consistency conditions derived by Tornberg and Engquist in[43], these conditions enable us to construct a method based on modified coefficientswhich reduces the errors from the staircasing while preserving energy, at virtuallyno extra cost. Unlike similar methods there is no need to compute areas or volumesof cuts cells. A numerical comparison is shown in Figure 7.1.

7.2 Accuracy of staircase approximations

To better understand the errors generated by staircase approximations in the Yeescheme, we derive exact modal solutions of the numerical scheme when includingthe staircase boundary. Essentially we solve the dispersion relation

c2λ2(

sin2 hkx2 + sin2 hky

2

)= sin2 ω∆t

2 , λ = ∆th,

together with

kx + αky = K mod 2πh.

Page 39: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

7.3. CONSISTENT BOUNDARY APPROXIMATIONS IN THREE DIMENSIONS 27

x/π

y/π

−0.5 0 0.5−0.5

0

0.5

−0.15

−0.1

−0.05

0

0.05

0.1

0.15

(a) Ey , standard Yee.

x/π

y/π

−0.5 0 0.5−0.5

0

0.5

−0.15

−0.1

−0.05

0

0.05

0.1

0.15

(b) Ey , modified coefficients.

Figure 7.2: Scattering against a metallic sphere in three dimensions.

This leads to a polynomial equation characterizing the wave vectors kr = (krx, kry).Using these we can evaluate the field on the boundary,

P

(m+ 1

2 , jm + 12

)=

ν∑r=0

αreikr

x(m+ 12 )h+ikr

y(jm+ 12 )h

=ν∑r=0

αrei(kr

x+αkry)(m+ 1

2 )h+ikryδm+ 1

2h

= eiK(m+ 12 )h

ν∑r=0

αreikr

yδm+ 12h.

Setting these to zero then gives a system of equations determining the modal so-lutions for the boundary condition p = 0. This corresponds soft boundaries inacoustics, and perfect electric conductors (PEC) for the TM mode in electromag-netics. We also consider the boundary condition n ·u = 0, which corresponds torigid boundaries in acoustics, and PEC boundaries for the TE mode of Maxwell’sequations.

From this we can characterize the asymptotic behaviour, in particular theevanescent waves generated along the boundary of O(1) amplitude and O(1/h)frequency. A rigorous error analysis is done, where we show in detail how thestaircasing affects phase, amplitude, frequency and attenuation of waves.

7.3 Consistent boundary approximations in three dimensions

We consider the extension of the method in [43] to three dimensions. For theacoustic equations and rigid boundaries n ·u = 0 we obtain a solid improvement

Page 40: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

28 CHAPTER 7. SUMMARY OF APPENDED PAPERS

10 10010

−1

100

L2 e

rro

r

Yee (p)

Mod (p)

Yee (u)

Mod (u)

10 100

100

101

Points per wavelength

Ma

x n

orm

err

or

Yee (p)

Mod (p)

Yee (u)

Mod (u)

(a) n ·u = 0

10 100

10−2

10−1

100

L2 e

rro

r

Yee (p)

Mod (p)

Yee (u)

Mod (u)

10 100

10−2

10−1

100

101

Points per wavelength

Ma

x n

orm

err

or

Yee (p)

Mod (p)

Yee (u)

Mod (u)

(b) p = 0

Figure 7.3: Convergence result in L2 and L∞. Lines indicating slope 1/2, 1 and 2 areincluded.

in accuracy with minimal modifications of the Yee structure and without CFL-reduction. For soft boundaries, where p = 0, we use an interpolating/extrapolatingtechnique to improve the order of convergence, while keeping the optimal CFLcondition of standard Yee scheme. An example of the convergence rate obtained isshown in Figure 7.3 both for rigid and soft boundaries.

While formally straightforward, the extension to three-dimensional electromag-netics is observed to slowly generate divergence at a metallic boundary. This limitsthe method to shorter time-scales. For longer simulation times the divergence needsto be projected away. Nonetheless, the accuracy is greatly increased, as can be seenin Figure 7.2.

Page 41: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

7.4. A NUMERICAL SUBGRID MODEL 29

x

y

−1 −0.5 0 0.5 1−1

−0.5

0

0.5

1

−0.2

−0.15

−0.1

−0.05

0

0.05

0.1

0.15

0.2

x

y

−1 −0.5 0 0.5 1−1

−0.5

0

0.5

1

−0.2

−0.15

−0.1

−0.05

0

0.05

0.1

0.15

0.2

Figure 7.4: Illustrating the two-dimensional computation for a hole with relative widthw/h = 0.16. The colour map is highly compressed to show the transmitted wave. Top:standard Yee scheme computed at a very high resolution (16002 cells). Bottom: effectivestencil with α = 0.16, β = 0.84 (642 cells).

Page 42: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

30 CHAPTER 7. SUMMARY OF APPENDED PAPERS

1.5 2 2.5 310

−4

10−3

10−2

10−1

t

EFF

LOW

Figure 7.5: The error of the L2 value of the transmitted wave as a function of time. Thestandard Yee scheme (LOW) is included for comparison.

7.4 A numerical subgrid model

For obstacles and holes smaller than the grid spacing we introduce a numerical sub-grid scale method, where the coefficients of the stencil are pre-computed by solvinga highly resolved local problem. This is done by essentially connecting parametrizedabsorbing boundary conditions in the cell containing the hole or obstacle. For theacoustic equations in one dimension we get the relations

(un0 )L = α− 1α+ 1

1Zpn− 1

2− 1

2+ β

α+ 1

(1Zpn− 1

212

+ (un−10 )R

),

(un0 )R = −α− 1α+ 1

1Zpn− 1

212− β

α+ 1

(1Zpn− 1

2− 1

2− (un−1

0 )L),

which are then used in the standard update stencil for the neighbouring p points.These parameters α and β then, to lowest order, give the amount of reflection andtransmission observed at the macro scale. Full reflection is obtained for α = 1and full transmission for β = 1. To determine α and β for simulations in higherdimensions we need to solve a minimization problem. If we minimize the error inthe transmitted energy for a small hole in two dimensions, we obtain the resultsshown in Figure 7.4 and 7.5. The extension to three dimensions is straightforward.

Page 43: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

References

[1] I. 31-5:1992. Part 5: Electricity and magnetism. ISO, Geneva, Switzerland,1992.

[2] I. 31-5:1992. Part 6: Electromagnetism. ISO, Geneva, Switzerland, 1992.

[3] C. A. Balanis. Antenna Theory: Analysis and Design. Wiley-Interscience, 3edition, 2005.

[4] A. Bondeson, T. Rylander, and P. Ingelstrom. Computational Electromagnet-ics. Springer, 2005.

[5] D. Botteldooren. Finite-difference time-domain simulation of low-frequencyroom acoustic problems. J. Acoust. Soc. Am., 98(6):3302–3308, 1995.

[6] O. P. Bruno and F. Reitich. Solution of a boundary value problem forHelmholtz equation via variation of the boundary into the complex domain.Proc. R. Soc. Edinburgh, 122:317–340, 1992.

[7] O. P. Bruno and F. Reitich. Numerical solution of diffraction problems: amethod of variation of boundaries. J. Opt. Soc. Am. A, 10(6):1168–1175,1993.

[8] A. Cangellaris and D. Wright. Analysis of the numerical error caused by thestair-stepped approximation of a conducting boundary in FDTD simulations ofelectromagnetic phenomena. IEEE Trans. Antenn. Propag., 39(10):1518–1525,1991.

[9] G. Cohen, X. Ferrieres, and S. Pernet. Discontinuous Galerkin methods forMaxwell’s equations in the time domain. C. R. Phys., 7(5):494–500, 2006.Electromagnetic modelling.

[10] S. Dey and R. Mittra. A locally conformal finite-difference time-domain(FDTD) algorithm for modeling three-dimensional perfectly conducting ob-jects. IEEE Microw. Guided. W., 7(9):273–275, sep 1997.

[11] B. Engquist and O. Runborg. Computational high frequency wave propagation.Acta Numer., 12:181–266, 2003.

31

Page 44: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

32 REFERENCES

[12] B. Engquist and L. Ying. Fast directional multilevel algorithms for oscillatorykernels. SIAM J. Sci. Comput., 29(4):1710–1737, 2007.

[13] M. Fusco. FDTD algorithm in curvilinear coordinates. IEEE Trans. Antenn.Propag., 38(1):76–89, 1990.

[14] W. C. Gibson. The Method of Moments in Electromagnetics. Chapman andHall/CRC, 2007.

[15] L. Greengard and V. Rokhlin. A fast algorithm for particle simulations. J.Comput. Phys., 73(2):325–348, 1987.

[16] B. Gustafsson. High Order Difference Methods for Time Dependent PDE.Springer, 2008.

[17] J. Haggblad. Boundary and interface conditions for electromagnetic wave prop-agation using FDTD, 2010. Licentiate thesis.

[18] J. Haggblad and O. Runborg. Accuracy of staircase approximations infinite-difference methods for wave propagation. Technical Report TRITA-NA2012:10, Department of Numerical Analysis, KTH Royal Institute of Technol-ogy, Stockholm, Sweden, 2012.

[19] J. S. Hesthaven and T. Warburton. Nodal high-order methods on unstructuredgrids: I. time-domain solution of Maxwell’s equations. J. Comput. Phys.,181(1):186–221, 2002.

[20] R. Holland. Pitfalls of staircase meshing. IEEE Trans. Electromagn. C.,35(4):434–439, 1993.

[21] R. Holland and L. Simpson. Finite-difference analysis of EMP coupling to thinstruts and wires. IEEE Trans. Electromagn. C., EMC-23(2):88–97, 1981.

[22] J. D. Jackson. Classical Electrodynamics. Wiley, 3 edition, 1998.

[23] T. Jurgens, A. Taflove, K. Umashankar, and T. Moore. Finite-difference time-domain modeling of curved surfaces. IEEE Trans. Antenn. Propag., 40(4):357–366, 1992.

[24] J. B. Keller. Geometrical theory of diffraction. J. Opt. Soc. Am., 52(2):116–130, 1962.

[25] R. G. Kouyoumjian and P. H. Pathak. A uniform geometrical theory of diffrac-tion for an edge in a perfectly conducting surface. Proc. IEEE, 62:1448–1461,1974.

[26] S. Leung, J. Qian, and R. Burridge. Eulerian Gaussian beams for high-frequency wave propagation. Geophysics, 72:61–76, 2007.

Page 45: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

REFERENCES 33

[27] N. K. Madsen. Divergence preserving discrete surface integral methods forMaxwell’s curl equations using non-orthogonal unstructured grids. J. Comput.Phys., 119(1):34–45, 1995.

[28] R. Makinen, J. Juntunen, and M. Kivikoski. An improved thin-wire model forFDTD. IEEE Trans. Microw. Theory., 50(5):1245–1255, 2002.

[29] J. G. Maloney and K. E. Cummings. Adaptation of FDTD techniques toacoustic modeling. In 11th Annual Review of Progress in Applied Computa-tional Electromagnetics, volume 2, pages 724–731, Monterey, CA, 1995.

[30] A. Monorchio and R. Mittra. A hybrid finite-element finite-difference time-domain (FE/FDTD) technique for solving complex electromagnetic problems.IEEE Microw. Guided. W., 8(2):93–95, 1998.

[31] C. S. Peskin. The immersed boundary method. Acta Numer., 11:479–517,2002.

[32] M. M. Popov. A new method of computation of wave fields using Gaussianbeams. Wave Motion, 4(1):85–97, 1982.

[33] C. Railton and I. Craddock. Stabilised CPFDTD algorithm for the analysisof arbitrary 3D PEC structures. IEE Proc. Microwaves Antennas Propag.,143(5):367–372, 1996.

[34] C. Railton and J. Schneider. An analytical and numerical analysis of severallocally conformal FDTD schemes. IEEE Trans. Microw. Theory., 47(1):56–66,1999.

[35] C. J. Randall. Absorbing boundary condition for the elastic wave equation:Velocity-stress formulation. Geophysics, 54(9):1141–1152, 1989.

[36] V. Rokhlin. Rapid solution of integral equations of classical potential theory.J. Comput. Phys., 60(2):187–207, 1985.

[37] O. Runborg and B. Engquist. Mathematical models and numerical methodsfor high frequency waves. Commun. Comput. Phys., 2:827–880, 2007.

[38] T. Rylander and A. Bondeson. Stable FEM-FDTD hybrid method forMaxwell’s equations. Comput. Phys. Commun., 125(1-3):75–82, 2000.

[39] J. A. Stratton. Electromagnetic Theory. McGraw-Hill Companies, 1941.

[40] A. Taflove and S. C. Hagness. Computational Electrodynamics: The Finite-Difference Time-Domain Method. Artech House Publishers, 3 edition, 2005.

[41] A. Taflove, K. Umashankar, B. Beker, F. Harfoush, and K. Yee. DetailedFD-TD analysis of electromagnetic fields penetrating narrow slots and lappedjoints in thick conducting screens. IEEE Trans. Antennas Propag., 36(2):247–257, 1988.

Page 46: Modified Stencils for Boundaries and Subgrid Scales in the ...kth.diva-portal.org/smash/get/diva2:528722/FULLTEXT01.pdfden 15 juni 2012 klockan 10.00 i F3, Lindstedtsv¨agen 26, Kungl

34 REFERENCES

[42] A.-K. Tornberg and B. Engquist. Regularization for accurate numerical wavepropagation in discontinuous media. Methods Appl. Anal., 13:247–274, 2006.

[43] A.-K. Tornberg and B. Engquist. Consistent boundary conditions for the Yeescheme. J. Comput. Phys., 227(14):6922–6943, 2008.

[44] A.-K. Tornberg, B. Engquist, B. Gustafsson, and P. Wahlund. A new type ofboundary treatment for wave propagation. BIT, 46:145–170, November 2006.

[45] K. Umashankar, A. Taflove, and B. Beker. Calculation and experimental val-idation of induced currents on coupled wires in an arbitrary shaped cavity.IEEE Trans. Antennas Propag., 35(11):1248–1257, 1987.

[46] J. Virieux. SH-wave propagation in heterogeneous media: Velocity-stress finite-difference method. Geophysics, 49(11):1933–1942, 1984.

[47] J. Virieux. P-SV wave propagation in heterogeneous media: Velocity-stressfinite-difference method. Geophysics, 51:889, 1986.

[48] R. K. Wangsness. Electromagnetic Fields. Wiley, 2 edition, 1986.

[49] R.-B. Wu and T. Itoh. Hybrid finite-difference time-domain modeling ofcurved surfaces using tetrahedral edge elements. IEEE Trans. Antenn. Propag.,45(8):1302–1309, 1997.

[50] K. S. Yee. Numerical solution of initial boundary value problems involvingMaxwell’s equations in isotropic media. IEEE Trans. Antenn. Propag., 14,1966.

[51] I. Zagorodnov, R. Schuhmann, and T. Weiland. Conformal FDTD-methodsto avoid time step reduction with and without cell enlargement. J. Comput.Phys., 225(2):1493–1507, 2007.