Script for Computing Shear Rates From a 3D Grid in EDEM
Overview
This Python script computes shear rates for each point in a 3D grid in six tensor directions (zx,xz,zy,xy,yz,yx), as shown in Figure 1, using finite difference approximation. Shear rates for points at the boundaries of the grid are calculated by either forward or backward difference, and central difference is used for all interior points. The shear rate represents the rate at which adjacent layers of particles move past each other.
The script automatically calculates the distance between each point in each axis and performs the finite difference approximation for a point using the velocity values of its adjacent points.
Figure 1 - Shear Rate Direction Notation
All the requisite files for this script can be found here.
Pre-Requisite
The script computes the shear rates from EDEM velocity continuum data. In order to extract velocity data for each point in a grid once a simulation has finished, go to Analyst > Continuum Analysis > Add Continuum Item. Right click on the Continuum Item > Add Plane Group. Specify the location, size and density of the planes as well as the number of points per plane. Under Generate Data select the Velocity Attribute and Generate Data.
You can now export the data to a .csv file by selecting File > Export > Continuum Data. Specify the name of the .csv file and select the Continuum Item, making sure to deselect the Export Header option.
Usage/Installation Instructions
The settings of the script are contained in Shear_Rate_settings.txt and defined in Figure 2.
Figure 2 - Shear Script Settings Key
The numbers under "#Plane(s) Along [X,Y,Z] (integers)" determines which coordinate index along the axis will be plotted. For example, the data exported from the simulation analysed in this work in EDEM has 100 points along x, 6 along y, 100 along z. To plot the halfway point along z (z=10), one would define 49 under #Plane(s) along Z (integers), as the first plane will have an index of 0. The settings specified in Figure 2 produce the right hand side plot shown in Figure 3.
Figure 3 - EDEM Continuum Velocity Plane vs. Python Script Shear Rate Planes
The script also exports a ShearRate_analysis.csv file containing each point's coordinates and their respective velocity and shear rate components, shown in Figure 4.
Figure 4 - Portion of the ShearRate_analysis.csv File