CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Fluent UDF and Scheme Programming

UDF in Cylindrical Coordinate

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

Reply
 
LinkBack Thread Tools Display Modes
Old   August 22, 2011, 02:51
Question UDF in Cylindrical Coordinate
  #1
New Member
 
Masoud Hassani
Join Date: Aug 2011
Posts: 3
Rep Power: 5
mas_viper is on a distinguished road
Hi guys,
I am a newbie in UDF world and I need some help for a simple UDF problem.
I have a 3d turbo setup and i need to have tangential velocity profile in inlet as a function of "r" in cylindrical coordinate. I had no idea about C programing and UDF so I used Fluent sample for inlet boundary and changed it to this:

#include "udf.h"
DEFINE_PROFILE(T_velocity,thread,index)
{
real x[ND_ND];
real y[ND_ND];
real xx;
real yy;
face_t f;

begin_f_loop(f,thread) /* loops over all faces in the thread passed
in the DEFINE macro argument */
{
F_CENTROID(y,f,thread);
yy = y[1];
F_CENTROID(x,f,thread);
xx = x[1];

F_PROFILE(f,thread,index) = 0.00002*(xx*xx+yy*yy)*1000000-0.028*sqrt(xx*xx+yy*yy)*1000+11.565;
}
end_f_loop(f,thread)
}

Clearly it did not work because I did not know what I was doing!!! please helpme to change this UDF to give me velocity in cylindrical coordinate as "0.00002*r^2*1000000-0.028*r*1000+11.565" where "r" is radial distance from 0,0,0
Thank you


mas_viper is offline   Reply With Quote

Old   August 22, 2011, 05:46
Default
  #2
New Member
 
Join Date: Aug 2011
Posts: 5
Rep Power: 5
Erny is on a distinguished road
If I am not mistaken the;-

F_CENTROID(x,f,thread)

Should give you the x,y,z coordinates for the cell such as;-
x[0] = x
x[1] = y
x[2] = z
Erny is offline   Reply With Quote

Old   August 22, 2011, 06:43
Default
  #3
New Member
 
Masoud Hassani
Join Date: Aug 2011
Posts: 3
Rep Power: 5
mas_viper is on a distinguished road
Thank you so much! It is so easy
mas_viper is offline   Reply With Quote

Old   April 18, 2012, 06:55
Default
  #4
New Member
 
Aydın Dönmez
Join Date: Feb 2012
Posts: 4
Rep Power: 5
donmezayd is on a distinguished road
i also have to define a parabolic tangential profile but the velocity values computed by the udf does not match with the real values. help please!

#include "udf.h"
DEFINE_PROFILE(velocity_profile,t,i)
{
real x[ND_ND]; /* this will hold the position vector */
real r,R,omega;
face_t f;
R=0.1;
omega=20;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
r=sqrt((x[0]*x[0])+(x[1]*x[1]));

F_PROFILE(f,t,i) = (omega*R*R/r)*(1-exp(-r*r/R*R));
}
end_f_loop(f,t)
}
donmezayd is offline   Reply With Quote

Reply

Tags
cylindrical, inlet, udf

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
cylindrical coordinate vs cartesian coordinate Lam FLUENT 10 May 11, 2013 13:05
cylindrical coordinate -Gambit noussa ANSYS Meshing & Geometry 2 June 12, 2010 09:07
CFD Software with Cylindrical and Spherical Coordinate cfd2010 Main CFD Forum 0 June 9, 2010 21:55
cartesian to cylindrical coordinate UDF Manoj FLUENT 0 December 15, 2005 10:43
Cording Ground.for in Cylindrical coordinate J.H. Lee. Phoenics 2 March 28, 2003 05:28


All times are GMT -4. The time now is 04:48.