Soil Bed Compaction EDEMpy Script



For the automotive and heavy equipment industries, tire-soil contact area and sinkage are highly relevant since they allow engineers to predict Tractor performance at field applications, allowing the analysis of parameters such as traction, slip and fuel efficiency.  It is possible to reduce the need of using conventional testing methods, involving lengthy and costly iterations on the field, to measure the sinkage through the use of simulations, where the variables that determine contact area and sinkage, such as soil type and tire geometry, can be changed quickly and easily. This EDEMpy script, used in post processing, can analyze and predict the sinkage of a vehicle in various materials, providing information that will assist in improving vehicle performance within a small amount of time and a fraction of the cost of experimental iterations.

The Soil Compaction script can be used to calculate the maximum compaction a bed of material experiences after a rigid tire has passed over it and returns the maximum compaction across the whole domain and the maximum compaction a particle can experience.

How it works

The compaction of the solid bed is calculated by comparing the surfaces of the bed before and after a tire has passed over it. The primary function of the code is to extract and compare the surface of the soil bed. This is done by dividing the bed domain into bins and then extracting the positions of the topmost particles using the numpy.max() function of Python. After all the maximum positions have been saved, the surface area can then be collated from the positions. This method however is sensitive to the number of bins used to extrapolate the surface and the size of the bins themselves. If there are too few or too many bins, the code will give misleading results. Similarly, if the bins are too far apart, the script will miss out data points that may contain important spatial values. With this in mind, an auto calculate feature is used in the code that determines the best number of bins, and their respective size, for accurate results.

Representation of the domain division, implemented in the get_surface() function

Due to the high degree of division of the domain, there is bound to be “noise”. The code filters out the noise by iterating again, this time only for the array of particles extracted through the main function of the script. Checks are conducted to see if the absolute difference between a particle's Z position and its neighbors' is greater than an empirically set value, determined through an iterative process. Should the particles have a greater difference, the Z position is replaced with the average Z position of its neighbors.

Filter method simplification. The Z-Position of the particle is compared within its horizontal and vertical neighbors. Should it be out of bound, it is replaced with their average.

Once filtered, the maximum and minimum Z positions of the extracted surface are located using numpy functions and their difference calculated. In addition, a particle-by-particle compaction is calculated by creating a mask array that checks which surface particles at the first timestep are also on the surface at the last timestep. This considers the displacement of the particles in other directions, caused by the interaction with the tire. 

The position of the point where maximum compaction occurs is located through the ID of the minimum point. The same ID is used later on to find and calculate the average compaction of the immediate neighbors of the lowest particle. The final part of the code plots the surface at the final timestep in a contour plot identifying the areas that feature the greatest and least compaction.

If you are looking for further information on EDEM or other Altair products we have plenty more on Altair Community: Altair Community EDEM

For instructions on how to set up EDEMpy see the following video:


Have EDEM 2023.1 or later installed.

Have EDEMpy 1.4 installed.

Usage/Installation Instructions

Download the attached files. The zip file contains an optional test deck.

Launch the EDEM deck with the soil bed. Open the preference file and change the settings accordingly. Define the correct EDEM deck and tire geometry names, select the appropriate settings such as custom selection, domain dimensions and auto-calculation of bins.

Go to the Analyst tab and click on File, Run EDEMpy script and select the script. Note that the deck and the script and preference file should be in the same folder. Run the script. A command prompt will open showing the results and check the folder for the output files.