|
[Sponsors] |
UDF at outlet boundary (particle tracking issue) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 12, 2024, 04:43 |
UDF at outlet boundary (particle tracking issue)
|
#1 |
New Member
Dahae Seong
Join Date: Feb 2022
Posts: 4
Rep Power: 4 |
Hi all,
I am working on creating a UDF to track particles hitting the outlet boundary. The setup involved in an air purifier in a small chamber, and I aim to set the purifier's efficiency at 95%. (95% of the particles that reach the outlet will escape, while 5% will be reinjected from a reinjection point) From my understanding: return PATH_END is used for considering particles escaped from the domain and return PATH_ACTIVE is for continuously tracking particles I would like to set up the system so that 5% of particles are reinjected from the reinjection point and continue being tracked. While PATH_END seems to work as expected, PATH_ACTIVE does not. In the console, particles are being aborted. I have revised my code several times and attempted different solutions, but I am currently out of ideas. Would anyone be able to help me solve this issue or suggest any possible approaches? I would greatly appreciate your insights. Thanks you in advance! Best regards, Dahae -------------------------------------------------------------- Here is my code FYI: #include "udf.h" #include "dpm.h" #define REINJECT_POSITION_X 2.0 // Set the x-coordinate of the reinjection point #define REINJECT_POSITION_Y 0.425 // Set the y-coordinate of the reinjection point #define REINJECT_POSITION_Z 0.18 // Set the z-coordinate of the reinjection point /* Global variables */ int particle_count = 0; int escaped_count = 0; int reinjected_count = 0; DEFINE_DPM_BC(udf_outlet, tp, t, f, f_normal, dim) { particle_count++; if (particle_count <= 95) { /* Mark as escaped */ escaped_count++; return PATH_END; } if (particle_count > 95) { /* Mark as reinjected */ reinjected_count++; /* Move particle to specific point */ P_POS(tp)[0] = REINJECT_POSITION_X; // Specific X position P_POS(tp)[1] = REINJECT_POSITION_Y; // Specific Y position P_POS(tp)[2] = REINJECT_POSITION_Z; // Specific Z position return PATH_ACTIVE; } /* Reset the counter after 100 particles */ if (particle_count > 100) { particle_count = 0; escaped_count = 0; reinjected_count = 0; } return PATH_ACTIVE; } |
|
Tags |
fluent, particle tracking, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
sliding mesh problem in CFX | Saima | CFX | 46 | September 11, 2021 08:38 |
Centrifugal fan | j0hnny | CFX | 13 | October 1, 2019 14:55 |
Out File does not show Imbalance in % | Mmaragann | CFX | 5 | January 20, 2017 11:20 |
Wrong flow in ratating domain problem | Sanyo | CFX | 17 | August 15, 2015 07:20 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 05:05 |