|
[Sponsors] |
Urgent: Looping over all particles in unsteady flow |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 4, 2011, 21:59 |
Urgent: Looping over all particles in unsteady flow
|
#1 |
New Member
Ro'ee Orland
Join Date: Nov 2010
Posts: 18
Rep Power: 16 |
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 |
|
May 19, 2011, 08:46 |
|
#2 |
Member
john
Join Date: Nov 2010
Posts: 50
Rep Power: 16 |
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); } |
|
May 23, 2011, 08:33 |
thanks,
|
#3 |
New Member
Ro'ee Orland
Join Date: Nov 2010
Posts: 18
Rep Power: 16 |
I'll get right on it
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Urgent: Unsteady 3-D supersonic cavity flow | Min-Sung Kang | FLUENT | 3 | April 6, 2014 10:50 |
how to predict unsteady flow from case definition? | Felix | Main CFD Forum | 6 | August 28, 2007 17:40 |
urgent help needed with 2d compressible flow | James | FLUENT | 2 | June 20, 2007 05:22 |
Particle mass flow rate | Jeff | CFX | 3 | September 17, 2004 11:46 |
Unsteady AND Steady mode for Fully Developped Flow | Dominique | FLUENT | 5 | April 16, 2004 18:58 |