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

please help UDF for velocity profile in y-directio

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By LuckyTran

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 22, 2008, 06:58
Default please help UDF for velocity profile in y-directio
  #1
raju
Guest
 
Posts: n/a
hi everybody,

i want put parabolic velocity profile in a pipe flowing water.in verticle direction.means in y direction i want give parabolic profile so what should i do??what should i make in this program. there is a sample problem for x direction which is given in UDF manual

/************************************************** ******************** udfexample.c UDF for specifying a steady-state velocity profile boundary condition ************************************************** ********************/ #include "udf.h" /* must be at the beginning of every UDF you write */ DEFINE_PROFILE(x_velocity,thread,index) { real x[ND_ND]; /* this will hold the position vector */ real y; face_t f; begin_f_loop(f,thread) /* loops over all faces in the thread passed in the DEFINE macro argument */ { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f,thread,index) = 20. - y*y/(.0745*.0745)*20.; } end_f_loop(f,thread) }

so what change should i make for y direction.i tried to put y at the place of x but it is not working.

please help me. thank you
  Reply With Quote

Old   September 22, 2008, 12:29
Default Re: please help UDF for velocity profile in y-dire
  #2
Keith Robinson
Guest
 
Posts: n/a
I think the problem lies in your DEFINE_PROFILE line. Try this:

#include "udf.h"

DEFINE_PROFILE (y_velocity,thread,index) {

real y,x[ND_ND];

face_t f;

begin_f_loop(f,thread)

{

F_CENTROID(x,f,thread);

y=X[1];

F_PROFILE(f,thread,index)=20.-y*y/(0.0745*0.0745) *20.;

}

end_f_loop(f,thread) }

  Reply With Quote

Old   September 22, 2008, 14:52
Default Re: please help UDF for velocity profile in y-dire
  #3
raju
Guest
 
Posts: n/a
thanks for response but keith still it is not giving parabolic profile in y direction...if you are understanding my problem please help me thank you.
  Reply With Quote

Old   September 22, 2008, 16:36
Default Re: please help UDF for velocity profile in y-dire
  #4
Keith Robinson
Guest
 
Posts: n/a
I apologize for committing an ID10T error in my previous post.

The best thing I can suggest is to read the documentation for the DEFINE_PROFILE section. There is an example of the DEFINE_PROFILE for a pressure boundary layer that explains what each section means. The y=x[1] gives the y coordinate of the centroid. You will need to replace the y=x[1] statement with the appropriate statement.
  Reply With Quote

Old   April 5, 2019, 07:08
Default defining temperature profile with UDF
  #5
New Member
 
soumya
Join Date: Apr 2019
Posts: 1
Rep Power: 0
soumya_jain is on a distinguished road
I am facing same problem related to defining temperature profile in y-direction. @raju did you get any solution for your problem?? Thank you
soumya_jain is offline   Reply With Quote

Old   April 5, 2019, 10:58
Default
  #6
Senior Member
 
Lucky
Join Date: Apr 2011
Location: Orlando, FL USA
Posts: 5,668
Rep Power: 65
LuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura aboutLuckyTran has a spectacular aura about
Follow the example in the manual. Replace x[0] with x[1].
bietchetlien1995 likes this.
LuckyTran is offline   Reply With Quote

Old   April 12, 2019, 23:21
Default
  #7
New Member
 
Michael Fily
Join Date: Feb 2019
Posts: 24
Rep Power: 7
bietchetlien1995 is on a distinguished road
#include "udf.h"
DEFINE_PROFILE(log_velocity,thread,index)
{
real y[ND_ND];
real x,z;
face_t f;
begin_f_loop(f,thread)
{
F_CENTROID(y,f,thread);
x = y[1];
z = y[2];
F_PROFILE(f,thread,index) = 26.22*log(x/2)/log(149.5/2);
//Note here to express [28.19*log(x/2)/log(149.5/2)] in terms of (x,z); please get the //correct equation.
}
end_f_loop(f,thread)
}



ps/ it works for me in the 3d, try this one, change the fomular. This example with the change of velocity depending on the change of height (y-axis)
bietchetlien1995 is offline   Reply With Quote

Reply


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
Velocity profile as an velocity intlet condition kees FLUENT 3 April 16, 2008 18:35
velocity profile as an velocity inlet condition KEES Main CFD Forum 0 April 15, 2008 11:26
velocity profile nabeel FLUENT 0 June 27, 2006 05:32
How to get summation of one variable at x directio zhou1 FLUENT 3 October 21, 2003 10:17
particle velocity and velocity profile HGG FLUENT 2 June 10, 2001 16:32


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