EDEMpy offers methods for binning objects using the BoxBin and CylinderBin classes. Users 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.
Any arbitrary list of objects can be searched for inside a bin by passing the getBinnedObjects() function two arguments. For example:
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.
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, option='velocity’, average=True)
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) 2022 Altair Engineering Inc. All Rights Reserved. |
||