📄 uspas02.inp
字号:
uspas02{This input file, uspas02.inp, was written by David Bruhwilerfor "Object Oriented Computational Accelerator Physics," atwo week course presented at the University of Colorado forthe U.S. Particle Accelerator School in June, 2001.Here, we model a quiescent electron plasma, with a uniform background of stationary ions, in Cartesian geometry.Low resolution and few particles are used here for testing purposes.Boundary conditions: The simulation region is bounded by perfect conductors. This is not optimal, but it correctly handles the issue of particles that exit the simulation.Topics for discussion: a) How are the plasma electrons initialized? b) What is the particle distribution in x, y, Ux, Uy? c) What sort of fields are generated by the plasma? d) What is happening at the boundaries? e) What happens if the plasma frequency is not resolved?}// Define variables that can be used throughout this input file.Variables{// First, define some useful constants. 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// Define the number of grids in X and Y numYgrids = 64 numXgrids = 64 numCells = numXgrids * numYgrids// Calculate the size of the simulation region, grid spacings, time step. xGridSize = 0.001 maxLengthMKS = numXgrids * xGridSize yGridSize = 0.001 maxWidthMKS = numYgrids * yGridSize effGridSize = 1. / sqrt( 1./(xGridSize*xGridSize) + 1./(yGridSize*yGridSize) ) timeStep = 0.9 * effGridSize / speedOfLight// Define the plasma density, number of plasma electron macro-particles, etc. plasmaDensityMKS = 2.e20 simulationVolume = maxWidthMKS * 1.0 * maxLengthMKS totalNumPlasma = plasmaDensityMKS * simulationVolume numPtclsPerCell = 4 numPlasmaPtcls = numPtclsPerCell * numCells plasmaNumRatio = totalNumPlasma / numPlasmaPtcls}// This simulation has only one "region", which contains// the grid, all particles, etc.Region{// Define the grid for this region.Grid{// Define number of grids along X-axis and physical coordinates. J = numXgrids x1s = 0.0 x1f = maxLengthMKS n1 = 1.0// Define number of grids along Y-axis and physical coordinates. K = numYgrids x2s = 0.0 x2f = maxWidthMKS n2 = 1.0// Specify Cartesian geometry Geometry = 1}// Specify "control" parameters for this regionControl{// Specify the time step. dt = timeStep}// Define the plasma ions.Species{ name = plasma_ions m = lithiumMass q = ionCharge}// Load the plasma ions over the entire simulation region.Load{ speciesName = plasma_ions density = plasmaDensityMKS x1MinMKS = 0.0 x1MaxMKS = maxLengthMKS x2MinMKS = 0.0 x2MaxMKS = maxWidthMKS// This specifies a static uniform background (no macro-particles). np2c = 0}// Define the plasma electrons.Species{ name = plasma_electrons m = electronMass q = electronCharge}// Load the plasma electrons over the entire simulation regionLoad{ speciesName = plasma_electrons density = plasmaDensityMKS x1MinMKS = 0.0 x1MaxMKS = maxLengthMKS x2MinMKS = 0.0 x2MaxMKS = maxWidthMKS np2c = 2 * plasmaNumRatio// Specify loading that is more uniform than random LoadMethodFlag = 1}// 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_y is forced// to vanish).Conductor{ j1 = 0 j2 = 0 k1 = 0 k2 = numYgrids normal = 1}// Specify a perfect conductor along the top boundary. This serves as a// particle boundary condition (catches particles that leave the simulation)// and as a field boundary condition (E_x is forced to vanish).Conductor{ j1 = 0 j2 = numXgrids k1 = numYgrids k2 = numYgrids normal = -1}// Specify a perfect conductor along the bottom boundary. This serves as a// particle boundary condition (catches particles that leave the simulation)// and as a field boundary condition (E_x is forced to vanish).Conductor{ j1 = 0 j2 = numXgrids k1 = 0 k2 = 0 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_y is forced to vanish).Conductor{ j1 = numXgrids j2 = numXgrids k1 = numYgrids k2 = 0 normal = -1}}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -