# Presentation: 357647

## Simulation Needs Overview

- John Petillo – SAIC, Burlington, MA
- Baruch Levush – NRL, Washington, DC
- Sept. 25, 2003

**ANL Theory Institute on Production of Bright Electron Beams**
- Argonne National Lab, Argonne, IL
- Sept. 22-26, 2003

## Outline

- Generate discussion on codes & needs
- Code needs
- Needs by component
- Inter-Code issues
- Code availability
- Selection of examples to motivate interest in needs/wants
- Action items

## Post Processing & Animation

- Animation of physics
- Provides the researcher with an ability to gain intuition into the dynamics of the complicated interactions between particles (primary and secondary), fields & the device structure

- Electron Gun

- Multistage Depressed Collector

## Code Needs

- What’s needed?
- Space charge - under what circumstances?
- Emission models – characterize , implement model & test
- 2D/3D – when is what needed & with what model?
- Time-domain
- When can we get away with ES vs. EM?
- Frequency-domain
- Need for conformal surfaces – gridding
- Usually means FE, but can be “FD”
- FE usually means SLOW – but not necessarily
- What models are needed for modeling efficiency?
- Explicit PIC, implicit PIC, transport in smooth pipe, etc.
- List these in detail

## 3D Mesh Types - Illustration

## Needs by component

- Examples – what’s needed for...
- Guns
- Steady-state/thermionic vs. RF
- Beamline components
- Buncher – what’s needed here?
- List like this needs to be prepared
- Need input from everyone for this

## Inter-Code data transfer

- Different codes are needed/used in different regions
- Incompatibilities may exist – some can be extreme
- Need to transfer...
- Between codes, often have different...
- Data types
- Computational type
- Mesh type
- Particle data, field data
- Sometimes easy...  But, may have tocharacterize from one code – process – then send to second code
- Region overlap needed?
- How to transfer & start ultra-relativistic beams in a PIC code with a soft start
- What development is needed here?
- What standards should be used, or defined?

## What Codes Are People Using?

- Government provided / home grown / “store bought”
- These should be listed
- Pros & cons listed
- What/which codes can be made available to everyone?
- Govt. can commission codes to be written and disseminated to community with training

## Training

- Proper training often overlooked
- Introducing new codes to users...
- Many codes are difficult to use – people avoid them
- Difficult to use – or difficult to get the right answer?
- For difficult codes, often need “Experts” to model first problem before transitioning code to a user
- Modern codes are both easier and harder to use
- Better meshes get better answers
- Meshing is now the hard part
- Are they faster?
- Outside support from authors is important – must be available
- USPAS tries to help here, but general-purpose codes like PIC codes not well represented in the curriculum

## Availability...

- Are the codes available, and to whom?
- Who provides/pays-for codes that cost money?
- Important Goal...
- that everyone in the community has access to the same tools
- that they are trained

## Examples

- Motivation for coming up with desired code capabilities

## Parallel Plate CapacitorLimited Emission Region

- D = 10 cm, R = 10 cm
- R_beam = 1 cm
- V = 10,000 V

- Is Max right?????

## Parallel Plate CapacitorLimited Emission Region

- D = 10 cm, R = 10 cm
- R_beam = 1 cm
- V = 10,000 V

## Parallel Plate CapacitorLimited Emission Region

- Childs Law: I = 0.073 A
- Code:          I = 0.23 A – ratio of 3.18
- Max says ratio of sqrt(d/r) = sqrt(10) = 3.16!

##  Example: Use of Conformal Meshes

- Guns
- Modulation Control grids can be analyzed
- Electron surface emission models have improved
- Multi-beam and Sheet beam devices can be analyzed
- Multistage Depressed Collectors - limitations
- Anisotropic Collectors – can be analyzed
- Secondary emission models – improved models
- Tolerance analysis – often 3D in nature
- Most typical alignment and clocking errors can be analyzed
- Fine structure representation
- Multiple particle species – electrons/ions/charge-exchange
- Multiple-Beam
- No longer a 2D or a small 3D problem when many beams need to be modeled

## Hybrid Multiblock Mesh Example

**Building a Hybrid Multiblock ****Mesh**
- Build structured mesh with an interface to unstructured block.
- Extract quads on interface.
- Build unstructured mesh.
- Merge.  Create pyramid elements.

**+**

**=>**

**=**

**interface**

**interface**

- 3D Hybrid Mesh
- MICHELLE Result

## Models, Meshing & Algorithms

- Finite Element Approach – linear, quadratic
- Grid System Supported - conformal
- Within Voyager GUI with ICEM-CFD mesher
- Supports most high-end CAD modelers – we use SolidWorks
**Structured Mesh**
-  3D Multi-block, Hexahedral
**Unstructured Mesh**
- 2D - Triangle, Quadrilateral
- 3D - Tetrahedral, Hexahedral, Prism, Pyramid
**Hybrid Mesh**
- Single run Structured mesh & Unstructured mesh
- Makes use of compact data storage of a structured mesh for computational efficiency
- Within STAR’s ANALYST code
**Adaptive Mesh Refinement**
**Unstructured Mesh**
- 2D – Triangle
- 3D - Tetrahedral

- Coarse Mesh

- Fine Mesh

## Example: Advanced Models & Algorithms

- Particle Tracking – adaptive time step model
- Boris push – Structured
- Nelson push – Structured, Unstructured
- Field Solutions
- Self-consistent Electrostatic field solution (CG)
- Off-axis B-field expansion
- Import externally calculated B-fields (Maxwell 3D)
- 2D self-magnetic field model
- Emission
- Child’s law, Longo-Vaughan Temperature-limited, Thermionic
- Secondary emission
- Spent Beam particle launch
- Periodic, Reflection
- Ion beams / charge exchange

**-****       Applied Voltage       ****+**

**Emitter**
**Surface**

## Example: GUI & Post-Processing

- Graphical User Interface (GUI)
- Problem control – setup and run
- New model creation with Setup Wizard
- Batch control
- Direct mesh visualization
- Multiple job queuing
- Export of results for post-processing
- Embedded Python support for comprehensive scripting capabilities
- Hybrid mesh support
- Unification and simplification of translator interfaces
- Post Processor
- Structure, mesh, fields & particles visualization
- Calculation of beam quantities
- Beam profiles.
- Collection power,current, efficiency table & visualization.
- Alpha, emittance, velocity spread.
- User-defined quantities (via Python).
- Effort
- Creation of useful tools to maximize understanding and design intuition

## :Beam Transport issues 

- Modeling of beam transport in *long, thin beamlines* often suffers from *numerical instability* or *very slow convergence.*
- Under some conditions, the beamline can be broken up into *n* segments, and each segment run separately, patching the solutions together across the interfaces with good results.
- Sufficiently short segments are always stable, and each has faster convergence.
- In the examples shown with 5 segments, the speed increase was a factor of 2 to 4.

- Beam Pipe and Beam: uniform beam not matched to B-field

## Long, Thin Beamlines:Performance Comparison

- This case represents beam transport where the  beams are very laminar.  The segmented method works well in these cases.
- Emittance Comparison
- Shows overall excellent agreement between single and segmented cases
- Tracking Error Comparison
- Shows a maximum of < 2.0% tracking difference at end of trajectory between single and segmented cases
- Indications that segmentation is a suitable solution to a difficult problem over a wide problem class
- Automating the segmentation task would be a useful development task

## CPI XK-8050 Example3D Structured, 2D/3D Unstructured Comparison

- Area convergence ratio ~71 – difficult problem
- Same CAD Model - ICEM-CFD produced meshes
- "Same” MICHELLE input file
- 	2D Unstructured	3D Structured	3D Unstructured
- 	     0.277 A		    0.2804 A	       0.2852 A
- Good agreement with DEMEOS
- Expect better agreement when 3D unstructured mesh is refined

- 3D Structured Mesh

- 3D Unstructured Mesh

- 2D Unstructured Mesh

## Embedding MICHELLE in a Commercial Design Environment

**CAD**

**Meshing**

**Post-processing**

**MICHELLE**

- Mesh

- Result

- File translation
- interface

- Config

**Solver setup**

**MICHELLE**

**Existing Design Environment**

**Interface Layer**

- MICHELLE Standardized mesh, result, and solver configuration file formats enable embedding.

## MICHELLE has been embedded in STAR’s Analyst product

- Integrated parametric CAD.
- Automated meshing.
- Adaptive mesh refinement.
- Python.
- Support for field solvers
- Statics
- Eigenmodes
- Driven frequency
- Optimization.

- Python-based scripting provides important flexibility
- for problem specific numerical post-processing.

## Action Items

- Come up with a roadmap for code capability
- Characterize codes and availability (cost)
- Many codes in other disciplines can be used – list what’s available
- Distribute to this group
- List of names & contact info of the group members
- Characterize what it would take to do a start-to-end simulation
- Gather information from community
- List development level of desired capability/upgrades
- What do you want?
- Some development is important and possibly can be made available right now
- Will provide the basis for the roadmap
- Start by e-mailing me code names, your application for that code &  suggested upgrades/needs
- jpetillo@bos.saic.com