EDEM API: Particle Body Force – Residence Time and Distance Travelled in Geometries

Stephen Cole
Stephen Cole
Altair Employee
edited May 2023 in Altair Exchange

Overview

Here you can find the source code and example deck for a Particle Body Force model tracking the distance travelled, as well as residence time, within specific geometries.

The total distance travelled by particles inside the boundaries of one or more predefined geometries (which can either be a sphere, box or cylinder) is stored in a Distance Tracked custom property. With this model, it is therefore possible to analyze the total distance travelled within specific volumes of interest.

In DistanceInVolume_2022.zip you will find :

  • PleaseRead-PrefsFileFormat.txt outlining how to specify the bins

src folder : The source code of the plugin.
example folder which contains :

  • An example deck
  • The compiled .dll (Windows), .so (Linux)  and .cu file (for CUDA GPU processing)
  • DistanceInVolumePrefs.txt : the preference file used for the example (which is the exact same format as the Residence Time in Geometries example)

This plugin is GPU compatible and uses the version 3.4 of the API and is supported on EDEM 2022.1 or newer.

 image

Pre-Requisite

EDEM 2022.1 or later

Usage/Installation Instructions

  • To use download the .zip file and extract the contents.
  • Go to the Example folder and open the DistanceInVolume.dem file
  • This has been setup with the DistanceInVolume library (.dll or .so file) loaded into the EDEM Particle Body Force
  • This also supports GPU as the .cu file is included in the same folder
  • The properties of a particle is only updated when it is within the boundaries of the geometry defined in the DistanceInVolumePrefs.txt (prefs file format detailed below).
  • In the Analyst once the simulation is run the properties are accessible through a custom property called "Custom Residence Time" and “Distance Tracked”

Prefs file format:

It is possible to define up to 7 geometries in the DistanceInVolumePrefs.txt file and the particles they will affect.
3 kinds of geometries are available : Sphere, Box and Cylinder.
If there is no preference file, the plugin will simply calculate the properties for all particles in the whole simulation domain.

A geometry is defined according to the following model.
It is possible to specify up to 7 geometries one after another.

GeometryType ParticleName1 ParticleName2 ... ParticleNameN
******************** Geometry Data ***********************

GeometryType : "Sphere", "Cylinder" or "Box" 
               These are the geometries domains types available in this version. Any other name (such as "None")
           will trigger the calculation in the whole simulation domain (default behaviour) 
           The properties will be updated only inside the geometry  
ParticleNameX : Name of a particle for which the properties will be calculated in this geometry
        It is possible to specify as many particle names as desired
           "All" enable the properties for all particles in this geometry     

The Geometry Data block of parameters depends on the chosen Geometry Type.
All dimensions are in millimeters and the angles are in degrees.

For Sphere :

CenterX CenterY CenterZ
Radius

For Cylinder :

StartPointX StartPointY StartPointZ
RadiusStart
EndPointX EndPointY EndPointZ
RadiusEnd

For Box :

CenterX CenterY CenterZ
SizeX SizeY SizeZ
RotationX RotationX RotationX

IMPORTANT : Do not input any value in Geometry Data if the GeometryType is not Sphere/Cylinder/Box 

### TIP ###

The geometries Cylinder and Box are defined on the preference file in the same way EDEM does.
This means that it is possible to easily define a Virtual Geometry in EDEM for a better visualization
of the Particle Property evolution.