hi William,
I wrote the following UDF to add the effects of other particles on the tracked particles as a body force.
DEFINE_DPM_BODY_FORCE(partbf,p,i)
{
double bforce=0., Bc=0.;
Thread *t;
cell_t c;
Particle *pi;
t = P_CELL_THREAD(p);
c = P_CELL(p);
if (Data_Valid_P())
{
begin_particle_cell_loop(pi,c,t)
{
Bc+=P_MASS(pi);
}
end_particle_cell_loop(pi,c,t)
}
bforce=Bc/PMASS(p)+1.; /*i component, x,y,or z component force*/
return bforce; /*return the acceleration*/
}
as I run it, it gives "FLUENT received fatal signal (ACCESS_VIOLATION)" error. I believe it is because of "begin_particle_cell_loop" macro. Do you have any idea why this happens? How can I use "begin_particle_cell_loop" macro properly?
Thank you very much for your help.
Sean.