CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

DPM: UDF - loop over all particles

Register Blogs Community New Posts Updated Threads Search

Like Tree7Likes

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   February 1, 2007, 04:54
Default DPM: UDF - loop over all particles
  #1
chris
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); }
  Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 23:18.