Dear Amine, 

I fully understand that you cannot comment much on the UDF. All I wanted for you to just check whether or not I implemented the idea somewhat alright, just as a guidance, what you provided accordingly. Thanks a lot for that. Of course I did not expect you to debug my code. 

I was able to find the source of the compilation error. There was a single white space somehow smuggled into the file name by mistake, which I was seeing as an underscore. Haha, it's funny how much debugging trouble, time and research something so trivial can cost!

Anyhow, to answer your question, I am currently working on a project, where I am looking at the neighbouring particles of any tracked particle to find out the likelihood of them colliding into each other, as an alternative to the current collision model. So, you understand now my predicament, why I am concerned as to the speed of execution of the segment? For each single time step if I have to loop through the entire domain, it is going to cost me significant computation time, I suppose. I wish, there was a more elegant way of doing it. Please guide me with some hints, if you have any idea.

Thanks again for your assistance. 

With best regards