+ All Categories
Home > Documents > Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect...

Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect...

Date post: 05-Apr-2020
Category:
Upload: others
View: 8 times
Download: 0 times
Share this document with a friend
55
Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1
Transcript
Page 1: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Particle Tracking with Space Charge Effect using GPU

Yoshi Kurimoto J-PARC/KEK

J-PARC Main Ring Power Converter Group

1

Page 2: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Contents

โ€ข Introduction about GPU

โ€ข Single Particle Mechanics

โ€ข Space Charge Effect

โ€ข Application to J-PARC Main Ring

โ€ข Current Issues

2

Page 3: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

References

3

โ€ข K. Ohmi et al., โ€œStudy of Halo Formation in J-PARC MRโ€, in Proc. PAC07, Albuquerque, NM, USA, Jun. 2007, paper THPAN040, pp. 3318-3320.

โ€ข M. Ferrario et al., โ€œSpace Charge Effectsโ€ 26 pages, contribution to the CAS - CERN Accelerator School: Advanced Accelerator Physics Course, Trondheim, Norway, 18-29 Aug 2013 10.5170/CERN-2014-009.331

โ€ข Laurent S. Nadolski โ€œSymplectic Integrators applied to Beam Dynamics in Circular Accelerators Basis for Constructing Integration Schemes for Hamiltonian Systemsโ€ NPAC 2010โ€“2011 (v1.4)

โ€ข C.K. Birdsall, A.B Langdon, โ€œPlasma Physics via Computer Simulationโ€ DOI: https://doi.org/10.1201/9781315275048โ€ข R. De Maria, et al., โ€œSixTrack Physics Manualโ€โ€ข F. Christoph Iselin, โ€œThe MAD Program Physical Methods Manual โ€œ Version 8.13

โ€ข S. Machida โ€œ็ฉบ้–“้›ป่ทๅŠนๆžœโ€ OHO seminar 2000โ€ข K. Oide โ€œใƒ“ใƒผใƒ ๅŠ›ๅญฆๅ…ฅ้–€โ€ 1992

โ€ข Private Communication to Ohmi-san (KEK) Hochi-san (JAEA)

This work is also supported by NVIDIA Corporation via NVIDIA GPU Grant Program

Page 4: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

GPU (Graphic Processing Unit)

4

โ€ฆGlobal Memory

Thread 1

โ€ฆ

Shared

Memory

Block M

Thread 2

Thread N

โ€ข Each operation can be assigned to each thread.

โ€ข Execution of each thread can be parallelly done.

โ€ข Threads in a common block can access the shared memory.

โ€ข Shared memory is limited (12288 double words) but very fast

Thread 1

โ€ฆ

Shared

Memory

Block 2

Thread 2

Thread N

Thread 1

โ€ฆ

Shared

Memory

Block 1

Thread 2

Thread N

Page 5: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Example

5

๐‘–=1

๐‘

๐‘Ž๐‘–๐‘ฅ๐‘– = ๐‘Ž1๐‘ฅ1 + ๐‘Ž2๐‘ฅ2 +โ‹ฏ+ ๐‘Ž๐‘๐‘ฅ๐‘

1. Each term can be calculated in parallel

a1x1 a2x2 a3x3 a4x4 a5x5 a6x6 a7x7 a8x8

+ + + +

2. Summation also can be partially parallel.

a1x1 +a2x2 a3x3 +a4x4 a5x5 +a6x6 a7x7 +a8x8

+ +

No

t Para

llel

Parallel

Matrix multiplication, Fourier transformation โ€ฆ

a1 x1ร— a2 x2ร— aN xNร—โ€ฆ

Parallel

Page 6: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

CUDA (Compute Unified Device Architecture)

โ€ข C/C++ based Programing Language

โ€ข Compiler : โ€œnvccโ€ (instead of gcc)

โ€ข FFT Library : โ€œcuFFTโ€

โ€ข Linear Algebra Library : โ€œcublasโ€

6

Page 7: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Hardware

7

Quadro P6000 TESLA V100

Single Precision (float) 12.63 TFLOP 14 TFLOP

Double Precision (double) 394.8 GFLOP 7 TFLOP

How I Got NVIDIA gave me Amazon Web Service 3-4$/hour

How I use Checking if my code works correctly

Massive calculations

NVIDIA Quadro P6000 TESLA V100

Page 8: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Overview of the Particle Tracking Simulation

8

Particle Generation Drift, Magnets, Cavity Space Charge Effect

Single Particle Mechanics : Maps between two locations can be calculated in parallel

PIC simulation : Maps requires spatial distributions of particles

Page 9: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Single Particle Mechanics

9

Page 10: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Implemented Components

โžขBEND, DRIFT

10

โ€ข Find the exact solutions of particle motions in uniform magnetic fields

โžขQUAD, SEXT, thin multipole, Cavity

โ€ข Using Hamiltonianโ€ข Approximated by sequential symplectic transformations

Page 11: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Hamiltonian

11

๐ป ๐‘ฅ, ๐‘๐‘ฅ, ๐‘ฆ, ๐‘๐‘ฆ, ๐œŽ, ๐‘๐œŽ; ๐‘  = ๐‘๐œŽ โˆ’ 1 + โ„Ž๐‘ฅ 1 + ๐›ฟ 2 โˆ’ ๐‘๐‘ฅ2 โˆ’ ๐‘๐‘ฆ

2 โˆ’ ๐‘’๐ด๐‘ (๐‘ฅ,๐‘ฆ)

๐‘0

๐‘๐œŽ =๐ธโˆ’๐ธ0

๐›ฝ0๐‘0๐‘, ๐œŽ = ๐‘  โˆ’ ๐›ฝ0๐‘ก, ๐›ฟ =

๐‘โˆ’๐‘0

๐‘0โ‰ˆ ๐‘๐œŽ โˆ’

1

2๐›พ02 ๐‘๐œŽ

2,

โ‰ˆ๐‘๐‘ฅ

2+๐‘๐‘ฆ2

2+

๐‘๐œŽ2

2๐›พ02 โˆ’ โ„Ž๐‘ฅ โˆ’ โ„Ž๐‘ฅ๐‘๐œŽ โˆ’

๐‘๐‘ฅ2+๐‘๐‘ฆ

2

2๐‘๐œŽ โˆ’ ๐‘’

๐ด๐‘ (๐‘ฅ,๐‘ฆ)

๐‘0

Then just have to solve the Hamilton equations. But not always solvable

Page 12: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Symplectic Map

12

In case that a Hamilton equation is difficult to be solved,

๐‘’๐‘–๐ป0๐ฟ/2๐‘’๐‘–๐‘‰๐ฟ ๐‘’๐‘–๐ป0๐ฟ/2๐‘’๐‘–๐ป0๐‘Ž๐ฟ๐‘’โˆ’๐‘–๐‘‰๐‘๐ฟ ๐‘’โˆ’๐‘–๐ป0๐‘๐ฟ ๐‘’๐‘–๐‘‰๐‘๐ฟ๐‘’โˆ’๐‘–๐ป0๐‘Ž๐ฟ

๐‘Ž =1

21 โˆ’

1

3, ๐‘ =

1

2, ๐‘ =

1

3

Both symplectic integrators ( ๐‘’๐‘–๐ป0๐‘  and ๐‘’๐‘–๐‘‰๐‘  ) are integrable๐ป = ๐ป0 + ๐‘‰ :

or

The map between the entrance and exit of a components (Length = ๐ฟ ) :

Page 13: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

๐‘’๐ด๐‘ (๐‘ฅ) = โˆ’1

2๐‘˜1(๐‘ฅ

2 โˆ’ ๐‘ฆ2)

๐ป โ‰ˆ๐‘๐‘ฅ

2+๐‘๐‘ฆ2

2+

1

2๐‘˜1 ๐‘ฅ2 โˆ’ ๐‘ฆ2 โˆ’

๐‘๐‘ฅ2+๐‘๐‘ฆ

2

2๐‘๐œŽ +

๐‘๐œŽ2

2๐›พ02

h

๐ป0 ๐‘‰

โ€ข ๐‘’๐‘–๐ป0๐‘  โ€ข ๐‘’๐‘–๐‘‰๐‘ 

๐‘ฅ ๐‘  = ๐‘ฅ 0 cos ๐‘˜1๐‘  +๐‘๐‘ฅ(0)

๐‘˜1sin ๐‘˜1๐‘ 

๐‘๐‘ฅ ๐‘  = ๐‘๐‘ฅ 0 cos ๐‘˜1๐‘  โˆ’ ๐‘˜1๐‘ฅ(0) sin ๐‘˜1 ๐‘ 

๐œŽ ๐‘  = ๐œŽ 0

๐‘๐œŽ ๐‘  = ๐‘๐œŽ 0

๐‘ฅ ๐‘  = โˆ’๐‘๐‘ฅ(0)๐‘๐œŽ 0 ๐‘  + ๐‘ฅ(0)

๐‘ฆ ๐‘  = โˆ’๐‘๐‘ฆ(0)๐‘๐œŽ 0 ๐‘  + ๐‘ฆ(0)

๐œŽ ๐‘  = ๐œŽ 0 +๐‘๐œŽ 0

๐›พ02

โˆ’๐‘๐‘ฅ 0 2 + ๐‘๐‘ฆ 0 2

2๐‘ 

๐‘๐‘ฅ ๐‘  = ๐‘๐‘ฅ 0

๐‘๐‘ฆ ๐‘  = ๐‘๐‘ฆ 0

๐‘๐œŽ ๐‘  = ๐‘๐œŽ 0

๐‘ฆ ๐‘  = ๐‘ฆ 0 cosh ๐‘˜1๐‘  +๐‘๐‘ฆ(0)

๐‘˜1sinh ๐‘˜1๐‘ 

๐‘๐‘ฆ ๐‘  = ๐‘๐‘ฆ 0 cosh ๐‘˜1๐‘  + ๐‘˜1๐‘ฆ(0) sinh ๐‘˜1 ๐‘ 

Ex1 Quad Magnets

13

Page 14: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Particle Motions of Uniform Magnetic Fields

14

๐ฟ

๐œŒ

Reference orbit๐‘ฅ

ว๐‘ง

( ๐‘ฅ ๐‘ก , ว๐‘ง ๐‘ก )

๐‘ฅ ๐‘ก =๐‘ƒ๐‘ฅ(0)

๐‘ž๐ตsin

๐‘ž๐ต

๐‘š๐›พ๐‘ก +

๐‘ƒ๐‘ง (0)

๐‘ž๐ตcos

๐‘ž๐ต

๐‘š๐›พ๐‘ก + ๐‘ฅ 0 โˆ’

๐‘ƒ๐‘ง(0)

๐‘ž๐ต

ว๐‘ง ๐‘ก =๐‘ƒ๐‘ง(0)

๐‘ž๐ตsin

๐‘ž๐ต

๐‘š๐›พ๐‘ก โˆ’

๐‘ƒ๐‘ฅ(0)

๐‘ž๐ตcos

๐‘ž๐ต

๐‘š๐›พ๐‘ก +

๐‘ƒ๐‘ฅ(0)

๐‘ž๐ต

1. Find ๐‘ก when ว๐‘ง ๐‘ก = tan๐ฟ

๐œŒ๐‘ฅ ๐‘ก

๐ตโจ‚

๐‘ฅ ๐ฟ = ๐‘ฅ2 ๐‘ก + ว๐‘ง2 ๐‘ก โˆ’ ๐œŒ

2. Convert canonical valuables

๐‘ƒ๐‘ฅ ๐‘ก = ๐‘ƒ๐‘ฅ(0)cos๐‘ž๐ต

๐‘š๐›พ๐‘ก โˆ’ ๐‘ƒ๐‘ง(0)sin

๐‘ž๐ต

๐‘š๐›พ๐‘ก

๐‘ƒ๐‘ง ๐‘ก = ๐‘ƒ๐‘ง(0)cos๐‘ž๐ต

๐‘š๐›พ๐‘ก + ๐‘ƒ๐‘ฅ(0)sin

๐‘ž๐ต

๐‘š๐›พ๐‘ก

๐‘๐‘ฅ ๐ฟ =๐‘ƒ๐‘ฅ ๐‘ก cos

๐ฟ๐œŒ + ๐‘ƒ๐‘ง(๐‘ก) sin

๐ฟ๐œŒ

๐‘0

๐‘ƒ๐‘ง 0 = ๐‘0 1 + 2๐‘๐œŽ + ๐›ฝ2๐‘๐œŽ2 โˆ’ ๐‘๐‘ฅ 0 2 โˆ’ ๐‘๐‘ฆ(0)

2

๐‘ƒ๐‘ฅ 0 = ๐‘0๐‘๐‘ฅ 0

, where

Solution

Ex2 Bend

๐‘‘๐‘ƒ(๐‘ก)

๐‘‘๐‘ก= ๐‘ž ิฆ๐›ฝ๐‘ ร— ๐ต

Equation of Motion

( ๐‘ฅ 0 , 0)

Page 15: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Space Charge Effect

15

โ€ข Overview

โ€ข Histogram Making (Charge weighting)

โ€ข Poisson Solver

โ€ข Electric field

Page 16: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Overview

16

(๐œ•2

๐œ•๐‘ฅ2+

๐œ•2

๐œ•๐‘ฆ2+

๐œ•2

๐œ•๐‘ง2)๐œ‘(๐‘ฅ, ๐‘ฆ, ๐‘ง) = โˆ’

๐œŒ(๐‘ฅ, ๐‘ฆ, ๐‘ง)

ํœ€0๐‘”(๐‘ง)

๐œ•2

๐œ•๐‘ฅ2+

๐œ•2

๐œ•๐‘ฆ2๐‘ข(๐‘ฅ, ๐‘ฆ) = โˆ’

๐‘” ๐‘ง ๐‘“(๐‘ฅ, ๐‘ฆ)

ํœ€02D approximation๐œŽ๐‘ฅ, ๐œŽ๐‘ฆ โ‰ช ๐œŽ๐‘ง

1. Make histogram ๐‘“ ๐‘ฅ, ๐‘ฆ ๐‘Ž๐‘›๐‘‘ ๐‘” ๐‘ง

2. Solve 2D Poisson equation ๐‘ข ๐‘ฅ, ๐‘ฆ with boundary conditionsa

3. Calculate gradient (kick) โˆ’๐œ•

๐œ•๐‘ฅ,๐œ•

๐œ•๐‘ฆ,๐œ•

๐œ•๐‘ง๐ด๐‘” ๐‘ง ๐‘ข(๐‘ฅ, ๐‘ฆ) ร— ๐ฟ

The most time-consuming part

๐ด =๐‘’

๐‘š๐‘๐›พ๐‘3๐›ฝ๐‘2๐‘2

๐‘, ๐ฟ = ๐‘€๐‘œ๐‘ฃ๐‘–๐‘›๐‘” ๐ท๐‘–๐‘ ๐‘ก๐‘Ž๐‘›๐‘๐‘’

a. Using โ€œpolarโ€ or โ€œrectangularโ€ boundary condition depending on the duct shape.b. This coefficient A is not always correct (come back later)

Page 17: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Space Charge Effect

17

โ€ข Overview โ€ข Histogram Making (Charge weighting)โ€ข Poisson Solverโ€ข Electric field

Page 18: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Cartesian Coordinate

๐‘ฅ๐‘– , ๐‘ฆ๐‘— ๐‘ฅ๐‘–+1, ๐‘ฆ๐‘—

๐‘ฅ๐‘–+1, ๐‘ฆ๐‘—+1๐‘ฅ๐‘– , ๐‘ฆ๐‘–+1

๐‘ฅ, ๐‘ฆ

๐‘ž

๐‘„ ๐‘ฅ๐‘– , ๐‘ฆ๐‘— += ๐‘ž(๐‘ฅ๐‘–+1 โˆ’ ๐‘ฅ)(๐‘ฆ๐‘—+1 โˆ’ ๐‘ฆ)

๐›ฟ๐‘ฅ๐›ฟ๐‘ฆ

๐‘„ ๐‘ฅ๐‘–+1, ๐‘ฆ๐‘— += ๐‘ž(โˆ’๐‘ฅ๐‘– + ๐‘ฅ)(๐‘ฆ๐‘—+1 โˆ’ ๐‘ฆ)

๐›ฟ๐‘ฅ๐›ฟ๐‘ฆ

๐‘„ ๐‘ฅ๐‘– , ๐‘ฆ๐‘—+1 += ๐‘ž(๐‘ฅ๐‘–+1 โˆ’ ๐‘ฅ)(โˆ’๐‘ฆ๐‘— + ๐‘ฆ)

๐›ฟ๐‘ฅ๐›ฟ๐‘ฆ

๐‘„ ๐‘ฅ๐‘–+1, ๐‘ฆ๐‘—+1 += ๐‘ž(โˆ’๐‘ฅ๐‘– + ๐‘ฅ)(โˆ’๐‘ฆ๐‘— + ๐‘ฆ)

๐›ฟ๐‘ฅ๐›ฟ๐‘ฆ

Making Histograms

18

Page 19: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Sub-histograms using shared memory

19

โ€ฆ

๐‘ฅ0, ๐‘ฆ0

๐‘ฅ1, ๐‘ฆ1

๐‘ฅ2, ๐‘ฆ2

๐‘ฅ(๐‘โˆ’1)๐‘š, ๐‘ฆ(๐‘โˆ’1)๐‘š

๐‘ฅ(๐‘โˆ’1)๐‘š+1, ๐‘ฆ(๐‘โˆ’1)๐‘š+1

๐‘ฅ(๐‘โˆ’1)๐‘š+2, ๐‘ฆ(๐‘โˆ’1)๐‘š+2

โ€ฆ

1. Divide (macro) particles into N groups

๐‘ฅ๐‘šโˆ’1, ๐‘ฆ๐‘šโˆ’1

โ€ฆ

๐‘ฅ๐‘๐‘šโˆ’1, ๐‘ฆ๐‘๐‘šโˆ’1

โ€ฆ

๐‘ฅ๐‘š, ๐‘ฆ๐‘š

๐‘ฅ๐‘š+1, ๐‘ฆ๐‘š+1

๐‘ฅ๐‘š+2, ๐‘ฆ๐‘š+2

๐‘ฅ2๐‘šโˆ’1, ๐‘ฆ2๐‘šโˆ’1

GROUP1 GROUP2 GROUPN

Page 20: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Sub-histograms using shared memory

20

Thread

Thread

Threadโ€ฆ

Shared Memory

Block 1๐‘ฅ0, ๐‘ฆ0

๐‘ฅ1, ๐‘ฆ1

๐‘ฅ2, ๐‘ฆ2

โ€ฆ

Thread

Thread

Threadโ€ฆ

Shared Memory

Block N๐‘ฅ(๐‘โˆ’1)๐‘š, ๐‘ฆ(๐‘โˆ’1)๐‘š

๐‘ฅ(๐‘โˆ’1)๐‘š+1, ๐‘ฆ(๐‘โˆ’1)๐‘š+1

๐‘ฅ(๐‘โˆ’1)๐‘š+2, ๐‘ฆ(๐‘โˆ’1)๐‘š+2

1. Divide (macro) particles into N groups 2. Assign each group to each block and each particle to each thread

Page 21: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Sub-histograms using shared memory

21

Thread

Thread

Threadโ€ฆ

Sub-histogram 1

Shared Memory

Block 1

AtomicAdd

๐‘ฅ0, ๐‘ฆ0

๐‘ฅ1, ๐‘ฆ1

๐‘ฅ2, ๐‘ฆ2

โ€ฆ

Thread

Thread

Threadโ€ฆ

Sub-histogram N

Shared Memory

Block N

AtomicAdd

๐‘ฅ(๐‘โˆ’1)๐‘š, ๐‘ฆ(๐‘โˆ’1)๐‘š

๐‘ฅ(๐‘โˆ’1)๐‘š+1, ๐‘ฆ(๐‘โˆ’1)๐‘š+1

๐‘ฅ(๐‘โˆ’1)๐‘š+2, ๐‘ฆ(๐‘โˆ’1)๐‘š+2

Can be done in parallel

Note: Each thread in a common block adds entries in shared sub-histogram. But use โ€œexclusive addโ€ operation (called AtomicAdd function)

1. Divide (macro) particles into N groups 2. Assign each group to each block and each particle to each thread3. Sub-histogram in each shared memory be made in parallel.

Page 22: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Sub-histograms using shared memory

22

Thread

Thread

Threadโ€ฆ

Sub-histogram 1

Shared Memory

Block 1

AtomicAdd

๐‘ฅ0, ๐‘ฆ0

๐‘ฅ1, ๐‘ฆ1

๐‘ฅ2, ๐‘ฆ2

โ€ฆ

Sub-histogram 1

Sub-histogram N+ +

โ€ฆ

Global Memory

Total Histogram =

Thread

Thread

Threadโ€ฆ

Sub-histogram N

Shared Memory

Block N

AtomicAdd

๐‘ฅ(๐‘โˆ’1)๐‘š, ๐‘ฆ(๐‘โˆ’1)๐‘š

๐‘ฅ(๐‘โˆ’1)๐‘š+1, ๐‘ฆ(๐‘โˆ’1)๐‘š+1

๐‘ฅ(๐‘โˆ’1)๐‘š+2, ๐‘ฆ(๐‘โˆ’1)๐‘š+2

1. Divide (macro) particles into N groups 2. Assign each group to each block and each particle to each thread3. Sub-histogram in each shared memory be made in parallel.4. Copy sub-histograms to the global memory and make summation

Page 23: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Space Charge Effect

23

โ€ข Overview โ€ข Histogram Making (Charge weighting)โ€ข Poisson Solverโ€ข Electric field

Page 24: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Poisson Solver (Rectangular Coordinates)

24

๐œ•2๐‘ข

๐œ•๐‘ฅ2+๐œ•2๐‘ข

๐œ•๐‘ฆ2= ๐‘“(๐‘ฅ, ๐‘ฆ)

๐œ•๐‘ฆ

๐œ•๐‘ฅ=๐‘ฆ๐‘–+1 โˆ’ ๐‘ฆ๐‘–

โˆ†๐‘ฅ

Boundary Condition : ๐‘ข ๐‘ฅ, 0 = ๐‘ข ๐‘ฅ, ๐ฟ๐‘ฅ = ๐‘ข ๐‘ฆ, 0 = ๐‘ข ๐‘ฆ, ๐ฟ๐‘ฆ = 0

2D Poisson Equation (Rectangular Coordinates)

Discretization with

๐‘ข๐‘–โˆ’1,๐‘— โˆ’ 2๐‘ข๐‘–,๐‘— + ๐‘ข๐‘–+1

โˆ†๐‘ฅ2+๐‘ข๐‘–,๐‘—โˆ’1 โˆ’ 2๐‘ข๐‘–,๐‘— + ๐‘ข๐‘–,๐‘—+1

โˆ†๐‘ฆ2= ๐‘“๐‘–,๐‘—

Odd Extension for x

๐‘ˆ๐‘™,๐‘— = (0, ๐‘ข1,๐‘—, ๐‘ข2,๐‘— , โ‹ฏ , ๐‘ข๐‘š,๐‘— , 0, โˆ’๐‘ข๐‘š,๐‘— , โˆ’๐‘ข๐‘šโˆ’1,๐‘— , โ‹ฏ , โˆ’๐‘ข1,๐‘—)

๐‘–, ๐‘— = 1,โ‹ฏโ‹ฏ ,๐‘š

๐‘™ = 0,โ‹ฏโ‹ฏ , 2(๐‘š + 1) โˆ’ 1

Page 25: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Poisson Solver (Rectangular Coordinates)

25

๐ท๐น๐‘‡๐‘ฅ(๐‘ˆ๐‘™โˆ’1,๐‘— โˆ’ 2๐‘ˆ๐‘™,๐‘— + ๐‘ˆ๐‘™+1,๐‘—

โˆ†๐‘ฅ2)๐‘ = ๐‘ข1,๐‘— + ๐‘’

โˆ’๐‘–๐‘

2 ๐‘š+12๐œ‹

๐‘ข2,๐‘— โˆ’ 2๐‘ข1,๐‘— + ๐‘’โˆ’๐‘–

2๐‘2 ๐‘š+1

2๐œ‹๐‘ข3,๐‘— + ๐‘ข1,๐‘— โˆ’ 2๐‘ข2,๐‘—

= 0 + 1 โˆ’2๐‘’โˆ’๐‘–

๐‘2 ๐‘š+1

2๐œ‹+๐‘’

โˆ’๐‘–2๐‘

2 ๐‘š+12๐œ‹

๐‘ข1,๐‘— + ๐‘’โˆ’๐‘–

3๐‘2 ๐‘š+1

2๐œ‹โˆ’ 2๐‘’

โˆ’๐‘–2๐‘

2 ๐‘š+12๐œ‹+ ๐‘’

โˆ’๐‘–3๐‘

2 ๐‘š+12๐œ‹

๐‘ข2,๐‘—โ‹ฏ

= ๐‘’๐‘–

๐‘2 ๐‘š+1

2๐œ‹+ ๐‘’

โˆ’๐‘–๐‘

2 ๐‘š+12๐œ‹โˆ’ 2 0 + ๐‘’

โˆ’๐‘–๐‘

2 ๐‘š+12๐œ‹๐‘ข1,๐‘— + ๐‘’

โˆ’๐‘–2๐‘

2 ๐‘š+12๐œ‹๐‘ข2,๐‘— +โ‹ฏ

= โˆ’4๐‘ ๐‘–๐‘›2๐‘๐œ‹

2(๐‘š + 1)

๐‘™=0

2 ๐‘š+1 โˆ’1

๐‘’โˆ’๐‘–

๐‘๐‘™2 ๐‘š+1

2๐œ‹๐‘ˆ๐‘™,๐‘—

Odd Extension for y

๐‘‰๐‘™,๐‘™โ€ฒ = (0, ๐‘ˆ๐‘™,1, ๐‘ˆ๐‘™,2, โ‹ฏ , ๐‘ˆ๐‘™,๐‘š, 0, โˆ’๐‘ˆ๐‘™,๐‘š, โˆ’๐‘ˆ๐‘™,๐‘šโˆ’1, โ‹ฏ , โˆ’๐‘ˆ๐‘™,1)

๐‘™โ€ฒ = 0,โ‹ฏโ‹ฏ , 2(๐‘š + 1) โˆ’ 1

๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐‘‰๐‘™โˆ’1,๐‘™โ€ฒ โˆ’ 2๐‘‰๐‘™,๐‘™โ€ฒ + ๐‘‰๐‘™+1,๐‘™โ€ฒ

โˆ†๐‘ฅ2)๐‘)๐‘ž = โˆ’

4

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2(๐‘š + 1)

๐‘™=0

2 ๐‘š+1 โˆ’1

๐‘™โ€ฒ=0

2 ๐‘š+1 โˆ’1

๐‘’โˆ’๐‘–

๐‘๐‘™2 ๐‘š+1

2๐œ‹๐‘’โˆ’๐‘–

๐‘ž๐‘™โ€ฒ

2 ๐‘š+12๐œ‹๐‘‰๐‘™,๐‘™โ€ฒ

Page 26: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

๐น๐‘™,2 = (0, ๐‘“1,2, ๐‘“2,2, โ‹ฏ , ๐‘“๐‘š,2, 0, โˆ’๐‘“๐‘š,2, โˆ’๐‘“๐‘šโˆ’1,2, โ‹ฏ ,โˆ’๐‘“1,2)

๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐œ•2๐‘ข

๐œ•๐‘ฅ2+๐œ•2๐‘ข

๐œ•๐‘ฆ2)๐‘)๐‘ž โ†’ โˆ’4

1

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š + 1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š + 1

๐‘™=0

2 ๐‘š+1 โˆ’1

๐‘™โ€ฒ=0

2 ๐‘š+1 โˆ’1

๐‘’โˆ’๐‘–

๐‘๐‘™2 ๐‘š+1

2๐œ‹๐‘’โˆ’๐‘–

๐‘ž๐‘™โ€ฒ

2 ๐‘š+12๐œ‹๐‘‰๐‘™,๐‘™โ€ฒ

= โˆ’41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š + 1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š + 1๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐‘‰)๐‘)๐‘ž

๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž โ†’

๐‘™=0

2 ๐‘š+1 โˆ’1

๐‘™โ€ฒ=0

2 ๐‘š+1 โˆ’1

๐‘’โˆ’๐‘–

๐‘๐‘™2 ๐‘š+1

2๐œ‹๐‘’โˆ’๐‘–

๐‘ž๐‘™โ€ฒ

2 ๐‘š+12๐œ‹๐น๐‘™,๐‘™โ€ฒ

Odd Extension of ๐‘“๐‘–,๐‘—

๐น๐‘™,0 = (0, 0,0,โ‹ฏ , 0, 0,0,0,โ‹ฏ , 0)

๐น๐‘™,1 = (0, ๐‘“1,1, ๐‘“2,1, โ‹ฏ , ๐‘“๐‘š,1, 0, โˆ’๐‘“๐‘š,1, โˆ’๐‘“๐‘šโˆ’1,1, โ‹ฏ ,โˆ’๐‘“1,1)

๐น๐‘™,๐‘š = (0, ๐‘“1,๐‘š, ๐‘“2,๐‘š ,โ‹ฏ , ๐‘“๐‘š,๐‘š , 0, โˆ’๐‘“๐‘š,๐‘š, โˆ’๐‘“๐‘šโˆ’1,๐‘š ,โ‹ฏ ,โˆ’๐‘“1,๐‘š)

๐น๐‘™,๐‘š+1 = (0, 0,0,โ‹ฏ , 0, 0,0,0,โ‹ฏ , 0)

๐น๐‘™,๐‘š+2 = (0, โˆ’๐‘“1,๐‘š, -๐‘“2,๐‘š ,โ‹ฏ ,โˆ’๐‘“๐‘š,๐‘š , 0, ๐‘“๐‘š,๐‘š, ๐‘“๐‘šโˆ’1,๐‘š ,โ‹ฏ , ๐‘“1,๐‘š)

โ‹ฎ

Poisson Solver (Rectangular Coordinates)

26

( FFT result for the left-hand side of the equation )

( FFT result for the right-hand side of the equation )

Page 27: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Poisson Solver (Rectangular Coordinates)

27

๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐œ•2๐‘ข

๐œ•๐‘ฅ2+๐œ•2๐‘ข

๐œ•๐‘ฆ2)๐‘)๐‘ž = ๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

โˆ’41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š + 1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š + 1๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐‘‰)๐‘)๐‘ž = ๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐‘‰)๐‘)๐‘ž = โˆ’๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41โˆ†๐‘ฅ2

๐‘ ๐‘–๐‘›2๐‘๐œ‹

2 ๐‘š + 1+

1โˆ†๐‘ฆ2

๐‘ ๐‘–๐‘›2๐‘ž๐œ‹

2 ๐‘š + 1

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘ž โ‰  0๐‘ โ‰  0 ๐‘œ๐‘Ÿ

๐‘ = 0 ๐‘Ž๐‘›๐‘‘ ๐‘ž = 0 ๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐‘‰)0)0 =

๐‘™=0

2 ๐‘š+1 โˆ’1

๐‘™โ€ฒ=0

2 ๐‘š+1 โˆ’1

๐‘‰๐‘™,๐‘™โ€ฒ = 0 (๐‘‰๐‘™,๐‘™โ€ฒ is odd extension of ๐‘ข๐‘–,๐‘— )

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ 4 FFTs using GPU

Page 28: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Poisson Solver (Rectangular Coordinates)

28

Summary

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

1. Odd extension of charge distributions

Page 29: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Poisson Solver (Rectangular Coordinates)

29

Summary

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

1. Odd extension of charge distributions

2. Apply 2D FFT to the extended distributions

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

Page 30: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Poisson Solver (Rectangular Coordinates)

30

Summary

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

1. Odd extension of charge distributions

2. Apply 2D FFT to the extended distributions

3. Divide the FFT results by โˆ’41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

Page 31: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Poisson Solver (Rectangular Coordinates)

4. Apply 2D iFFT to 3

31

Summary

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

1. Odd extension of charge distributions

2. Apply 2D FFT to the extended distributions

3. Divide the FFT results by โˆ’41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

Page 32: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Poisson Solver (Rectangular Coordinates)

4. Apply 2D iFFT to 3

32

Summary

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

1. Odd extension of charge distributions

2. Apply 2D FFT to the extended distributions

3. Divide the FFT results by โˆ’41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

5. Extracted the solutions from the extended solutions.

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

๐‘‰๐‘™,๐‘™โ€ฒ โ†’ ๐‘ข๐‘–,๐‘—

๐‘‰๐‘™,๐‘™โ€ฒ = โˆ’๐‘–๐ท๐น๐‘‡๐‘ฆ(๐‘–๐ท๐น๐‘‡๐‘ฅ(๐ท๐น๐‘‡๐‘ฆ(๐ท๐น๐‘‡๐‘ฅ(๐น๐‘–,๐‘—)๐‘)๐‘ž

41

โˆ†๐‘ฅ2๐‘ ๐‘–๐‘›2

๐‘๐œ‹

2 ๐‘š+1+

1

โˆ†๐‘ฆ2๐‘ ๐‘–๐‘›2

๐‘ž๐œ‹

2 ๐‘š+1

)๐‘™)๐‘™โ€ฒ

Page 33: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Space Charge Effect

33

โ€ข Overview โ€ข Histogram Making (Charge weighting)โ€ข Poisson Solverโ€ข Electric field

Page 34: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Rectangular Coordinate

Electric Field

34

Interpolate potential using Bezier Surface

๐œ‘ ๐‘ฅ, ๐‘ฆ =

๐‘š=0

3

๐‘›=0

3

๐œ‘(๐‘ฅ๐‘–+๐‘šโˆ’1, ๐‘ฆ๐‘—+๐‘›โˆ’1)3!

๐‘š! (3 โˆ’ ๐‘š)!(๐‘ฅ โˆ’ ๐‘ฅ๐‘–๐›ฟ๐‘ฅ

)๐‘š(๐‘ฅ๐‘–+1 โˆ’ ๐‘ฅ

๐›ฟ๐‘ฅ)3โˆ’๐‘š

ร—3!

๐‘›! (3 โˆ’ ๐‘›)!(๐‘ฆ โˆ’ ๐‘ฆ๐‘—

๐›ฟ๐‘ฆ)๐‘›(

๐‘ฆ๐‘—+1 โˆ’ ๐‘ฆ

๐›ฟ๐‘ฆ)3โˆ’๐‘›

๐‘ฅ๐‘– , ๐‘ฆ๐‘— ๐‘ฅ๐‘–+1, ๐‘ฆ๐‘—

๐‘ฅ๐‘–+1, ๐‘ฆ๐‘—+1๐‘ฅ๐‘– , ๐‘ฆ๐‘–+1

-1

๐‘ฅ๐‘–โˆ’1, ๐‘ฆ๐‘—

๐‘ฅ๐‘–โˆ’1, ๐‘ฆ๐‘–+1

๐‘ฅ๐‘–+2, ๐‘ฆ๐‘—

๐‘ฅ๐‘–+2, ๐‘ฆ๐‘—+1

๐‘ฅ๐‘– , ๐‘ฆ๐‘–+2 ๐‘ฅ๐‘–+1, ๐‘ฆ๐‘—+2

๐‘ฅ๐‘– , ๐‘ฆ๐‘—โˆ’1 ๐‘ฅ๐‘–+1, ๐‘ฆ๐‘—โˆ’1

๐ธ ๐‘ฅ, ๐‘ฆ = โˆ’๐‘”๐‘Ÿ๐‘Ž๐‘‘ ๐œ‘ ๐‘ฅ, ๐‘ฆ = โˆ’(๐œ•

๐œ•๐‘ฅ,๐œ•

๐œ•๐‘ฆ)๐œ‘(๐‘ฅ, ๐‘ฆ)

Page 35: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Application to J-PARC Main Ring

35

Page 36: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

J-PARC Main Ring (MR)

36

Circumference 1568 m

Injection Energy 3 GeV

Extraction Energy 30 GeV

Transverse Tune (21.35, 21.45)

Synchrotron Tune 0.002 โ†’ 0.00015

Transition gt j32.5

RF frequency 1.67โ†’1.72 MHz

Harmonics 9

J-PARC MR

Extraction to NU

Injection from RCS

2.48 s

Specifications of J-PARC MR

Present Operation Cycle for NU

Intensity ~ 500 kW (8 bunches)Protons per bunch > 3x1013

Page 37: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Simulation of J-PARC Main Ring

37

2700 sec /10000 turns using NVIDIA TESLA V100

At least 10 times faster than CPU simulation that we usually use for J-PARC MR

โ€ข (nx, ny) = (21.35, 21.45)โ€ข 3x1013 ppbโ€ข 200000 macro-particles โ€ข Rf 1st 160 kV 2nd 110 kVโ€ข Bunch factor @ Inj = 0.2โ€ข 2s emittance @ Inj 16p for horizontal and verticalโ€ข Aperture 65p for horizontal and verticalโ€ข Number of Components๏ผš~1600 / turnโ€ข Number of Locations for SC calculations๏ผš~1000 points /turn

Conditions

Page 38: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Preliminary Result

38

Beam Survival

Bunch Factor Iaverage/Ipeak

Simulation Measurement

Transverse Tunes

๏ฝž1 %

Operating Point๏ผˆ21.35,21.45๏ผ‰

Tune SpreadDn = 0.3-0.4

0.2 @ Injection ~0.3 after 1000 turns

Seems correctly working.

Page 39: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Current Issues

39

The calculations here were already implemented in my code. But they are not included in the results shown in the last slide. This is because they does not reproduce our measurements so far.

Page 40: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

2D Approximation (๐œŽ๐‘ง โ‰ซ ๐œŽ๐‘ฅ,๐‘ฆ)

โ€ข ๐‘‘๐‘–๐‘ฃ๐ธ =๐œŒ(๐‘ฅ,๐‘ฆ)

๐œ€0, ๐ธ = โˆ’๐‘”๐‘Ÿ๐‘Ž๐‘‘ ๐œ‘๐ธ(๐‘ฅ, ๐‘ฆ)

โˆ†๐œ‘๐ธ ๐‘ฅ, ๐‘ฆ = โˆ’๐œŒ ๐‘ฅ, ๐‘ฆ

ํœ€0

Electric Field

Magnetic Field

โ€ข ๐‘Ÿ๐‘œ๐‘ก๐ต =๐‘–(๐‘ฅ,๐‘ฆ)

๐œ€0๐‘2 , ๐ต = ๐‘Ÿ๐‘œ๐‘ก ิฆ๐ด ๐‘ฅ, ๐‘ฆ , ๐‘– ๐‘ฅ, ๐‘ฆ = ๐›ฝ0๐‘๐œŒ(๐‘ฅ, ๐‘ฆ)

โˆ†๐ด๐‘ง ๐‘ฅ, ๐‘ฆ = โˆ’๐œŒ ๐‘ฅ, ๐‘ฆ ๐›ฝ0

ํœ€0๐‘โ†’ โˆ†๐œ‘๐ต ๐‘ฅ, ๐‘ฆ = โˆ’

๐œŒ ๐‘ฅ, ๐‘ฆ

ํœ€0(๐œ‘๐ต ๐‘ฅ, ๐‘ฆ =

๐‘

๐›ฝ0๐ด๐‘ง(๐‘ฅ, ๐‘ฆ))

In free space, ๐œ‘๐ธ(๐‘ฅ, ๐‘ฆ) and ๐œ‘๐ต ๐‘ฅ, ๐‘ฆ are same. (satisfy same equation )

Origin of the coefficient ๐‘’

๐‘š๐‘๐›พ๐‘3๐›ฝ๐‘

2๐‘2(1)

40

(Using Coulomb Gauge)

Page 41: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Using ิฆ๐น ๐‘ฅ, ๐‘ฆ = ๐น๐ธ ๐‘ฅ, ๐‘ฆ + ๐น๐ต ๐‘ฅ, ๐‘ฆ =๐‘‘

๐‘‘๐‘ก๐‘ƒ = ๐‘ƒ0๐›ฝ0๐‘

๐‘‘

๐‘‘๐‘ แˆถ๐‘ฅ ๐‘  , แˆถ๐‘ฆ ๐‘  (Equation of Motion),

๐‘‘

๐‘‘๐‘ แˆถ๐‘ฅ ๐‘  , แˆถ๐‘ฆ ๐‘  = โˆ’

๐‘ž

๐‘š๐›ฝ02๐›พ0

3๐‘2

๐œ•

๐œ•๐‘ฅ,๐œ•

๐œ•๐‘ฆ๐œ‘(๐‘ฅ, ๐‘ฆ)

๐น๐ธ ๐‘ฅ, ๐‘ฆ = โˆ’๐‘ž๐œ•

๐œ•๐‘ฅ,๐œ•

๐œ•๐‘ฆ๐œ‘๐ธ(๐‘ฅ, ๐‘ฆ)

๐น๐ต ๐‘ฅ, ๐‘ฆ = ๐‘ž 0,0, ๐›ฝ0๐‘ ร—๐œ•

๐œ•๐‘ฅ,๐œ•

๐œ•๐‘ฆ,๐œ•

๐œ•๐‘งร— 0,0, ๐ด๐‘ง ๐‘ฅ, ๐‘ฆ = โˆ’๐‘ž

๐œ•

๐œ•๐‘ฅ,๐œ•

๐œ•๐‘ฆ(โˆ’๐›ฝ0

2๐œ‘๐ต ๐‘ฅ, ๐‘ฆ )

This is correct only when the beam is in infinite free space. ๐œ‘๐ธ ๐‘ฅ, ๐‘ฆ = ๐œ‘๐ต ๐‘ฅ, ๐‘ฆ

In general, however, electric and magnetic fields satisfy different boundary conditions

The forces on a test particle by electric and magnetic fields are written as

๐‹๐‘ฌ ๐’™, ๐’š โ‰  ๐‹๐‘ฉ ๐’™, ๐’š

Origin of the coefficient ๐‘’

๐‘š๐‘๐›พ๐‘3๐›ฝ๐‘

2๐‘2(2)

41

Page 42: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Boundary Conditions with Beam Ducts

42

Electric Field Magnetic Field

๐œ‘๐ธ ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ธ ๐‘ฅ, ยฑ๐‘Œ/2 = Const.

๐‘‹/2

๐‘Œ/2

Skin depth ๐›ฟ(frequency of the beam) << Duct depth ๐‘ค

Same potential at duct surfaces

Yes (fast)

๐ต๐‘ฆ ๐‘ฅ, ยฑ๐‘Œ

2= โˆ’

๐œ•

๐œ•๐‘ฅ๐œ‘๐ต(๐‘ฅ, ยฑ

๐‘Œ

2) = 0

๐ต๐‘ฅ ยฑ๐‘‹

2, ๐‘ฆ =

๐œ•

๐œ•๐‘ฆ๐œ‘๐ต(ยฑ

๐‘‹

2, ๐‘ฆ) = 0

B is tangential to duct surfaces

๐‘ค

Page 43: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Boundary Conditions with Beam Ducts

43

Electric Field Magnetic Field

๐œ‘๐ธ ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ธ ๐‘ฅ, ยฑ๐‘Œ/2 = Const.

๐‘‹/2

๐‘Œ/2

Skin depth ๐›ฟ(frequency of the beam) << Duct depth ๐‘ค

Same potential at duct surfaces

Yes (fast)

๐ต๐‘ฆ ๐‘ฅ, ยฑ๐‘Œ

2= โˆ’

๐œ•

๐œ•๐‘ฅ๐œ‘๐ต(๐‘ฅ, ยฑ

๐‘Œ

2) = 0

๐ต๐‘ฅ ยฑ๐‘‹

2, ๐‘ฆ =

๐œ•

๐œ•๐‘ฆ๐œ‘๐ต(ยฑ

๐‘‹

2, ๐‘ฆ) = 0

B is tangential to duct surfaces

๐œ‘๐ต ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ต ๐‘ฅ, ยฑ๐‘Œ/2 = Const.๐‹๐‘ฉand ๐‹๐‘ฌ can be commonly calculated

๐‘ค

Page 44: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Boundary Conditions with Beam Ducts

44

Electric Field Magnetic Field

๐œ‘๐ธ ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ธ ๐‘ฅ, ยฑ๐‘Œ/2 = Const.

๐‘‹/2

๐‘Œ/2

Skin depth ๐›ฟ(frequency of the beam) << Duct depth ๐‘ค

๐œ‘๐ต ยฑโˆž = 0

Same as free space

Same potential at duct surfaces

No (slow)Yes (fast)

๐ต๐‘ฆ ๐‘ฅ, ยฑ๐‘Œ

2= โˆ’

๐œ•

๐œ•๐‘ฅ๐œ‘๐ต(๐‘ฅ, ยฑ

๐‘Œ

2) = 0

๐ต๐‘ฅ ยฑ๐‘‹

2, ๐‘ฆ =

๐œ•

๐œ•๐‘ฆ๐œ‘๐ต(ยฑ

๐‘‹

2, ๐‘ฆ) = 0

B is tangential to duct surfaces

๐œ‘๐ต ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ต ๐‘ฅ, ยฑ๐‘Œ/2 = Const.๐‹๐‘ฉand ๐‹๐‘ฌ can be commonly calculated

๐‘ค

Page 45: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Boundary Conditions with Beam Ducts

45

Electric Field Magnetic Field

๐œ‘๐ธ ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ธ ๐‘ฅ, ยฑ๐‘Œ/2 = Const.

๐‘‹/2

๐‘Œ/2

Skin depth ๐›ฟ(frequency of the beam) << Duct depth ๐‘ค

๐œ‘๐ต ยฑโˆž = 0

Same as free space

Same potential at duct surfaces

No (slow)Yes (fast)

๐ต๐‘ฆ ๐‘ฅ, ยฑ๐‘Œ

2= โˆ’

๐œ•

๐œ•๐‘ฅ๐œ‘๐ต(๐‘ฅ, ยฑ

๐‘Œ

2) = 0

๐ต๐‘ฅ ยฑ๐‘‹

2, ๐‘ฆ =

๐œ•

๐œ•๐‘ฆ๐œ‘๐ต(ยฑ

๐‘‹

2, ๐‘ฆ) = 0

B is tangential to duct surfaces

๐œ‘๐ต ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ต ๐‘ฅ, ยฑ๐‘Œ/2 = Const.

๐‹๐‘ฉand ๐‹๐‘ฌ must be separately calculated

๐‹๐‘ฉand ๐‹๐‘ฌ can be commonly calculated

๐‘ค

Page 46: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Free Space 2D Poisson Equation

46

๐œ‘(๐‘ฅ, ๐‘ฆ) =1

2๐œ‹เถฑ๐œŒ(๐‘ฅโ€ฒ, ๐‘ฆโ€ฒ) ln

1

(๐‘ฅ โˆ’ ๐‘ฅโ€ฒ)2+(๐‘ฆ โˆ’ ๐‘ฆโ€ฒ)2๐‘‘๐‘ฅโ€ฒ๐‘‘๐‘ฆโ€ฒ

1. Find potential at the boundary using the Green function*

2. Modify the differential equation

Obtained by the Green function

โˆ’2๐‘ข1,๐‘— + ๐‘ข2,๐‘—

โˆ†๐‘ฅ2+๐‘ข1,๐‘—โˆ’1 โˆ’ 2๐‘ข1,๐‘— + ๐‘ข1,๐‘—+1

โˆ†๐‘ฆ2= ๐‘“1,๐‘— โˆ’

๐‘ข0,๐‘—

โˆ†๐‘ฅ2

Modifying charge distribution near the boundary

* Calculating whole region using the Green function costs a lot since it needs O(n2) operations

๐‘ข0,๐‘— โˆ’ 2๐‘ข1,๐‘— + ๐‘ข2,๐‘—

โˆ†๐‘ฅ2+๐‘ข1,๐‘—โˆ’1 โˆ’ 2๐‘ข1,๐‘— + ๐‘ข1,๐‘—+1

โˆ†๐‘ฆ2= ๐‘“1,๐‘—

Page 47: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

In case of J-PARC Main Ring (1)

47

๐œ‘๐ธ ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ธ ๐‘ฅ, ยฑ๐‘Œ/2 = Const. ๐œ‘๐ต ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ต ๐‘ฅ, ยฑ๐‘Œ/2 = Const.1. Same Boundary Condition

โžข Comparison with measurement of coherent tune shift

BM duct height 100mm(real value)

BM duct height 60mm(good agreement with measurement )

Bending Magnet Duct

131 mm

100 mm

60 mm

Simulation Results

Need to make duct height unreasonably smaller

๐œ‘

Page 48: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

In case of J-PARC Main Ring (2)

48

๐œ‘๐ธ ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ธ ๐‘ฅ, ยฑ๐‘Œ/2 = Const.2. ๐œ‘๐ต ยฑโˆž = 0

๐œ‘๐ธ ๐œ‘๐ต ๐œ‘๐ธ โˆ’ ๐›ฝ02๐œ‘๐ต

Potential Distribution in a BM Duct

Incoherent tune shifts to vertical direction are so large and cause huge beam loss within a few turnsโ€ฆ

Need to consider other physics

Page 49: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

One Possibility Boundary with Magnetic Material

49

โ€ข ๐ต at the surface of ferromagnetic material must be perpendicular to the surface ( ๐›ฟ โ‰ช ๐‘ค)

โ€ข The cores of the BMs touch with all horizontal surface of the duct. (J-PARC MR)

โžข Use image current density so that the tangential components of ๐ต can be eliminated

๐‘–๐‘–๐‘š๐‘Ž๐‘”๐‘’(๐‘ฅ, ๐‘ฆ) =[๐‘– ๐‘ฅ, โˆ’1 ๐‘›๐‘ฆ + ๐‘›๐‘Œ ]

Page 50: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

๐œ‘(๐‘ฅ, ๐‘ฆ) =1

2๐œ‹เถฑ(๐œŒ ๐‘ฅโ€ฒ, ๐‘ฆโ€ฒ + ๐œŒ๐‘–๐‘š๐‘Ž๐‘”๐‘’ ๐‘ฅโ€ฒ, ๐‘ฆโ€ฒ )ln

1

(๐‘ฅ โˆ’ ๐‘ฅโ€ฒ)2+(๐‘ฆ โˆ’ ๐‘ฆโ€ฒ)2๐‘‘๐‘ฅโ€ฒ๐‘‘๐‘ฆโ€ฒ

1. Find potential including image current at the boundary using the Green function*

2. Modify the differential equation (same as for free space )

Finding Potential with Image Current

50

๐œŒ๐‘–๐‘š๐‘Ž๐‘”๐‘’(๐‘ฅ, ๐‘ฆ) =[๐œŒ ๐‘ฅ, โˆ’1 ๐‘›๐‘ฆ + ๐‘›๐‘Œ ]

Page 51: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

In case of J-PARC Main Ring (3)

51

๐œ‘๐ธ ยฑ๐‘‹/2, ๐‘ฆ = ๐œ‘๐ธ ๐‘ฅ, ยฑ๐‘Œ/2 = Const.2. ๐ต๐‘ฅ ๐‘ฅ, ยฑ๐‘Œ/2 = ๐ต๐‘ฆ ยฑ๐‘‹/2, ๐‘ฆ = 0

๐œ‘๐ธ ๐œ‘๐ต ๐œ‘๐ธ โˆ’ ๐›ฝ02๐œ‘๐ต

Potential Distribution in a BM Duct

Incoherent tune shifts to vertical direction are still so large and cause huge beam loss within a few turnsโ€ฆ

The potential in the BM duct can not be simply modeled. May need combinations of phenomena shown here ??

Page 52: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Summary

โ€ข Particle tracking simulation code with space charge effect has been developed for GPU usage.

โ€ข Not only single particle mechanics but also space charge calculation can be accelerated using FFT.

โ€ข For the simulation of J-PARC MR, the developed code with GPU is at least 10 times faster than our official(?) code with CPU.

โ€ข Currently working on the calculation of SC in thin rectangular ducts.

52

Page 53: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Backup

53

Page 54: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Canonical Valuables

54

๐‘ฅ : horizontal coordinate of a plane perpendicular to the reference orbit

๐›ฟ =๐‘โˆ’๐‘0

๐‘0โ‰ˆ ๐‘๐œŽ โˆ’

1

2๐›พ02 ๐‘๐œŽ

2,

๐‘๐‘ฅ : momentum of ๐‘ฅ direction normalized by the reference momentum ๐‘0

๐‘ฆ : vertical coordinate of a plane perpendicular to the reference orbit

๐‘๐œŽ =๐ธโˆ’๐ธ0

๐›ฝ0๐‘0๐‘: canonical conjugate of ๐œŽ

๐‘๐‘ฆ : momentum of ๐‘ฆ direction normalized by the reference momentum ๐‘0

๐œŽ = ๐‘  โˆ’ ๐›ฝ0๐‘ก

Implemented Components

Page 55: Particle Tracking with Space Charge Effect using GPU...Particle Tracking with Space Charge Effect using GPU Yoshi Kurimoto J-PARC/KEK J-PARC Main Ring Power Converter Group 1 References

Ex2 Acceleration

โ€ข Cavity

55

๐‘‰๐‘…๐น : Amplitude of RF voltage, ๐‘“๐‘…๐น : RF frequency, ๐‘› : n-th order harmonics, ๐œ‘๐‘  : Synchrotron phase

๐‘๐‘ฅ(๐‘ ) = ๐‘๐‘ฅ 0 ๐‘๐‘ฆ(๐‘ ) = ๐‘๐‘ฆ 0 ๐‘๐œŽ ๐‘  = ๐‘๐œŽ 0 +๐‘’๐‘‰๐‘…๐น

๐‘š๐›พ๐›ฝ๐‘2(sin

2๐œ‹๐‘“๐‘…๐น

๐›ฝ๐‘๐œŽ 0 + ๐œ‘๐‘  โˆ’ sin๐œ‘๐‘ )

๐‘ฆ ๐‘  = ๐‘ฆ 0 ๐œŽ ๐‘  = ๐œŽ 0๐‘ฅ ๐‘  = ๐‘ฅ 0

โ€ข Adiabatic Damping (turn by turn)

๐‘๐‘ฅ,๐‘›+1 = ๐‘๐‘ฅ,๐‘›(1 โˆ’โˆ†๐ธ

๐‘š๐›พ๐‘›๐›ฝ๐‘›2)

๐‘๐‘ฆ,๐‘›+1 = ๐‘๐‘ฆ,๐‘›(1 โˆ’โˆ†๐ธ

๐‘š๐›พ๐‘›๐›ฝ๐‘›2)

๐‘๐œŽ,๐‘›+1 = ๐‘๐œŽ,๐‘›(1 โˆ’โˆ†๐ธ(1 +

1๐›พ๐‘›

2)

๐‘š๐›พ๐‘›๐›ฝ๐‘›2 )


Recommended