I'm on a UV water treatment reactor case, using a DPM feature to measure the UV Dose received by particles.

My problem is quiet simple and common according to other related topics(SANDIA lab uv dose files) but I still can't find the problem in my UDF :

I use a SCALAR_UPDATE macro to increase the uv dose at each time step(using a DPM scalar) which is working well at the only exception that (and I do not know why) the "initialize" variable (int) given by Fluent is always on the 1 value and this implies the program to enter always in the initialization condition and then my scalar are always reset to zero.

I solved this problem by bypassing the initialization part (I know it's bad but I didn't find any solution... Anyway scalar initialization at zero seems to be automatic when adding it in the DPM menu). If you have explanation about this they are welcome but it is not the real problem.

Here it is : the DPM_OUTPUT macro. I run this simulation on a parallel mode and when I put the "%s" for name(char variable) at the end of the par_printf() the solver crashes when a particle is sampled. When I do not put the "%s" the solver doesn't crash but I have totaly non sense values written like these :

Wether I'm in serial or in parallel mode, the fprintf in the dpm scal update macro works fine but that was just for testing. In the file it writes well all variables but for each interpolated positions and this is not easily exploitable. I don't know if there is a way to write in the file only if a particle is removed of the domain, with a particular condition. If it is possible that will help me because the fprintf works.