|
[Sponsors] |
April 5, 2017, 08:55 |
why the UDF cann't trap particles? thanks
|
#1 |
New Member
Join Date: Feb 2017
Posts: 5
Rep Power: 9 |
Hello everyone,
I write UDF to loop all injection particles, and the particles will be trap by the wall when the distance between the particle and the wall equal or less than the radius of the particle. The udf can be 'compiled' and compute. However, it cannot trap particles. Please help me and thanks. This is my UDF: #include "stdio.h" #include "udf.h" #include "dpm.h" #include "mem.h" #include "sg.h" #include "math.h" #include "surf.h" /* for macros: RP_Cell() & RP_Thread() */ #include "sg_mphase.h" #define wall_id 9 /* wall face ID*/ #define dim 2 /* dimension number 2D or 3D */ DEFINE_ADJUST(trapparticle, domain) { cell_t pc; face_t f; Thread *ft, *tcell; Injection *Ilist; Injection *I; Particle *p; real fp_dis, x, y, radius,particlenum=0, total_volume=0.0; real xc[ND_ND], xf[ND_ND]; int i; /*working counter for script*/ ft = Lookup_Thread(domain, wall_id); /* wall face*/ Ilist = Get_dpm_injections(); loop(I, Ilist) { loop(p, I->p) /* Standard ANSYS FLUENT Looping Macro to get particle streams in an Injection */ { pc = P_CELL(p); /* Get the cell and thread that the particle is currently in */ tcell = P_CELL_THREAD(p); /* Particle Structure using new macros*/ radius=P_DIAM(p); /* Particle radius*/ x = P_POS(p)[0]; y = P_POS(p)[1]; C_UDMI(pc,tcell,0) = 0; begin_f_loop(f,ft) { F_CENTROID(xf,f,ft); /*face centerial */ fp_dis=fabs(sqrt(SQR(x-xf[0]) + SQR(y-xf[1]))); /* the distance between particle centre and wall face*/ /* if the distance less than particle radius,particle velocity equal 0 and save particle cell 1 and particle position */ if(fp_dis <= radius) { for (i=0; i<dim; i++) { P_VEL(p)[i] = 0.0; } C_UDMI(pc,tcell,0) = 1; C_UDMI(pc,tcell,1) = P_POS(p)[0]; C_UDMI(pc,tcell,2) = P_POS(p)[1]; particlenum +=1; /* if particle is trapped, increase particle-number */ MARK_PARTICLE(p, P_FL_REMOVED); /* Remove particle after accretion */ } else { C_UDMI(pc,tcell,0) = 0; C_UDMI(pc,tcell,1) = 0.0; C_UDMI(pc,tcell,2) = 0.0; particlenum +=0; } } end_f_loop(f,ft) C_UDMI(pc,tcell,3) = particlenum; } } } |
|
April 18, 2017, 01:26 |
|
#2 |
New Member
Yoon
Join Date: Mar 2015
Location: Seoul
Posts: 22
Rep Power: 11 |
Did you get Answer of this problem? please share your UDF of this Method (Collection on Outer Boundary of Particle)
|
|
April 18, 2017, 20:32 |
|
#3 |
New Member
Join Date: Mar 2017
Posts: 8
Rep Power: 9 |
hi touyet! You seem to like the filter too much.
|
|
April 18, 2017, 20:35 |
|
#4 |
New Member
Join Date: Mar 2017
Posts: 8
Rep Power: 9 |
hi touyet!! Do you want anonymous?
|
|
April 23, 2019, 11:08 |
|
#5 | |
Member
Sebi
Join Date: Mar 2019
Posts: 49
Rep Power: 7 |
Quote:
Did anyone have any progress to this? I am attempting a similar thing |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
WILLING TO PAY/ FREELANCER REQUIRED / small UDF coding force loads over body / 6DOF | acasas | CFD Freelancers | 1 | January 23, 2015 08:26 |
is it possible to inject DPM particles via UDF? | Saidul | Fluent UDF and Scheme Programming | 3 | January 20, 2015 06:03 |
How to create over one particles in udf | chaocaho_0627 | FLUENT | 0 | July 26, 2014 23:43 |
Injecting Particles via UDF in Parallel FLUENT | TedBrogan | FLUENT | 3 | July 11, 2011 14:43 |
How to define a parabolic velocity inlet of particles with UDF | zumaqiong | FLUENT | 2 | February 22, 2010 10:46 |