CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   please help UDF for velocity profile in y-directio (http://www.cfd-online.com/Forums/fluent/49313-please-help-udf-velocity-profile-y-directio.html)

raju September 22, 2008 06:58

please help UDF for velocity profile in y-directio
 
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

Keith Robinson September 22, 2008 12:29

Re: please help UDF for velocity profile in y-dire
 
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) }


raju September 22, 2008 14:52

Re: please help UDF for velocity profile in y-dire
 
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.

Keith Robinson September 22, 2008 16:36

Re: please help UDF for velocity profile in y-dire
 
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.


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