|
[Sponsors] |
October 2, 2021, 14:53 |
UDF for recycle particle
|
#1 |
New Member
Pensylvania
Join Date: Sep 2021
Posts: 2
Rep Power: 0 |
Hi good people,
I am trying to simulate a filter with 90% efficiency. So I am using 2 UDF. DEFINE_DPM_BC for killing 90% particle that touches the outlet boundary and DEFINE_DPM_SCALAR_UPDATE to update the position of particle from outlet to inlet for recycling the 10% particle. Till now everything works fine. But It seems I also need to update the velocity because once the particle recycled they continue to move towards the negative x-direction. I tried to fix the issue by updating the velocity also but it is not working. I tried with P_VEL(p)[1] = positive and negative value. but for both of the cases, the particle moves towards the negative y-direction. ** here I am attaching my UDF Can you please take a look and help me in this regard? #include "udf.h" #include <stdlib.h> #include <time.h> DEFINE_DPM_BC(bc_reflect,p,t,f,f_normal,dim) { float my_rand,init_vel; init_vel = - 0.272; srand ( time(NULL) ); my_rand=rand() %100; if (my_rand <= 1) { return PATH_END; } else { P_VEL(p)[0] = 0; P_VEL(p)[1] = init_vel; return PATH_ACTIVE; } } DEFINE_DPM_SCALAR_UPDATE(recycle_particles,c,t,ini tialize,p) { FILE *fp; float temp_rand, pos_rand, inlet_max; inlet_max = 0.4; srand ( time(NULL) ); temp_rand = rand() % 100; pos_rand = (temp_rand/100)*inlet_max; if (P_POS(p)[0] <= 0.4 && P_POS(p)[1] <= 0.7) { P_POS(p)[0] = pos_rand; P_POS(p)[1] = 0.75 ; } } |
|
October 11, 2021, 20:59 |
|
#2 |
Senior Member
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34 |
I don't have much experience in DPM, but
shouldn't you modify velocity in update_scalar macro, as DEFINE_DPM_BC seems to be a boundary condition? Code:
DEFINE_DPM_SCALAR_UPDATE(recycle_particles,c,t,ini tialize,p) { // your code P_VEL(p)[0] = 0; P_VEL(p)[1] = init_vel; }
__________________
best regards ****************************** press LIKE if this message was helpful |
|
Tags |
dpm, particle, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF for particle interception with pt_termination fortran routine | abcdefgh | CFX | 6 | October 6, 2019 14:30 |
Problem with a simple UDF to calculate cell-averaged particle values | kmayank | FLUENT | 1 | January 18, 2011 02:40 |
Move particle in UDF | Henrik | FLUENT | 5 | July 29, 2008 11:55 |
HELP! HELP! For udf of particle body force!!!! | zhaoh | FLUENT | 0 | February 5, 2007 05:10 |
udf about particle concentration--who can help me? | zhaoh | FLUENT | 1 | January 17, 2007 12:46 |