CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

UDF for recycle particle

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 2, 2021, 13:53
Default UDF for recycle particle
  #1
New Member
 
Pensylvania
Join Date: Sep 2021
Posts: 2
Rep Power: 0
khayrulbuet13 is on a distinguished road
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 ;

}
}
Attached Files
File Type: c bcvel.c (703 Bytes, 2 views)
khayrulbuet13 is offline   Reply With Quote

Old   October 11, 2021, 19:59
Default
  #2
Senior Member
 
Alexander
Join Date: Apr 2013
Posts: 2,363
Rep Power: 34
AlexanderZ will become famous soon enoughAlexanderZ will become famous soon enough
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
AlexanderZ is offline   Reply With Quote

Reply

Tags
dpm, particle, udf

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF for particle interception with pt_termination fortran routine abcdefgh CFX 6 October 6, 2019 13:30
Problem with a simple UDF to calculate cell-averaged particle values kmayank FLUENT 1 January 18, 2011 01:40
Move particle in UDF Henrik FLUENT 5 July 29, 2008 10:55
HELP! HELP! For udf of particle body force!!!! zhaoh FLUENT 0 February 5, 2007 04:10
udf about particle concentration--who can help me? zhaoh FLUENT 1 January 17, 2007 11:46


All times are GMT -4. The time now is 01:32.