OpalRingTest.in 1.82 KB
Newer Older
1 2 3 4 5
//////////////////////////////////////////////////////////////////////////////
// Input file for single bunch tracking through ERIT FFAG ring              //
//////////////////////////////////////////////////////////////////////////////
Title,string="ERIT test simulation using OPAL code";
Option, ASCIIDUMP=TRUE;
6
OPTION, PSDUMPFREQ=100000;
7
Option, VERSION=10900;
8

9 10 11 12 13 14 15 16 17
REAL Edes=0.011;
REAL e_tot = (Edes+PMASS);
REAL p_tot = (e_tot^2-PMASS^2)^0.5;
REAL gamma = e_tot/PMASS;
REAL beta = p_tot/e_tot;
REAL gambet = gamma*beta;
REAL P0 = gamma*beta*PMASS;
REAL brho = (PMASS*1.0e9*gambet) / CLIGHT;
REAL x_closed_orbit = 2349.008;
18 19 20 21

// print to terminal
value,{gamma,brho,Edes,beta,gambet,x_closed_orbit};

22 23
REAL n_turns=100.0;
REAL revolution_period=327;
24

25 26 27 28
REAL step_size=0.1; // ns
REAL max_steps=n_turns*revolution_period/step_size;
REAL steps_per_turn=revolution_period/step_size;
REAL frequency=6000/revolution_period;
29

snuverink_j's avatar
snuverink_j committed
30
value,{n_turns,revolution_period,step_size,frequency};
31 32 33

Probe1: PROBE, xstart=0, xend=+4000., ystart=0, yend=0.;

adelmann's avatar
adelmann committed
34 35
ringdef: RINGDEFINITION, HARMONIC_NUMBER=6, LAT_RINIT=2350.0, LAT_PHIINIT=0.0,
         LAT_THETAINIT=0.0, BEAM_PHIINIT=0.0, BEAM_PRINIT=0.0,
36 37
         BEAM_RINIT=x_closed_orbit, SYMMETRY=8.0, RFFREQ=frequency, IS_CLOSED=true;

Andreas Adelmann's avatar
Andreas Adelmann committed
38
triplet: SBEND3D, FMAPFN="OpalRingTest.field", LENGTH_UNITS=10., FIELD_UNITS=1e-3;
39

40
l1: Line = (ringdef, probe1, triplet);
41

Andreas Adelmann's avatar
Andreas Adelmann committed
42
Dist1: DISTRIBUTION, TYPE=fromfile, FNAME="beam.dat", INPUTMOUNITS=NONE;
43

44
Fs1:FIELDSOLVER, FSTYPE=FFT, MX=2, MY=2, MT=2,
45 46 47
		 PARFFTX=true, PARFFTY=true, PARFFTT=false,
		 BCFFTX=open, BCFFTY=open, BCFFTT=open,BBOXINCR=2;

adelmann's avatar
adelmann committed
48
beam1: BEAM, PARTICLE=PROTON, pc=P0, NPART=12, BCURRENT=1.0E-19, CHARGE=1.0, BFREQ=frequency;
49

adelmann's avatar
adelmann committed
50 51 52
TRACK, LINE=l1, BEAM=beam1, MAXSTEPS=max_steps, STEPSPERTURN=steps_per_turn;
RUN, METHOD="CYCLOTRON-T", BEAM=beam1, FIELDSOLVER=Fs1, DISTRIBUTION=Dist1;
ENDTRACK;
53
STOP;