Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Submit feedback
  • Sign in
S
src
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 70
    • Issues 70
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 4
    • Merge Requests 4
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • OPAL
  • src
  • Wiki
  • FFA

FFA

Last edited by ext-rogers_c Nov 24, 2020
Page history

Examples are provided for tracking FFAs in a number of circumstances:

  1. Tracking through an analytical horizontal FFA field model
  2. Tracking through a 3D field map.
  3. Tracking through an analytical horizontal FFA field model with RF acceleration
  4. Tracking through an analytical vertical FFA field model

The following workflows have been checked with OPAL 2.0.0rc2 and OPAL 2.4.0_2.

Tracking through an analytical field model

OPAL can use a fully scaling field model including scaling fringe fields to model FFAs analytically. A sample lattice file is available in this example:

example_1-OPAL2.0.0rc2.tar.gz (Tested on OPAL2.0.0rc2)

example_1-OPAL2.4.0.tar.gz (Tested on OPAL2.4.0_2)

To run the example, download the file example.tar.gz and do

tar -xzf example_1-OPAL2.4.0.tar.gz

Then change into the working directory and run the code:

cd example_1/example_sector_ffa

/path/to/bin/opal SectorFFAGMagnet

cd ..

If it worked - congratulations, you have run OPAL. You should see a lot of output. There is a sample log file here:

log

OPAL parses the input file, then writes out the position of each field element, then tracks the particle with some debugging output. You can then make some plots:

python example_scripts/plot_orbit.py example_sector_ffa/

For OPAL2.4.0 version, the plotting routines use matplotlib and python3. The OPAL2.0.0 version use python2 and PyRoot, the python API for ROOT plotting library. Here is an example of the sort of plots you might see:

opal_example_1_x_y_bz

Three sectors are shown, together with the dipole (bz) field in Tesla and a low energy proton trajectory at injection (3 MeV).

Tracking through an 3D field map

OPAL can be used to track through a 3D field map. By default interpolation is trilinear. A sample lattice file is available in this example:

example_2-OPAL2.0.0rc2.7z (Tested on OPAL2.0.0rc2)

example_2-OPAL2.4.0.7z (Tested on OPAL2.4.0_2)

Due to the size of the field map this example was compressed using 7za. Uncompress using 7za from p7zip package. Then run in the usual way.

7za x example_2-OPAL2.4.0.7z

cd example_2/example_main_ring

/path/to/bin/opal KURNS_ADS_Ring

cd ..

Here is an example log file:

log

To make plots, again do

python example_scripts/plot_orbit.py example_main_ring/

Here is an example of the sort of plots you might see:

opal_example_2_x_y_bz

Three sectors are shown, together with the dipole (bz) field in Tesla and a low energy proton at injection (11 MeV).

Tracking through an analytical field map with acceleration

OPAL can also model the full acceleration cycle for an FFA. There is an example FFA with RF active here:

example_3-OPAL2.0.0rc2.tar.gz (Tested on OPAL2.0.0rc2)

example_3-OPAL2.4.0.tar.gz (Tested on OPAL2.4.0_2)

Unpack it and run it like:

tar -xzf example_3.tar.gz

cd example_3/example_sector_ffa

/path/to/bin/opal SectorFFAMagnet

cd ..

Here is an example log file:

log

To make plots of the RF field do

python example_scripts/plot_dump_fields.py example_sector_ffa/

and to plot the particle energy with time, do

python example_scripts/plot_output_planes.py example_sector_ffa/

Here are a couple of examples of the sort of plots you might see:

cavity_time_dependence_0 cavity_time_dependence_5

These two plots show the RF cavity oscillations at injection and after 500 microseconds. Note how the frequency of the RF cavity has increased - this is to match the increased particle revolution frequency (as the particles have accelerated so much).

The particle energy increases with time to match the RF frequency, like:

t_vs_energy

It looks like the acceleration worked! There are actually two particle trajectories shown: the black points show a particle tuned to match the RF reference trajectory, while the blue points show a particle that is offset longitudinally and oscillating around the reference trajectory.

Tracking through an analytical vertical FFA field map

OPAL can track through a vertical FFA field, where the orbit moves vertically as the energy increases. This is unlike a conventional hFFA where the orbit moves radially. There is an example of OPAL with a vertical FFA field here (OPAL >2.4.0 only):

example_4-OPAL2.4.0.tar.gz

Run it like

tar -xzf example_4-OPAL2.4.0.tar.gz

cd example_3/example_sector_ffa

/path/to/bin/opal VerticalSectorFFA

cd ..

Here is an example log file:

log

To make plots of the field and orbits

python example_scripts/plot_orbit.py example_vertical_ffa/

Here is the sort of plot you might see:

opal_example_4_x_y_bz

This shows the field in the vertical direction with the trajectory of the closed orbit superimposed. The lattice is a 10 cell triplet lattice, as described in https://arxiv.org/abs/2011.10783. Note that at present (Nov 2020), RF acceleration is not supported in VFFAs.

Clone repository
  • FFA school prerequisites
  • FFA
  • For-Developers
    • CodingStyle
    • Compile OPAL at CSCS
    • Compile OPAL
    • File Format for stat Storage
    • Most Used Directories in the Code
    • OPAL Development Workflow
    • Periodic Tele cons
    • Pmodules
    • Release Procedure
    • opaldks
    • tech ideas
  • For-Developers/Periodic-Tele-cons
    • 20191210
    • 20200420
View All Pages