- cutCellPosGen
cutCellPosGen¶
As an emitter it generates particle positions on the surface of a grid boundary using a triangulated approximation of that boundary and/or as a loader generates particles into a region defined by a grid boundary.
cutCellPosGen only works with the xvLoaderEmitter and in combination with a velocity generator. cutCellPosGen will actually work on problems when no cut cells exist provided in the grid boundary block
calculateVolume = true
is used.
cutCellPosGen Parameters when Emitting¶
Use emit=true and load=false in the ParticleSource block
- emitterBoundary (string, required)
defines the grid boundary that particles will be emitted from. Particles can be emitted from a subset of the emitterBoundary by the use of a mask. In order for a grid boundary to be used as an emission boundary the grid boundary must have
calculateVolume = true
within the grid boundary block, this allows for the computation of triangulated surfaces which are required for emission.
- nomMacroPtclsPerStep (float, required)
Defines the number of macro particles to be emitted per step.
- emitterMask (string, optional)
Used to mask out parts of the emitterBoundary. The emitterMask is a gridBoundary where emission regions are defined to be positive and non-emission regions are
0
or negative. The intersection of the positive regions of the emitterMask with the surface of the emitterBoundary defines the region where particles can be placed on the surface for emission. The emitterMask always points to a grid boundary and never to an STFunc Block or other structure.
- mask (block, optional)
A mask for the emitterBoundary can be specified using an STFunc Block
<STFunc mask>
with the explicit name “mask” instead of the emitterMask. This allows the mask to be defined using an STFunc, which requires no geometry data. The emission region is computed once at the beginning of the simulation so time dependence of the STFunc is effectively ignored in the current implementation. Emission regions are defined to be positive and non-emission regions are0
or negative.
- emissionOffset (float, optional)
Defines the distance that particles are offset from the desired emission location on a grid boundary surface. The emissionOffset is measured as a fraction of the average cell edge length in each direction. So offset=emissionOffset*(dx+dy+dz)/3. The emission offset is often required to prevent particles from being immediately absorbed since emitters and absorber frequently exist on the same grid boundary. Furthermore, when the absCutCell absorber is used, the absorption boundary can be slightly ahead of the emission boundary resulting in patches of particles that are absorbed upon emission. emissionOffset should be a value between 0 and 1 with smaller values putting the particles closer to the true emission region. In many cases an emission offset of
0
will work.
- positionFunction (string, optional, default = random)
Choose the type of loading, either bit reversed (quasi-uniform) or random, valid options
random
,Random
,bitReversed
orbitreversed
.
Note
In serial runs, the position generator will dump exactly nomMacroPtclsPerStep macroparticles per step. In parallel runs, where the emitter is cut by block boundaries, only approximately this number of particles will be emitted.
Note
If both an STFunc mask and an emitterMask are defined, then the emission region becomes the intersection of the STFunc mask the emitterMask and the surface of the emitterBoundary.
Note
If you do not specify an emitterMask or <STFunc mask> then Vorpal emits particles from the entire emitterBoundary.
cutCellPosGen Parameters when Loading¶
Use emit=false and load=true in the ParticleSource block
- gridBoundary (string, required)
Defines the grid boundary to be used for loading. Particles are loaded wherever this gridBoundary is positive.
- ptclsPerCell (int, required)
Defines the number of particles to be distributed per cell on average.
- positionFunction (string, optional, default = random)
Choose the type of loading, either bit reversed (quasi-uniform) or random, valid options
random
,Random
,bitReversed
orbitreversed
.
When you use cutCellPosGen to load particles, Vorpal loads the particles into a region defined by a grid boundary. An alternative method to loading particles in a geometric region is by defining a loadSlab and then using <STFunc relMacroDenFunc> to reject particles outside the region defined by the <STFunc relMacroDenFunc>. However, this method is much less efficient since many particles may be rejected. In contrast, cutCellPosGen loads only particles within the specified region, rejecting a small number of particles.
It is also possible to use an <STFunc relMacroDenFunc> in conjunction with the cutCellPosGen. First define the loading region based on the gridBoundary and next use the relMacroDenFunc to either limit it further or give the loading a spatially varied shape.
Note
gridBoundary and emitterBoundary
are actually the same variable, so if both load = true
and
emit = true
only one of these grid boundaries needs to be
defined as the other is redundant. Vorpal first checks for the existence
of emitterBoundary, if emitterBoundary is not found then Vorpal looks
for gridBoundary.
Example cutCellPosGen Block in Emitter Mode¶
Note
The names cathode and theMask refer to a pre-defined grid boundary.
<PositionGenerator thisGen>
emit = true
load = false
kind = cutCellPosGen
nomMacroPtclsPerStep = 20.0
emitterBoundary = cathode
emitterMask = theMask
emissionOffset = 0.1
<STFunc mask>
kind=expression
expression = x
</STFunc>
</PositionGenerator>