Packing generator batch

Purpose

The packing_generator batch inserts particles in parallel, even across processor boundaries (examples).

Syntax

insertion [insertion keywords] packing_generator style batch keyword value

Keywords

Description

batch_volume_fraction

volume fraction of a single batch; mutually exclusive with batch_size
default: 0.05; range: (0,1); units [-]

batch_size

number of particles in a single batch; mutually exclusive with batch_volume_fraction
range: [1,∞); units: [-]

batch_limit

maximum number of allowed batch loops
default: 1000; range: [1,∞); units: [-]

empty_batch_limit

maximum number of allowed batch loops that do not insert any additional particles
default: 5; range: [1,∞); units: [-]

Examples

insertion mode pack region reg1 particle_distribution pd1 velocity constant ( 0, 0, -1 ) &
     packing_generator style batch

insertion mode pack region reg1 particle_distribution pd1 velocity constant ( 0, 0, -1 ) &
     packing_generator style batch batch_volume_fraction 0.2

insertion mode pack region reg1 particle_distribution pd1 velocity constant ( 0, 0, -1 ) &
     packing_generator style batch batch_size 100 batch_limit 100 empty_batch_limit 3

Description

All insertion commands use packing generators in the background, which are responsible for the generation of the particles (see here). The packing generator of style batch allows to insert particles across processor boundaries and helps to avoid undesired gaps:

_images/packing_generator.png

Insertion of a pack of particles on four cores, once with packing generator of style simple (a) and once with packing generator of style batch (b).

In contrast to other insertion methods, the layout of the insertion does not depend on the number of processors in this case, meaning that a serial batch insertion is identical to the same batch insertion on N processors.

The algorithm creates a batch of non-overlapping particles, which it then tries to insert in the domain. The number of particles in the batch is set by batch_volume_fraction [default], which computes the batch size from the volume fraction, or batch_size. The size of a batch should remain rather low, to ensure the creation of the batch can be done without too much computational effort. Only non-overlapping (with already inserted) particles from the batch will be actually inserted in the domain.

If none of the particles from a batch could be inserted, a new batch (new particle positions and orientations) will be created. The batch cycle can be limited by empty_batch_limit, which reflects the maximum number of batches with zero insertions. Another way to limit the batch cycle is by the batch_limit keyword, which reflects the overall maximum number of batch loops. Finally, the batch cycle will also be finished if the total amount of particles to be inserted is reached. Note that if any of these limits is reached, the batch insertion cycle will be stopped.

Restrictions

Please note that style batch cannot be use for insertion regions of style mesh/vtk.