TITLE, STRING="Chopper cavity test"; OPTION, VERSION = 23000, //SEED = 123456789, // fix seed for particle generation and comparison reason ECHO = false, INFO = false, STATDUMPFREQ = 1, // after how many time steps we dump statistical data ENABLEHDF5 = true, PSDUMPFREQ = 100, // Affects the stdout information **BUNCH** EBDUMP = false, AUTOPHASE = 6; // how accurate the search for the phase at which the maximal energy is gained (default=6, off=-1) //---------------------------------------------------------------------------- // Beam parameter REAL freq_Hz = 1.3e9; //REAL Qbunch = 0.77e-12; // 1mA REAL Qbunch = 0.77e-15; //1 uA REAL current = Qbunch*freq_Hz; REAL lambda_m = 2.998e8/freq_Hz; REAL gamma = 611/511; REAL beta = sqrt(1-1/gamma^2); // Simulation parameter REAL nelectrons = 10000; //[1e4] REAL dt_s = 5e-12; //[10e-12] time step in s REAL zstop = 0.4; // in m //---------------------------------------------------------------------------- // Distribution distr_gauss_injected: DISTRIBUTION, TYPE = GAUSS, SIGMAR = 0.5e-3, CUTOFFR = 3, SIGMAZ = 0.0215, CUTOFFLONG = 3, WRITETOFILE = True, EMITTED=false; //DEBUG SIGMAZ = 0.015960; // [SIGMAZ]=m; distr_flattop_injected: DISTRIBUTION, TYPE = FLATTOP, SIGMAR = 10e-3, SIGMAZ = 0.1, EMITTED=false; //---------------------------------------------------------------------------- // Fieldsolver fieldsolver_default: FIELDSOLVER, FSTYPE = FFT, // Specify type of field solver ("none" does not respect space charge) MX = 20, // Number of grid points in x specifying rectangluar grid MY = 20, MT = 20, PARFFTX = true, // dimension x is distributed among the processors PARFFTY = true, PARFFTT = false, // changed that! BCFFTX = open, // Boundary condition in x,y options: [open] BCFFTY = open, BCFFTT = open, // Boundary condition in z options: [open, periodic] BBOXINCR = 10, // Enlargement of the bounding box in % GREENSF = INTEGRATED; //---------------------------------------------------------------------------- // Source cathode: SOURCE, ELEMEDGE = 0.0; // not yet known if really necessary //---------------------------------------------------------------------------- // Collimator REAL wcol = 0.03; REAL lcol = wcol; collimator1: FLEXIBLECOLLIMATOR, Z = 0.2, L = 10e-3, DESCRIPTION = "rectangle(0.005,0.005)", //DESCRIPTION = "ellipse(0.1,0.1)", OUTFN ="col_out.h5"; collimator2: RCOLLIMATOR, Z = 0.2, L = 10e-3, XSIZE=1, YSIZE=1, // Memory access error occurs if this line is commented out APERTURE="circle(0.01)"; driftcolli: DRIFT, APERTURE = "circle(0.005)", ELEMEDGE = 0.3, L = 1e-3; //---------------------------------------------------------------------------- //Drifts beampipe: DRIFT, APERTURE = "circle(0.04)", ELEMEDGE = 0, L = zstop; beamdump: DRIFT, APERTURE = "circle(0.0001)", ELEMEDGE = zstop, L = 1e-3; //---------------------------------------------------------------------------- // Monitors mon0: MONITOR, ELEMEDGE = 0.10, OUTFN="screen_0100"; mon1: MONITOR, ELEMEDGE = 0.40, OUTFN="screen_0300"; mon2: MONITOR, ELEMEDGE = 0.54, OUTFN="screen_0540"; mon3: MONITOR, ELEMEDGE = 0.70, OUTFN="screen_0700"; mon4: MONITOR, ELEMEDGE = 1.00, OUTFN="screen_1000"; mon5: MONITOR, ELEMEDGE = 1.20, OUTFN="screen_1200"; tmp0: MONITOR, ELEMEDGE = 0.70, OUTFN="temp_distr_0700", TYPE = TEMPORAL; monline: LINE=(mon0, mon1); // monline: LINE=(mon0, mon1, mon2, mon3, mon4, mon5, tmp0); //---------------------------------------------------------------------------- // Beamline mybeamline: LINE = (cathode, collimator1, monline);//, driftcolli); //---------------------------------------------------------------------------- // Beam mybeam: BEAM, PARTICLE = ELECTRON, ENERGY = EMASS+1e-4, // in MeV // But for gun no starting energy needed // ENERGY = EMASS+1e-9, // in GeV BCURRENT = current, // in A NPART = nelectrons, BFREQ = freq_Hz*1e-6; // [BFREQ] = MHz //---------------------------------------------------------------------------- // Simulation TRACK, LINE = mybeamline, BEAM = mybeam, MAXSTEPS = 10000, DT = dt_s, // in s ZSTOP = zstop; // in m RUN, METHOD = "OPAL-T", BEAM = mybeam, FIELDSOLVER=fieldsolver_default, // DISTRIBUTION=distr_gauss_injected; DISTRIBUTION=distr_flattop_injected; ENDTRACK; // SYSTEM, "python3 python_xy_multimon_enhanced.py $(ls screen_*.h5)"; STOP;