CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Problem with getting the particle position using UDF (

Ananth Pai January 17, 2010 02:11

Problem with getting the particle position using UDF
I am trying to get the particle positions at the end of each time step into a csv or text file. I am using DEFINE_DPM_SCALAR_UPDATE to get the positions. I am injecting 10000 particles initially and later on there is no injections. The csv file is written after each time step but there r 140000 entries into it with the no of particles bieng only 10000(i have checked it through Particle tracks). Below given is the UDF code

#include "udf.h"
#include "dpm.h"

/* update the user scalar variables */

DEFINE_DPM_SCALAR_UPDATE(follow_particle, cell, thread, initialize, p)
char n[18];

FILE *pf;
pf = fopen ("n", "a");
fprintf(pf,"%g %g\n",P_POS(p)[0], P_POS(p)[1]);



Kindly help.

All times are GMT -4. The time now is 12:22.