# Presentation: 509585

## Application of Adaptive Mesh Refinement to PIC simulations in inertial fusion

**J.-L. Vay, P. Colella, J.W. Kwan, P. McCorquodale, D. Serafini**
**Lawrence Berkeley National Laboratory**
**A. Friedman, D.P. Grote, G. Westenskow**
**Lawrence Livermore National Laboratory**** **
**J.-C. Adam, A. Héron**
**CPHT, Ecole Polytechnique, France**
**I. Haber**
**University of Maryland**

**15****th**** International Symposium on Heavy Ion Inertial Fusion **
**Princeton, New Jersey**
**June 7-11, 2004**

## Outline

**Motivations for coupling PIC with AMR**
**Issues**
**Examples of electrostatic and electromagnetic PIC-AMR**
**Joint project at LBNL to develop AMR library for PIC**
**Conclusion**

## Goal: end-to-end modeling of a Heavy Ion Fusion driver

**challenging because length scales span a wide range: ********m to km(s)**

**Goal: end-to-end modeling of a Heavy Ion Fusion driver**

## The Adaptive-Mesh-Refinement (AMR) method

** ****addresses the issue of wide range of space scales**
** ****well established method in fluid calculations**

**AMR concentrates the resolution around the edge which contains the most interesting scientific features. **

**3D AMR simulation of an explosion **
**(microseconds after ignition)**

## Electrostatic PIC+AMR: issues

## Mesh Refinement in Particle-In-Cell: Issues

- Asymmetry of grid implies asymmetry
-     of field solution for one particle
- spurious self-force
- Some implementations may violate Gauss’ Law
- Total charge may not be conserved exactly
- EM: shortest wavelength resolved on fine grid not resolved on coarse grid reflect at interface with factor>1
- May cause instability by multiple reflections

- As shown in the following slides, the choice of algorithm matters.

## Electrostatic: possible implementations

- Given a hierarchy of grids, there exists several ways to solve Poisson
- Two considered:
**‘****1-pass’**
- solve on coarse grid
- interpolate solution on fine grid boundary
- solve on fine grid
- different values on collocated nodes
**‘****back-and-forth’**
- interleave coarse and fine grid relaxations
- collocated nodes values reconciliation
- same values on collocated nodes

## Illustration of the spurious self-force effect

-  2-grid set with metallic boundary;

- as if there was a spurious image

## Self-force amplitude map and mitigation

**Self-force amplitude map and mitigation**

-  Magnitude of self force decreases rapidly with distance from edge
-  with the 1-pass method, the self-force effect can be mitigated by defining a transition region surrounding the patch in which deposit charge and solve but get field from underlying coarse patch

- patch

- main grid

- transition region

## Electromagnetics: usual scheme

- Rc

- Rf

- G

- Rc: coarse resolution
- Rf: fine resolution

- P

-  the solution is computed as usual in the main grid and in the patch
-  interpolation is performed at the interface
-  unfortunately, most schemes relying on interpolations have instability issues at short wavelengths (the ones that may be generated in the patch but cannot propagate in the main grid)

## Illustration of instability in 1-D EM tests

- Space only

- Space+Time

- o: E, x:B

## Rc

**ABC**

- P1

- Rf

- P2

- G

- Outside patch:
- F = F(G)

- Inside patch:
- F = F(G)+F(P2)-F(P1)

**Electromagnetics: we proposed a method by “substitution”**

- Rc: coarse resolution
- Rf: fine resolution

## Electrostatic PIC+AMR examples

## Study of steady-state regime of HCX triode 

## 3D WARP simulation of High-Current Experiment (HCX)

**3D WARP simulation of High-Current Experiment (HCX)**

**Modeling of source is critical since it determines initial shape of beam**

| Run | Grid size | Nb particles |
| --- | --- | --- |
| Low res. | 56x640 | ~1M |
| Medium res. | 112x1280 | ~4M |
| High res. | 224x2560 | ~16M |
| Very High res. | 448x5120 | ~64M |

**WARP simulations show that a fairly high resolution is needed to reach convergence**

## Prototype MR implemented in WARPrz ( axisymmetric )

**Prototype MR implemented in WARPrz (******** axisymmetric )**

** ****Three runs with single uniform grid**
** ****One run at medium resolution + MR patch **

| Run | Grid size | Nb particles |
| --- | --- | --- |
| Low res. | 56x640 | ~1M |
| Medium res. | 112x1280 | ~4M |
| High res. | 224x2560 | ~16M |
| Medium res. + MR | 112x1280 | ~4M |

**In this case: speedup ~ 4**

## Prototype AMR implemented in WARPrz ( axisymmetric )

**Prototype AMR implemented in WARPrz (******** axisymmetric )**

** ****Better results obtained with a dynamic AMR mockup refining emitter area + beam edge **

| Run | Grid size | Nb particles |
| --- | --- | --- |
| Low res. | 56x640 | ~1M |
| Medium res. | 112x1280 | ~4M |
| High res. | 224x2560 | ~16M |
| Medium res. + AMR | 112x1280 | ~4M |

**In this case: speedup ~ 4**

## Prototype AMR implemented in WARPrz (

**Prototype AMR implemented in WARPrz (******

** ****Higher speedup obtained with a “true” dynamic AMR implementation**

- Z (m)

- R (m)

**In this case: speedup ~ 11.3**

| Run | Grid size | Nb particles |
| --- | --- | --- |
| Low res. | 56x640 | ~1M |
| Medium res. | 112x1280 | ~4M |
| High res. | 224x2560 | ~16M |
| Low res. + AMR | 56x640 | ~1M |

- Low res.

- High res.

- Medium res.

## Time-dependent modeling of ion source rise-time 

## 3D WARP simulation of HCX shows beam head scrapping 

- Rise-time  = 800 ns
- beam head particle loss < 0.1%

**z (m)**

**z (m)**

**x (m)**

**x (m)**

- Rise-time  = 400 ns
- zero beam head particle loss

** ****Can we get even cleaner head with faster rise-time? **
** ****Optimum?**

## 1D time-dependent modeling of ion diode: fast rise-time

**Emitter**

**Collector**

**V**

**V=0**

**d**

- Careful analysis shows that di too large by >104
- => irregular patch

- Insufficient resolution of beam front
- => AMR patch

**Irregular MR patch covering emission area suppresses long wavelength oscillation**
** **
**Adaptive MR patch following the beam head suppresses front peak**

## Specialized 1-D patch implemented in 3-D injection routine (2-D array)

Extension Lampel-Tiefenback technique to 3-D implemented in WARP
 predicts a voltage waveform which extracts a nearly flat current at emitter

Without MR, WARP predicts overshoot

Run with MR predicts very sharp risetime (not square due to erosion)

- Specialized 1-D patch implemented in 3-D injection routine (2-D array)
- Extension Lampel-Tiefenback technique to 3-D implemented in WARP
-  predicts a voltage waveform which extracts a nearly flat current at emitter
- Without MR, WARP predicts overshoot
- Run with MR predicts very sharp risetime (not square due to erosion)

**Application to three dimensions**

**T (********s)**

**V (kV)**

**“****Optimized” Voltage**

**Current at Z=0.62m**

**X (m)**

**Z (m)**

**STS500 experiment**

## Experimental voltage lowered so that risetime = particle transit time

Mesh Refinement essential to recover experimental results
Ratio of smaller mesh to main grid mesh ~ 1/1000

- Mesh Refinement essential to recover experimental results
- Ratio of smaller mesh to main grid mesh ~ 1/1000

**Comparison with experiment**

## Electromagnetic PIC+MR example

## Laser-plasma interaction in the context of fast ignition

**A laser impinges on a cylindrical target which density is far greater than the critical density. **
**The center of the plasma is artificially cooled to simulate a cold high-density core.**
**Patch boundary surrounds plasma. Laser launched outside the patch.**

** ****Implemented new MR technique in EM PIC code Emi2d (E. Polytech.)**

## Comparison single uniform high res. grid / low res. + patch

- without patch

- with patch

-  no instability nor spurious wave reflection observed at patch border

-  can be used as is for various applications and we are also exploring improvements and variants

## AMR library for PIC

## Researchers from AFRD (PIC) and ANAG (AMR-Phil Colella’s group) collaborate to provide a library of tools that will give AMR capability to existing PIC codes (on serial and parallel computers)

The base is the existing ANAG’s AMR library Chombo 

The way it works

WARP is test PIC code but library will be usable by any PIC code

**Researchers from AFRD (PIC) and ANAG (AMR-Phil Colella’s group) collaborate to provide a library of tools that will give AMR capability to existing PIC codes (on serial and parallel computers)**
**The base is the existing ANAG’s AMR library Chombo **
**The way it works**
**WARP is test PIC code but library will be usable by any PIC code**

**Effort to develop AMR library for PIC at LBNL**

## Example of WARP-Chombo injector field calculation

-  Interactions with particles is being implemented

## Conclusion

** ****PIC and AMR are numerical techniques that have proven to be very valuable in various fields and their combination may lead to more powerful tools for beams and plasmas modeling in inertial fusion (and beyond).**
** ****The implementation must be done with care (beware of potential spurious self-forces, violation of Gauss’ Law, reflection of smallest wavelengths).**
** ****Prototypes of AMR methods were implemented in existing PIC codes and test runs demonstrated the effectiveness of the method in ES-PIC and a proof-of-principle of a new method was performed in EM-PIC.**
** ****There is an ongoing effort at LBNL to build an AMR library which will ultimately provide AMR capabilities to existing PIC codes.**

## Backup slides

## Time and length scales in driver and chamber span a wide range 

_**Length scales:**_

**electron**

**cyclotron**

**in magnet**

**pulse**

**electron drift**

**out of magnet**

**beam**

**residence**

****

**pb**

****

**lattice**

**period**

**betatron**

**depressed**

**betatron**

****

**pe**

**transit**

**thru**

**fringe**

**fields**

**beam**

**residence**

**pulse**

**log of timescale**

**in seconds**

****

**pi**

****

**pb**

** ****electron gyroradius in magnet ~10 ********m**
** ********D,beam**** ~ 1 mm**
** ****beam radius ~ cm**
** ****machine length ~ km's**

_**Time scales:**_

## Global error

-  global error larger with BF than 1P
-  BF: Gauss’ law not satisfied; error transmitted to coarse grid solution

**Global error**

## Electrostatic issues: summary

-  Mesh Refinement introduces spurious self-force that has a repulsive  effect on a macroparticle close to coarse-fine interface in fine grid, but:
- real simulations involve many macroparticles: dilution of the spurious force
- for some coarse-fine grid coupling, the magnitude of the spurious effect can be reduced by an order of magnitude by interpolating to and from collocated nodes in band in fine grid along coarse-fine interface
- we may also simply discard the fine grid solution in band and use coarse grid solution instead for force gathering (or ramp)
-  some scheme may violate Gauss’ law and may introduce unphysical non-linearities into “mother” grid solution: hopefully there is also dilution of the effect in real simulations
-  we note that our tests were performed for a node-centered implementation and our conclusion applies to this case only. For example, a cell-centered implementation does strictly enforce Gauss’ Law and results may differ.