FLUENT VOF + DPM with UDF looping all particles in parallel model
I am working on a VOF+DPM model, in which I would like to calculate how many particles are in the 2nd phase after each flow time step. The UDF seems to work in serial mode, but in parallel mode, the calculation is not accurate due to the unknown issue with the UDF.
When in parallel mode, at the end of each time step, the UDF loops all the particles to verify the volume fraction of the 2nd phase in the cell which contains the particle is larger than a specific value (Vofm), and then writes down the number of particles to a local file. However, as the parallel processes increase, the total number of particles in 2nd phase increases at the same time step.
I am using hybrid method for DPM model and below is the UDF.
Any help is appreciated!