34
This work was performed under the auspices of the U.S. Department of Energy by the University of California, Lawrence Livermore National Laboratory under Contract No. W-7405-ENG-48. Development and Application of Compatible Discretizations of Maxwell’s Equations Past, Present, and Future Research at LLNL Daniel White, Joe Koning, Rob Rieben Lawrence Livermore National Laboratory IMA workshop on Compatible Spatial Discretizations for Partial Differential Equations May 11-15, 2004 UCRL-PRES-203950

Development and Application of Compatible Discretizations

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Development and Application of Compatible Discretizations

This work was performed under the auspices of the U.S. Department of Energy by the University of California, Lawrence Livermore National Laboratory under Contract No. W-7405-ENG-48.

Development and Application of Compatible Discretizations of Maxwell’s Equations

Past, Present, and Future Research at LLNL

Daniel White, Joe Koning, Rob RiebenLawrence Livermore National Laboratory

IMA workshop onCompatible Spatial Discretizations for Partial

Differential EquationsMay 11-15, 2004

UCRL-PRES-203950

Page 2: Development and Application of Compatible Discretizations

D. White 5/17/2004- 2

Agenda• Review of Maxwell’s Equations• Review of previous methods

— FDTD— Mixed Finite Element— Modified Finite Volume, Discrete Surface Integral

• Review of EMSolve— Higher order H(curl) & H(div) basis functions— Symplectic time integration

• Applications— Photonics— Accelerators— Magnetohydrodynamics

Page 3: Development and Application of Compatible Discretizations

D. White 5/17/2004- 3

Maxwell’s Equations

E H Jtε ∂ =∇× −∂

H Etµ ∂ =−∇×∂

Eε ρ∇• =

0Hµ∇• =E electric field, D electric flux density, H magnetic field, B magnetic flux densityJ current density, ρ charge density

( )n E f n E g n E E qα β× = ×∇× = × + ∇× =

• Electromagnetic waves (similar equation for H)

• Divergence constraints can be considered initial conditions• Important boundary conditions

2 12E JE tt

ε µ−∂ ∂=−∇× ∇× −∂∂

D Eε=

B Hµ=

Page 4: Development and Application of Compatible Discretizations

D. White 5/17/2004- 4

• Boundary conditions across material interfaces

• Conservation of energy

Maxwell’s Equations: Considerations

σ1 σ2

normal continuity

Electric Current

ε1 ε2

Electric Field

tangential continuity

E Eε•H Hµ•

J E•

P E H= ×

stored energy

energy gain (or loss)

power entering (or exiting) throughsurface

Page 5: Development and Application of Compatible Discretizations

D. White 5/17/2004- 5

Finite Difference Time Domain

• Dual Cartesian mesh with edge-based variables (Yee, 66)— Electric field is constant on primary mesh edges— Magnetic field is constant on dual mesh edges

• Leapfrog in time— Given E field, update H field— Given H field, update E field

( ) ( )( ) ( )

1 ( 1)

( 1)

z z

x

y

x

y

n nn n ijk i jk

n nijk ijkijk ij k

e e

e ethh h µ

⎡ ⎤⎢ ⎥⎢ ⎥⎛ ⎞ ⎛ ⎞⎢ ⎥⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟ ⎢ ⎥⎝ ⎠ ⎝ ⎠⎢ ⎥⎢ ⎥⎣ ⎦

+ +

+

− +∆= −∆ −

And similar equations forother field components

1H Et µ∂ = ∇×∂

xy

z

Page 6: Development and Application of Compatible Discretizations

D. White 5/17/2004- 6

FDTD : Dispersion Analysis

• The method is 2nd order accurate— Plane waves of the form are solutions of free-space Maxwell’s

equations, with — The solution to the discrete equations satisfies

exp( )i k xω− •2 2 2/k cω=

2 2 2 22 2 2 2 21 1 1 1sin ( ) sin ( ) sin ( ) sin ( )2 zx y

t k x k y k zc t x y z

ω∆ = ∆ + ∆ + ∆∆ ∆ ∆ ∆

0, 0, 0, 0t x y z∆ = ∆ = ∆ = ∆ =

2 22 22 22 2 2 22 1 ... 1 ...12 12 12 12

yx zk yk x k zt kcω ω

⎛ ⎞⎛ ⎞ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟ ⎜ ⎟⎜ ⎟⎝ ⎠ ⎝ ⎠

∆∆ ∆∆− + = − − − +

— Taylor expansion about yields

Page 7: Development and Application of Compatible Discretizations

D. White 5/17/2004- 7

FDTD: Stability Analysis

• The method is conditionally stable— Assume ∆x=∆y=∆z. The dispersion relation can be expressed as

— We require that ω be real, otherwise we will have exponential growth of the numerical solution. This yields

• It can be shown that with a stable ∆t the method conserves energy— Eigenvalues of amplification matrix lie on unit circle— Eigenvectors of amplification matrix are independent

3xt

c∆∆ <

1 sin( )2 sin3k xc t

t xω⎛ ⎞⎜ ⎟⎜ ⎟⎜ ⎟⎝ ⎠

− ∆∆=∆ ∆

Page 8: Development and Application of Compatible Discretizations

D. White 5/17/2004- 8

What about divergence constraints?• It looks like they are ignored…• But in fact they are satisfied exactly in a discrete sense• The original compatible discretization of Maxwell’s equations!

Sum of electric fields at node = 0

Sum of magnetic fluxes on cell = 0E

B

Page 9: Development and Application of Compatible Discretizations

D. White 5/17/2004- 9

FDTD: Stair-casing errors

REMCOM

• For some problems, approximating a curved surface by stair-casing is acceptable

• For other problems an alternative to FDTD is required

Page 10: Development and Application of Compatible Discretizations

D. White 5/17/2004- 10

Alternatives to FDTD• Mixed Finite Element (Madsen & Ziolkowski 1988)

— Galerkin procedure applied to coupled 1st order systems— In 2D,one field is a vector while the other is a scalar— Several formulations: Q1-P1, Q1-P0— Had “odd-even” spurious solutions. Similar to early finite element

solutions of Stokes problem

• Modified Finite Volume (Madsen & Ziolkowski 1990) and Discrete Surface Integral (Madsen 1992)

— Based on discretizing line and surface integrals— Reduce to FDTD for Cartesian grids— Satisfied divergence conditions exactly, just like FDTD— But were (weakly) unconditionally unstable

Page 11: Development and Application of Compatible Discretizations

D. White 5/17/2004- 11

DSI instability for Chevron mesh

• RHS can be negative, complex frequency• Taylor series expansion about ∆t=0 yields

— Exponential growth of solution

2D periodic Chevron Mesh Numerical Dispersion Relation

r iω ω γ= +

Page 12: Development and Application of Compatible Discretizations

D. White 5/17/2004- 12

Matrix Stability Analysis

• Consider semi-discrete equations

• Combine to form 2nd-order equation

— If has complex eigenvalues, they will occur in conjugate-pairs, and the exact solution will grow exponentially

— It can be shown that for the Chevron mesh DSI has complex eigenvalues— Cause of instability is spatial discretization, not temporal discretization

• Note that if is symmetric, all eigenvalues are real, and exact solution is oscillatory

— Now we can construct a numerical time integration procedure that will be stable

' , 'e Kh h Ke= =−

''e KKe=−KK

KK

Page 13: Development and Application of Compatible Discretizations

D. White 5/17/2004- 13

Present-Day: The EMSolve code• EMSolve is a parallel, 3D unstructured mesh finite element code

— Hexahedrons, tetrahedrons, prisms

• Based on ideas and notation of differential forms— Boffi, Bossavit, Demkowicz, Deschamps, Hirani, Hiptmair, Kotuiga,

Madsen, Marsden, Monk, Nedelec, Teixiera, Tonti, Warnick, Ziolkowksi, and others

• Uses arbitrary-order H(curl)-conforming and H(div)-conforming basis functions for fields and fluxes, respectively

— Same polynomial space as Nedelec 86— We our use own degrees-of-freedom

• Time integration— Implicit Newmark-beta for wave equations— Higher-order symplectic for coupled 1st order equations

Page 14: Development and Application of Compatible Discretizations

D. White 5/17/2004- 14

Higher-Order Basis Functions

• SL: uniformly spaced Silvester-Lagrange interpolatory d.o.f.• Spectral: non-uniform interpolatory d.o.f.

— Improved conditioning of linear systems as p increases• Hierarchical: allows for easier implementation of p-adaptivity• Sparse: a custom basis-quadrature pair that results in increased sparsity

• Available at www.llnl.gov/casc/femster

p-form0-form 1-form 2-form 3-form

Tet PrismHex

Spectral HierarchicalSL

*** ******Sparse

Page 15: Development and Application of Compatible Discretizations

D. White 5/17/2004- 15

Conditioning of Higher-Order Matrices

• Our finite element approach requires that we solve a large sparse linear system at every time step

• When using an iterative solver, the conditioning of this system is important

• We developed novel basis functions that result in a well-conditioned linear system at no additional cost

pe∝

log( )p∝

105

Page 16: Development and Application of Compatible Discretizations

D. White 5/17/2004- 16

Reduced Integration Basis Functions

G: Gauss-Legendre points on [0, 1]L: Gauss-Lobatto points on [0, 1]

Four categories of mass integrals involving:2 xx basis functions: G x L x LG x L x L2 yy basis functions: L x G x LL x G x L2 zz basis functions: L x L x GL x L x Gdifferent directions: L x L x LL x L x L

Idea: Maximize sparsity by using using inexact integration, with different order in different directions

,...,p,; j,k,...,p-,iGzLLyLLxLzyxw

LzLGyLLxLzyxw

LzLLyLGxLzyxw

pi

pk

pj

pk

pi

pj

pk

pj

pi

10110 of nscombinatio allFor ˆ),(),(),(),,(ˆ),(),(),(),,(ˆ),(),(),(),,(

13

12

11

==

=

=

=

z

y

x

Page 17: Development and Application of Compatible Discretizations

D. White 5/17/2004- 17

Reduced Integration is Effective

10x Reduction in non10x Reduction in non--zeroszeros

Standard mass matrixnnz =132128132128

Lumped mass matrixnnz=1180411804

Negligible effect on errorNegligible effect on error

Page 18: Development and Application of Compatible Discretizations

D. White 5/17/2004- 18

Discrete Differential Operators are just Matrices

L2H(div)H(curl)H(grad)

H(grad)

H(curl)

H(div)

L2 ∇•

∇×

∇•

∇×

domain

rang

e

rang

e

3-form2-form1-form0-form

0-form

1-form

2-form

3-form

G

domain

C

D

C

Adjoint Operators1 T−=D N G W 1 T−=C W C F 1 T−=G F D M

D

G

“mass matrices”

Page 19: Development and Application of Compatible Discretizations

D. White 5/17/2004- 19

Discrete Vector Calculus• Curl of gradient is zero

• Divergence of curl is zero—

• Curl-Curl operator

— Real eigenvalues…no late-time instabilities— Correct null space because of— Correct range because of

0 30 : f fφ∇×∇ = = =CG 0 CG 0

1 20 : G g g∇•∇× = = =DC 0 DC 0

: v v vα∇× ∇× = -1 TCC W C FC

0f =CG 02g =DC 0

Page 20: Development and Application of Compatible Discretizations

D. White 5/17/2004- 20

Time Integration of Discrete Maxwell’s Equations

constant

=T T

e'=Cbb'= Ce

e We+b Fb

Semi-Discrete Maxwell

2 2 1

''

p qq p

p q+ =

==−

Harmonic Oscillator

symplectic non-symplectic

Page 21: Development and Application of Compatible Discretizations

D. White 5/17/2004- 21

Stability of Symplectic IntegrationThe generalized kth order Symplectic update method applied to the discrete Maxwell’s equations can be written as a product of amplification matrices:

2i

ii i i

I tCQ

tC I t CCβ

α α β∆⎡ ⎤

= ⎢ ⎥− ∆ − ∆⎣ ⎦

1

11

kn n

iin n

e eQ

b b+

=+

⎡ ⎤ ⎡ ⎤⎛ ⎞= ⎜ ⎟⎢ ⎥ ⎢ ⎥⎝ ⎠⎣ ⎦ ⎣ ⎦∏

( ) 1iQρ ≤2

( )i i

tCCρ α β

∆ ≤

The Necessary Stability Condition is then:

Page 22: Development and Application of Compatible Discretizations

D. White 5/17/2004- 22

Performance of 3rd order symplectic method• 1st Order Method:• Time Step = 0.005 sec• # Steps = 60,000• CPU time / step = 0.0941 sec• Total Run Time = 94.1min

20x More 20x More Effective!Effective!

.015 .00075

1.01 1.0001

• 3rd Order Method:• Time Step = 0.015 sec• # Steps = 20,000• CPU time / step = 0.2976 sec• Total Run Time = 99.2 min

Page 23: Development and Application of Compatible Discretizations

D. White 5/17/2004- 23

Validation Example: Coaxial Waveguide

TEM wave in a coaxial waveguide

Computed solution compared to exact solution for various discretizations

Higher-order is a clear winner

Page 24: Development and Application of Compatible Discretizations

D. White 5/17/2004- 24

Application: Photonic Band Gap Structures

3D Photonic Crystal Structures3D Photonic Crystal Structures“For most λ, beam propagatesthrough crystal without scattering(scattering cancels coherently)

...but for some λ (~ 2a), no light can propagate: a photonic band gap”

-Stephen G. Johnson, MIT

λ

• • •

• • •

• • •

• • •

• • •

• • •

• • •

• • •

• • •

• • •

•••

• ••

•••

• ••

• ••

•••

• ••

• ••

• ••

• ••

• ••

• ••

• ••

• ••

a

Page 25: Development and Application of Compatible Discretizations

D. White 5/17/2004- 25

Application: A 3D PBG “woodpile”

Lattice Constant*:Lattice Constant*:

1.123 cm1.123 cm

Unit Cell*:Unit Cell*:

1.123cm x 1.123cm x 1.272cm1.123cm x 1.123cm x 1.272cm

Wood Pile Crystal:Wood Pile Crystal:

9 x 13 x 7 layers9 x 13 x 7 layers

Introduce three separate defects in the crystal to create a “Multi-Bend” wave guide:

*Özbay et. al., Phys. Rev. B 50(3), pp 1945-1948,1994

Page 26: Development and Application of Compatible Discretizations

D. White 5/17/2004- 26

Application: Parallel Computing Solution of 3D PBG Multibend

Signal Freq:Signal Freq: 11 GHz11 GHz

Basis degree:Basis degree: p = 2p = 2

No. Elements:No. Elements: 419,328419,328

No. Unknowns:No. Unknowns: ~10.5 million~10.5 million

No. Time Steps: No. Time Steps: 65006500

No. MCR CPUs:No. MCR CPUs: 150150

Page 27: Development and Application of Compatible Discretizations

D. White 5/17/2004- 27

Application: Linear Accelerators, e.g. the NLC

~4 km ~30 km~0.5m

Page 28: Development and Application of Compatible Discretizations

D. White 5/17/2004- 28

Application: Accelerator “Pillbox” Problem

• Transient simulation of a relativistic Gaussian electron bunch

• Note how the pillbox “rings” long after the bunch has exited

• Existing codes have difficulties with this type of simulation

Page 29: Development and Application of Compatible Discretizations

D. White 5/17/2004- 29

Snapshot of Accelerator WakefieldsThis is a snapshot of a time-dependent simulationof an generic accelerator wakefield. The Gaussianelectron bunch has left the device, but the device“rings” for a very long time.

Page 30: Development and Application of Compatible Discretizations

D. White 5/17/2004- 30

Wakefields

1( ) 0, , 0, , z s z sW s E r z t v B r z t dzc c c⎛ ⎞ ⎛ ⎞⎜ ⎟ ⎜ ⎟+⎜ ⎟ ⎜ ⎟⎝ ⎠ ⎝ ⎠

−∞

+ += = = × = =∫

s frequency

s

W(s) is the impulse on test charge due to fields generated by source charge, as a function of separation s

Red: 1 CavityBlue: 5 Cavities

volta

ge

volta

ge

Page 31: Development and Application of Compatible Discretizations

D. White 5/17/2004- 31

Application: NIF Magnetohydrodynamics

eT∇

en∇Laser beamsHohlraum

e eT n∇ ×∇Extra term from non-collinear electron gradients

Lasers create gradients in electron number density and temperature.

Page 32: Development and Application of Compatible Discretizations

D. White 5/17/2004- 32

Application: Magnetohydrodynamics

2

0( )4 e e

e

c c T nt en

ηπ

∂= ∇× × − ∇× ∇× + ∇ ×∇

∂B v B B

0∇ =Bi

Magnetic Induction equation in the small Hall parameter limit

0h e ex τ= Ω → xh is Hall parameter

Additional sourceterm in magneticinduction equation

Page 33: Development and Application of Compatible Discretizations

D. White 5/17/2004- 33

Application: Magnetohydrodynamics

2 form= −Bvector=v

1 ( )n n n nvb S+ = − +Fb C FCCb

, 0e eT n form= −

( ) ( )n n nvb = ×v bn n n

e eS T n= ×G G“sharp & flat” operators…ask Joe

1-form

2-form

Page 34: Development and Application of Compatible Discretizations

D. White 5/17/2004- 34

Open Issues• We think we understand electromagnetics, but what about multiphysics problems?

— Electro-thermal-mechanical problems— Moving meshes, contact problems, ALE methods, etc.

• Solvers are always important— Solvers are still the computational bottleneck for implicit time-domain

simulations, as well as frequency domain simulations.— Multigrid algorithms exist, but there are issues with non-uniform

meshes, material discontinuities, etc.

• Non-linear materials— Photonics problems, magnetic materials etc.

• Radiation boundary conditions