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

Urgent: Looping over all particles in unsteady flow

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   April 4, 2011, 20:59
Default Urgent: Looping over all particles in unsteady flow
  #1
New Member
 
Ro'ee Orland
Join Date: Nov 2010
Posts: 18
Rep Power: 6
orland is on a distinguished road
I have an unsteady flow with one single injection that produces only 1 particle.
I want to know its position at every fluid time step.
is there a udf that can loop over all particles (or two separate udf's, one for looping over all injection threads, and the other over all particles in each injection thread)?
thanks
orland is offline   Reply With Quote

Old   May 19, 2011, 07:46
Default
  #2
Member
 
john
Join Date: Nov 2010
Posts: 50
Rep Power: 6
johnwinter is on a distinguished road
hi,
DEFINE_DPM_SCALAR_UPDATE(track_dpm_particles,c,t,i nitialize,p)
{
if (RP_Get_Boolean("dpm/unsteady-tracking?"))
{
float time = RP_Get_Real("flow-time");
float x = p->state.pos[0];
float y = p->state.pos[1];
float u = p->state.V[0];
float v = p->state.V[1];
#if RP_3D
float z = p->state.pos[2];
float w = p->state.V[2];
#endif
FILE *fd;
int id = p->part_id;
char whoru[80];
sprintf(whoru,"dpm_positions%f.out",time);
fd = fopen(whoru, "a");
#if RP_3D
fprintf(fd, "%i %f %e %e %e %e %e %e %e %e %e \n", id, time, x, y, z, u, v, w, P_T(p), P_MASS(p), P_RHO(p));
#else
fprintf(fd, "%i %f %e %e %e %e %e %e %e \n", id, time, x, y, u, v, P_T(p), P_MASS(p), P_RHO(p));
#endif
fclose(fd);
}
johnwinter is offline   Reply With Quote

Old   May 23, 2011, 07:33
Default thanks,
  #3
New Member
 
Ro'ee Orland
Join Date: Nov 2010
Posts: 18
Rep Power: 6
orland is on a distinguished road
I'll get right on it
orland is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Urgent: Unsteady 3-D supersonic cavity flow Min-Sung Kang FLUENT 3 April 6, 2014 09:50
how to predict unsteady flow from case definition? Felix Main CFD Forum 6 August 28, 2007 16:40
urgent help needed with 2d compressible flow James FLUENT 2 June 20, 2007 04:22
Particle mass flow rate Jeff CFX 3 September 17, 2004 10:46
Unsteady AND Steady mode for Fully Developped Flow Dominique FLUENT 5 April 16, 2004 17:58


All times are GMT -4. The time now is 20:58.