|
[Sponsors] |
UDF for assigning particles position (re-injecting to the inlet) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
November 11, 2019, 08:11 |
UDF for assigning particles position (re-injecting to the inlet)
|
#1 |
New Member
Jemyung Cha
Join Date: Jul 2009
Posts: 12
Rep Power: 17 |
Hello.
I'm trying to re-injecting particles exiting outlet back into inlet. There is a good reference provided by user 'e'. Periodic BC in ANSYS DDPM, UDF Exactly same code of user 'e' was tested. Code:
#include "udf.h" DEFINE_DPM_BC(continue_tracking,p,t,f,f_normal,dim) { return PATH_ACTIVE; } DEFINE_DPM_SCALAR_UPDATE(recycle_particles,c,t,initialize,p) { FILE *fp; if (P_POS(p)[0]<0.08333) { P_USER_REAL(p,1) = 0.; } if (P_POS(p)[0]>0.91667 && P_USER_REAL(p,1) == 0.) { // save particle position to a text file fp=fopen("recycleparticles.txt", "a"); // x, y, z particle positions [m], particle ID [#] and time [s] fprintf(fp,"%e %e %e %d %e\n",P_POS(p)[0],P_POS(p)[1],P_POS(p)[2],p->part_id,P_TIME(p)); fclose(fp); // save the number of times this particle has been recycled P_USER_REAL(p,0) = P_USER_REAL(p,0) + 1.; P_USER_REAL(p,1) = 1.; // send particle to the inlet boundary P_POS(p)[0] = 0.; P_POS(p)[1] = P_POS(p)[1] + 0.0833; } } First, I managed to succeed re-injecting particles in a cubic domain (1.0 * 1.0 * 1.0 m3). The inlet is on the left side and the outlet is on the right. Particle is injected at the line-surface and flows to the outlet. Near the outlet (x > 0.91667), it was shown that the particles moves to the inlet!! Their positions are exactly what I want. case1(first_cycle).jpg case1(third_cycle).jpg But, sometimes, I noticed that it doesn't work unexpectedly. It seems like that the particles positions are highly affected by the mesh size, particles velocity, time step and other numerical parameters. Some particles are deviating the position they should be. case2(before_outlet).jpg case2(after_outlet).jpg I think all particles must pass through the fluid cells with spatial and temporal steps. So the time step was reduced for the fine mesh case. Two case files are in the follwing link. https://drive.google.com/drive/folde...cp?usp=sharing (case1.zip is coarse mesh and case2.zip is fine mesh. they are generated in ANSYS student version 2019 R2.) How to control the particle position more adequately? Please provide any information about this topic. Thanks. |
|
Tags |
define_dpm_scalar_update, dpm |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
help with udf for wind profil at inlet | BEK_Ad | FLUENT | 1 | April 8, 2018 11:08 |
UDF paraboloid velocity inlet | rosco | FLUENT | 10 | June 2, 2017 09:01 |
UDF problem- time dependent temperature at inlet | kaeran | FLUENT | 1 | June 16, 2015 22:48 |
Inlet won't apply UDF and has temperature at 0K! | tccruise | Fluent UDF and Scheme Programming | 2 | September 14, 2012 07:08 |
UDF paraboloid velocity inlet | Ronak Shah | FLUENT | 0 | June 4, 2003 10:44 |