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

Velocity profile UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 8, 2012, 19:29
Default Velocity profile UDF
  #1
Member
 
Join Date: Jan 2011
Posts: 45
Rep Power: 15
egge24 is on a distinguished road
Hi,

I'm trying to create a tranverse velocity profile UDF to use it as velocity inlet boundary condition to simulate flow in a water tank. The UDF is as follows:

########################################

DEFINE_PROFILE(Velocity_Profile_Z, thread, index)
{
real x[ND_ND]; /* this will hold the position vector */
real z;
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);
z = x[1];

if (z < 0)

z = z*(-1);

else

F_PROFILE(f, thread, index) = 1*pow((z/(12.8)),0.142857);

}
end_f_loop(f, thread)
}

############################################

When I run the simulation, once it converges I plot a XY Plot, see attached figure . In my case the Z-axis represents the abscissa and the velocity magnitude the ordinate. The plot shows that even do the function represents the desire velocity profile, there is almost none velocity magnitude variation!!!

Does anyone have an idea of why is that happening??

Thanks in advance.

[/URL]
egge24 is offline   Reply With Quote

Old   May 9, 2012, 05:11
Default
  #2
Member
 
Daniel Tanner
Join Date: Apr 2009
Posts: 54
Rep Power: 18
Daniel Tanner is on a distinguished road
You have set z = x[1]. This is the y direction on your mesh, is that correct? The x vector is given by: (x[0], x[1], x[2]) which is equivalent to (x,y,z).

Worth checking this.
Daniel Tanner is offline   Reply With Quote

Old   May 10, 2012, 14:03
Default
  #3
Member
 
Join Date: Jan 2011
Posts: 45
Rep Power: 15
egge24 is on a distinguished road
Thanks Daniel!!

That was the problem!!!!!
egge24 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
UDF problems - velocity profile Oli Fluent UDF and Scheme Programming 6 October 24, 2016 11:38
Logarithmic velocity profile cfdworker Fluent UDF and Scheme Programming 0 April 23, 2009 20:09
How to specify the Velocity profile (eqn) by UDF Anant FLUENT 1 February 27, 2008 15:54
Multi step transient UDF velocity profile problem William177 FLUENT 1 February 3, 2008 07:47
Prescribed inflow velocity profile - how to? Alan Main CFD Forum 10 October 28, 2005 13:14


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