|
[Sponsors] |
February 1, 2007, 04:54 |
DPM: UDF - loop over all particles
|
#1 |
Guest
Posts: n/a
|
I would like to have my EXECUTE_AT_END udf loop over all particles in the domain. I would like to know how many particles there are in every cell. But i get a "Segmentation violation" when i want to access any variable that is beeing processed during the "begin_particle_cell_loop". I am using FLUENT 6.3
Thanks for your help! This is my code: DEFINE_EXECUTE_AT_END(execute_at_end) { Thread *t; Domain *d; Particle *pi; /* Particle index for looping over all particles in the cell */ real numb_cell=0.; real numb_part_dom=0.; cell_t c; d = Get_Domain(1); /* mixture domain if multiphase */ thread_loop_c(t,d) { begin_c_loop(c,t) { numb_cell += 1; begin_particle_cell_loop(pi,c,t) { numb_part_dom += 1; } end_particle_cell_loop(pi,c,t) } end_c_loop(c,t) } printf("Number of cells %g\n", numb_cell); printf("Number of particles %g\n", numb_part_dom); fflush(stdout); } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
DPM UDF Injection leads to 2 different particles | sega | Fluent UDF and Scheme Programming | 4 | December 28, 2017 22:57 |
DPM - do the particles affect the liquid? | Nikhil Dani | FLUENT | 0 | January 1, 2009 11:58 |
NACA0012 geometry/design software needed | Franny | Main CFD Forum | 13 | July 7, 2007 15:57 |
DPM: using UDF for creating and deleting Particles | Markus Alzon | FLUENT | 0 | July 4, 2007 01:18 |
DPM; particle seeded / deleted by UDF | Laika | FLUENT | 6 | January 22, 2006 23:40 |