Count Wall/Sphere contacts

Submitted by johnr on Thu, 03/28/2019 - 08:58

I would like to calculate the number of particles that hit a wall. I have implemented the 'compute conts all contact/atom' with the fix that allows the collisions to be summed (https://www.cfdem.com/forums/counting-particle-particle-collisions), but this is limited to sphere/sphere contacts. Is there a simple way to count wall-sphere contacts?

wd_whu | Thu, 03/28/2019 - 12:14

I don't know a direct way to get these data, but as far as I know, compute wall/gran/local command provides the information on particle-wall contacts. You can sum the contact of each particle.

johnr | Fri, 03/29/2019 - 11:03

Hi wd_whu, I think that will work! F.y.i., I add these lines to my script :

compute wp1 all wall/gran/local
dump dmpwp all local/gran/vtk 2500 post/wallgran*.vtp wp1

Then in the Paraview visualisation I can see rings around the particles that hit the wall using the Tube filter. I will only see the impacts that occur within the 2500 time-step output spacing, but I could shorten that if accurate impact data is necessary (I think an indicator may be fine for my purposes). And I'll need to decipher the .vtp file to make a count, but that is probably best done with a python script. Thanks again!

wd_whu | Fri, 03/29/2019 - 14:00

I recommend you delete vtk keyword in dump, so you can get data in ASCII format

johnr | Fri, 03/29/2019 - 15:47

There's a simpler solution. I've added an atom integer variable wall_cont that is initialized to 0. Then in FixWallGran::post_force_mesh
...
if(deltan <= 0 || (radius && deltan < contactDistanceMultiplier*radius[iPart]))
{
atom->wall_cont[iPart] = 1;
...
The particles that have hit the wall have wall_cont = 1. I've also added wall_cont to dump particle. This corresponds with the wall/gran/local result and I think it won't miss any contacts.