📄 mcctest.inp
字号:
mccTest{This is a test input file, derived originally from the e150posb.inpfile, which is used to model the E-150 plasma lens experiment at SLAC --High-energy positron bunch enters a dense neutral gas in cylindrical geometry. The positron beam is Gaussian in z and r.Boundary conditions:a) The simulation region must be bounded by either conductors or insulators, in order to capture lost particles.b) Conductors were chosen, to avoid any charge build up.c) The choice of conducting boundary conditions means that electric fields parallel to the boundaries are forced to zero; however, fields near the boundaries of the simulation must be small anyway to accurately model a semi-infinite plasma, so this is OK.Gas jet:a) The MCC algorithm is used to model a gas jet, which is confined to a subregion of the grid.b) The MCC model is turned off after the beam has fully traversed the jet. Otherwise, the ionization cascade creates an exponentially growing number of ions and secondary electrons.Moving window:a) Once the positron beam is beyond the gas jet, a moving window algorithm is invoked so that the beam can then be modeled for relatively long times.b) This has the added benefit of removing the now-irrelevant ions and secondary electrons from the simulation, which speeds things up quite a bit.}// Define variables that can be used throughout this input file.Variables{// First, define some useful constants. pi = 3.14159265358979323846 speedOfLight = 2.99792458e+08 electronMass = 9.1093897e-31 unitCharge = electronMass * 1.75881962e11 electronCharge = -1. * unitCharge electronMassEV = electronMass * speedOfLight * speedOfLight / unitCharge ionCharge = unitCharge unitMassMKS = electronMass / 5.48579903e-04 lithiumMassNum = 6.942 lithiumMass = unitMassMKS * lithiumMassNum hydrogenMassNum = 1.00797 hydrogenMass = unitMassMKS * hydrogenMassNum nitrogenMassNum = 14.007 nitrogenMass = unitMassMKS * nitrogenMassNum// Next, define the parameters of the high-energy electron beam. beamEnergyEV = 1.0e+09 beamGammaMin1 = beamEnergyEV / electronMassEV beamGamma = 1 + beamGammaMin1 beamBetaGamma = sqrt( beamGammaMin1 * (beamGammaMin1+2) ) beamBeta = beamBetaGamma / beamGamma totalNumBeam = 1000000 totalBeamCharge = totalNumBeam * electronCharge rmsBeamRadius = 5.0e-05 rmsBeamLength = 5.0e-05 rmsBeamTime = rmsBeamLength / speedOfLight radialCutoffFac = 1 axialCutoffFac = 1 totalBeamRadius = radialCutoffFac * rmsBeamRadius totalBeamLength = 1 * axialCutoffFac * rmsBeamLength beamAspectRatio = totalBeamLength / totalBeamRadius totalBeamArea = pi * totalBeamRadius * totalBeamRadius rmsBeamVolume = pi * rmsBeamRadius * rmsBeamRadius * rmsBeamLength rmsEnergySpread = 0.0 beamTempEV = rmsEnergySpread * beamEnergyEV thermalBeamSpeedEV = 0.5 * beamTempEV rmsNormalizedEmittance = 0.0 rmsBeamSize = rmsBeamRadius / sqrt(2) rmsThermalBeta = rmsNormalizedEmittance / rmsBeamSize rmsThermalGamma = 1. / sqrt(1.-rmsThermalBeta*rmsThermalBeta) rmsVelocityMKS = rmsThermalBeta * speedOfLight rmsVelocityEV = (rmsThermalGamma-1.)*electronMassEV rmsEfactor = 8.0e-04 rmsVfactor = 1.0e-04// Define the number of grids in R and Z simRadiusOverBeamRadius = 1. totalSimulationLength = 0.001 simLengthOverBeamLength = totalSimulationLength / totalBeamLength numRgridsAcrossBeam = 4 numZgridsAcrossBeam = 4 numRgrids = numRgridsAcrossBeam * simRadiusOverBeamRadius numZgrids = numZgridsAcrossBeam * simLengthOverBeamLength numCells = numRgrids * numZgrids// Number of beam particles numBeamPtclsPerCell = 1000 numBeamCells = numRgridsAcrossBeam * numZgridsAcrossBeam numBeamPtcls = numBeamPtclsPerCell * numBeamCells beamNumRatio = totalNumBeam / numBeamPtcls// Intermediate calculations for modeling Gaussian shape of the beam. invSigRsq = 1.0 / ( rmsBeamRadius * rmsBeamRadius ) invSigZsq = 0.5 / ( rmsBeamLength * rmsBeamLength ) invSigTsq = invSigZsq * speedOfLight * speedOfLight// Calculate the size of the simulation region, grid spacings, time step.// We are assuming the same grid size in both z and r maxRadiusMKS = simRadiusOverBeamRadius * totalBeamRadius maxLengthMKS = simLengthOverBeamLength * totalBeamLength rGridSize = maxRadiusMKS / numRgrids zGridSize = maxLengthMKS / numZgrids dx = 1. / sqrt( 1./(rGridSize*rGridSize) + 1./(zGridSize*zGridSize) ) timeStep = 0.7 * dx / speedOfLight// Calculate peak currents for defining emission of the high-energy beam. peakCurrentDensity=totalBeamCharge*speedOfLight/rmsBeamVolume/sqrt(2.*pi) peakCurrent = peakCurrentDensity * totalBeamArea pulseLengthSec = totalBeamLength / speedOfLight oneHalfPulse = pulseLengthSec/2. oneEighthPulse = pulseLengthSec/8. threeEighthsPulse = 3.*oneEighthPulse sevenEighthsPulse = 7.*oneEighthPulse// Define gas density, pressure and other MCC parameters gasTempEV = 1.0e-06 // make gas cold (cannot set temperature to zero) gasDensityMKS = 1.0e+24 gasPressureTorr = 1.20e-21 * gasDensityMKS * gasTempEV Min1MCC = 0.0001 // leading edge of gas jet Max1MCC = 0.0007 // trailing edge of gas jet Avg1MCC = 0.5 * (Min1MCC + Max1MCC) // center of gas jet RMS1MCC = (Max1MCC - Avg1MCC)/3. // RMS width of gas jet Min2MCC = 1.27e-05 Max2MCC = 0.25*totalBeamRadius // Gas jet does not go out to full radius. // This reduces # of ions and secondary electrons}// This simulation has only one "region", which contains grid, all particles, etc.Region{// Define the grid for this region.Grid{// Define number of grids along Z-axis and physical coordinates. J = numZgrids x1s = 0.0 x1f = maxLengthMKS n1 = 1.0// Define number of grids along R-axis and physical coordinates. K = numRgrids x2s = 0.0 x2f = maxRadiusMKS n2 = 1.0}// Specify "control" parameters for this regionControl{// Specify the time step. dt = timeStep// Turn on damping for the high-frequency EM fields emdamping = 0.49}// Define the nitrogen ions.Species{ name = ions m = nitrogenMass q = ionCharge subcycle = 100 particleLimit = 5.0e+04 // prevents out-of-control growth in # of ptcls}// Define the secondary electrons.Species{ name = electrons m = electronMass q = electronCharge collisionModel = 1 particleLimit = 5.0e+04 // prevents out-of-control growth in # of ptcls}// Define the beam positrons.Species{ name = positrons m = electronMass q = unitCharge collisionModel = 1 rmsDiagnosticsFlag = 1}// Define the beam emitter, which introduces the high-energy beam into the// simulation.VarWeightBeamEmitter{ speciesName = positrons I = peakCurrent// Define the 2-D function F(x,t) that specifies beam emission profile. xtFlag = 3 F=step(pulseLengthSec-t)// Macroparticles are emitted from the left boundary, close to the axis of symmetry. j1 = 0 j2 = 0 k1 = 0 k2 = numRgridsAcrossBeam normal = 1 np2c = beamNumRatio// Emit particles, directed along the Z-axis, with specified energy and temperature. units = EV v1drift = beamEnergyEV v1thermal = rmsEfactor * rmsVelocityEV v2thermal = rmsVfactor * rmsVelocityEV// v3thermal = rmsVfactor * rmsVelocityEV}// Specify the Monte Carlo collision parameters for background gasMCC{ gas = N relativisticMCC = 1 pressure = gasPressureTorr temperature = gasTempEV analyticF = 1.0e+07*gasDensityMKS * exp(-(x1-Avg1MCC)*(x1-Avg1MCC)/RMS1MCC/RMS1MCC) eSpecies = electrons iSpecies = ions x1MinMKS = Min1MCC x1MaxMKS = Max1MCC x2MinMKS = Min2MCC x2MaxMKS = Max2MCC delayTime = delayTimeMCC // delay time in seconds before MCC kicks in stopTime = stopTimeMCC // time after which MCC is no longer used collisionFlag = 1 // collisions are on in the Monte Carlo if 1 (default) and off if 0. laserIonizationFlag = 1 // by analogy with collisionsFlag, default is 0. }// Specify a perfect conductor along the left boundary. This serves as a particle// boundary condition (catches particles that leave the simulation) and as a// field boundary condition (E_r is forced to vanish).Conductor{ j1 = 0 j2 = 0 k1 = 0 k2 = numRgrids normal = 1}// Specify a perfect conductor along the radial boundary. This serves as a// particle boundary condition (catches particles that leave the simulation)// and as a field boundary condition (E_z is forced to vanish).Conductor{ j1 = 0 j2 = numZgrids k1 = numRgrids k2 = numRgrids normal = -1}// Specify a perfect conductor along the right boundary. This serves as a// particle boundary condition (catches particles that leave the simulation)// and as a field boundary condition (E_r is forced to vanish).Conductor{ j1 = numZgrids j2 = numZgrids k1 = numRgrids k2 = 0 normal = -1}// Define the cylindrical symmetry axis.CylindricalAxis{ j1 = 0 j2 = numZgrids k1 = 0 k2 = 0 normal = 1}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -