
[Sponsors] 
February 13, 2001, 05:53 
Distance to the nearest wall...

#1 
Guest
Posts: n/a

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 

February 13, 2001, 08:06 
Re: Distance to the nearest wall...

#2 
Guest
Posts: n/a

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. 

February 13, 2001, 09:57 
Re: Distance to the nearest wall...

#3 
Guest
Posts: n/a

Thanks for your reply  Jonas.
What is a meaning of C_WALL_DIST(c,t) variable? Michal 

February 13, 2001, 10:15 
Re: Distance to the nearest wall...

#4 
Guest
Posts: n/a

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 

February 13, 2001, 10:27 
Re: Distance to the nearest wall...

#5 
Guest
Posts: n/a

Thanks for your explanation  Keith.
Michal 

February 13, 2001, 11:03 
Re: Distance to the nearest wall...

#6 
Guest
Posts: n/a

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)


February 13, 2001, 15:49 
Re: Distance to the nearest wall...

#7 
Guest
Posts: n/a

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 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
calculate distance from wall to neighbourig cell centroid  rr123  Fluent UDF and Scheme Programming  32  April 18, 2016 17:21 
Fluent3DMeshToFoam  simvun  OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ...  48  May 14, 2012 05:20 
Wall distance in BC  Sylvain  OpenFOAM  1  June 14, 2011 19:54 
UDF problem about nearest wall !  alex  FLUENT  2  December 24, 2010 22:31 
Multicomponent fluid  Andrea  CFX  2  October 11, 2004 05:12 