Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 --...

25
9/22/2016 1 Lecture 11 Slide 1 EE 5303 Electromagnetic Analysis Using Finite‐Difference Time‐Domain Lecture #11 Formulation of 2D‐FDTD Without a PML These notes may contain copyrighted material obtained under fair use rules. Distribution of these materials is strictly prohibited Lecture Outline Lecture 11 Slide 2 Code development sequence for 2D Maxwell’s equations Finite‐difference approximations Reduction to two dimensions Update equations Boundary Conditions Revised FDTD Algorithm for 2D Simulations

Transcript of Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 --...

Page 1: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

1

Lecture 11 Slide 1

EE 5303

Electromagnetic Analysis Using Finite‐Difference Time‐Domain

Lecture #11

Formulation of 2D‐FDTD Without a PML These notes may contain copyrighted material obtained under fair use rules.  Distribution of these materials is strictly prohibited  

Lecture Outline

Lecture 11 Slide 2

• Code development sequence for 2D

• Maxwell’s equations

• Finite‐difference approximations

• Reduction to two dimensions

• Update equations

• Boundary Conditions

• Revised FDTD Algorithm for 2D Simulations

Page 2: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

2

Lecture 11 Slide 3

Code Development Sequence

Lecture 11 Slide 4

Step 1 – Basic Update Equations

The basic update equations are implemented along with simple Dirichlet boundary conditions.

Dirichlet Boundary Condition

Dirichlet Boundary Condition

DirichletBoundary Condition D

irichlet

Boundary C

onditio

n

Page 3: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

3

Lecture 11 Slide 5

Step 2 – Incorporate Periodic Boundaries

Periodic boundary conditions are incorporated so that a wave leaving the grid reenters the grid at the other side.

Periodic Boundary Condition

Periodic Boundary Condition

Periodic Boundary Condition

Perio

dic B

oundary C

onditio

n

Lecture 11 Slide 6

Step 3 – Incorporate a PML

The perfectly matched layer (PML) absorbing boundary condition is incorporated to absorb outgoing waves.

y‐lo PML

y‐hi PML

x‐hi PMLx‐

lo PML

Page 4: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

4

Lecture 11 Slide 7

Step 4 – Total‐Field/Scattered‐Field

Most periodic electromagnetic devices are modeled by using periodic boundaries for the horizontal axis and a PML for the vertical axis.  We then implement TF/SF at the vertical center of the grid for testing.

Periodic Boundary Condition

Perio

dic B

oundary C

onditio

n

Lecture 11 Slide 8

Step 5 – Calculate TRN, REF, and CON

We move the TF/SF interface to a unit cell or two outside of the top PML.  We include code to calculate Fourier transforms and to calculate transmittance, reflectance, and conservation of power.

Page 5: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

5

Lecture 11 Slide 9

Step 6 – Model a Device to Benchmark

We build a device on the grid that has a known solution.  We run the simulation and duplicate the known results to benchmark our new code.

Lecture 11 Slide 10

Summary of Code Development Sequence

Step 1 – Basic Update + Dirichlet

Step 2 – Basic Update + Periodic BC

Step 3 – Add PML Step 4 – TF/SF

Step 5 – Calculate Response Step 6 – Add a Device and Benchmark

Page 6: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

6

Lecture 11 Slide 11

Maxwell’s Equations

Lecture 11 Slide 12

Maxwell’s Equations

We start with Maxwell’s equations in the following form:

0

v

DH

t

BE

t

B

D

0

0

r

r

D t E t

B t H t

Page 7: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

7

Lecture 11 Slide 13

Normalize the Electric Fields

We will now adopt the more conventional approach in FDTD and normalize the electric field according to:

0

0 0

1E E E

To be consistent, we also need to normalize other parameters related to the electric field.

0

0 0

1D D c D

0

0 0

0

0 0

1

1

P P c P

J J c J

We won’t be using J and P.

Lecture 11 Slide 14

Normalized Maxwell’s Equations

Using the normalized fields, Maxwell’s equations become

0

0

1

r

r

HE

c t

DH

c t

D E

These equations are independent of r.

We can derive update equations from these expressions without complicating them with what might need to be done to model r.

This is a very simple equation that makes it much easier to model more sophisticated dielectrics that may be anisotropic, nonlinear, dispersive, all of the above, or something else altogether.

Page 8: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

8

Lecture 11 Slide 15

HDE Algorithm

To make our code more modular, we will modify the FDTD algorithm to what is called the HDE algorithm.

Update H from E

0

r HE

c t

Update D from H

0

1 DH

c t

Update E from D

rD E

t

Lecture 11 Slide 16

Expand Maxwell’s Equations

0

r HE

c t

0

1 DH

c t

0

0

0

1

1

1

y xz

yx z

y x z

H DH

y z c t

DH H

z x c t

H H D

x y c t

0

0

0

1

1

1

y yxz zxx xy xz

yx xz zyx yy yz

y yx x zzx zy zz

E HHE H

y z c t t t

HE HE H

z x c t t t

E HE H H

x y c t t t

rD E

x xx x xy y xz z

y yx x yy y yz z

z zx x zy y zz z

D E E E

D E E E

D E E E

Page 9: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

9

Lecture 11 Slide 17

Assume Only Diagonal Tensors

0

r HE

c t

0

1 DH

c t

0

0

0

1

1

1

y xz

yx z

y x z

H DH

y z c t

DH H

z x c t

H H D

x y c t

0

1y yxzxx xy

E HHE

y z c t t

z

xz

H

t

0

1x xzyx

E HE

z x c t

y z

yy yz

H H

t t

0

1y x xzx

E E H

x y c t

y

zy

H

t

z

zz

H

t

rD E

x xx x xy yD E E xz zE

y yx xD E yy y yz zE E

z zx xD E zy yE

zz zE

Lecture 11 Slide 18

Governing Equations

These are the primary governing equations from which we will formulate the 2D and 3D FDTD method.

0

0

0

1

1

1

y xz

yx z

y x z

H DH

y z c t

DH H

z x c t

H H D

x y c t

0

0

0

y xx xz

yy yx z

y x zz z

E HE

y z c t

HE E

z x c t

E E H

x y c t

x xx x

y yy y

z zz z

D E

D E

D E

Page 10: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

10

Lecture 11 Slide 19

Final Analytical Equations

It will be beneficial in the formulation and implementation to calculate the curl terms separately.  We start by expressing Maxwell’s equations in the following form.

0

0

0

1

1

1

H xx

yHy

H zz

DC

c t

DC

c t

DC

c t

0

0

0

E xx xx

yy yEy

E zz zz

HC

c t

HC

c t

HC

c t

x xx x

y yy y

z zz z

D E

D E

D E

yE zx

E x zy

yE xz

EEC

y z

E EC

z x

E EC

x y

yH zx

H x zy

yH xz

HHC

y z

H HC

z xH H

Cx y

Lecture 11 Slide 20

Finite‐Difference Approximations

Page 11: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

11

Lecture 11 Slide 21

Finite‐Difference Equations for H

0

0

0

E xx xx

yy yEy

E zz zz

HC

c t

HC

c t

HC

c t

2 2

2 2

2 2

, , , ,, ,, ,

0

, , , ,, ,

, ,

0

, , , ,, ,, ,

0

t t

t t

t t

i j k i j ki j ki j k x xt txxE

x t

i j k i j ki j ky yi j k t tyyE

y t

i j k i j ki j ki j k z zt tzzE

z t

H HC

c t

H HC

c t

H HC

c t

, 1, , , , , 1 , ,

, ,

, , 1 , , 1, , , ,

, ,

1, , , , , 1, , ,

, ,

i j k i j k i j k i j k

i j k z z y yE t t t tx t

i j k i j k i j k i j k

i j k x x z zE t t t ty t

i j k i j k i j k i j k

i j k y y x xE t t t tz t

E E E EC

y z

E E E EC

z x

E E E EC

x y

yE zx

E x zy

yE xz

EEC

y z

E EC

z x

E EC

x y

Curl Terms

Maxwell’s Equations

Lecture 11 Slide 22

Finite‐Difference Equations for D

0

0

0

1

1

1

H xx

yHy

H zz

DC

c t

DC

c t

DC

c t

2

2

2

, , , ,

, ,

0

, , , ,

, ,

0

, , , ,

, ,

0

1

1

1

t

t

t

i j k i j k

i j k x xH t t tx t

i j k i j k

i j k y yH t t ty t

i j k i j k

i j k z zH t t tz t

D DC

c t

D DC

c t

D DC

c t

2 2 2 2

2

2 2 2 2

2

2 2 2

2

, , , , 1, , , 1,

, ,

, , , , 1 , , 1, ,

, ,

, , 1, , ,

, ,

t t t t

t

t t t t

t

t t t

t

i j k i j ki j k i j ky yi j k z zt t t tH

x t

i j k i j k i j k i j k

i j k x x z zt t t tHy t

i j k i j k i jy yi j k xt t tH

z t

H HH HC

y z

H H H HC

z x

H H HC

x

2

, , 1,t

k i j k

x tH

y

yH zx

H x zy

yH xz

HHC

y z

H HC

z xH H

Cx y

Curl Terms

Maxwell’s Equations

Page 12: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

12

Lecture 11 Slide 23

Finite‐Difference Equations for E

x xx x

y yy y

z zz z

D E

D E

D E

, , , ,, ,

, , , ,, ,

, , , ,, ,

i j k i j ki j k

x xx xt t

i j k i j ki j k

y yy yt t

i j k i j ki j k

z zz zt t

D E

D E

D E

Lecture 11 Slide 24

Reduction to Two Dimensions

Page 13: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

13

Lecture 11 Slide 25

Real Electromagnetic Devices

All physical devices are three‐dimensional.

Lecture 11 Slide 26

3D  2D (Exact)

Sometimes it is possible to describe a physical device using just two dimensions.  Doing so dramatically reduces the numerical complexity of the problem and is ALWAYS GOOD PRACTICE.

periodic BC

perio

dic B

C

absorbing BC

absorbing BC

z

x

y

Page 14: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

14

Lecture 11 Slide 27

3D  2D (Approximate)Many times it is possible to approximate a 3D device in two dimensions.  It is very good practice to at least perform the initial simulations in 2D and only moving to 3D to verify the final design.

1,effn

2,effn

Effective indices are best computed by modeling the vertical cross section as a slab waveguide.

A simple average index can also produce good results. 

1,effn

2,effn

absorbing BC

absorbing BC

absorbing B

C

absorbing BC

Lecture 11 Slide 28

2D Grids are Infinite in the 3rd Dimension

periodic BC

perio

dic B

C

absorbing BC

absorbing BC

Anything represented on a 2D grid, is actually a device that is of infinite extent along the 3rd dimension.

0z

Assuming the z direction is uniform and of infinite extent, then the field is also uniform and of infinite extent in the z direction. 

x

y

Page 15: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

15

Lecture 11 Slide 29

Assume Uniform in z Direction

For 2D devices,/z=0 and Maxwell’s equations reduce to

x xx x

y yy y

z zz z

D E

D E

D E

, , , ,, ,

, , , ,, ,

, , , ,, ,

i j k i j ki j k

x xx xt t

i j k i j ki j k

y yy yt t

i j k i j ki j k

z zz zt t

D E

D E

D E

yH zx

HHC

y z

H xy

HC

z

z

yH xz

H

x

H HC

x y

yE zx

EEC

y z

E xy

EC

z

z

yE xz

E

x

E EC

x y

0

0

0

E xx xx

yy yEy

E zz zz

HC

c t

HC

c t

HC

c t

0

0

0

1

1

1

H xx

yHy

H zz

DC

c t

DC

c t

DC

c t

, 1, , , , , 1 , ,

, ,

i j k i j k i j k i j k

i j k z z y yE t t t tx t

E E E EC

y z

, , 1 , ,

, ,

i j k i j k

i j k x xE t ty t

E EC

z

1, , , ,

1, , , , , 1, , ,

, ,

i j k i j k

z zt t

i j k i j k i j k i j k

i j k y y x xE t t t tz t

E E

x

E E E EC

x y

2 2

2 2

2 2

, , , ,, ,, ,

0

, , , ,, ,

, ,

0

, , , ,, ,, ,

0

t t

t t

t t

i j k i j ki j ki j k x xt txxE

x t

i j k i j ki j ky yi j k t tyyE

y t

i j k i j ki j ki j k z zt tzzE

z t

H HC

c t

H HC

c t

H HC

c t

2 2 2 2

2

, , , , 1, , , 1,

, , t t t t

t

i j k i j ki j k i j ky yi j k z zt t t tH

x t

H HH HC

y z

2 2

2

, , , , 1

, , t t

t

i j k i j k

i j k x xt tHy t

H HC

z

2 2

2 2 2 2

2

, , 1, ,

, , 1, , , , , 1,

, ,

t t

t t t t

t

i j k i j k

z zt t

i j k i j k i j k i j ky yi j k x xt t t tH

z t

H H

x

H H H HC

x y

2

2

2

, , , ,

, ,

0

, , , ,

, ,

0

, , , ,

, ,

0

1

1

1

t

t

t

i j k i j k

i j k x xH t t tx t

i j k i j k

i j k y yH t t ty t

i j k i j k

i j k z zH t t tz t

D DC

c t

D DC

c t

D DC

c t

Lecture 11 Slide 30

2D Finite‐Difference Equations

We eliminate the z‐derivative terms.

x xx x

y yy y

z zz z

D E

D E

D E

, , , ,, ,

, , , ,, ,

, , , ,, ,

i j k i j ki j k

x xx xt t

i j k i j ki j k

y yy yt t

i j k i j ki j k

z zz zt t

D E

D E

D E

H zx

H zy

yH xz

HC

y

HC

xH H

Cx y

E zx

E zy

yE xz

EC

y

EC

x

E EC

x y

0

0

0

E xx xx

yy yEy

E zz zz

HC

c t

HC

c t

HC

c t

0

0

0

1

1

1

H xx

yHy

H zz

DC

c t

DC

c t

DC

c t

, 1, , ,

, ,

1, , , ,

, ,

1, , , , , 1, , ,

, ,

i j k i j k

i j k z zE t tx t

i j k i j k

i j k z zE t ty t

i j k i j k i j k i j k

i j k y y x xE t t t tz t

E EC

y

E EC

x

E E E EC

x y

2 2

2 2

2 2

, , , ,, ,, ,

0

, , , ,, ,

, ,

0

, , , ,, ,, ,

0

t t

t t

t t

i j k i j ki j ki j k x xt txxE

x t

i j k i j ki j ky yi j k t tyyE

y t

i j k i j ki j ki j k z zt tzzE

z t

H HC

c t

H HC

c t

H HC

c t

2 2

2

2 2

2

2 2 2 2

2

, , , 1,

, ,

, , 1, ,

, ,

, , 1, , , , , 1,

, ,

t t

t

t t

t

t t t t

t

i j k i j k

i j k z zt tHx t

i j k i j k

i j k z zt tHy t

i j k i j k i j k i j ky yi j k x xt t t tH

z t

H HC

y

H HC

x

H H H HC

x y

2

2

2

, , , ,

, ,

0

, , , ,

, ,

0

, , , ,

, ,

0

1

1

1

t

t

t

i j k i j k

i j k x xH t t tx t

i j k i j k

i j k y yH t t ty t

i j k i j k

i j k z zH t t tz t

D DC

c t

D DC

c t

D DC

c t

Page 16: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

16

Lecture 11 Slide 31

We No Longer Need Grid Index k

For 2D devices, we only retain grid indices i and j.

x xx x

y yy y

z zz z

D E

D E

D E

, ,,

, ,,

, ,,

i j i ji j

x xx xt t

i j i ji j

y yy yt t

i j i ji j

z zz zt t

D E

D E

D E

H zx

H zy

yH xz

HC

y

HC

xH H

Cx y

E zx

E zy

yE xz

EC

y

EC

x

E EC

x y

0

0

0

E xx xx

yy yEy

E zz zz

HC

c t

HC

c t

HC

c t

0

0

0

1

1

1

H xx

yHy

H zz

DC

c t

DC

c t

DC

c t

, 1 ,

,

1, ,

,

1, , , 1 ,

,

i j i j

i j z zE t tx t

i j i j

i j z zE t ty t

i j i j i j i j

i j y y x xE t t t tz t

E EC

y

E EC

x

E E E EC

x y

2 2

2 2

2 2

, ,,,

0

, ,,

,

0

, ,,,

0

t t

t t

t t

i j i ji ji j x xt txxE

x t

i j i ji jy yi j t tyyE

y t

i j i ji ji j z zt tzzE

z t

H HC

c t

H HC

c t

H HC

c t

2 2

2

2 2

2

2 2 2 2

2

, , 1

,

, 1,

,

, 1, , , 1

,

t t

t

t t

t

t t t t

t

i j i j

i j z zt tHx t

i j i j

i j z zt tHy t

i j i j i j i jy yi j x xt t t tH

z t

H HC

y

H HC

x

H H H HC

x y

2

2

2

, ,

,

0

, ,

,

0

, ,

,

0

1

1

1

t

t

t

i j i j

i j x xH t t tx t

i j i j

i j y yH t t ty t

i j i j

i j z zH t t tz t

D DC

c t

D DC

c t

D DC

c t

Lecture 11 Slide 32

Two Distinct Modes: Ez and HzMaxwell’s equations have decoupled into two distinct sets of equations.

x xx x

y y

z zz z

y y

D E

D E

D E

, ,,

,

, ,

,,

,

i j i ji j

x xx xt t

i j i ji j

y yy

i j i ji j

z zz zt t

yt t

D E

D E

D E

H z

yH xz

x

H zy

H HC

x

HC

y

HC

x

y

E zx

E

y

zy

E xz

E

EC

y

E

y

EC

Cx

x

0

0

0

E xx xx

yy yE

E zz z

y

z

HC

c t

HC

c

HC

c t

t

0

0

0

1

1

1

H z

xx

H

z

H

yy

DC

c t

DC

c

D

c t

t

C

, 1 ,

,

1, ,

,

1, , , 1 ,

,

i j i j

i j z zE t tx t

i j i j

i j z

i j i j i j i j

i j y y x xE t t t t

E

t

z

t

t

zty

E EC

y

E EC

x

E E E EC

x y

2

2 2

2 2

2

, ,,,

,

0

,,

,

0

, ,

,

0

,

t t

t t

t t

i j i ji ji j x xt txxE

x t

i j i ji jy yi j t tyyE

y

i j i ji ji j z zt t

t

zzEz t

H HC

c t

H HC

H HC

c

t

t

c

2 2 2 2

2

2 2

2

2 2

2

,

, , 1

,

,

1, , , 1

1

,

,

,

t t

t

t t t t

t

t t

t

i j i j

i j z zt tHx t

i j i

i j i j i j i jy

j

i j z zt

yi j x xt t t tH

t

tH

z

y t

H HC

y

H H H HC

x y

H HC

x

2

2

2

, ,

,

0

, ,

,

,

,

0

0

,

1

1

1

t

t

t

i j i j

i j x xH t t tx t

i j i j

i j y

i j i j

i j z zH t t tz t

yH t t ty t

D DC

c

D DC

c

t

D DC

c t

t

Page 17: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

17

Lecture 11 Slide 33

EzMode

z zz zD E , ,,i j i ji j

z zz zt tD E

yH xz

H HC

x y

E zx

E zy

EC

y

EC

x

0

0

E xx xx

yy yEy

HC

c t

HC

c t

0

1H zz

DC

c t

, 1 ,

,

1, ,

,

i j i j

i j z zE t tx t

i j i j

i j z zE t ty t

E EC

y

E EC

x

2 2

2 2

, ,,,

0

, ,,

,

0

t t

t t

i j i ji ji j x xt txxE

x t

i j i ji jy yi j t tyyE

y t

H HC

c t

H HC

c t

2 2 2 2

2

, 1, , , 1

, t t t t

t

i j i j i j i jy yi j x xt t t tH

z t

H H H HC

x y

2

, ,

,

0

1t

i j i j

i j z zH t t tz t

D DC

c t

Lecture 11 Slide 34

HzMode

x xx x

y yy y

D E

D E

, ,,

, ,,

i j i ji j

x xx xt t

i j i ji j

y yy yt t

D E

D E

H zx

H zy

HC

y

HC

x

yE xz

E EC

x y

0

E zz zz

HC

c t

0

0

1

1

H xx

yHy

DC

c t

DC

c t

1, , , 1 ,

,

i j i j i j i j

i j y y x xE t t t tz t

E E E EC

x y

2 2

, ,,,

0

t t

i j i ji ji j z zt tzzE

z t

H HC

c t

2 2

2

2 2

2

, , 1

,

, 1,

,

t t

t

t t

t

i j i j

i j z zt tHx t

i j i j

i j z zt tHy t

H HC

y

H HC

x

2

2

, ,

,

0

, ,

,

0

1

1

t

t

i j i j

i j x xH t t tx t

i j i j

i j y yH t t ty t

D DC

c t

D DC

c t

Page 18: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

18

Lecture 11 Slide 35

Update Equations

Lecture 11 Slide 36

Update Equations for EzMode

2 2

2 2

2

,, , 0,

,, ,0

,

, , ,

0

, ,

,

1

t t

t t

t

i ji j i j Ex x xi jt t t

xx

i ji j i j Ey y yi jt t t

yy

i j i j i jHz z z tt t t

i j i j

z zi jt t t tzz

c tH H C

c tH H C

D D c t C

E D

Solving the finite‐difference equations for the future time values of the fields associated with the Ezmode leads to:

2 2

2 2

2

, ,,,

0

, ,,

,

0

, ,

,

0

, ,,

1

t t

t t

t

i j i ji ji j x xt txxE

x t

i j i ji jy yi j t tyyE

y t

i j i j

i j z zH t t tz t

i j i ji j

z zz zt t

H HC

c t

H HC

c t

D DC

c t

D E

Page 19: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

19

Lecture 11 Slide 37

Update Equations for HzMode

2 2

2

2

,, , 0,

, , ,

0

, , ,

0

, ,

,

, ,

,

1

1

t t

t

t

i ji j i j Ez z zi jt t t

zz

i j i j i jHx x x tt t t

i j i j i jHy y y tt t t

i j i j

x xi jt t t txx

i j i j

y yi jt t t tyy

c tH H C

D D c t C

D D c t C

E D

E D

Solving the finite‐difference equations for the future time values of the fields associated with the Hzmode leads to:

2 2

2

2

, ,,,

0

, ,

,

0

, ,

,

0

, ,,

, ,,

1

1

t t

t

t

i j i ji ji j z zt tzzE

z t

i j i j

i j x xH t t tx t

i j i j

i j y yH t t ty t

i j i ji j

x xx xt t

i j i ji j

y yy yt t

H HC

c t

D DC

c t

D DC

c t

D E

D E

Lecture 11 Slide 38

Boundary Conditions

Page 20: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

20

Lecture 11 Slide 39

Where Are the Boundary Conditions?

All of the spatial derivatives appear only the curl calculations.

, 1 ,

,

1, ,

,

1, , , 1 ,

,

i j i j

i j z zE t tx t

i j i j

i j z

i j i j i j i j

i j y y x xE t t t t

E

t

z

t

t

zty

E EC

y

E EC

x

E E E EC

x y

2 2 2 2

2

2 2

2

2 2

2

,

, , 1

,

,

1, , , 1

1

,

,

,

t t

t

t t t t

t

t t

t

i j i j

i j z zt tHx t

i j i

i j i j i j i jy

j

i j z zt

yi j x xt t t tH

t

tH

z

y t

H HC

y

H H H HC

x y

H HC

x

Boundary conditions are handled in the curl computations.

We have “modularized” the boundary conditions by isolating the curl calculations.

(y‐hi)

(x‐hi)

(x‐hi and y‐hi)

(y‐lo)

(x‐lo)

(x‐lo and y‐lo)

Lecture 11 Slide 40

Hint About Implementing Boundary Conditions

DO NOT USEIF STATEMENTS!!!Your code will not be much shorter and it will run slower if you use if statements. 

Page 21: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

21

Lecture 11 Slide 41

Dirichlet Boundary Conditions for CEx

, 1 ,

,

,

1.

0 2.

y

i j i j

z zt ty

i jEx i Nt

z ty

E Ej N

yC

Ej N

y

For CEx, the problem occurs at the y‐hi side of the grid.

We fix it explicitly.

% Compute CExfor nx = 1 : Nx

for ny = 1 : Ny-1CEx(nx,ny) = (Ez(nx,ny+1) - Ez(nx,ny))/dy;

endCEx(nx,Ny) = (0 - Ez(nx, Ny))/dy;

end

1

2 y‐hi

Lecture 11 Slide 42

Dirichlet Boundary Conditions for CEy

1, ,

,

,

1.

0 2.

i j i j

z zt txi jE

y i jt

z tx

E Ei N

xCE

i Nx

For CEy, the problem occurs at the x‐hi side of the grid.

We fix it explicitly.

% Compute CEyfor ny = 1 : Ny

for nx = 1 : Nx-1CEy(nx,ny) = - (Ez(nx+1,ny) - Ez(nx,ny))/dx;

endCEy(Nx,ny) = - (0 - Ez(Nx,ny))/dx;

end

1 2

x‐hi

Page 22: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

22

Lecture 11 Slide 43

Dirichlet Boundary Conditions for CHz

2 2 2 2

2 2 2

2 2 2

, 1, , , 1

1, 1, 1, 1

,

,1 1,12

1. for 1 and 1

0 2. for 1 and 1

t t t t

t t t

t t t

i j i j i j i jy y x xt t t t

j j jy x xt t t

i jHz i it t

y y xt t t

H H H Hi j

x y

H H Hi j

x yC

H H H

x

2 2

,1

1,1 1,1

0 3. for 1 and 1

0 0 4. for 1 and 1

t t

i

y xt t

i jy

H Hi j

x y

For CHz, the problem occurs at both the x‐lo side of the grid and y‐lo.

We fix both of these explicitly.

12

34 y‐lo

x‐lo

Lecture 11 Slide 44

MATLAB Code for CHz (1 of 3)

First, we just blindly implement the curl calculation…

% Compute CHzfor ny = 1 : Ny

for nx = 1 : NxCHz(nx,ny) = (Hy(nx,ny) - Hy(nx-1,ny))/dx ...

- (Hx(nx,ny) - Hx(nx,ny-1))/dy;end

end

As expected, this will produce an error when trying to access Hy(0,ny)or Hx(nx,0)

Page 23: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

23

Lecture 11 Slide 45

MATLAB Code for CHz (2 of 3)

Second, we handle the problem at nx = 1 explicitly by copying the code inside the nx loop, pasting it above, and handling the problem.

% Compute CHzfor ny = 1 : Ny

CHz(1,ny) = (Hy(1,ny) - 0)/dx ...- (Hx(1,ny) - Hx(1,ny-1))/dy;

for nx = 2 : NxCHz(nx,ny) = (Hy(nx,ny) - Hy(nx-1,ny))/dx ...

- (Hx(nx,ny) - Hx(nx,ny-1))/dy;end

end

We still will have an error at Hx(1,0) and Hx(nx,0)

Lecture 11 Slide 46

MATLAB Code for CHz (3 of 3)

Third, we handle the problem at ny = 1 explicitly by copying the code inside the ny loop, pasting it above, and handling the problem.

% Compute CHzCHz(1,1) = (Hy(1,1) - 0)/dx ...

- (Hx(1,1) - 0)/dy;for nx = 2 : Nx

CHz(nx,1) = (Hy(nx,1) - Hy(nx-1,1))/dx ...- (Hx(nx,1) - 0)/dy;

endfor ny = 2 : Ny

CHz(1,ny) = (Hy(1,ny) - 0)/dx ...- (Hx(1,ny) - Hx(1,ny-1))/dy;

for nx = 2 : NxCHz(nx,ny) = (Hy(nx,ny) - Hy(nx-1,ny))/dx ...

- (Hx(nx,ny) - Hx(nx,ny-1))/dy;end

end

Page 24: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

24

Lecture 11 Slide 47

Revised FDTD Algorithm 

for 2D Simulations

Lecture 11 Slide 48

FDTD Algorithm for EzMode

, 1 , 1, ,

, ,

, ,

0 0

y

i j i j i j i jz z z zt t t t

y xi j i jE Ex yi N i jt t

z zt ty x

E E E Ej N i N

y xC CE E

j N i Ny x

2 2 2 2 2

, ,, ,, , 0 0, , t t t t t

i j i ji j i ji j i j E Ex x x y y yi j i jt t t tt t

xx yy

c t c tH H C H H C

2 2 2 2

2 2 2

2 2 2

, 1, , , 1

1, 1, 1, 1

,

,1 1,12 ,1

for 1 and 1

0 for 1 and 1

t t t t

t t t

t t t

i j i j i j i jy y x xt t t t

j j jy x xt t t

i jHz i it t i

y y xt t t

H H H Hi j

x y

H H Hi j

x yC

H H H

x

2 2

1,1 1,1

0 for 1 and 1

0 0 for 1 and 1

t ty xt t

i jy

H Hi j

x y

, , ,

0 2

i j i j i jHz z z t tt t tD D c t C

, ,

,

1i j i j

z zi jt t t tzz

E D

time

src src src src, ,i j i j

z zt t t tD D g T

x & y

x & y

x & y

x & y

x & y

Simple soft source

Page 25: Lecture #11 Formulation of 2D‐FDTD Without a PMLemlab.utep.edu/ee5390fdtd/Lecture 11 -- Formulation of 2D FDTD.pdf · PPcP JJcJ We won’t be using J and P. Lecture 11 Slide 14

9/22/2016

25

Lecture 11 Slide 49

Animation of Basic 2D FDTD Algorithm

Dirichlet Boundary Condition

Dirichlet Boundary Condition

DirichletBoundary Condition D

irichlet

Boundary C

onditio

n