SAAMG-Test-1.in 2.11 KB
Newer Older
1 2
Title, string="Gaussian bunch test of simple beam pipe";

3
OPTION, ECHO = FALSE,
4 5
        PSDUMPFREQ = 10,
        STATDUMPFREQ = 10,
6
        REPARTFREQ = 1000;
7
Option, VERSION=10900;
8 9

// Some local variables
10 11 12 13 14 15 16 17 18 19
REAL Ekin = 59940*1e-9;          // eV -> GeV
REAL H2mass = 1.876634889;       // GeV/c^2
REAL Etot = Ekin+H2mass;
REAL gamma = Etot/H2mass;        // Dimless
REAL beta = sqrt(1-(1/gamma^2)); // Dimless
REAL gambet = gamma*beta;        // Dimless
REAL P0 = gambet*H2mass;         // GeV/c
REAL brho = (H2mass*1.0e9*gambet)/CLIGHT;
REAL RF_FREQ = 8.2 * 1e6; // Hz (6th harmonic = 49.2 MHz)
REAL harmonic = 6;
20 21 22
value,{Ekin, beta, gamma, brho, P0};

// Input variables from data file
23
REAL CURRENT = 30e-1;     // Beam current in A (0.01 - 0.05)
24 25 26 27 28 29 30 31 32 33 34

// Available Geometry Files
// Geometry File 1:  "Pipe_1m_10cm.h5"

INF_GEOM: GEOMETRY, FGEOM = "./Pipe_1m_10cm.h5", XYZSCALE = 0.001;

D1: DRIFT, ELEMEDGE = -0.5, L = 1.0;

L1: LINE = (D1);

Fs1: FIELDSOLVER, FSTYPE = SAAMG, MX = 16, MY = 16, MT = 16,
35
     PARFFTX = FALSE, PARFFTY = FALSE, PARFFTT = TRUE, GEOMETRY = INF_GEOM,
36
     ITSOLVER = CG, INTERPL = CONSTANT, TOL = 1.0e-6,
37 38
     MAXITERS = 1000, PRECMODE = STD;

39
Dist1: DISTRIBUTION, TYPE = GAUSS,
40
       OFFSETX = 0.0, OFFSETY = 0.0, OFFSETZ = 0.0,    // Centroid of bunch (m)
41 42 43 44 45
       SIGMAX = 1.5e-3, SIGMAY = 1.5e-3, SIGMAZ = 5.0e-3,  // Sigmas of the Gaussian bunch (m)
       OFFSETPX = 0.0, OFFSETPY = 0.0, OFFSETPZ = 0.0,     // Mean momenta (eV)
       SIGMAPX = 0.0 , SIGMAPY = 0.0 , SIGMAPZ = 0.0 ,     // Sigmas of the momenta (eV)
       CORRX = 0.0, CORRY = 0.0, CORRZ = 0.0;              // Correlations

46
//Dist1:DISTRIBUTION, TYPE = fromfile, FNAME="../fieldmaps/Benchmark.dat";
47 48

// Units: Mass in GeV/c^2, Charge in multiples of e, PC in betagamma
49
Beam1: BEAM, PARTICLE = H2, MASS = H2mass, CHARGE = 1.0, BFREQ = RF_FREQ*harmonic * 1e-6,
50
       PC = P0, NPART = 4096, BCURRENT = CURRENT;
51 52 53

Select, LINE = L1;

54
track, LINE = L1, BEAM = Beam1, MAXSTEPS = 1000, ZSTOP = 0.1, DT = 1.0e-10, ZSTART=15.0e-3;
55

56
run, METHOD = "PARALLEL-T", BEAM = Beam1, FIELDSOLVER = Fs1,
57 58 59 60
     DISTRIBUTION = Dist1, BOUNDARYGEOMETRY = INF_GEOM;

endtrack;

61
Stop;