1 / 102

PyECLOUD

PyECLOUD. G. Iadarola , G. Rumolo. Thanks to: R. De Maria, K. Li. ECLOUD meeting 28/11/2011. Outline. Why a new code for electron cloud build-up simulation? From ECLOUD to PyECLOUD Management of macroparticle size and number Back-tracking algorithm for the impacting electrons

shae
Télécharger la présentation

PyECLOUD

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PyECLOUD G. Iadarola, G. Rumolo Thanks to: R. De Maria, K. Li ECLOUD meeting 28/11/2011

  2. Outline • Why a new code for electron cloud build-up simulation? • From ECLOUD to PyECLOUD • Management of macroparticle size and number • Back-tracking algorithm for the impacting electrons • Beam field calculation • Space charge field • Preliminary convergence study • PyECLOUD at work • Conclusion and future work

  3. Outline • Why a new code for electron cloud build-up simulation? • From ECLOUD to PyECLOUD • Management of macroparticle size and number • Back-tracking algorithm for the impacting electrons • Beam field calculation • Space charge field • Preliminary convergence study • PyECLOUD at work • Conclusion and future work

  4. Why a new code for electron cloud build-up simulation? • At the very beginning our idea was to reorganize ECLOUD in order to make it easier the development of new features, to identify and correct of present and future bugs, to access to a larger amount of information about our simulations.

  5. Why a new code for electron cloud build-up simulation? • At the very beginning our idea was to reorganize ECLOUD in order to make it easier the development of new features, to identify and correct of present and future bugs, to access to a larger amount of information about our simulations. • This task has revealed to be quite hard since: • The code is scarcely modular: the frequent use of global variables makes very difficult to extract subroutines and building self consistent modules for development and testing purposes • In Fortran 77 is very difficult to write readable and flexible code (even a proper indentation is a non-trivial task)

  6. Why a new code for electron cloud build-up simulation? • At the very beginning our idea was to reorganize ECLOUD in order to make it easier the development of new features, to identify and correct of present and future bugs, to access to a larger amount of information about our simulations. • We have retained that the effort of writing a fully reorganized code,in a newer and more powerful language, should be compensated by a significantly increased efficiency in future development and debugging.

  7. Python • It is a powerful general purpose interpreted language: • Allows incremental and interactive development of the code, encouraging an highly modular structure. Reading and understanding the code, writing extensions, exploring different solutions is much faster (orders of magnitude!!) with respect to compiled languages (especially looking at FORTRAN 77) • Open source libraries (like NumPy and SciPy) make it a very powerful tool for scientific computation (comparable to a specialized commercial tool like MATLAB) • Computationally intensive parts can be written in C/C++ or FORTRAN and easily integrated in a Python code (successfully employed in our distribution computation/interpolation routines – x6 overall speed up)

  8. Outline • Why a new code for electron cloud build-up simulation? • From ECLOUD to PyECLOUD • Management of macroparticle size and number • Back-tracking algorithm for the impacting electrons • Beam field calculation • Space charge field • Preliminary convergence study • PyECLOUD at work • Conclusion and future work

  9. From ECLOUD to PyECLOUD • Writing PyECLOUD has required a detailed analysis of ECLOUD algorithm and implementation, looking also at the related long experience in electron cloud simulations. • Attention has been devoted to the individuation of ECLOUD limitations, in particular in terms of its convergence properties with respect to the electron distribution in bending magnets (how many stripes…)

  10. From ECLOUD to PyECLOUD • Writing PyECLOUD has required a detailed analysis of ECLOUD algorithm and implementation, looking also at the related long experience in electron cloud simulations. • Attention has been devoted to the individuation of ECLOUD limitations, in particular in terms of its convergence properties with respect to the electron distribution in bending magnets (how many stripes…) • As a result, several features have been significantly modified in order to improve the code’s performances in terms: • Accuracy • Efficiency • Flexibility

  11. Ingredients for e-cloud build-up simulation • 1. Seed electrons generation • (gas ionization, photoemission)

  12. Ingredients for e-cloud build-up simulation • 1. Seed electrons generation • (gas ionization, photoemission) • 2. Force exerted by the beam on e-

  13. Ingredients for e-cloud build-up simulation • 1. Seed electrons generation • (gas ionization, photoemission) • 2. Force exerted by the beam on e- • 3. Force exerted by the e- on each other • (space charge)

  14. Ingredients for e-cloud build-up simulation • 1. Seed electrons generation • (gas ionization, photoemission) • 2. Force exerted by the beam on e- • 3. Force exerted by the e- on each other • (space charge) • 4. Equations of motion • (also in presence of an external magnetic field)

  15. Ingredients for e-cloud build-up simulation • 1. Seed electrons generation • (gas ionization, photoemission) • 2. Force exerted by the beam on e- • 3. Force exerted by the e- on each other • (space charge) • 4. Equations of motion • (also in presence of an external magnetic field) • 5. Secondary emission

  16. From ECLOUD to PyECLOUD • The most relevant improvements introduced in PyECLOUD are: • A different management of macroparticle size and number • A more accurate back-tracking algorithm for the impacting electrons • A more efficient computation of the electric field generated by the travelling proton beam • A more general ad accurate method for the evaluation of the electrons space-charge field

  17. Outline • Why a new code for electron cloud build-up simulation? • From ECLOUD to PyECLOUD • Management of macroparticle size and number • Back-tracking algorithm for the impacting electrons • Beam field calculation • Space charge field • Preliminary convergence study • PyECLOUD at work • Conclusion and future work

  18. Macroparticles • The simulation of the dynamics of the entire number of electrons (≈1010 per meter) is extremely heavy (practically unaffordable) • Since the dynamics equation of the electron depends only on the q/m ratio of the electron a macroparticle (MP) method can be used: • The MP size can be seen as the “resolution” our electron gas simulation

  19. Macroparticles • In an electron-cloud buildup, due to the multipacting process, the electron number spreads several orders of magnitude: • It is practically impossible to choose a MP size that is suitable for the entire simulation (allowing a satisfactory description of the phenomenon and a computationally affordable number of MPs)

  20. ECLOUD – MP number control: the CLEAN routine • In ECLOUD the clean routine is called once per bunch passage and when the number of MPs goes beyond 2*105

  21. ECLOUD – MP number control: the CLEAN routine • In ECLOUD the clean routine is called once per bunch passage and when the number of MPs goes beyond 2*105 • If the number of MPs Nmpis >5*104 it randomly eliminates MPs in order to obtain Nmp ≈ 5*104.

  22. ECLOUD – MP number control: the CLEAN routine • In ECLOUD the clean routine is called once per bunch passage and when the number of MPs goes beyond 2*105 • If the number of MPs Nmpis >5*104 it randomly eliminates MPs in order to obtain Nmp ≈ 5*104.

  23. ECLOUD – MP number control: the CLEAN routine • In ECLOUD the clean routine is called once per bunch passage and when the number of MPs goes beyond 2*105 • If the number of MPs Nmpis >5*104 it randomly eliminates MPs in order to obtain Nmp ≈ 5*104. • Then the remaining MPs’ charge is rescaled in order to obtain the same total charge present in the chamber before the clean

  24. ECLOUD – MP number control: the CLEAN routine • In ECLOUD the clean routine is called once per bunch passage and when the number of MPs goes beyond 2*105 • If the number of MPs Nmpis >5*104 it randomly eliminates MPs in order to obtain Nmp ≈ 5*104. • Then the remaining MPs’ charge is rescaled in order to obtain the same total charge present in the chamber before the clean • This approach guarantees the charge conservation but does not preserve the total energy or the velocity distribution of the electrons.

  25. ECLOUD – MP number control: other observations • In a typical ECLOUD simulation (SPS MBB SEY=1.5): • The number and the sizeof MPs produced by the seed generation mechanism is kept constant during the entire simulation. • As consequence, at saturation, we have a certain number of MPs carrying practically no charge (≈ 5% of the MPs carries ≈1ppm of the total charge)

  26. ECLOUD – MP number control: other observations • In a typical ECLOUD simulation (SPS MBB SEY=1.5): • The number and the size of MPs produced by the seed generation mechanism is kept constant during the entire simulation. • As consequence, at saturation, we have a certain number of MPs carrying practically no charge (≈ 5% of the MPs carries ≈1ppm of the total charge) • At saturation, there is a consistent number of MPs which are trapped near the chamber wall and undergo several low energy impact becoming smaller and smaller. • In ECLOUD there is no mechanism which selectively eliminates them.

  27. PyECLOUD – MP number control: a global approach • In PyECLOUD we try to treat in a unified way all issues related to MP size and number, namely:

  28. PyECLOUD – MP number control: a global approach • In PyECLOUD we try to treat in a unified way all issues related to MP size and number, namely: • Given the number of seed e-to be generated in a certain time-step how many MP do we generate? (i.e. how do we choose their size?)

  29. PyECLOUD – MP number control: a global approach • In PyECLOUD we try to treat in a unified way all issues related to MP size and number, namely: • Given the number of seed e-to be generated in a certain time-step how many MP do we generate? (i.e. how do we choose their size?) • When a MP hits the wall when it is sufficient to change the size of the current MP according to the Secondary Emission Yield and when true secondary MPs must be created?

  30. PyECLOUD – MP number control: a global approach • In PyECLOUD we try to treat in a unified way all issues related to MP size and number, namely: • Given the number of seed e-to be generated in a certain time-step how many MP do we generate? (i.e. how do we choose their size?) • When a MP hits the wall when it is sufficient to change the size of the current MP according to the Secondary Emission Yield and when true secondary MPs must be created? • When a MP (after some low energy impacts) is considered so small to be eliminated without affecting the simulation? x

  31. PyECLOUD – MP number control: a global approach • In PyECLOUD we try to treat in a unified way all issues related to MP size and number, namely: • Given the number of seed e-to be generated in a certain time-step how many MP do we generate? (i.e. how do we choose their size?) • When a MP hits the wall when it is sufficient to change the size of the current MP according to the Secondary Emission Yield and when true secondary MPs must be created? • When a MP (after some low energy impacts) is considered so small to be eliminated without affecting the simulation? • What to do when, because of multipacting process, the number of MPs becomes too large for a reasonable computational burden ? x

  32. PyECLOUD – MP number control: a global approach • We control all this issues through the single parameter Nref which is a target average size of the MPs (i.e. our resolution) and is adaptively changed during the simulation:

  33. PyECLOUD – MP number control: a global approach • We control all this issues through the single parameter Nref which is a target average size of the MPs (i.e. our resolution) and is adaptively changed during the simulation: • Given the number of seed e-to be generated , the generated MPs have size Nrefand their number is chosen as a consequence

  34. PyECLOUD – MP number control: a global approach • We control all this issues through the single parameter Nref which is a target average size of the MPs (i.e. our resolution) and is adaptively changed during the simulation: • Given the number of seed e-to be generated , the generated MPs have size Nrefand their number is chosen as a consequence • When a MP hits the wall, additional true secondary MPs are emitted if the total emitted charge is >1.5Nref and, in that case, their number is chosen so that their size is as close as possible to Nref

  35. PyECLOUD – MP number control: a global approach • We control all this issues through the single parameter Nref which is a target average size of the MPs (i.e. our resolution) and is adaptively changed during the simulation: • Given the number of seed e-to be generated , the generated MPs have size Nrefand their number is chosen as a consequence • When a MP hits the wall, additional true secondary MPs are emitted if the total emitted charge is >1.5Nref and, in that case, their number is chosen so that their size is as close as possible to Nref • At each bunch passage a clean function is called that eliminates all the MPs with charge <10-4Nref x

  36. PyECLOUD – MP number control: a global approach • When the number of MPs becomes larger than a certain threshold (≈105) that means that the computational burden is becoming too high, we change MPtarget size (Nref ) and perform a regeneration of the MPs system:

  37. PyECLOUD – MP number control: a global approach • When the number of MPs becomes larger than a certain threshold (≈105) that means that the computational burden is becoming too high, we change MPtarget size (Nref ) and perform a regeneration of the MPs system: • Each macroparticle is assigned to a cell of a uniform grid in the 5-D space (x,y,vx,vy,vz) obtaining an approximation of the phase space distribution

  38. PyECLOUD – MP number control: a global approach • When the number of MPs becomes larger than a certain threshold (≈105) that means that the computational burden is becoming too high, we change MPtarget size (Nref ) and perform a regeneration of the MPs system: • Each macroparticle is assigned to a cell of a uniform grid in the 5-D space (x,y,vx,vy,vz) obtaining an approximation of the phase space distribution

  39. PyECLOUD – MP number control: a global approach • When the number of MPs becomes larger than a certain threshold (≈105) that means that the computational burden is becoming too high, we change MPtarget size (Nref ) and perform a regeneration of the MPs system: • Each macroparticle is assigned to a cell of a uniform grid in the 5-D space (x,y,vx,vy,vz) obtaining an approximation of the phase space distribution

  40. PyECLOUD – MP regeneration • When the number of MPs becomes larger than a certain threshold (≈105) that means that the computational burden is becoming too high, we change MPtarget size (Nref ) and perform a regeneration of the MPs system: • Each macroparticle is assigned to a cell of a uniform grid in the 5-D space (x,y,vx,vy,vz) obtaining an approximation of the phase space distribution • The new target MP size is chosen so that:

  41. PyECLOUD – MP regeneration • When the number of MPs becomes larger than a certain threshold (≈105) that means that the computational burden is becoming too high, we change MPtarget size (Nref ) and perform a regeneration of the MPs system: • Each macroparticle is assigned to a cell of a uniform grid in the 5-D space (x,y,vx,vy,vz) obtaining an approximation of the phase space distribution • The new target MP size is chosen so that: • A new MPs set, having the new reference size, is generated according to the computed distribution.

  42. PyECLOUD – MP regeneration • When the number of MPs becomes larger than a certain threshold (≈105) that means that the computational burden is becoming too high, we change MPtarget size (Nref ) and perform a regeneration of the MPs system: • Each macroparticle is assigned to a cell of a uniform grid in the 5-D space (x,y,vx,vy,vz) obtaining an approximation of the phase space distribution • The new target MP size is chosen so that: • A new MPs set, having the new reference size, is generated according to the computed distribution. • All moments related to position and velocity (e.g. energy distrib. , charge distrib.) are preserved. The error on total charge and total energy does not go beyond 1-2%

  43. Outline • Why a new code for electron cloud build-up simulation? • From ECLOUD to PyECLOUD • Management of macroparticle size and number • Back-tracking algorithm for the impacting electrons • Beam field calculation • Space charge field • Preliminary convergence study • PyECLOUD at work • Conclusion and future work

  44. Impacting electrons backtracking - ECLOUD • Electrons impacting on the chamber’s wall are detected when they are found outside the chamber and must be backtracked on the wall. • ECLOUD applies a simple rescaling of the electron’s position:

  45. Impacting electrons backtracking - ECLOUD • Electrons impacting on the chamber’s wall are detected when they are found outside the chamber and must be backtracked on the wall. • ECLOUD applies a simple rescaling of the electron’s position:

  46. Impacting electrons backtracking - ECLOUD • Electrons impacting on the chamber’s wall are detected when they are found outside the chamber and must be backtracked on the wall. • ECLOUD applies a simple rescaling of the electron’s position: • This forces to choose very small time-steps in order to avoid perturbations on the distribution of the electron cloud.

  47. Impacting electrons backtracking - PyECLOUD • Electrons impacting on the chamber’s wall are detected when they are found outside the chamber and must be backtracked on the wall. • PyECLOUD always stores the MPs’ position at previous timestep in order to compute the crossing point between the chamber’s wall and the electron’s trajectory :

  48. Impacting electrons backtracking - PyECLOUD • Electrons impacting on the chamber’s wall are detected when they are found outside the chamber and must be backtracked on the wall. • PyECLOUD always stores the MPs’ position at previous timestep in order to compute the crossing point between the chamber’s wall and the electron’s trajectory :

  49. Impacting electrons backtracking - PyECLOUD • Electrons impacting on the chamber’s wall are detected when they are found outside the chamber and must be backtracked on the wall. • PyECLOUD always stores the MPs’ position at previous timestep in order to compute the crossingpoint between the chamber’s wall and the electron’s trajectory :

  50. Impacting electrons backtracking - PyECLOUD • Electrons impacting on the chamber’s wall are detected when they are found outside the chamber and must be backtracked on the wall. • PyECLOUD always stores the MPs’ position at previous timestep in order to compute the crossingpoint between the chamber’s wall and the electron’s trajectory : • Together with the improved space-charge computation, this simple trick has a great impact on the convergence properties with respect to the timestep (as we will see in a few slides).

More Related