Preserving particle ID for postprocessing for cyclic boundaries

Hi there,
I am trying to output particle data for postprocessing with periodic BC. I end up getting multiple rows per time-step for a particle at the point where it crosses the boundary and the particle ID gets changed. I can easily change this for maybe two or three particles while post-processing. But, I imagine there should be a better way to do this via the udf i’m using for the output such that the particle ID is preserved throughout (in cases of large number of particles.

Is the particle ID preserved in the vtp files? Is this a parallel run or serial run?

It’s a serial run. I’m not using the vtp files. I’m outputting my values to a text file in an xyz format to view in another visualization software. My particle shape is not spherical and I have modified mfix code for the shape I am treating (i.e hence the reason for outputting my values).