- gridLoader
gridLoader¶
This particle source loads particles along the nodes of the simulation grid. It is a general loader that can work with a moving window.
This particle source is available for all VSim licenses.
gridLoader Sub-Blocks¶
- Slab
Slab (block) Is required to be named initLoadSlab and is the slab into which particles are loaded at
t = 0
. At later times, the load slab is the initial load slab moved by the sweep rate times the time.
- VelocityGenerator
VelocityGenerator (block) Is used to generate velocities of a particle when loaded. All velocities, including particle weight as a function of (x,y,z,t) must be specified in the laboratory frame. Particle positions and velocities are transformed internally in the moving frame of the simulation.
gridLoader Parameters¶
- applyTimes (double vector)
Times for when the source will generate particles.
- macroPerDir (double vector)
The number of macro-particles in each direction. The product of these is the number of particles loaded per cell.
- sweepVel (double vector)
Velocities at which the loading region is moving.
Example Particle Source Block of Kind gridLoader¶
<ParticleSource channelSrc>
kind = gridLoader
applytimes = [0. 1.]
<Slab initLoadSlab>
lowerBounds = [STARTRAMP_BOOST YSTART_LOAD ZSTART_LOAD]
upperBounds = [ENDPLASMA_BOOST YEND_LOAD ZEND_LOAD]
</Slab>
sweepVel = [$ -VX_BOOST $ 0. 0.]
macroPerDir = [NUM_PER_DX NUM_PER_DY NUM_PER_DZ]
# All velocity components (0,1,2) default to zero, which is what we want.
# Here, the particle weights (component 3) are set to create a short
# density ramp.
<VelocityGenerator rampVelGen>
kind = funcVelGen
# specify relativistic drift along x
<STFunc component0>
kind = constantFunc
amplitude = -UX_BOOST
</STFunc>
# specify weight of the variably-weighted particles
<STFunc component3>
kind = multFunc
<STFunc cosFT>
kind = expression
expression = 0.5 * H(pp(t, x) - STARTRAMP_BOOST) \
* H(STARTFLAT_BOOST - pp(t, x)) \
* (1 + cos(PI * (STARTFLAT_BOOST - pp(t, x)) \
/ RAMPLEN_BOOST)) + H(pp(t, x) - STARTFLAT_BOOST) \
* H(ENDFLAT_BOOST - pp(t, x)) \
+ 0.5 * H(pp(t, x) - ENDFLAT_BOOST) \
* H(ENDPLASMA_BOOST - pp(t, x)) \
* (1 + cos(PI * (pp(t, x) - ENDFLAT_BOOST) \
/ RAMPLEN_BOOST))
</STFunc>
<STFunc channel>
kind = leakyChannel
direction = [1. 0. 0.]
channelPosition = [0. 0. 0.]
maxParabRadius = MAXPARABRADIUS
maxRadius = MAXRADIUS
centerAmplitude = DENSRAT
quadCoef = QUADCOEF
</STFunc>
</STFunc>
</VelocityGenerator>
</ParticleSource>