CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Velocity of Fluid @ different positions of Particle in DPM using UDF (http://www.cfd-online.com/Forums/fluent/65067-velocity-fluid-different-positions-particle-dpm-using-udf.html)

pmghadge June 2, 2009 19:07

Velocity of Fluid @ different positions of Particle in DPM using UDF
 
Hello,
I am trying to develop an UDF to find the velocity of Fluid at the different positions of particle in DPM. Finally I am interested in getting relative velocity of particle with respect to the fluid.

I am novice in the area of UDF, so please suggest me some macros which can be used for this.:confused:

Thank you very much.

pmghadge June 16, 2009 20:11

I got it
 
/* Following UDF gives relative velocity I am looking for */
#include
"udf.h"
real R_vel;
DEFINE_DPM_SCALAR_UPDATE(relative_vel,c,t,initiali ze,p)
{
real R_vx, R_vy, P_vel, F_vel;
/* Relative Velocity */
R_vx = C_U(c, t) - (P_VEL(p)[0]);
R_vy = C_V(c, t) - (P_VEL(p)[1]);
R_vel = sqrt( R_vx*R_v+x + R_vy*R_vy );
Message(
"Relative Velocity in X = %10f m/s and Y = %10f m/s\n",R_vx, R_vx);
Message(
"Relative Velocity= %10f m/s\n\n",R_vel);
}


All times are GMT -4. The time now is 19:34.