Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

[UDF] [PARTICLE] Raycast or find distance to walls in multiple directions?

    • adrian.sieradzki
      Subscriber

      Hello,

      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? 

    • Ahmed Hussien
      Ansys Employee

      You 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.

       

      • adrian.sieradzki
        Subscriber

        Thanks for the reply. I have another question. 

         Any idea why I cannot access the documentation link? I am on university license/network. What is the default way to open the documentation? 

Viewing 1 reply thread
  • You must be logged in to reply to this topic.