
[Sponsors] 
January 5, 2011, 18:30 
normal unit outward vector to the wall

#1 
New Member
YuanLiu
Join Date: Aug 2010
Posts: 10
Rep Power: 6 
I am tring to implement a wall lubrication force for multiphase flow.Thus, the unit vector normal of the nearest wall is needed. Does anyone know how i can access it for my UDF?
Thanks! 

January 31, 2011, 09:46 

#2 
New Member
Join Date: Sep 2010
Posts: 4
Rep Power: 6 
There are two ways:
1. You can extract the face area vector which is a surface normal vector that points outwards from the domain and has a magnitude equal to the area of the wall cell face, you would then divide it by the magnitude of the vector to get a unit normal vector: F_AREA(A,f,t); where A is a vector with 2 elements if 2D simulation, 3 elements if 3D. You can use the ND_ND function to automatically size it to 2 or 3D. For example, the declaration of A would be "real A[ND_ND];" f is the face index for which the face area vector will be extracted (type: face_t) t is the thread index of the boundary surface (type: Thread) you can then calculate the magnitude of the vector with the NV macro: real AMag=NV_MAG(A); Then calculate the the unit normal vector as: A[0]=A[0]/AMag; A[1]=A[1]/AMag; A[2]=A[2]/AMag; 2: Use the BOUNDARY_FACE_GEOMETRY macro which explicitly gives you the unit normal vector (along with a bunch of other data on the boundary face): BOUNDARY_FACE_GEOMETRY(f,t,A,ds,es,A_by_es,dr0) f is the face index (type face_t) t is the thread index (type Thread) A is the the area normal vector (same as above type real with ND_ND elements) ds is the distance from the boundary face centroid to the cell centroid (type real) es is the unit normal vector in the direction from the cell centroid to the boundary face centroid (i.e. out of the domain) (type real vector with ND_ND elements) A_by_es is the dot product of the area normal vector with itself divided by the dot product of the area normal vector with the unit normal vector (type real) dr0 is a vector that connects the centroid of the cell to the boundary face centroid (i.e. es multiplied by ds) (type real vector with ND_ND elements) Hope that helps 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
Wall Normal Temperature Gradient  Daniel Tanner  FLUENT  5  May 3, 2009 00:01 
outward normal  Prem Venugopal  Main CFD Forum  6  July 26, 2004 04:20 
help with wall functions  Nick Georgiadis  Main CFD Forum  4  February 20, 2000 18:07 
Wall function in adverse pressure gradients  stephane baralon  Main CFD Forum  11  September 2, 1999 04:05 
Wall functions  Abhijit Tilak  Main CFD Forum  6  February 5, 1999 02:16 