CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   How can I get the particle current position in UDF (https://www.cfd-online.com/Forums/fluent/28331-how-can-i-get-particle-current-position-udf.html)

cfdfans March 21, 2001 05:35

How can I get the particle current position in UDF
 
hi

I want to write a UDF about particle track. who can tell me how to get the the particle current position in UDF. thanks

yueroo March 31, 2001 11:12

Re: How can I get the particle current position in
 
You can use Postprocessing for the Discrete Phase. You can use step- by-step reports of the particle position, velocity. or write reust to file.

cfdfans April 1, 2001 23:03

Re: How can I get the particle current position in
 
thank you

I want to calculate the multiphase flow .And I want to give a centripetal acceleration to particle.I must get the current position of particle in my UDF program not in postprocessing.

In UDF Use's Guide 5.4.1 "Melting Index Along a Particle Trajectory" ,there is a example program.

the followed is the program I modify for my project

#include "udf.h"

#include "dpm.h"

#define C_acceler 30.0 /* centripetal acceleration */

DEFINE_DPM_BODY_FORCE(particle_body_force, p, i) {

real y,z; real alpha; face_t f;

float bforce; /* centripetal force */

y = p->state.pos[1]; /* particle y axis coordinate */ z = p->state.pos[2]; /* particle z axis coordinate*/

alpha = acos(fabs(z)/(sqrt(pow(z,2)+pow(y,2))));

if(z>0)

{

if(y>0)

{

if(i==1) bforce=-C_acceler*sin(alpha)*P_MASS(p)*9.8;

else if(i==2) bforce=-C_acceler*cos(alpha)*P_MASS(p)*9.8;

}

else

{

if(i==1) bforce=C_acceler*sin(alpha)*P_MASS(p)*9.8;

else if(i==2) bforce=-C_acceler*cos(alpha)*P_MASS(p)*9.8;

}

}

else

{

if(y>0)

{

if(i==1) bforce=-C_acceler*sin(alpha)*P_MASS(p)*9.8;

else if(i==2) bforce=C_acceler*cos(alpha)*P_MASS(p)*9.8;

}

else

{

if(i==1) bforce=C_acceler*sin(alpha)*P_MASS(p)*9.8;

else if(i==2) bforce=C_acceler*cos(alpha)*P_MASS(p)*9.8;

}

}

return (bforce);

}

but the program can not pass the compile. FLUENT show error in the line "y = p->state.pos[1]; /* particle y axis coordinate */ z = p->state.pos[2]; /* particle z axis coordinate*/" with message " structure inference reference not implement " Could you help me find what is wrong with it. or is there another way to give a force that change with time and position to the particle . thank you very much


yueroo April 2, 2001 01:00

Re: How can I get the particle current position in
 
Hi: I don't know why you want to add centripetal acceleration to particle. In my case. I simulate particle flow in 180degree bend tube. Particle flow in bend tube, it will get centripetal force, and hit tube. Particle ¡¥s Trajectory was decided from fluid flow. Can you tell me why you want to add centripetal acceleration to particle? Thanks!!

cfdfans April 2, 2001 05:03

Re: How can I get the particle current position in
 
hi thank you

the flow field in a column container with a exit. and the container in a curve motion. so the particle in the flow field have a body force change with position and time. if you konw how to resolve it ,please tell me thanks


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