Overview
beamtracer solves steady ion beams in their own field: the extraction of positive or negative ions from a plasma, their acceleration and focusing by electrodes and solenoids, and the charge changes of a fast beam on a gas or a plasma. Nothing depends on time. The beam is the fixed point of a field solve, a trace of the trajectories and a deposit of their space charge, on a 2D mesh, planar per unit depth or cylindrically symmetric .
Each equation on these pages is declared on the code that implements it, as a method card, and checked by the tests: six closed forms against SymPy rules, seven discretisations against their order of convergence. The pages of the section list the cards module by module; this one shows how they fit together.
The pipeline
Section titled “The pipeline”BeamOptics
classsourceSteady ion beams in planar or cylindrical geometry.
- poisson
- plasma
- motion
- space charge
- Assumes
- steady: the beam is the fixed point of field solve, trace and deposit (
timeis always 0) - planar per unit depth or cylindrically symmetric ; the solenoids and a measured axial profile only in cylindrical geometry
- an imposed static and/or from a field map (
beamtracer.field_map) in the frame of the grid, added to the solved field and the solenoids - a Boltzmann plasma species: electrons () for positive-ion extraction, positive ions () for negative-ion extraction; the extracted species are traced beams
- configuration in e, u and eV, converted to C, kg and J; with MPI the trajectories are shared between the ranks and every rank solves the field
- steady: the beam is the fixed point of field solve, trace and deposit (
- Built from
- Mesh. Uniform nodes of spacing ; the electrodes are simgeometry shapes, and the distance from a node to an electrode surface is bracketed in 255ths of a cell.
- Poisson’s equation with the Boltzmann plasma species, by finite differences (Shortley-Weller next to the electrodes, the axis by L’Hôpital) and Newton’s method, second order in .
- Fields: the electric field on the edges between the nodes, at the electrode surfaces taken over the bracketed distance; the magnetic field of solenoids or a measured profile, expanded off the axis.
- Beams seeded from an emission line with a quasi-random Sobol beam (the same on every iteration), traced by RK4, their charge deposited at the midpoint of every step.
- Charge changes of every trajectory on the targets it crosses, as fractions (third order in the step) or as sampled events, with the tallies a plasma model takes its sources from.
- The Vlasov iteration ties them together, relaxing the charge density until the potential stops changing:
vlasov_iterate
functionsourceRun iterations Vlasov iterations.
- iteration 0
- solve
- relaxation
- convergence
- Assumes
- the compensated deposit of the beam traced in , re-seeded identically every iteration; =
relaxationin acts on the charge density, not on the potential - the Boltzmann species built once, at , with given or the beams'
- at most
iterations; an unconverged iteration returns its last state without a warning (stats['converged']is 0); the returned trace is that of the newest potential - with MPI every rank solves the whole field and the deposits are summed
- the compensated deposit of the beam traced in , re-seeded identically every iteration; =
- Built from
- Beam moments at diagnostic planes: rms emittance, Twiss parameters and the mismatch, with the trajectories of a cylindrical beam as rings.
Around the solve:
- The neutralizer iterates the traced beam with the global plasma model of the channel (wellbalanced) to a fixed point of the path fractions.
- The beamline carries the beam on as 3D markers on straight lines: a grid of beamlets, the duct with its reionization, a residual-ion dump or stray field (Boris push), a calorimeter and the fits the experiments make.
- The design problems, the einzel lens (with its thin-lens and paraxial estimates) and the H- beamlet, are searched by differential evolution, which ranks the designs by feasibility first.
Units and conventions
Section titled “Units and conventions”SI units in the solver; the configuration takes charges in e, masses in u and energies and temperatures in eV, and converts them to C, kg and J. The beam moves along ; in cylindrical geometry is the radius and a trajectory stands for a ring, in planar geometry a current is per metre of depth. Currents are magnitudes: the sign of the space charge is that of the particles’ charge.
Not in the model
Section titled “Not in the model”- No time dependence and no relativity (the normalised emittance uses only).
- No 3D fields in the traced region, no planar or non-axisymmetric magnetic fields.
- The source plasma is not modelled: the beams’ current densities are inputs, the Boltzmann species has no inertia, flow or sheath, and the meniscus is where its density falls off.
- No collisions besides the charge changes (no scattering, energy loss or secondaries); the targets are prescribed, not transported.
- The beamline has no space charge, no fields in the duct, no gas in the field region and no wall physics.
- No convergence safeguards: an unconverged Vlasov iteration, Newton solve or neutralizer fixed point returns its last iterate, flagged but without a warning.
Verification
Section titled “Verification”Besides the checks of the cards, the tests compare the field with the coaxial and uniformly charged cylinders, the Child-Langmuir diode with , Busch’s theorem through a solenoid, the charge-state fractions with plasmacoll’s on the line density, the analog mean with the fractions mode, a parallel beam in the neutralizer with the global model, the duct transmission and reionization with their closed forms, the Boris push with the Larmor circle, and the thin-lens voltage of the einzel lens with a scan of the full model.