Beam lines

A cavity is installed between beam pipes, bellows, tapers and absorbers, and its neighbours change its modes. cavsim2d has a class for each of these devices, and joins devices with + into one structure that meshes, solves, tunes and optimises like a single cavity:

from cavsim2d import Beampipe, Bellows, BLA, EllipticalCavity, Taper

mid_cell = [42, 42, 12, 19, 35, 57.7, 103.3]     # A, B, a, b, Ri, L, Req [mm]
line = (Beampipe(R=35, L=120)
        + Bellows(Ri=35, A=12, L_p=10, N_conv=4, R_root=2, R_crest=2)
        + EllipticalCavity(2, mid_cell, beampipe='none')
        + Taper(R_left=35, R_right=50, L=80)
        + BLA(R=50, L=160, absorber_length=90, absorber_thickness=10))

line.eigenmode.run()

Beam lines builds a line step by step. This page lists the devices and their dimensions, all in millimetres, and explains how a line is joined and how it names its dimensions. To repeat one cavity into a module of identical cavities, see Modules of one cavity below.

Devices

Beam pipe (Beampipe)

A straight pipe, Beampipe(R, L): the drift between devices.

parameter

meaning

R

bore radius

L

length

ends

the end faces: 'pmc' (open, the default) or 'pec' (metal plates), or a (left, right) pair

Open ends follow the eigenmode solver’s boundary_conditions, like the ends of any cavity: 'ee' closes them, 'oo' puts an absorbing layer on each. Ends built as 'pec' stay closed whatever the boundary conditions.

Bellows (Bellows)

A corrugated pipe: N_conv convolutions on a bore of radius Ri. One convolution is a flat at the root, a flank, a flat at the crest and a flank back down, with every corner rounded.

parameter

meaning

Ri

bore (root) radius

A

convolution depth; the crest sits at Ri + A

L_p

length of one convolution

N_conv

number of convolutions (a whole number, so it cannot be tuned or varied)

R_root

corner radius at the root

R_crest

corner radius at the crest

crest_fraction

share of the flat length given to the crest (default 0.5)

flank_angle

flank angle from the axis in degrees (default 90, a vertical flank)

L_bp

straight pipe at each end (default 0)

_images/beamline_bellows_nomenclature.png

Fig. 2 Bellows parameters.

The corner radii are checked when the bellows is built: each corner must fit on its flat, and two corners sharing a flank must both fit on it, so a set that cannot be built is rejected with the name of the dimension at fault. Where a corner radius reaches L_p/4 the flats vanish and the wall runs from arc to arc, the usual shape of a hydroformed bellows.

Taper (Taper)

A cone between two bore radii, the gradual alternative to the abrupt step left where two devices of different bores meet.

parameter

meaning

R_left

bore radius at the upstream end

R_right

bore radius at the downstream end

L

overall length

straight_left

straight pipe before the cone (default 0)

straight_right

straight pipe after the cone (default 0)

R_fillet

radius rounding both corners of the cone (default 0, sharp); needs a straight pipe to sit on

cone_length

read-only: L minus the two straight pipes

half_angle

read-only: the cone’s half-angle from the axis, degrees

_images/beamline_taper_nomenclature.png

Fig. 3 Taper parameters.

With no straight pipes the cone spans the whole taper, so its corners belong to the devices it joins, and R_fillet is ignored.

Beam line absorber (BLA)

A beam pipe with a lossy dielectric ring set into its wall, to damp modes that travel out of a cavity along the pipe.

parameter

meaning

R

bore radius, the free opening, which the ring leaves unchanged

L

overall length

absorber_length

length of the ring along the axis

absorber_thickness

thickness of the ring: it spans R to R + absorber_thickness, and the wall steps out around it

z_absorber

centre of the ring along the axis, from the centre of the absorber (default 0)

eps_r, tan_delta

permittivity and loss tangent of the ring

maxh

element size inside the ring

_images/beamline_bla_nomenclature.png

Fig. 4 Beam line absorber parameters.

The ring is a dielectric region, which only the eigenmode solver takes into account; see Dielectric regions.

Joining devices

Devices joined with + form an Assembly, which is itself a cavity: every analysis runs on it. The devices are joined end to end and the vacuum inside is one region, so a cavity built from parts gives the same modes as the same cavity built in one piece. Only the two outer ends of the line are boundaries; line.set_ends('pec') closes both, whatever the end devices declare.

Assembly(elements, gaps=..., ends=..., allow_steps=...) builds a line directly:

parameter

meaning

elements

the devices, upstream to downstream

gaps

straight pipe at each junction, one value or one per junction (default 0, the devices touch)

ends

the two outer end faces (default: what the end devices declare)

allow_steps

silence the warning about mismatched bores (default False)

Where two neighbouring devices have different bores, the junction is closed with an abrupt radial step. That is a real structure, so it is built, but it is easy to make by accident and hard to see once the walls are joined. Building the line therefore warns once, listing every step with its position and the two radii:

>>> Beampipe(R=40, L=40, name='narrow') + Beampipe(R=80, L=40, name='wide')
CavsimWarning: assembly 'assembly': aperture mismatch at 1 junction, closed with an abrupt radial step:
  z =    20.000 mm : 'narrow' ends at r = 40 mm, 'wide' starts at r = 80 mm  ->  step of +40 mm
If that is intended, pass allow_steps=True to silence this. If not, insert a Taper
between the elements, e.g. Taper(R_left=40, R_right=80, L=...).

line.check_continuity() returns the same list. Pass allow_steps=True when the steps are intended, or put a Taper between the devices.

Naming dimensions

A line gathers its devices’ dimensions into one dictionary, line.parameters. Each name is '<device label>:<dimension>', for example 'bellows:A' or 'cavity:Req_m', and that name is how you refer to a dimension when you tune, optimise or vary the line. A device’s label is its name, with _1, _2, … added where two devices share one. line.labels lists them in order.

Where each device sits

line.element_spans() lists where each device starts and ends along the axis, in mm, and line.shade_elements(ax) shades those spans behind an existing plot, so a field along the axis can be read against the hardware.

Which mode is reported

Only the cavities in a line count towards its number of cells, line.n_cells. Pipes, tapers, bellows and absorbers do not, so the accelerating mode reported for the line is the one its cavities set.

Modules of one cavity

To repeat one cavity into a module of identical cavities, pass chain when you build it. spacing sets the length of the drift between neighbouring cavities, in mm, from iris to iris:

module = EllipticalCavity(1, cell, beampipe='both', chain=4, spacing=30)
# the same, with the count and the drift together:
module = EllipticalCavity(1, cell, beampipe='both', chain={'count': 4, 'spacing': 30})

spacing takes one value for every drift, or a list with one per drift. Without it, the drift is the cavity’s two beam pipes end to end. Neighbouring cavities couple through the drift, so each mode of one cavity becomes a passband of chain modes in the module; the shorter the drift, the stronger the coupling.

How-to guides