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

UDF at outlet boundary (particle tracking issue)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 12, 2024, 03:43
Default UDF at outlet boundary (particle tracking issue)
  #1
New Member
 
Dahae Seong
Join Date: Feb 2022
Posts: 4
Rep Power: 4
dseong is on a distinguished road
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;
}
dseong is offline   Reply With Quote

Reply

Tags
fluent, particle tracking, 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
sliding mesh problem in CFX Saima CFX 46 September 11, 2021 07:38
Centrifugal fan j0hnny CFX 13 October 1, 2019 13:55
Out File does not show Imbalance in % Mmaragann CFX 5 January 20, 2017 10:20
Wrong flow in ratating domain problem Sanyo CFX 17 August 15, 2015 06:20
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 04:05


All times are GMT -4. The time now is 20:46.