Simulation with Space- ChargeSimulation with Space-Charge Reference: “Computer Simulation Using...
Transcript of Simulation with Space- ChargeSimulation with Space-Charge Reference: “Computer Simulation Using...
-
Simulation with Space-Charge
Reference: “Computer Simulation Using Particles”, R.W. Hockney andJ.W. Eastwood (UKAEA Culham and Reading University).
Sunday, 22 February 2009
-
• Principles of simulation• Calculation of space-charge forces• 1D longitudinal tracking codes• 2D transverse tracking codes• 3D tracking codes• Formulation of results• Benchmarking and validation• Illustrations
Sunday, 22 February 2009
-
Envelope Codes2D (transverse) codes use envelope equations for KV beam:
a′′ + kx(s)a−!2xa3− 2K
a + b= 0
b′′ + kb(s)b−!2yb3− 2K
a + b= 0
K =I
I0
2(βγ)3
is the Perveance
Define X =
aa′
bb′
=⇒dXds
=dds
aa′
bb′
=
a′
−kx(s)a +2K
a + b+
!2xa3
b′
−ky(s)b +2K
a + b+
!2yb3
Integrate using standard numerical packages based on, for example,Runge-Kutta techniques.
Output either as beam sizes or Twiss parameters defined by βx = a2/"x,αx = −aa′/"x etc
Sunday, 22 February 2009
-
Examples of Envelope CodesKVBL Includes matching, parameter optimisation, graphical output;
switches to standard matrix methods in absence of space-charge
WinAgile Similar to KVBL but Windows based with GUI; available in DLcode repository
Trace2D Old code from Los Alamos, based on matrices with space chargekicks in the middle of elements
Trace3D Development of Trace2d to include momentum effects; works froma keyboard implemented graphics system.
β-functions with space-charge from the ESSSunday, 22 February 2009
-
Good modelling practiceAvoid subtracting; add where possible
Work with u := γ − 1 = TE0
Then (βγ)2 = γ2 − 1 = (γ − 1)(γ + 1) = u(u + 2)
and momentum is pc =m0c2
eβγ = E0
√u(u + 2)
Example: Given kinetic energy T =m0c2
e(γ − 1) = E0(γ − 1)
Avoid: (βγ)2 = γ2 − 1 = (u + 1)2 − 1
Can give results with limited accuracy at low energies (small T )
Similarly, for RMS emittance use !̃2 = 〈x′2〉〈(
x − x′ 〈xx′〉
〈x′2〉
)2〉
rather than 〈x2〉〈x′2〉 − 〈xx′〉2
Sunday, 22 February 2009
-
Description of machine
Basic beam parameters
Input distribution, N macro-particles
Calculate external forces
Calculate space-charge forces
Push particles forward one time step
Output as required
Sunday, 22 February 2009
-
Input Beam Distribution
• How many macro-particles are needed to model a beam of 1010-1014 real particles?
• sufficiently many for good statistics• predicted effects should not be a
consequence of reduced number of particles, statistical errors, rounding and interpolation errors.
• Most space-charge codes now use ~105 simulation particles; some runs have been made with 107.
Sunday, 22 February 2009
-
Initial Particle Distribution
• Can be read from a given dataset, for example from a previousrun, or can be based on physical data.
• Can be a model distribution - KV, Waterbag, Gaussian, semi-Gaussian etc
– generate a normalised distribution; then scale and rotate asappropriate
– may need to change coordinates, e.g Cartesians to 4D-polarsystem
– can be fitted to given beam sizes or created as an rms equiv-alent beam
Sunday, 22 February 2009
-
Generation of Model DistributionFor normalised 4D-phase space with x2 + y2 + x′2 + y′2 = ρ2, convert to4D-polars
x = ρ sin θ sinφ cos χ, y = ρ sin θ sinφ sinχ, x′ = ρ sin θ cos φ, y′ = ρ cos θ
0 ≤ θ,φ ≤ π, 0 ≤ χ ≤ 2π
Jacobian is∂(x, y, x′, y′)∂(ρ, θ, φ, χ)
= ρ3 sin2 θ sinφ
Then f(x, y, x′, y′) dx dy dx′ dy′ = f̂(ρ, θ, φ, χ)ρ3 sin2 θ sinφ dρ dθ dφ dχ
Waterbag: f̂ d4V ∝ d(ρ4) d(θ − sin θ cos θ) d(cos φ) dχ
Then R = ρ4, Θ = θ − 12 sin 2θ, Φ = cos φ and χ are uniformly distributed.Use standard random number generators on [0, 1] and scale appropriately
KV: f̂ ∝ δ(1− ρ2) =⇒ dΘ dΦ dχ
Sunday, 22 February 2009
-
Method based on f(x) dx = dF (x) where F ′(x) = f(x); this may notalways be possible.
Method of Ratio of Uniform Deviates:
The density function f(x) can be generated through a uniform filling ofthe region
0 < u <√
f( v
u
)
of the two-dimensional (u, v) plane with a random number generator.Then x =
v
uhas the desired density function.
Example: The Cauchy Distribution f(x) =1π
11 + x2
.The sampling region is
(u, v) : 0 ≤ u ≤[1 +
( vu
)2]− 12
= {(u, v) : u2 + v2 ≤ 1, u ≥ 0}.
Half circle, centred on origin, radius 1.Sunday, 22 February 2009
-
Example: Gaussian Distribution f(x) =1√2π
e−12x
2.
The sampling region is{
(u, v) : 0 ≤ u ≤ e−v2
2u2
}= {(u, v) : v ≤
√−2u2 lnu, 0 ≤ u ≤ 1}.
A
B C
D
QP
Sampling method: adjust tan-gents at P , Q to minimise areaABCD.=⇒ Probability that a pointwithin ABCD is also within requiredregion is 0.922. Method uses somesimple initial pre-sampling to checkthat a point (u, v) lies in region; ifso, then a more accurate check.
Approach turns out to be faster than most other methods and also givesa very good model of the required distribution.
Sunday, 22 February 2009
-
Solution of Equations of MotionEquations of motion of the form x′′ = F(s,x,x′)
Euler (forward) difference method:[
xn+1x′n+1
]=
[xn + hx′n
x′n + hF(sn,xn,x′n)
]
Accuracy is only O(h2)h is step length
Set X =[
xx′
],
dXds
= f(s,X) =[
x′F(s,x,x′)
]
k1 = hf(sn,Xn)
k2 = hf(sn + 12h,Xn +12k1)
k3 = hf(sn + 12h,Xn +12k2)
k4 = hf(sn + h,Xn + k3)
=⇒ Xn+1 = Xn + 16(k1 + 2k2 + 2k3 + k4
)
Could use Runge-Kutta method accurate to O(h4), but requires extrastorage and 4 calculations of F for each particle instead of one. Canbe reduced by Blum’s method, but unlikely to give a viable method formodelling >∼ 105 particles in a realistic time.
Sunday, 22 February 2009
-
Leap-frog Integration Scheme
Interleave position and velocity half astep out of phase, and leap-frog coordi-nates forward in distance or time.
xn+1 = xn + hx′n+ 12
x′n+ 12 = x′n− 12
+12h[F(sn,xn,x′n− 12 ) + F(sn,xn,x
′n+ 12
)]
Error is O(h3)
Step length must be chosen to allow plasmaoscillations to be represented (ωph/βc! 2)
Method is extremely stable. It has a time-reversible property, which avoids long-termdrift caused by systematic errors that couldmask the true solution. Note: even 4th orderRunge-Kutta suffers.
Sunday, 22 February 2009
-
Space-Charge Calculations
Many different approaches, most based on approximations.
• Use Coulomb forces between pairs of particles to calculate forcesat each step.
• Assume variation of space-charge with distance is small; imposespace-charge kicks once or twice per element, but track using non-space-charge methods otherwise.
• Use KV linear space-charge formula, scaled by longitudinal linedensity.
• Calculate space-charge potential from Poisson’s equation in beam-frame, either in 3D or 2+1D.
Note: some methods ignore boundary effects
Sunday, 22 February 2009
-
• Coulomb approach is O(N2) and very time consuming. Prob-lems when particles move too close together =⇒ cut-off distanceneeded (Debye length). Also open to rounding errors, especiallyon the axes where transverse forces should sum to zero.e.g 2D circular uniform beam, N = 50, 000 simulation particles:calculations take several minutes and only 60% within 10% errorband.
• 2D+1D approach gives good results (beam split into 2D slices fortransverse forces, then longitudinal force from line density).
• Finite difference method represents sophisticated approach but in-clusion of boundaries (image effects) not easy.
• Finite elements provide most flexible approach and can call on hugerange of engineering expertise.
Sunday, 22 February 2009
-
Based on the variational problem:
δπ(φ) = 0, where π(φ) =12
∫
V|∇φ|2 dV + 1
$0
∫
Vρφ dV −
∫
∂Vφ̄nφ dS
Equivalent to ∇2φ = − ρ$0
in V , φ = φ̄,∂φ
∂n= φ̄n on ∂V
Finite Element Approach
Cover region with mesh to fit boundaries:
-60 -40 -20 0 20 40 60-60
-40
-20
0
20
40
60
TRANSVERSE BEAM CROSS-SECTION
X (mm)
Y (mm)
Fit a polynomial to each mesh:
φ = a0 order 0+a1x + a2y + a3z order 1+a4x2 + a5y2 + a6z2
+a7xy + a8xz + a9yz order 2+ . . .
=∑
i fi(ξj)φi
Sunday, 22 February 2009
-
1
2
34
5
6
7
89
10
fi are shape functions, ξi are areal coordinates. Look for a complete set tochosen order. For example to order 2, 10 unknowns (a0, . . . , a9), so need 10nodes:
1 2
3
ξ1ξ2
ξ3
Variational problem turns into sparse matrix equation for potential at nodesgiven by
Kijφj = Qi, (1)
where Qi come from charge distribution
ρ(x) =∑
particles i
qiδ(x− xi) =⇒∫
ρφ dV =∑
particles i
qiφ(xi).
(Kij) depends only on mesh. (1) is solved by standard methods (Gaussianelimination, triple factoring, conjugate gradient etc).
Sunday, 22 February 2009
-
Space-charge forces calculated from
F = −∇φ = −∑
i,j
∂fi∂ξj
φi∇ξj .
Standard Test: 2D uniform circular beam, N = 50, 000 macro-particles
• 3rd Order, ∼ 400 mesh elements, find > 95% within 10% errorband
• 1st order, ∼ 3000 mesh elements, find > 90% within 10% errorband
• Since stiffness matrix (Kij) depends only on mesh, can be set upand pre-inverted, giving a fast, simple ”black-box” for space-chargecalculations
Sunday, 22 February 2009
-
• Simple conversion to different coordinate systems.
– For example, 2D transverse (x, y) Poisson solver to axisym-metric 3D (r, z) code through x→ r, y → z, dx dy → r dr dz
• 2D code easily converted to 3D, triangular elements to tetrahedra
• Fits all boundaries likely in accelerators. For analytical purposes,“infinite” boundaries modelled using super-elements or matchingto ln r (2D) or 1/r (3D) potentials at sufficiently large distances.
• Longitudinal boundary conditions generally periodic (bunch tobunch in linacs or rings)
• Requires large amounts of storage and CPU
– can be parallelised using method of static condensation tosplit into substructures substructures
Sunday, 22 February 2009
-
Example: Beam to Target line for Spallation Neutron Source
Iterative process involving envelope codes, zero space-charge non-linear track-ing, then full space-charge non-linear tracking.
Transverse beam distribution modified to target specifications by means ofhigher order elements:
• Assume an initial Gaussian distribution with cut-off at nσ (n ≥ 3)
• Use combined octupole-dodecapole system to fold in tails to generate
(i) uniform distribution (square/rectangular cross-section)(ii) 2D parabolic distribution (round beam)(iii) 2D elliptic distribution
• Octupole equations are x′′ +kx(x2−3y2) = F scx , y′′ +ky(3x2−y2) = F scy
– focus to flat beam so that octupoles tailor horizintal distribution,not vertical
– focus to thin upright beam to tailor vertical distribution– dodecapoles give small (necessary) corrections
Sunday, 22 February 2009
-
uniform, square distribution
2D parabolic distribution
2D elliptic distribution
Results from tracking code TRACK2D, after optimisation combined
with use of KVBL
Sunday, 22 February 2009
-
Heavy Ion Fusion Project (HIDIF)
Multiturn Injection - modelled with TRACK2D20 turns of 400 mA Bi+1 beam. Space-charge tune depression ~0.04. Note
distortion of individual turns in phase space
Sunday, 22 February 2009
-
Special Case: 1D Longitudinal Codes
Us = −qβcR[
g02β
Z0γ2− ω0L
]∂λ
∂s
d∆φdt
=hω20η
β2E
(∆Eω0
),
ddt
(∆Eω0
)=
q
2π[V (φ)− V (φs) + Us(φ)
]
Tracking uses symplectic mapping with space charge calculated fromderivative of the line density.
CODES: ESME (FNAL), LONG1D (TRIUMF), TRACK1D (RAL)
A major issue in a high intensity proton accelerator is building upthe beam intensity through several turns of injection. For the SNS,Nturns = 1600 turns are required; for the ESS, Nturns ∼ 1000. Forreliable results, need ∼ 5000 particles per turn, so >∼ 5× 106 overall.
One solution is to use “painting” technique with variable chargebuild-up. Restricts total to ∼ 105 particles, yet has ∼ 5000 per turn.
Sunday, 22 February 2009
-
Charge Assignment to Grid
φ
∆E
TRACK1D assignment uses Tri-angular Shaped Cloud (TSC).Line density smoothed with cu-bic splines to remove statisticaleffects. Includes corrections tocounteract artificial spreading ofthe beam.
Sunday, 22 February 2009
-
Longitudinal injection for the
European Spallation Source. 1000 turns
of 1.334 GeV, 114 mA proton
beam
Sunday, 22 February 2009
-
Available CodesIMPACT Rob Ryne, Ji Qiang (LBL); mainly a linac code with new MaryLie
develoments for modelling rings
TRACEWIN Nicolas Pichoff (CEA); Windows linac code
ORBIT Jeff Holme, Sarah Cousineau (SNS); ring code developed for SNS;exists in different versions at ORNL, FNAL, BNL
SIMPSONS Shinji Machida (RAL); used for J-PARC modelling
ACCSIM Fred Jones (TRIUMF); developed from matrix applications withspace-charge kicks
TRACKxD Chris Prior (RAL); x = 1, 2, 3; used for ISIS, ESS, SNS, HIDIF,Neutrino Factory and other modelling
GPT Bas van der Geer (Pulsar Physics); Commercial code developedinitially for high intensity, very short electron bunches.
Sunday, 22 February 2009
-
GeNTrackE Andreas Adelmann (PSI); major advances in past 3 years; nowfully 3D
BEST Hong Qin (PPPL); based on δf -method. Used for investigatingtwo-stream instabilities.
Micromap Ingo Hofmann, Giuliano Franchetti (GSI); used for modelling FAIRand for comparison with earlier theories.
WARP David Grote, Alex Friedmann (LLNL); fully 3D, mainly for earlystages of acceleration, from ion gun.
PATH Alessandra Lombardi (CERN); originally written to model themuon beam for the CERN neutrino factory, later developed forprotons.
VADOR Eric Sonnendrucker (Strasbourg); Vlasov solver
PARMILA Jim Billen (LANL); long established linac code; works in associa-tion with Trace3D; also PARMELA.
Sunday, 22 February 2009
-
Sunday, 22 February 2009
-
Sunday, 22 February 2009
-
F.W. Jones ICFA Workshop on Space Charge Simulation, April 2003
Status and simulation issues
1. Brief survey of code
2. Accsim 4
3. Development path
4. Simulation issues
Sunday, 22 February 2009
-
F.W. Jones ICFA Workshop on Space Charge Simulation, April 2003
Space charge 2D for coasting beam; for bunched beams a “2.5d”
treatment:– Quasi-independent longitudinal and transverse computations,
with induced couplings:– T ⇒ L via path-length terms– L ⇒ T via dispersion terms and line density term in transverse
space-charge field strength. Longitudinal kicks computed from line density using
differentiation (and optional smoothing) filters. Transverse kicks computed from 2D electric field of
entire ensemble, with the local line density as a scaling factor for the force on each particle.– Only meaningful for uncorrelated L/T distributions, e.g. for long
bunches with small emittance painted into large emittance.
Sunday, 22 February 2009
-
Accsim 4 Data Management
Beamline Transfer
MAD Parser
ElementTables
Machine Descriptionin MAD format
Element ListProcessor
MAD
Standard: drift, bend, quad,…Accsim: thin lens, rf, collimator,…
Element Definitions
DIMAD
ACCSIM
Beamline List
Beamline List ElementData
Matrix Generator
Element Transfer
MatrixProcessor
Element List& Optics Data
ElementData
ElementMatrices
Optics Generator
Splitter
StepMatrices
Sunday, 22 February 2009
-
F.W. Jones ICFA Workshop on Space Charge Simulation, April 2003
Scope of Accsim and similar space charge treatments
Some useful results/predictions– Beam profile measurements: CERN-PSB, KEK-PS, PSR(?)– Injection losses (e.g. mismatch, emittance transfer)– Coherent resonances -- intensity limitation– Benchmarks with Accsim, Orbit, Simpsons, show long-term (50k turns)
RMS matching to high degree of precision Further study
– Beam redistribution while preserving RMS matching– Intrinsic resonance due to space charge (sensitive to working point,
observed independently in Accsim and other codes)– Synchro-betatron effects -- space charge, chromaticity– Halo parameters and other amplitude measures– Stationary distributions ?– Still a need for more accessible benchmarks and test cases
Sunday, 22 February 2009
-
Accelerator Systems Division Oak Ridge National LaboratoryMarch 10-12, 2003
34
ORBIT: Inventory of Models
• ORBIT is designed to simulate real machines: it has detailed models for– Injection foil and painting– Single particle transport through various types of lattice elements– Magnet Errors, Closed Orbit Calculation, Orbit Correction– RF and acceleration– Longitudinal impedance and 1D longitudinal space charge– Transverse impedance– 2.5D space charge with or without conducting wall beam pipe– 3D space charge– Feedback for Stabilization– Apertures and collimation– Electron Cloud Model
• ORBIT has an excellent suite of routines for beam diagnostics.
Sunday, 22 February 2009
-
Accelerator Systems Division Oak Ridge National LaboratoryMarch 10-12, 2003
35
ORBIT: Applications
• Basic collective beam dynamics studies• CIS: Accumulation and emittance measurement• Fermilab Booster: Injection, capture, and losses• PSR: Space charge effects on accumulation and beam profiles• SNS
– Optimization of injection painting schemes– Space charge effects on accumulation and losses– Transverse and longitudinal impedance effects on accumulation and losses– SNS synchrotron– Collimator design and optimization– Ring fault study and beam-on-target footprint– Feedback stabilization of RF instability– Nonlinear single particle transport effects– Magnet errors, fringe field effects, and correction– Total foil-to-target simulation– Detailed treatment of injection chicane– Electron cloud studies
Sunday, 22 February 2009
-
Accelerator Systems Division Oak Ridge National LaboratoryMarch 10-12, 2003
36
ORBIT Application: 1.44 MW Injection Space Charge Benchmark and Final Distribution
Sunday, 22 February 2009
-
Vador – E. SonnendruckerDifficult in >2D phase space because of very large number of grid points. Hence very slow.
Use symmetry or conserved quantities on characteristics
Optimise number of grid points for specific simulations
Sunday, 22 February 2009
-
Example: Evolution of a Semi-Gaussian beam of 80keV Potassium ions in a uniform focussing channel, ΔQ~-0.25
Sunday, 22 February 2009