TAGGED: dpm, dpm-tracking, dpm-udfs
-
-
September 19, 2024 at 7:46 amdseongSubscriber
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.
Thank 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;
} -
September 19, 2024 at 10:53 amRobForum Moderator
Are you applying the UDF to the outlet boundary? What fate did you set on the boundary?
-
September 20, 2024 at 12:31 am
-
-
September 20, 2024 at 10:30 amRobForum Moderator
How far into the domain is the injection?
-
September 23, 2024 at 12:28 amdseongSubscriber
I injected around 10,000 particles uniformly all around the domain (the size of the domain is 3 m by 4 m by 2.5 m). And I wanted to set the 5% of particles passing the pressure outlet to be reinjected from the inlet. So, I specified the reinjection point in front of the inlet.
-
-
September 23, 2024 at 10:21 amRobForum Moderator
But you're not sending 5% back you're sending count-95 back. Or would be if it worked.
-
September 24, 2024 at 1:08 amdseongSubscriber
From my understanding, 'return PATH_END' means that particles escaped from the domain. So, I thought my code said that the particle count of less than 95 escaped. Could you please correct my code?
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;
}
-
-
September 24, 2024 at 9:00 amRobForum Moderator
I'm not debugging, the problem is if (particle_count > 95) I think.
-
September 25, 2024 at 1:29 amdseongSubscriber
Thanks for your reply, Rob
I am sorry but I am having trouble understanding the issue. If the problem lies with particle_count>95, how should I relocate particles from 96th to 100th that are hitting the outlet? I would greatly appreciate your answer.
-
-
September 25, 2024 at 8:48 amRobForum Moderator
If you have 100 parcels you'll have the last 5 be reinjected. But... with 1000 particles you'll have 905 reinjected. So a random number function may be better.
Now, for the actual return part. If a parcel hits the outlet does it leave the domain before the UDF triggers? If you put a surface at a few cells into the domain (porous jump are really useful for this) does behaviour change?
-
- You must be logged in to reply to this topic.
- How do you approach this?
- Convective Augmentation Factor in DEFINE_HEAT_FLUX
- Conservation issue with a UDS solution
- Where is the Electrolyte Projected Area in the Reports tab of PEMFC Model?
- ANSYS fluent – Rocky DEM coupling
- Non-Premixed Combustion PDF generation with 4th-order interpolation
- Solar load , Mesh Orientation and Beam direction
-
456
-
200
-
194
-
177
-
162
© 2024 Copyright ANSYS, Inc. All rights reserved.