Presentation is loading. Please wait.

Presentation is loading. Please wait.

Development of JSPEC for Cooling Simulation

Similar presentations


Presentation on theme: "Development of JSPEC for Cooling Simulation"— Presentation transcript:

1 Development of JSPEC for Cooling Simulation
He Zhang Computational Accelerator Physicist CASA JLEIC Collaboration Meeting April 1-3, 2019

2 Overview Three categories of program on electron cooling simulation:
Theoretical formula to calculate the friction force, the evolution of the macroscopic parameters of the ion beam, eg. emittance, momentum spread, bunch length, etc. (BETACOOL, JSPEC) Multi-particle simulation, one or a few ions’ motion inside the electron beam, friction force calculation and benchmarking. (Tech-X) Multi-particle simulation based on the first principle, collision and motion of the electron beam and the ion beam. (Prof. Erdelyi, NIU)

3 JSPEC: JLab Simulation Package for Electron Cooling
Developed at JLab for JLEIC Calculate the IBS rate and electron cooling rate Simulate the IBS and/or electron cooling process C++, open source Benchmarked with BETACOOL Text-based user interface (UI) Online version by Radiasoft LLC

4 IBS expansion rate Currently two formulas have been implemented:
Martini model [1] Bjorken-Mtingwa model [2] using Nagaitsev’s formula [3] Limits: Both assume the disappearance of the vertical dispersion. [1] Martini, M. Intrabeam scattering in the ACOL-AA machines. No. CERN-PS-84-9-AA. SCAN , 1984. [2] Bjorken, James D., and Sekazi K. Mtingwa. "Intrabeam scattering." Part. Accel. 13, no. FERMILAB-PUB THY (1982): [3] Nagaitsev, Sergei. "Intrabeam scattering formulas for fast numerical evaluation." Physical Review Special Topics-Accelerators and Beams 8, no. 6 (2005):

5 Cooling rate Monte Carlo model : sample the ion beam with particles of Gaussian distribution Sample the ions w.r.t the emittance, bunch length, momentum spread. Calculate the electron charge density around each ion Convert into beam frame Calculate the friction force on each ion (Parkhomchuk formula) Convert back to lab frame Each ion feels a kick as 𝑑𝒑=𝑭⋅𝑑𝑡. Emittace is calculated statistically as Calculate the cooling rate (the change of emittance in a unit time)

6 Cooling process simulation
Three models: RMS dynamic model (Gaussian distribution) Particle model Turn-by-turn model Four-step procedure: Create sample ions Calculate the expansion rate under the IBS and/or electron cooling effect Update the beam parameters and the sample ions, and Repeat till the end.

7 RMS dynamic method in the four-step procedure:
Create sample ions w.r.t. the given emittance Calculate the expansion rate under the IBS and/or electron cooling effect Update the beam parameters using 𝜀 𝑛𝑒𝑤 = 𝜀 𝑜𝑙𝑑 ⋅ 𝑒 𝑑𝑡/𝜏 , create new sample ions w.r.t. the new emittance, and repeat till the end time

8 Particle model in the four-step procedure:
Create sample ions with the given initial distribution Calculate the IBS rate and/or the friction force. Apply the IBS kick on each particle as 𝜃 2 = 𝜀 𝛽 ⊥ 𝑑𝑡 𝜏 𝐼𝐵𝑆 , Δ𝜃= 𝜃 2 ⋅𝜉, Gaussian random number 𝜉, 𝜎 𝜉 =1; apply the electron cooling kick as 𝑑𝒑=𝑭⋅𝑑𝑡⋅𝑓⋅ 𝑡 𝑐𝑜𝑜𝑙𝑒𝑟 ⋅ 𝑁 𝑐𝑜𝑜𝑙𝑒𝑟 ; apply a random phase advance for each particle; calculate new emittance and expansion rate; and 4. repeat till the end time.

9 Turn-by-turn model: The particle model can be easily modified to a manner of turn-by-turn tracking. Replace the time step with the period of the circular motion of the ion. Replace the random phase advance with a one-turn map. Turn-by-turn model honestly models the betatron and synchrotron motion of the ion beam. Slow, not suitable for long time cooling/IBS simulation. Used to benchmark the other tow models.

10 Benchmark RMS dynamic model with turn-by-turn model:
Simulate 10,000 or 1000,000 protons for one second and 10 seconds using the turn-by-turn model. Compare with the RMS dynamic model with step size of one second or ten seconds. Estimate the maximum accumulated error for one hour. Max Error of Emit. For One Step Size N=10,000 N=100,000 Δt=1s 1.54×10-5 2.42×10-6 Δt=10s 3.06×10-4 1.04×10-4 The smaller the time step is, the smaller the error we get. The larger the number of particles is, the smaller the error we get. If we use step size no more than one second, and number of particles no less than 100,000, the simulation results should be accurate enough (at least for now). Note that we assume the proton beam still has Gaussian distribution. Max Accu. Error of Emit. in One Hour N=10,000 N=100,000 Δt=1s 5.70% 0.88% Δt=10s 11.65% 3.81%

11 Benchmark particle model with turn-by-turn model:
Simulate the cooling on the proton beam for 10 seconds with particle model using different step sizes to compare with the turn-by-turn model. Cooling is enhanced by 100 times to observe detour from the Gaussian distribution. Electron beam size is smaller than the proton beam size. dt = 0.1 s, results are almost identical. dt = 0.5 s, the deviation starts to show, but not large. dt = 1 s, the deviation becomes larger. Taking a step size between 0.1 s – 0.5 s is acceptable.

12 Model of the electron beam
Electron beam with regular shape: DC beam with uniform distribution and round cross section. DC beam with uniform distribution and elliptical cross section. DC hollow beam with uniform distribution and round cross section. Bunched beam with uniform distribution and round cross section. Bunched beam with uniform distribution and elliptical cross section. Bunched hollow beam with uniform distribution and round cross section. Bunched beam with Gaussian distribution.

13 Electron beam with arbitrary shape:
The electron bunch is defined by sample particles with 6D coordinates (x, y, z, vx, vy, vz) saved in a asci/binary file. (x, y, z) is the position of a sample particle in the lab frame. (vx, vy, vz) is the velocity of the a sample particle in the beam frame. A tree-based algorithm is used to calculate the local charge density and temperature for a given ion. The tree only needs to be constructed once if the electron bunch is assumed not changing during the cooling.

14 𝑁 𝑒 = 10 6 ,𝑆=200 gives the best result.
Compare the cooling rate of a perfect Gaussian bunch with one that is represented by sample particles. Rx (1/s) Ry (1/s) Rz (1/s) Perfect Gaussian 𝑁 𝑒 = 10 6 , 𝑆=50 𝑁 𝑒 = 10 6 , 𝑆=100 𝑁 𝑒 = 10 6 , 𝑆=200 𝑁 𝑒 = 10 6 , 𝑆=300 𝑁 𝑒 = 10 6 , 𝑆=400 𝑁 𝑒 = 10 6 ,𝑆=200 gives the best result. Good to see the results is not very sensitive to the change of 𝑆, which means even if 𝑆 deviates from the optimal value a little, the result will not be too bad.

15 Benchmark with BETACOOL
IBS of coasting ion beam IBS of bunched ion beam

16 DC cooling only with particle model
DC cooling only with RMS model

17 Bunched beam cooling only with particle model
Bunched beam cooling only with RMS model

18 DC cooling & IBS with particle model
Bunched beam cooling & IBS with RMS model DC cooling & IBS with particle model

19 Parallelization Parallelization for shared memory structure: GPU, Intel Xeon Phi, or just a multi-core PC. Parallelization is based on thrust, a parallel algorithm library that supports CUDA, TBB (Threading Building Blocks) and OpenMP. IBS rate calculation, 100x100x100 grid: NVidia GTX 660 ti GPU: 7.76 s CPU AMD Phenom™ II X4 840T Processor 2.9GHz: 62 s Electron cooing rate calculation: 200,000 samples: GPU 0.03 s CPU s 40,000 samples: GPU s CPU s Efficiency is NOT the bottleneck of this program.

20 UI UI of JSPEC Inspired by ELEGANT
An input file is composed of a few sections and should be ended by the section_run Three kinds of sections The only section that allows you to define some variables, do some simple calculation with them, and use them in the following sections. Like your scratch paper. You can have multipole scratch sections and put them anywhere you like. Calculations and simulations are carried out. Run JSPEC in command line: > jspec.exe input_file_name

21 Use of the scratch section
User can define variables and perform calculations on the variables. These variables can be used in the following sections Reserved variables are used to save the calculation/simulation results and can be used in the following calculation/simulations. Use of the operation section Create objectives, eg. ion beam, electron beams, ring, cooler, etc. Perform calculation/simulation. Use of the defination sections Define the objectives. Set up calculation/simulation parameters.

22 Anything follows a “#” is a comment.
A list of the key words for all the sections can be found in the user manual on Github.

23 Continue …

24 Online version by Radiasoft LLC

25

26

27 Summary JSPEC is developed at JLab for JLEIC but we also try to make it a general tool for electron cooling simulation. JSPEC calculates the IBS expansion rate and the electron cooling rate, and it simulates the evolution of the ion beam during electron cooling process (w. IBS). JSPEC provides a group of predefined electron beam model and it also supports an arbitrary electron beam represented by particles (provided by the user). JSPEC has been benchmarked with BETACOOL. JSEPC has a text-based UI. An online version of JSPEC is provided by Radiasoft LLC, which makes it easier to visualize your result and share your simulation. We actively use JSPEC in the electron cooling simulations for JLEIC. We keep updating JSPEC. JSPEC is open source, available through


Download ppt "Development of JSPEC for Cooling Simulation"

Similar presentations


Ads by Google