CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

normal unit outward vector to the wall

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By ScottN

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 5, 2011, 18:30
Default normal unit outward vector to the wall
  #1
New Member
 
YuanLiu
Join Date: Aug 2010
Posts: 10
Rep Power: 15
xiaoyoyo is on a distinguished road
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!
xiaoyoyo is offline   Reply With Quote

Old   January 31, 2011, 09:46
Default
  #2
New Member
 
Join Date: Sep 2010
Posts: 4
Rep Power: 15
ScottN is on a distinguished road
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
Khunnie_baby likes this.
ScottN is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with wall functions Nick Georgiadis Main CFD Forum 10 January 17, 2017 11:03
Wall Normal Temperature Gradient Daniel Tanner FLUENT 6 September 20, 2015 14:10
outward normal Prem Venugopal Main CFD Forum 6 July 26, 2004 05:20
Wall function in adverse pressure gradients stephane baralon Main CFD Forum 11 September 2, 1999 05:05
Wall functions Abhijit Tilak Main CFD Forum 6 February 5, 1999 02:16


All times are GMT -4. The time now is 22:16.