CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Trap and reflect udf (http://www.cfd-online.com/Forums/fluent-udf/66286-trap-reflect-udf.html)

 motallebi July 10, 2009 10:51

Trap and reflect udf

HI

I am gonna write a udf about the DPM.

I am gonna write a udf that can trap or reflect. On the other hand I can trap if shear stress lower than critical shear stress. otherwise it can reflect.

I used of swich command and another command But It does not work for me.

I wanna use of REMOVE_ PARTICLE FALSE that delet some of the particle .

It can use to solve this problem.

At the udf manual 6.2.3 write a udf about the DPM OUTPUT.

At the this program uses of REMOVE_ PARTICLE FALSE .

#include "udf.h"
/************************************************** ****************/
/* UDF that samples discrete phase size and velocity distributions*/
/* within the domain. */
/************************************************** ****************/
#define REMOVE_PARTICLES FALSE
{
#if RP_2D
real flow_time = solver_par.flow_time;
real y;
W-velocity[m/s] R-velocity[m/s] Drop Diameter[m]
Number of Drops Temperature [K] Initial Diam [m]
Injection Time [s] \n");
if(NULLP(p))
return;
if (rp_axi && (sg_swirl || rp_ke))
y = MAX(sqrt(SQR(p->state.pos[1]) + SQR(p->state.pos[2])),DPM_SMALL);
else

y = p->state.pos[1];
#if PARALLEL
par_fprintf(fp,"%d %d %e %f %f %f %f %e %e %f %e %f \n",
p->injection->try_id,p->part_id, P_TIME(p),y,p->state.V[0],
p->state.V[1],p->state.V[2],P_DIAM(p),p->number_in_parcel,
P_T(p), P_INIT_DIAM(p),p->time_of_birth);
#else
par_fprintf(fp,"%e %f %f %f %f %e %e %f %e %f \n",
P_TIME(p), y,p->state.V[0],p->state.V[1],p->state.V[2],P_DIAM(p),
p->number_in_parcel, P_T(p), P_INIT_DIAM(p), p->time_of_birth);
#endif /* PARALLEL */
#else
real flow_time = solver_par.flow_time;
real r, x, y;
y-velocity[m/s] z-velocity[m/s] Drop Diameter[m]
Number of Drops Temperature [K] Initial Diam [m]
Injection Time [s] \n");
if(NULLP(p))
return;
x = p->state.pos[0];
y = p->state.pos[1];
r = sqrt(SQR(x) + SQR(y));
#if PARALLEL
par_fprintf(fp,"%d %d %e %f %f %f %f %e %e %f %e %f \n",
p->injection->try_id, p->part_id, P_TIME(p), r,p->state.V[0],
p->state.V[1],p->state.V[2],P_DIAM(p),p->number_in_parcel,
P_T(p), P_INIT_DIAM(p), p->time_of_birth);
#else
par_fprintf(fp,"%e %f %f %f %f %e %e %f %e %f \n",
P_TIME(p), r,p->state.V[0],p->state.V[1],p->state.V[2],
P_DIAM(p),p->number_in_parcel,P_T(p), P_INIT_DIAM(p),
p->time_of_birth);
#endif /* PARALLEL */
#endif

#if REMOVE_PARCELS
p->stream_index=-1;
#endif

}

But it does not describe obout the this command.

Can you help me about the description for this command?

ALL THE BEST.

THANK YOU

MOTALLEBI

 rezayo October 8, 2013 07:05

کمک

سلام برادر
مشکل منم اینجوریه
میخوام با سرعت بحرانی بسنجه
اگه udf رو داشته باشی ممنون میشم به منم بدی

 All times are GMT -4. The time now is 09:22.