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

F_CENTROID

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

Like Tree2Likes
  • 2 Post By ap

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 8, 2004, 21:30
Default F_CENTROID
  #1
co2
Guest
 
Posts: n/a
I was looking at the following simple code for a UDF.

F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, nv) = 20.*(1.- y*y/(.0745*.0745));

x is the position vector defined as: float x[3]; /* this will hold the position vector*/

Question: wouldn't y=x[1] assignment pick up the x coordinate of the face centroid? the original formula for the velocity is

u(y) = 20 [ 1 - (y/0.0745)^2]

So I was wondering if we need to write y=x[2]
  Reply With Quote

Old   January 9, 2004, 02:53
Default Re: F_CENTROID
  #2
ap
Guest
 
Posts: n/a
No, in C all arrays starst from the 0 position. So you'll have x[0], x[1] and x[2], which contains, in the order, x, y, and z.

P.S. Better to define x as:

real x[ND_ND];

because FLUENT manages real type as a float or double according to the chosen solver.

ND_ND allows to keep the code more general because ND_ND = 2 for a 2D case and ND_ND = 3 for a 3D case.

Hi

ap
Dri and soheil_r7 like this.
  Reply With Quote

Old   September 1, 2011, 02:49
Default x{nd-nd}
  #3
Member
 
Nirav
Join Date: Jul 2011
Posts: 43
Rep Power: 14
niravtm007 is on a distinguished road
Send a message via Skype™ to niravtm007
please can you tell me how will the code for 3d parabolic inlet will be modified.
i have cubical section. with circular inlet of 0.1 radius on one face.
should i use x[ND_ND] & take y=x(2) as variaion will be in both directions y,z. it should be paraboloid.? please give some idea
niravtm007 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



All times are GMT -4. The time now is 07:14.