Distance to the nearest wall...
Hi,
How can I obtain a normal distance from any point in computational domain to the nearest wall  for UDF purposes. I need to define a walldistance based, turbulent Reynolds number so I have to know this... Thanks Michal 
Re: Distance to the nearest wall...
You can't do this in Fluent. This is also why Fluent does not offer any y+ dependent nearwall turbulence models. Your best bet is to derive a wall y* based on turbulent quantities instead. That is what Fluent does.
I guess that this lack of nearestwall distance was an early designdecision for their unstructured solver  keeping track of this everywhere would give too much overhead. I miss this feature a lot in postprocessing. Being able to extract data at a certain y+ isn't possible either, for example. 
Re: Distance to the nearest wall...
Thanks for your reply  Jonas.
What is a meaning of C_WALL_DIST(c,t) variable? Michal 
Re: Distance to the nearest wall...
The variable C_WALL_DIST(c,t) will in fact give you the distance to the nearest wall, with one small caveat. It appears that Fluent calculates the distance to the nearest wall bordering the particular cell zone that your cell is within. If the (physically) nearest wall is actually bounding a different cell zone, Fluent won't "see" it. Fortunately, this is rarely a problem, and I also have to admit that a couple of versions have come out since I noticed this, and it may be different now. For almost all problems, C_WALL_DIST(c,t) will work fine.
Now, what is tricky is finding the _vector_ definition to the nearest wall... Keith 
Re: Distance to the nearest wall...
Thanks for your explanation  Keith.
Michal 
Re: Distance to the nearest wall...
Interesting. Does this mean that this routine will work also for interior cells as long as the cell is within the same zone as the nearest wall? I thought the distance was only available for cells bordering to walls. Do you know how the distance is defined for interior cells? (I assume that they don't compute the correct normal distance)

Re: Distance to the nearest wall...
Yes, the C_WALL_DIST(c,t) variable gives values for all interior cells as well as 1stlayer cells. And my experience has been that it gives the distance to the nearest wall bounding its own cell zone, although that may have been changed in the latest versions to find the nearest wall regardless of cell zone.
You can actually display contours of this variable under "Grid>Cell Wall Distance" from the GUI, and it appears to be just the shortest distance to any wall. My guess is that whenever you initialize a .dat file, the routine loops through each interior cell and then in a nested loop through all boundary faces, calculates the distance between their centroids, and keeps the smallest one it finds. Regards, Keith 
All times are GMT 4. The time now is 08:39. 