// This is Single EEX beamline for 50 MeV 6D gaussian beam OPTION, PSDUMPFREQ = 10; //How often 6d info is dumped to .h5 OPTION, STATDUMPFREQ = 10; //How often beam stats dumped to .stat. OPTION, AUTOPHASE=0; //Always leave this on, unless doing a phase scan OPTION, REPARTFREQ=5; OPTION, VERSION=10600; Title, string="6D Gaussian beam EEX beamline"; // ------------------------------------------------------------------------ // Global Parameters REAL field_maps = 2.0; //Either 2D or 3D field maps REAL rf_freq = 1300.0; //RF frequency. (MHz) REAL n_particles = 1e4; //Number of particles in simulation. REAL beam_bunch_charge = 200e-12; //Charge of bunch. (C) REAL beam_current = rf_freq*beam_bunch_charge*1e6; REAL fs_decomp = 3; // // Injected energy Cal. // REAL Edes = 0.0488; REAL gamma = (Edes+EMASS)/EMASS; REAL beta = sqrt(1-(1/gamma^2)); REAL P0 = gamma*beta*EMASS; value , {Edes, P0}; // Dipoles position REAL l1 = 11 + 4.3457; // 11 m - Linac end, 4.2672 m - distance between linac and Dipole start. REAL l2 = l1 + 1.7; REAL l3 = l2 + 1.71; REAL l4 = l3 + 1.7; Value, {l1,l2,l3,l4}; //-------------------------------------------------------------------------------- //DEEX dipole // // L: Effective Length of magnet (m). // Gap: Gap size of magnet (m). // ANGLE: when this option is set, all particles are bent 2 degrees // FMAPFN: A file with coefficients for the fringe field (default is provided by OPAL) // ELEMEDGE: Start of physical magnet // DESIGNENERGY: Energy you want to bend // First Dogleg EEXDIP1: RBend, ANGLE = 20.0 * (Pi / 180.0), FMAPFN = "EEXDIP1_4.opal", ELEMEDGE= l1, DESIGNENERGY = 48.8E6, E1=0, L = 0.27, GAP = 0.05, ROTATION=Pi; EEXDIP2: RBend, ANGLE = 20.0 * (Pi / 180.0), FMAPFN = "EEXDIP1_4.opal", ELEMEDGE= l2, DESIGNENERGY = 48.8E6, E1=20.0 * (Pi / 180.0),L = 0.27, GAP = 0.05, ROTATION=0; EEXDIP3: RBend, ANGLE = 20.0 * (Pi / 180.0), FMAPFN = "EEXDIP1_4.opal", ELEMEDGE= l3, DESIGNENERGY = 48.8E6, E1=0, L = 0.27, GAP = 0.05, ROTATION=Pi; EEXDIP4: RBend, ANGLE = 20.0 * (Pi / 180.0), FMAPFN = "EEXDIP1_4.opal", ELEMEDGE= l4, DESIGNENERGY = 48.8E6, E1=20.0 * (Pi / 180.0),L = 0.27, GAP = 0.05, ROTATION=0; REAL l5 = l4 + 4.059; REAL l6 = l5 + 1.7; REAL l7 = l6 + 1.71; REAL l8 = l7 + 1.7; //Second Dogleg EEXDIP5: RBend, ANGLE = 20.0 * (Pi / 180.0), FMAPFN = "EEXDIP5_8.opal", ELEMEDGE= l5, DESIGNENERGY = 48.8E6, E1=0, L = 0.3, GAP = 0.05, ROTATION=0; EEXDIP6: RBend, ANGLE = 20.0 * (Pi / 180.0), FMAPFN = "EEXDIP5_8.opal", ELEMEDGE= l6, DESIGNENERGY = 48.8E6, E1=20.0 * (Pi / 180.0),L = 0.3, GAP = 0.05, ROTATION=Pi; EEXDIP7: RBend, ANGLE = 20.0 * (Pi / 180.0), FMAPFN = "EEXDIP5_8.opal", ELEMEDGE= l7, DESIGNENERGY = 48.8E6, E1=0, L = 0.3, GAP = 0.05, ROTATION=0; EEXDIP8: RBend, ANGLE = 20.0 * (Pi / 180.0), FMAPFN = "EEXDIP5_8.opal", ELEMEDGE= l8, DESIGNENERGY = 48.8E6, E1=20.0 * (Pi / 180.0),L = 0.3, GAP = 0.05, ROTATION=pi; // TDC REAL l_t1=l2+0.5955; REAL l_t2=l6+0.5955; //TDC1: RFCavity, L = 0.47903, VOLT = 2.7907e-06, ELEMEDGE = l_t1, TYPE = "STANDING", // FMAPFN = "TDC.dat", FREQ = 1300, LAG = 0.59 *(Pi/180); //TDC2: RFCavity, L = 0.47903, VOLT = 2.5708e-6, ELEMEDGE = l_t2, TYPE = "STANDING", // FMAPFN = "TDC.dat", FREQ = 1300, LAG = 18.2 *(Pi/180); //Drift Space DR1: DRIFT, L = 10, ELEMEDGE = 25; //-------------------------------------------------------------------------------- // Quads // L: effective length (m) // K1: quad strength (T/m). // ELEMEDGE: Start of quad (m). Q1: QUADRUPOLE, L = 0.1, ELEMEDGE = l1-1.5599, K1 = 0; Q2: QUADRUPOLE, L = 0.1, ELEMEDGE = l1-1.3048, K1 = 0; Q3: QUADRUPOLE, L = 0.1, ELEMEDGE = l1-1.0551, K1 = 0; Q4: QUADRUPOLE, L = 0.1, ELEMEDGE = l1-0.8, K1 = 0; Q5: QUADRUPOLE, L = 0.1, ELEMEDGE = 17.6294, K1 = 0.0; Q6: QUADRUPOLE, L = 0.1, ELEMEDGE = 18.5384, K1 = 0; Q7: QUADRUPOLE, L = 0.2, ELEMEDGE = l4+1, K1 = 0; Q8: QUADRUPOLE, L = 0.1, ELEMEDGE = l4+1.2, K1 = 0; Q9: QUADRUPOLE, L = 0.1, ELEMEDGE = l4+1.4, K1 = 0; Q10: QUADRUPOLE, L = 0.1, ELEMEDGE = l4+1.6, K1 = 0; Q11: QUADRUPOLE, L = 0.1, ELEMEDGE = l4+1.8, K1 = 0; Q12: QUADRUPOLE, L = 0.1, ELEMEDGE = 30.0839, K1 = 0; Q13: QUADRUPOLE, L = 0.2, ELEMEDGE = 30.3343, K1 = 0; Q14: QUADRUPOLE, L = 0.1, ELEMEDGE = 30.6717, K1 = 0.0; //-------------------------------------------------------------------------------- // YAG Screens //YAG9: Monitor, L=0.01, ELEMEDGE = 8.76, OUTFN = "DYAG3.h5"; //YAG10: Monitor, L=0.01, ELEMEDGE = 11.477, OUTFN = "DYAG4.h5"; //YAG11: Monitor, L=0.01, ELEMEDGE = 14.848, OUTFN = "DYAG5.h5"; //YAG12: Monitor, L=0.01, ELEMEDGE = 15.808, OUTFN = "DYAG6.h5"; //------------------------------------------------------------------------------------- // DEFINE BEAM LINE //Complete accelerator INS: Line = (Q1,Q2,Q3,Q4); EEX1: Line = (EEXDIP1,EEXDIP2,EEXDIP3,EEXDIP4); EXP: Line = (Q7,Q8,Q9,Q10,Q11); EEX2: Line = (EEXDIP5,EEXDIP6,EEXDIP7,EEXDIP8); END: Line = (Q12,Q13,Q14,DR1); DEEX: Line = (INS,EEX1,EXP,EEX2); //------------------------------------------------------------------------------------- // INITIAL DISTRIBUTION: FLATTOP // // SIGMAX/Y: RMS radius of transverse (m). // TRISE/FALL: Rise time and fall time of longitudinal guassian (s). // TPULSEFWHM: FWHM of longitudinal guassian (s). // CUTOFFLONG: Longitudinal cuttoff in units of sigma. // NBIN: Number of energy bins to use during emission. // DEBIN: Min energy band for a bin in KeV. Defines when to combine bins. // EMISSIONMODEL: NOEQUIL emission mode simulates photoinjector. // EMISSIONSTEPS: Number of steps during emission. // Emission time step is adjusted to fit this number. // EKIN: Kinetic energy of electrons at emission (eV). Used for emission model. // ELASER: Energy of laser (eV). Used for NONEQUIL mode. // W: Photocathode work function (eV). Used for NONEQUIL mode. // FE: Fermi energy of photocathode (eV). Used for NONEQUIL mode. // CATHTEMP: Temperature of photocathode (K). Used for NONEQUIL mode. //NOTE: Transvers size of laser profile is equal to SIGMAX/Y // TRISE/FALL = 1.6869*simgar // Sigmar = FWHM / 2.35 //Dist: DISTRIBUTION, DISTRIBUTION = fromfile, FNAME="N5.dat"; Dist: DISTRIBUTION, DISTRIBUTION = GAUSS, SIGMAX = 0.001, SIGMAY = 0.001, SIGMAZ = 0.001, SIGMAPX = 0.001, SIGMAPY = 0.001, SIGMAPZ = 0.01, CUTOFFLONG = 3, NBIN = 40, OFFSETZ=11, WRITETOFILE = False; //NOTE: FWHM pulse width divided by emission steps gives the time step for the // emissions process. i.e 2e-12 / 100 gives a time step of 0.2e-13 (s) // during emission.This is the not the same as the time step used in rest of the file. //------------------------------------------------------------------------------------- // Define Field solvers // The mesh sizes should be a factor of 2 for most efficient space charge (SC) calculation. if (fs_decomp == 1.0){ BOOL decx = true; BOOL decy = true; BOOL decz = false; } else if (fs_decomp == 2.0){ BOOL decx = false; BOOL decy = false; BOOL decz = true; } else if (fs_decomp == 3.0){ BOOL decx = true; BOOL decy = true; BOOL decz = true; } FS_SC: Fieldsolver, FSTYPE = FFT, MX = 16, MY = 16, MT = 32, PARFFTX = true, PARFFTY = true, PARFFTT = true, BCFFTX = open, BCFFTY = open, BCFFTT = open, BBOXINCR = 14, GREENSF = INTEGRATED; //------------------------------------------------------------------------------------- // Beam Definition BEAM1: BEAM, PARTICLE = ELECTRON, pc = P0, NPART = n_particles, BFREQ = rf_freq, BCURRENT = beam_current, CHARGE = -1; //------------------------------------------------------------------------------------- // Run beamline // Run to some specified distance. // LINE: The combination of elements defined earlier. // BEAM: Beam defined earlier, tells what kind of particles and charge. // MAXSTEPS: Sets a boundary on the number of simulation steps. This should be a large number. // DT: time steps you want to use through out the beam line. // ZSTOP: tells opal when to switch between time steps, and what Z location to run to. TRACK, LINE = DEEX, BEAM = BEAM1, MAXSTEPS = 1900000, DT = {10e-12}, ZSTOP={21}; RUN, METHOD = "PARALLEL-T", BEAM = BEAM1, FIELDSOLVER = FS_SC, DISTRIBUTION = Dist; ENDTRACK; Stop; Quit;