KR123: Access Distance of a cell from the nearest wall
The Macro described here returns the distance of the cell from the nearest wall in SI units.
This macro can be used in many applications such as specifying Wall function treatments, calculating Gradients and identifying cells near the wall.
Macro Argument Types
C_WALL_DIST (c, t) cell_t c, Thread *t
Distance of a cell from the nearest wall
Following UDF is to find the cells which are lying at a distance of 0.01m from the boundary.
/*Remember to initialize UDM from Fluent before running this UDF*/
Domain *d; /* declare domain pointer since it is not passed as an argument to the DEFINE macro */
d = Get_Domain(1);