Creating Bins 

EDEMpy offers methods for binning objects using the BoxBin and CylinderBin classes.

You can import these classes using:

from edempy import BoxBin, CylinderBin

BoxBin is defined by an origin [x, y, z] and edge lengths.
CylinderBin is defined by start and end points [x, y, z] and a radius.

You can search for any arbitrary list of objects inside a bin by passing two arguments to the getBinnedObjects() function.


boxbin = BoxBin([-0.25, 0.0, 0.0], 0.3, 1.0, 0.2)
ids = deck.timestep[tStep].particle[0].getIds()
pos = deck.timestep[tStep].particle[0].getPositions()
binned_ids = boxbin.getBinnedObjects(ids, pos)

The getBinnedObjects() function also accepts arguments for queryType (‘max’, ‘min’, ‘average’, or ‘total’) and transform where you can specify a 4x4 transformation matrix for translating and rotating the bin – this can be used with the getTransformMatrix() function on geometries to have bins track geometry motion.

Reading Binned properties

The getBinnedProperty() function can be used to collect binned particle, contact and bond data.

For example:

binnedAveVel, x, y, z =
     deck.timestep[tstep].particle[0].getBinnedProperty(50, 50, 50,

This returns binned average velocity for particle type 0, as well as the x, y, and z position of the bins. It is useful for displaying EDEM data as a continuum, plotted using Matplotlib functions such as contour() . You can also use it to calculate custom properties, such as the segregaton index.

By default, the bin’s max and min coordinates match the simulation domain, but custom limits can be passed. The default option returns IDs.

(c) 2023 Altair Engineering Inc. All Rights Reserved.

Intellectual Property Rights Notice | Technical Support