CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Problem with a simple UDF to calculate cell-averaged particle values (

kmayank July 13, 2009 10:16

Problem with a simple UDF to calculate cell-averaged particle values

I want to write a UDF for recovering averaged particle properties within each cell throughout the domain.
For that I wrote a simple test UDF, mainly copying from Fluent manual, as follows:

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


Domain *d;
Thread *t;
cell_t c;
d = Get_Domain(1); /* mixture domain if multiphase */
int count;
Particle *p;


count += 1;


printf("Total particles in domain %d \n", count);

This gives no error in compilation but on running gives Segmentation Violation and stack backtrace generation. The Segmentation Violation seems due to the presence of the particle loop only. When I remove the particle loop, the error message does not come.

Stack backtrace generated for process id 301 on signal 1:
Please include this information with any bug report you file on this issue!

Could anyone please me help me on this.

My aim is to obtain cell avergaed values of x, y, z particle velocities throughout the domain. Fluent postprocessing does not provide these values, so I guess we have to write a UDF.


Wikie January 18, 2011 02:40


did you solve your problem? I also have to count the number of particles, but I wasn't able to do so yet.


All times are GMT -4. The time now is 00:05.