# Presentation: 626603

## EM Computations with Embedded Boundaries(cut cells)

**C. Nieter****†****, ****J.R. Cary****†***** (presenter), ****G.R. Werner*********, D.N. Smithe****†****, P.H. Stoltz****†****, S. Ovtchinnikov****†**
**Tech-X Corporation, U. Colorado**
_**COMPASS Collaboration Meeting, Sep. 17-18, 2007**_
**We also acknowledge assistance from the rest of the VORPAL team: G. I. Bell, D. L. Bruhwiler, R. S. Busby, J. Carlsson, B. M. Cowan, D. A. Dimitrov, A. Hakim, P. Messmer, P. J. Mullowney, K. Paul, S. W. Sides, N. D. Sizemore, S. A. Veitzer, D. J. Wade-Stein, N. Xiang, W. Ye.**
**Work supported by**
**Offices of FES, HEP, and NP of the Department of Energy, the SciDAC program, AFOSR, JTO, Office of the Secretary of Defense, and the SBIR programs of the Department of Energy and Department of Defense**

## Outline

**Embedded boundaries: theory and use**
**Frequency extraction**
**Richardson extrapolation use and results**
**Areas for collaboration**

- Tech-X Corporation/COMPASS

## Finite difference time domain (FDTD) based on accurate derivatives

**Simple**
**Fast**
- No matrix inversions
**Manifestly stable**
- Symmetric update matrix
**Works well with particles**
- _The choice_ of PIC codes
**Parallelizes well**
- Only boundary information exchanged between domains

*E**z*

**y****j**

**y****j+1**

- VORPAL BG/L Speedup

- Tech-X Corporation/COMPASS

## But historically, FDTD failed to do well with curved surfaces

**But historically, FDTD failed to do well with curved surfaces**

**N (L/********x) cells in each direction**
**Error of (********x/L)****3**** at each surface cell**
**O(N****2****) cells on surface**
**Error = N****2****(********x/L)****3**** = O(1/N)**

**120x24x24 = 71,424 cells**
**= 215,000 degrees of freedom**

- Modest problems require 1012 cells for 10-5 error

- Tech-X Corporation/COMPASS

## Embedded boundaries give locally first order error

**AKA cut-cell or conformal**
**Dey-Mittra (NOT Yu-Mittra)**
**Justified as**
- Update flux by line integral
- Divide by area to get change of B

- Tech-X Corporation/COMPASS

## Embedded boundaries have global second-order error

**Extensive numerical validation**
**Computations now doable**
**Mesh generation parallelizes well**
**10****-5**** error with 100 cells per direction**
**10****6**** cells usually suffices for simple structures**
**Variable mesh will reduce further**

- Tech-X Corporation/COMPASS

## Embedded boundaries have some "issues"

**No real derivation in literature**
- Wrong centering
- No cut cells for B
- Lack of understanding prevents development of higher-order method
**Smaller cells decrease the maximum stable time step**
- Matrix elements ~ inverse triangle size
- Must discard tiny cells
- Results in
- O(x) scaling at small x
- Smaller time step for stability
- Locally trapped high frequency modes
- Interferes with Richardson scaling

- C. Nieter, J.R. Cary, G.R. Werner, D.N. Smithe, P.H. Stoltz, *Application of Dey-Mittra conformal boundary algorithm to 3D electromagnetic modeling*, preprint, 2007.

- Tech-X Corporation/COMPASS

## Frequencies obtained from subspace diagonalization

**Frequencies obtained from subspace diagonalization**

**We can beat Heisenberg!**
**Ring up finite bandwidth, compute time series in subspace**
**Diagonalize subspace**
**Multiple simulations if near degeneracies**

- G.R. Werner and J.R. Cary, *Extracting Degenerate Modes and Frequencies from Time Domain Simulations*, J. Comp. Phys., submitted (2007).

- Tech-X Corporation/COMPASS

## Application to nearly degenerate square shows accurate degeneracy extraction

**Application to nearly degenerate square shows accurate degeneracy extraction**

**Lx = 1m, Ly = 1.00001 m**
**Simulation set up to capture modes in +- 10% band**
**Expected number of modes from density of states**
**Four-fold near-degeneracy, so five simulations**
**Frequencies obtained to parts in 10****7****-10****-9**
**Computation error dominates over extraction error**

- Tech-X Corporation/COMPASS

## Method now extended to complex frequencies

**Can get Q measurements again from 10s of oscillations**
**Applied to simple cavities only so far**

- Tech-X Corporation/COMPASS

## Richardson extrapolation gets accuracy to next order

**Fit frequency:**
**Solve for ******** and ********0**** from two measurements**
**Requires smooth variation: similarity**

- Elliptic cavity, direct

- Elliptic cavity, extrapolated

- Tech-X Corporation/COMPASS

## Results: crab cavity frequencies to 50 kHz

**13 cell crab cavity**
**Varying resolution**
- 192x40x40
- ...
- 752x144x144
**Fit different ways**
- last two points
- last three points
- keep or not other polynomial terms
- results differ by less than 50 kHz

- Tech-X Corporation/COMPASS

## Results differ from previous in frequencies

**Observing 3 MHz difference**

- Tech-X Corporation/COMPASS

## Differences also seen in the splitting

**Differences also seen in the splitting**

**VORPAL sees typically 0.5-1MHz lower split**

- Tech-X Corporation/COMPASS

## Verification shows sampling okay, but pipe length effects present

**Effects of modified end groups?**
**Need outgoing wave for pipe ends?**

- Tech-X Corporation/COMPASS

## Doing few calculations on Tesla, multipactoring

**Jlab multipactoring**
**Tesla cavities**

- Tech-X Corporation/COMPASS

## There are potentially fruitful collaborations

**Higher-order embedded boundaries **
**Eliminate stable time step reduction**
**Particle motion near boundaries**
**Visualization**

- Tech-X Corporation/COMPASS

## Higher-order embedded boundaries would make a large impact 

**Boundary error same as interior**
- Boundary error is O(x), gives O(x2) globally
- Interior error is O(x2)
**With Richardson extrapolation**
- Boundary error is O(x2), gives O(x3) globally
- Interior error is O(x4)
**Boundary error is limiting with extrapolation**
**Improved boundary error will lead to overall error of O(********x****4****)!**
**We now have a derivation of Dey-Mittra**
**Have higher-order algorithm, but**
- Very complex
- Not manifestly symmetric

- Tech-X Corporation/COMPASS

## Elimination of time-step reduction improves modeling

**Reduces work by a factor of 4-10**
**Eliminates spurious trapped high-frequency modes (important for multipactoring studies)**
**I. A. Zagorodnov, R. Schuhmann, T. Weiland, [*****A uniformly stable conformal FDTD-method in Cartesian grids*****, Int. J. Numer. Model., 16, 127 (2003)] has heuristic approach based on area borrowing.**
**Can one prove the above?**
**Understand how to have minimal impact?**
**How is symmetry imposed?**

- Tech-X Corporation/COMPASS

## Particle dynamics near boundaries critical for accurate modeling

**Particle dynamics near boundaries critical for accurate modeling**

**Charge conservation near boundaries critical to avoid nonphysical charge buildup**
**What does one do with dynamics?  Without some care, we have observed self forces and excess heating.**
**We are approaching heuristically: copy over**
**Does this avoid self forces?**

- Tech-X Corporation/COMPASS

## Visualization and code comparision

**Visualization what one is solving is a great aid**
**For verification, would like to have easier ways to compare results**
- Exchange standards for data, geometries
**Ultimately, solve different problems and have increased productivity**

- Tech-X Corporation/COMPASS

## Summary and conclusions

**FDTD has made a number of advances in EM with embedded boundaries.  Now have accurate, charge conserving solutions**
**Potential collaborations with physicists**
- Data exchange
- Formats
**Potential collaborations with applied mathematicians**
- Higher order embedded boundaries
- Elimination of time-step reduction
- Dynamics of particles near boundaries
- Visualization, data formats

- Tech-X Corporation/COMPASS