Collision detection among particles with different sizes

Submitted by limone on Fri, 01/12/2018 - 18:17

Dear All,

I have a poly-dispersed system (particles with 44 sizes) and I would like to create an output for the collisions between the particles, a list of collisions (for all the collisions) like:

id particle-i | id particle-j | time-step when the collision occurs

To me, what is important is to know the id of the colliding particles. In such a way I can link the id to the radius of the colliding particles and "make statistics" on the "collisions per each particle size".

My input file (in.liggghts_init) is like this one:

fix pts1 all particletemplate/sphere 10007 atom_type 1 density constant 1500 radius constant 0.000140
fix pts2 all particletemplate/sphere 10009 atom_type 1 density constant 1500 radius constant 0.000160
fix pts3 all particletemplate/sphere 10037 atom_type 1 density constant 1500 radius constant 0.000180
fix pts4 all particletemplate/sphere 10039 atom_type 1 density constant 1500 radius constant 0.000200
fix pts5 all particletemplate/sphere 10061 atom_type 1 density constant 1500 radius constant 0.000220
fix pts6 all particletemplate/sphere 10067 atom_type 1 density constant 1500 radius constant 0.000240
fix pts7 all particletemplate/sphere 10069 atom_type 1 density constant 1500 radius constant 0.000260
fix pts8 all particletemplate/sphere 10079 atom_type 1 density constant 1500 radius constant 0.000280
fix pts9 all particletemplate/sphere 10091 atom_type 1 density constant 1500 radius constant 0.000300
fix pts10 all particletemplate/sphere 10093 atom_type 1 density constant 1500 radius constant 0.000320
.
.
.
.
.
fix pts44 all particletemplate/sphere 10391 atom_type 1 density constant 1500 radius constant 0.001000

Do you have any suggestion on what part of the LIGGGHTS code I need to change and, above all, how ?

Best regards,
Limone

AndresMM | Tue, 01/16/2018 - 12:32

Well, the question is
1- how do you know when a collision took place, and
2- Between which particles?

I guess you could also dump the force chains. There are only force chains if 2 particles are touching (collision) (answer to question 1). I assume that it is possible to find the particle ID from the forcechains dumps too (answer to question 2).

The problem would like on the time the collisions/contact take place. I assume they are just a couple of time-steps in contact so in order to capture all collisions through the dump files, you would have to dump very often. You could try making a python script that deletes the empty forcechain-dumps every 1000x timesteps and only leaves the ones with actual collisions.

limone | Tue, 01/16/2018 - 17:14

Many thanks AndresMM !!

I will try to "force chain" output as you suggested, besides the "compute contact/atom" ..... therefore something like:

compute contact/atom
compute atomtrack all contact/atom
dump collide all custom 200 CSVs/dump*.doll.csv c_atomtrack

force chains
compute fc all pair/gran/local id pos force
dump cforce all local 200 post/dump.fc.*.liggghts c_fc[1] c_fc[2] c_fc[3] c_fc[4] c_fc[5] c_fc[6] c_fc[7] c_fc[8] c_fc[9] c_fc[10] c_fc[11] c_fc[12]

Then, I will try to understand how to mix those information... :-)

Cheers,
Limone

limone | Thu, 01/25/2018 - 17:37

Dear AndresMM,

I got the output from both compute contact/atom for the contact detection of each particle and compute pair/gran/local for the force chain.

The results for the two files at the same time-step are different. Please have a look:

dump.fc.10000.liggghts


ITEM: TIMESTEP
10000
ITEM: NUMBER OF ENTRIES
57
ITEM: BOX BOUNDS mm mm mm
-0.12 0.12
-0.12 0.12
-0.001 0.57
ITEM: ENTRIES c_fc[1] c_fc[2] c_fc[3] c_fc[4] c_fc[5] c_fc[6] c_fc[7] c_fc[8] c_fc[9] c_fc[10] c_fc[11] c_fc[12]
-0.0119791 -0.0372214 0.00808775 -0.00274904 -0.0399211 0.0108293 39 85 0 -0.000100644 -0.000184731 -0.000235928
-0.0279946 -0.0275802 0.00895708 -0.0273477 -0.0184194 0.00499989 64 51 0 0.000543664 0.0011043 0.00262464
-0.0279946 -0.0275802 0.00895708 -0.0249331 -0.0272672 0.0184717 64 61 0 0.000293425 0.000381684 -7.0334e-05
-0.0201895 -0.0324198 0.00499982 -0.0208617 -0.0354904 0.0144927 95 80 0 0.00167992 -0.00127885 -0.000361249
-0.00440136 -0.031473 0.00500006 -0.00367668 -0.0214994 0.00499991 76 88 0 -0.000723488 0.000120806 0.00145762
-0.0273477 -0.0184194 0.00499989 -0.0358132 -0.0130963 0.00499995 51 31 0 -0.0001302 -0.000213634 0.000573923
-0.00367668 -0.0214994 0.00499991 0.00189059 -0.0198818 0.0131478 88 34 0 3.84608e-07 2.04164e-05 -9.16127e-06
-0.0358132 -0.0130963 0.00499995 -0.0396077 -0.0062695 0.0112446 31 82 0 7.68826e-06 8.44941e-06 -1.64976e-05
-0.00274904 -0.0399211 0.0108293 0.00511357 -0.0378726 0.00499991 85 8 0 -3.21344e-05 9.14682e-06 8.94728e-06
-0.00276775 -0.00533035 0.0144356 -0.0110374 1.3488e-05 0.0126873 74 73 0 9.57456e-05 0.000147521 -0.000109827
-0.00276775 -0.00533035 0.0144356 0.00635899 -0.00187714 0.0166214 74 68 0 2.70978e-05 1.09398e-05 6.09679e-06
-0.0174327 6.80009e-05 0.00499991 -0.022111 0.00102588 0.013786 69 96 0 3.20189e-06 -9.65264e-07 -1.73104e-05
-0.0174327 6.80009e-05 0.00499991 -0.0110374 1.3488e-05 0.0126873 69 73 0 1.23903e-05 -8.69348e-07 1.72145e-05
-0.0174327 6.80009e-05 0.00499991 -0.0166066 0.00869152 0.0099951 69 3 0 0.000797963 0.00161688 -0.00292904
-0.0323319 0.0198639 0.0049999 -0.0367224 0.0181406 0.0138176 90 7 0 3.10341e-07 2.93293e-07 -2.17524e-06
-0.0323319 0.0198639 0.0049999 -0.0299198 0.0268056 0.0117817 90 57 0 -2.25115e-06 -8.15439e-06 -1.5263e-05
-0.0221187 0.0202346 0.0049999 -0.0233785 0.0301549 0.00499993 105 41 0 -0.000375073 -8.65646e-05 0.00201354
-0.0221187 0.0202346 0.0049999 -0.0265597 0.0174887 0.0135285 105 52 0 -0.00301984 -0.000632578 -0.00180448
-0.0128304 0.0164882 0.00499991 -0.0166066 0.00869152 0.0099951 42 3 0 -0.000352924 -0.000351054 -0.00080909
-0.0128304 0.0164882 0.00499991 -0.0167636 0.0195161 0.0136809 42 13 0 -2.1436e-06 2.10349e-06 4.84231e-06
-0.00207699 0.0260532 0.00499992 -0.00774801 0.026673 0.013213 20 4 0 2.89533e-06 -2.511e-07 -6.98219e-06
-0.0233785 0.0301549 0.00499993 -0.0299198 0.0268056 0.0117817 41 57 0 -0.000919615 -0.000669283 -0.00121318
-0.0135464 0.027697 0.00499994 -0.0140269 0.0368204 0.00906588 104 99 0 -0.000351642 0.00183002 -0.00416098
-0.0140269 0.0368204 0.00906588 -0.00494966 0.0378548 0.00499991 99 93 0 -2.14499e-05 7.73808e-07 1.00233e-05
-0.0140269 0.0368204 0.00906588 -0.0174307 0.0294227 0.0148699 99 38 0 5.9377e-06 1.68836e-06 -5.05459e-06
-0.00494966 0.0378548 0.00499991 -0.000451576 0.0404762 0.0135377 93 33 0 -0.000445521 0.010205 -0.00291241
-0.0167636 0.0195161 0.0136809 -0.0174307 0.0294227 0.0148699 13 38 0 -0.000196053 -2.39771e-07 -8.95674e-05
-0.00774801 0.026673 0.013213 -0.00178252 0.0226735 0.0201712 4 81 0 0.0049332 -0.00305771 -0.00598846
0.00511357 -0.0378726 0.00499991 0.0115262 -0.0388562 0.0126098 8 75 0 -1.81612e-05 -1.00921e-06 -8.00849e-06
0.00431631 -0.0288069 0.00914989 0.0133517 -0.0277445 0.00499958 32 54 0 0.000335424 2.08415e-05 -0.000141562
0.0133517 -0.0277445 0.00499958 0.0227801 -0.0309897 0.00575233 54 100 0 0.000330542 -0.000121624 9.13611e-05
0.0133517 -0.0277445 0.00499958 0.0125685 -0.0215804 0.0128348 54 56 0 0.000147395 -0.000482757 -0.000654966
0.0227801 -0.0309897 0.00575233 0.0255832 -0.0321823 0.0152767 100 79 0 -0.000379985 -0.00278225 7.21469e-05
0.0302391 -0.0254775 0.00949902 0.0307166 -0.0165596 0.00499991 86 87 0 2.14335e-05 5.8538e-05 0.0001689
0.0302391 -0.0254775 0.00949902 0.0264575 -0.0204731 0.017287 86 70 0 -2.47332e-05 3.15473e-05 2.72307e-05
0.00751333 -0.0179666 0.00499992 0.0125685 -0.0215804 0.0128348 28 56 0 -8.35805e-06 1.38234e-05 1.9204e-05
0.0207036 -0.0211208 0.00644715 0.022173 -0.0113359 0.00499986 58 16 0 0.00367002 0.00111896 0.011348
0.0307166 -0.0165596 0.00499991 0.0346382 -0.0133332 0.0136145 87 17 0 -1.45026e-06 -9.00725e-07 -3.28957e-06
0.022173 -0.0113359 0.00499986 0.020063 -0.0132771 0.0145799 16 14 0 0.000213597 -0.00377383 -0.000729664
0.0371571 -0.0089096 0.00499988 0.0404706 -0.00384042 0.0129574 45 60 0 3.71194e-05 5.37303e-05 0.000106851
0.0115262 -0.0388562 0.0126098 0.0157608 -0.0305306 0.0161807 75 67 0 -0.00178494 0.00154805 -0.00154129
0.020063 -0.0132771 0.0145799 0.0264575 -0.0204731 0.017287 14 70 0 -5.15014e-05 1.0534e-05 0.000189155
0.0357242 0.000987224 0.00499993 0.0315037 0.00119108 0.0140633 22 12 0 0.000100515 3.70987e-05 -2.32105e-06
0.0133112 0.00800893 0.00499988 0.012354 0.00589985 0.0147279 53 36 0 0.000219238 -1.40937e-05 0.000101751
0.0133112 0.00800893 0.00499988 0.0213078 0.00918205 0.0108884 53 62 0 0.000191065 3.94844e-05 6.19779e-05
0.0366148 0.0109476 0.00499973 0.0401897 0.00615543 0.0130157 49 101 0 -0.000716901 0.000160093 0.000334624
0.0366148 0.0109476 0.00499973 0.0308361 0.0111976 0.0131569 49 10 0 -4.03327e-05 4.28977e-05 0.000123138
0.0184678 0.0167928 0.00499992 0.022153 0.0223938 0.0124193 6 91 0 -1.20301e-05 -1.30391e-05 3.80838e-06
0.0284678 0.0168261 0.00499994 0.0272481 0.0267514 0.00499989 65 78 0 0.000668158 9.74035e-05 -0.00106092
0.0272481 0.0267514 0.00499989 0.022153 0.0223938 0.0124193 78 91 0 -8.04279e-06 7.87038e-06 2.34027e-05
0.0272481 0.0267514 0.00499989 0.0245962 0.0323254 0.0128674 78 66 0 -7.54178e-06 -2.20315e-05 -1.99092e-05
0.0213078 0.00918205 0.0108884 0.0308361 0.0111976 0.0131569 62 10 0 0.000131339 5.6036e-05 0.000233534
0.0401897 0.00615543 0.0130157 0.0404706 -0.00384042 0.0129574 101 60 0 0.000290889 2.0559e-05 -0.000495695
0.0308361 0.0111976 0.0131569 0.0348781 0.020258 0.0119046 10 98 0 0.000323099 -0.000308534 -0.00235972
0.0308361 0.0111976 0.0131569 0.0267986 0.00999968 0.0222267 10 44 0 -2.44847e-05 -1.74375e-05 0.000187432
0.022153 0.0223938 0.0124193 0.0153457 0.0257279 0.0189419 91 97 0 -7.19461e-06 -4.06512e-06 5.55833e-06
0.0245962 0.0323254 0.0128674 0.0168508 0.0355937 0.0182826 66 11 0 -2.13036e-05 0.00047883 -0.000328189

From this file we can extract c_fc[7] and c_fc[8], which are the id of the colliding particles (from Matlab!):


A = textscan(fileID, '%s%s%s%s%s%s%s%s%s%s%s%s');
id(:,1) = str2double( A{7}(11:end) );
id(:,2) = str2double( A{8}(11:end) );

id =

39 85
64 51
64 61
95 80
76 88
51 31
88 34
31 82
85 8
74 73
74 68
69 96
69 73
69 3
90 7
90 57
105 41
105 52
42 3
42 13
20 4
41 57
104 99
99 93
99 38
93 33
13 38
4 81
8 75
32 54
54 100
54 56
100 79
86 87
86 70
28 56
58 16
87 17
16 14
45 60
75 67
14 70
22 12
53 36
53 62
49 101
49 10
6 91
65 78
78 91
78 66
62 10
101 60
10 98
10 44
91 97
66 11

...and see how many times each particle is colliding (still from Matlab):


maxid = max(max(id));

for i = 1 : maxid
contacts_per_particle(i) = length(find(id==i));
end

contacts_per_particle =

0
0
2
2
0
1
1
2
0
4
1
1
2
2
0
2
1
0
0
1
0
1
0
0
0
0
0
1
0
0
2
1
1
1
0
1
0
2
1
0
2
2
0
1
1
0
0
0
2
0
2
1
2
3
0
2
2
1
0
2
1
2
0
2
1
2
1
1
3
2
0
0
2
2
2
1
0
3
1
1
1
1
0
0
2
2
2
2
0
2
3
0
2
0
1
1
1
1
3
2
2
0
0
1
2

Now, If I compare contacts_per_particle vector, extracted from the force chain in DEM, with the output of

dump10000.doll.csv


ITEM: TIMESTEP
10000
ITEM: NUMBER OF ATOMS
106
ITEM: BOX BOUNDS mm mm mm
-0.12 0.12
-0.12 0.12
-0.001 0.57
ITEM: ATOMS c_1
1
2
1
1
0
2
2
2
0
0
0
0
2
1
0
0
0
1
0
0
2
1
0
0
3
0
0
0
2
2
2
1
2
1
3
2
1
2
0
0
2
1
1
2
0
2
2
1
0
2
0
0
1
2
1
3
2
2
1
1
2
2
0
1
2
1
2
2
1
0
0
2
1
1
2
0
1
0
0
0
1
2
0
2
1
1
0
3
0
1
0
1
2
2
4
0
1
3
0
2
0
0
0
1
1
1

We can see they are different.

Are we sure the output is the same for the two DEM outputs, i.e. dump10000.doll.csv (compute contact/atom) and dump.fc.10000.liggghts (compute pair/gran/local for the force chain) ???

Best,
Limone