예제 #1
0

# electron bunch for iota

lattice = readLattice("iota_oct4.seq", "iota")
addAperture2(lattice)
"""------------------------------- add RF Cavity -----------------------------"""

ZtoPhi = 2.0 * pi / lattice.getLength()
dESync = 0.0
RFHNum = 4
RFVoltage = 400 * pow(10, -9)
RFPhase = 0.0
length = 0.05
name = "rfnode"
rf_node = RFNode.Harmonic_RFNode(ZtoPhi, dESync, RFHNum, RFVoltage, RFPhase,
                                 length, name)
position = 25.79485606
RFLatticeModifications.addRFNode(lattice, position, rf_node)

sizeX = 64  #number of grid points in horizontal direction
sizeY = 64  #number of grid points in vertical direction
sizeZ = 3  #number of longitudinal slices in the 2.5D space charge solver
calc2p5d = SpaceChargeCalc2p5D(sizeX, sizeY, sizeZ)

for node in lattice.getNodes():
    if node.getType() == "drift teapot":
        if node.getLength() > 0.01 and node.getLength() < 0.1:
            node.setnParts(2)
        elif node.getLength() >= 0.1 and node.getLength() < 0.5:
            node.setnParts(3)
        elif node.getLength() > 0.5:
예제 #2
0
#-----------------------------
# Add RF Node
#-----------------------------

teapot_latt.initialize()
ZtoPhi = 2.0 * math.pi / lattlength
dESync = 0.0
RF1HNum = 1.0
RF1Voltage = 0.000016
RF1Phase = 0.0
RF2HNum = 2.0
RF2Voltage = -0.000003
RF2Phase = 0.0
length = 0.0

rf1_node = RFNode.Harmonic_RFNode(ZtoPhi, dESync, RF1HNum, RF1Voltage,
                                  RF1Phase, length, "RF1")
rf2_node = RFNode.Harmonic_RFNode(ZtoPhi, dESync, RF2HNum, RF2Voltage,
                                  RF2Phase, length, "RF2")
position1 = 196.0
position2 = 196.5
RFLatticeModifications.addRFNode(teapot_latt, position1, rf1_node)
RFLatticeModifications.addRFNode(teapot_latt, position2, rf2_node)

#----------------------------------------------
#make 2.5D space charge calculator
#----------------------------------------------
#set boundary
nboundarypoints = 128
n_freespacemodes = 32
r_boundary = 0.110
boundary = Boundary2D(nboundarypoints, n_freespacemodes, "Circle", r_boundary,