-
-
May 22, 2025 at 11:16 am
adrian.sieradzki
SubscriberHello,
I am studying behaviour of particles in procedurally generated devices.
To that end I need to know approximate distance (relative X, Y) of my particle to the walls of the device. Is there anything at all in Ansys UDF api to help with that?
For my use case an omnidirectional raycast would be nice but I dont see anything similar in the documentation.
Is there a way to do this in Ansys? Or any other suggestions on how to get my relative distance from walls inside volume mesh? -
May 27, 2025 at 2:17 pm
Ahmed Hussien
Ansys EmployeeYou can use the DEFINE_DPM_BC macro, which provides access to the particle properties at boundary interactions. Within this macro, you can use TP_POS(tp) to obtain the particle's position.
For more details, refer to the Fluent documentation on DPM macros—you’ll find several examples illustrating how DEFINE_DPM_BC is used. 2.5. Discrete Phase Model (DPM) DEFINE Macros
If you're trying to calculate the particle's distance from the wall, one approach is to loop through all wall boundary zones and compute the distance between the particle position and each wall face (or face centroid). The shortest distance among them can then be taken as the approximate particle-to-wall distance.
Â
-
- You must be logged in to reply to this topic.
-
3145
-
1007
-
935
-
858
-
792
© 2025 Copyright ANSYS, Inc. All rights reserved.