Linac Simulation Linac Simulation Primer Primer J.-F. Ostiguy APC ostiguy@fnal.gov September 2013 Ostiguy – Linac Simulation Primer - Sep 2013
Introduction ● This talk is not a summary of recent linac simulation work ● it is meant to be a very brief tutorial on ion linac simulations Ostiguy – Linac Simulation Primer - Sep 2013
Ion Linac Basics ● A few types of cavities, optimized for increasing velocities. More types = more efficient acceleration, but higher cost. ● Regular periodic sections are based on a specific cavity type ● Sections are “matched” to each other (both lattice functions and phase advance/length) Ostiguy – Linac Simulation Primer - Sep 2013
Longitudinal – Transverse Longitudinal – Transverse Coupling Coupling ● The presence of RF defocusing strongly couples the longitudinal to the transverse dynamics ● Transverse focusing lenses (solenoids, quads) have limited impact on the longitudinal dynamics. ● the longitudinal dynamics is addressed first. Ostiguy – Linac Simulation Primer - Sep 2013
Some Design Rules ● Within a section, the transverse phase advance/cell should not exceed 90 deg (envelope instability) ● Longitudinal phase advance/cell should also be limited ~90 deg to avoid instability. Typically it is lower than the transverse, but not necessarily. ● The ratio transverse/long phase advance must be chose to avoid driving a parametric resonance. ● phase adv/length should be a smooth, monotone function Ostiguy – Linac Simulation Primer - Sep 2013
Longitudinal Dynamics and Period Length ● At low energy, the bunches are long. This favors a low rf frequency and requires an accelerating phase phi_s far from crest. ● RF defocusing is large (maximum at phi_ = -90), acceleration is reduced, RF focusing (phase advance/length) is strong. ● Conclusion: a low energy, the period must be short ● Compact design: cavity +solenoid inside the same cryomodule. Ostiguy – Linac Simulation Primer - Sep 2013
Typical Beam Envelopes Ostiguy – Linac Simulation Primer - Sep 2013
Typical Phase Advance Plot Ostiguy – Linac Simulation Primer - Sep 2013
What a Simulation Code Should Provide ● An easy way to switch between envelope and particle tracking modes ● Good support for optical matching, many types of constraints etc ● Matching in envelope and/or particle mode ● Multiple space charge solvers (based on symmetry ● Approximations, symmetry speed up computations dramatically. ● “Brute force”, no compromise 3D space charge is important to validate approximations, confirm the soundness of a final design, or to perform “numerical experiments” ● Solver should be able to take advantage of multiple cores if present ● A “longitudinal only” mode ● An interactive mode ● A pure batch mode for large scale statistical error studies. ● Ability to handle a wide variety of field map types ● Ability to generate / read particle distributions ● No arbitrary artificial hard-wired limitation on the number of particles that can be tracked. On modern hardware > 10**6 particles is becoming routine. ● Explicit, human readable lattice description in an easily parsable format ● Well documented input/output formats for all files ● Facilities to compute, plot, tabulate all quantities of interest (emittances, beam size, lattice parameters, phase advances etc … ● A plugin architecture to allow user to implement custom elements, distribution filters etc … Ostiguy – Linac Simulation Primer - Sep 2013
The Matching Problem The Matching Problem ● In a linac it is essential for the beam envelope (longitudinal and transverse) to be as smooth as possible (envelope modulation drives halo formation) ● Matching between sections usually involves 6 parameters ( α, β in all planes) ● The presence of longitudinal-transverse coupling and the nonlinearity of RF focusing makes the matching problem harder to deal with than for high energy beamlines/rings. ● A good code need to support a wide variety of linac- specific constraints. Ostiguy – Linac Simulation Primer - Sep 2013
Reference Particle ● In contrast with a typical (high energy) synchrotron, the particle velocity changes rapidly. In fact it can change significantly within a single cavity. ● The cavity phases are usually specified w/r to the synchronous phase. Internally the code must uses “absolute” phases; they need to be determined for each run. ● This is done by tracking a reference particle. As the reference particle reaches a cavity, the absolute phase (modulo 2π) corresponding to the synchronous phase is determined and the absolute phase in the cavity is set. ● The reference particle is often (but not necessarily) also tracked simultaneously with the bunch. This makes it easy to express the coordinates w/r to those of the reference particle (not necessarily the same as the beam centroid coordinates) Ostiguy – Linac Simulation Primer - Sep 2013
RF Phase & Synchronous Phase ● For all cavities, one must define a phase reference. In a code, two references are used ● Phase when the reference particle arrives at the cavity entrance ● Synchronous phase: usually defined as the phase that results in the maximum energy gain. Ostiguy – Linac Simulation Primer - Sep 2013
Synchronous Phase Assuming that the velocity is constant through the cavity, one can define the synchronous phase as follows: Note that under this assumption, the energy gain can be computed for any phase φ once φs has been determined Ostiguy – Linac Simulation Primer - Sep 2013
Generalized Definition of φs At low energy, the velocity may change significantly while going through the cavity. In that case, one may generalize the definition is the phase that maximizes the integral (energy gain) Of course, when the velocity is nearly constant, this definition is equivalent to the previous one. Ostiguy – Linac Simulation Primer - Sep 2013
Setting Absolute Phases Note: not all codes use the same definition of “synchronous phase”. TRACK (ANL) uses a definition based on maximum gain. TraceWin (CEA/Saclay) uses an alternate definition which facilitates the determination of the parameters for an equivalent thin gap . Unless the relative change in velocity within a cavity is substantial, the phases determined with either convention are essentially the same. Ostiguy – Linac Simulation Primer - Sep 2013
RF Cavity Model ● Especially at low particle velocity when the phase slippage is large, RF cavities must be modeled with a full EM field map. ● In many practical situations, one can assume that the fields are axi-symmetric. In that case, an axial field map is sufficient to characterize the full 3D field. ● Arbitrary 3D field maps are useful to account for asymmetries due to rf couplers etc ... ● Axial or full field maps are obtained using a separate EM code (e.g. MWS ). Ostiguy – Linac Simulation Primer - Sep 2013
Axial Field Expansions For a cavity: The coefficients Am are obtained by expanding the on-axis E_z(z). Similar expansions are available for solenoids (Bz) or for electrostatic lenses (V(z) ). Ostiguy – Linac Simulation Primer - Sep 2013
Independent Variable : Time or Space ? ● Accelerator and beamline elements are ordered sequentially along some reference orbit. ● In a code, elements are treated as independent blocks (i.e. not aware of others) with local properties (e.g. field map). This is the motivation for using s (or z) as the independent (integration) variable. ● To account for space charge, one must know the position of all particles at a fixed time t. This provides the motivation for choosing t as the integration variable. The downside with this choice is this simple question: at time t within which element does a particle lie ? ● Codes based either choice are used ● For most ion linac simulation work, a s-based code is a more practical choice and leads to less code complexity. t is a better choice (more accurate) at very low energy, for example within an RFQ. Ostiguy – Linac Simulation Primer - Sep 2013
Equations of Motion Equations of Motion (Single particle) (Single particle) In principle, all we need to do is to integrate In a general curvilinear coordinate system, the explicit form can get quite complicated. Ostiguy – Linac Simulation Primer - Sep 2013
Trajectory Equations Trajectory Equations (in cartesian coordinates) (in cartesian coordinates) State Variables: Independent (Integration) Variable: s These equations do not involve any simplifications. This is a system of first order differential equations. It can be numerically integrated (usually using a RK integrator). Ostiguy – Linac Simulation Primer - Sep 2013
Maps ● Numerical integration is generally used for cavities, solenoids, einzel (electrostatic) lenses for which a field map is provided. ● To speed up calculations, for most other elements --in particular for drift space-- (linear) maps are used. ● It is assumed that a map can be parametrized w/r to the element length i.e. the code can easily split an element into N identical ones of length L/N to introduce space charge kicks. Ostiguy – Linac Simulation Primer - Sep 2013
Recommend
More recommend