////////////////////////////////////////////////////////////////////////////// // input file for injection envelope tracking // ////////////////////////////////////////////////////////////////////////////// OPTION, VERSION = 20000; OPTION, PSDUMPFREQ = 300; // 6d data written every 300 time steps (h5). OPTION, STATDUMPFREQ = 10; // Beam Stats written every 10 time steps (stat). //OPTION, BOUNDPDESTROYFQ=10; // Delete lost particles, if any OPTION, AUTOPHASE=4; // Autophase is on, and phase of max energy // gain will be found automatically for cavities. Title, string="Injector"; //---------------------------------------------------------------------------- //Global Parameters REAL h = 2; //harmonic number REAL f0 = 37.4179197618764e6; //Hz REAL f1 = h*f0; REAL sigmarf = 1; //rf sigma for injected bunch (degree) REAL n_particles = 1e4; //Number of particles in simulation REAL nsteps = 100000; //Number of steps REAL current = 10e-3; //Current (mA) //Initial Momentum Calculation REAL Eo = 0.04; //initial energy in MeV REAL Edes = Eo/1000; REAL gamma = (Edes+PMASS)/PMASS; REAL beta = sqrt(1-(1/gamma^2)); REAL gambet = gamma*beta; REAL P0 = gamma*beta*PMASS; //inital z momentum REAL sigmaZ = sigmarf/360/f0*beta*CLIGHT; //Printing initial energy and momentum to terminal output. value , {Edes, P0, sigmaZ}; //---------------------------------------------------------------------------- // RF photoinjector (Gun) // // Cavity/RF field. // // L: physical element length (real in m). Length (of field map) (m). // VOLT: field scaling factor (real). RF field magnitude (MV/m). // FMAPFN: file name, or full path name to file (string) // ELEMEDGE: physical start of the element on the floor (m) // TYPE: specifies "STANDING", "TRAVELLING" or "SINGLE GAP" structure // FREQ: RF frequency of cavity (real in MHz). Resonance frequency. // LAG: cavity phase (radians) // //gun_inj_phase = 0.0; // Rf injection phase (in degrees) with restpect // to max phase. i.e. 0.0 inj phase corresponds // to running on crest (max energy). //GUN: RFCavity, L = 0.2927, VOLT = 60.0, ELEMEDGE = 0.0, TYPE = "STANDING", // FMAPFN = "DriveGun.T7", FREQ = 1300.0, LAG = (gun_inj_phase*Pi)/180.0; //LAG (phase) is converted to radians //---------------------------------------------------------------------------- //Drift after gun. DR1: DRIFT, L = 1, ELEMEDGE = 0; //---------------------------------------------------------------------------- // DEFINE BEAM LINE //GS: Line = (GUN, BF, M); // Complete accelerator DRIVE: Line = ( DR1); //---------------------------------------------------------------------------- // INITIAL DISTRIBUTION // // Flattop distribution. // SIGMAX/Y: RMS radius of transverse beam size (Laser radius in m). // TRISE/FALL: Rise time/fall time in longitudinal direction (s). // TPULSEFWHM: FWHM in longitudinal direction (s). // CUTOFFLONG: Longitudinal cuttoff in units of sigma. // NBIN: Number of energy bins to use during emission. // DEBIN: Defines when to combine bins (Min energy difference in KeV). // EMISSIONSTEPS: Number of steps during emssion. // Emission time step is adjusted to fit this number. // EKIN: Kinetic energy of electrons at emission (eV). // ELASER: Energy of laser (eV). // W: Photocathode work functioin (eV). // FE: Fermi energy of photocathode (eV). // CATHTEMP: Operating temperature of photocathode (K). // Note, ELASER, W, FE, and CATHTEMP are used for the NONEQUIL emission model. // These values are not necessary when using other models. Dist:DISTRIBUTION, TYPE=gauss, INPUTMOUNITS=NONE, sigmax= 1e-03, sigmapx=gambet*10e-3, corrx=0.0, sigmay=1e-3, sigmapy=gambet*10e-3, corry=0.0, sigmaz= sigmaZ, sigmapz=gambet*5e-3, corrz=0.0; // Note on emission time step: FWHM pulse width divided by emission // steps gives the time step for the emissions process. // i.e 20.0e-12 / 100 gives a time step of 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 calculation. FS_SC: Fieldsolver, FSTYPE = FFT, MX = 16, MY = 16, MT = 16, // SC grid size is 16^3 PARFFTX = true, PARFFTY = true, PARFFTT = false, BCFFTX = open, BCFFTY = open, BCFFTT = open, BBOXINCR = 1, GREENSF = INTEGRATED; BEAM1: BEAM, PARTICLE = PROTON, pc = P0, NPART = n_particles, BFREQ = f1,BCURRENT = current, CHARGE = 1; TRACK, LINE = DRIVE, BEAM = BEAM1, MAXSTEPS = nsteps, DT = {1.0e-11}, ZSTOP={1.0}; RUN, METHOD = "PARALLEL-T", BEAM = BEAM1, FIELDSOLVER = FS_SC, DISTRIBUTION = Dist; ENDTRACK; Stop; Quit;