
[Sponsors] 
March 24, 2009, 05:07 
urgent: velocity inlet profile when pipe is 40% fill

#1 
Member
shubham
Join Date: Mar 2009
Posts: 48
Rep Power: 8 
hi all...
is there any mistake in my udf... #include "udf.h" #define ufull 0.3000000 /* full flow velocity*/ DEFINE_PROFILE(inlet_z_velocity,thread,index) { face_t f; real z[ND_ND]; begin_f_loop(f,thread) { F_CENTROID(z,f,thread); if(z[1] > 0.0248) /* upper half of he domain (0.0248 <= y <= .062)*/ { F_PROFILE(f,thread,index) = 0; } else /* lower half of the domain ( 0 <= y <= 0.0248)*/ { F_PROFILE(f,thread,index) = 2.166290476*ufull*(pow((z[1]/.0248),(1/7))); } } end_f_loop(f,thread) } please help me out.... 

March 24, 2009, 07:33 

#2 
Member
Henrik Ström
Join Date: Mar 2009
Posts: 32
Rep Power: 8 
What problems do you have? Compiling? Running? Any error messages? :)
In general, I think you should use real variables to avoid casting into integer. That is, change "(1/7)" to "(1.0/7.0)" and " = 0;" to "= 0.0;", although I don't know if that is the problem here. /Henrik 

March 24, 2009, 07:56 

#3 
Member
shubham
Join Date: Mar 2009
Posts: 48
Rep Power: 8 
Thanks hanrik..
I am using the vof model and at the inlet the the pipe is just 40% full (something like open channel flow). so, for defining the velocity proflie for this i wrote this udf and assume "above 0.4 time of pipe dia velocity of the mixture is zero and below it is function of y" and assume "in mixture vof of water is 1". when i hook this udf and start the iteration the continuty eq. didn't converge and then i see the velocity at the inlet what i found is zero velocity at every section of inlet means from this udf fluent just read zero velocity at the inlet... I dont know where i am wrong... please help me if i am doing or assuming anything wrong.. 

March 24, 2009, 08:33 

#4 
Member
Henrik Ström
Join Date: Mar 2009
Posts: 32
Rep Power: 8 
Have you made the changes I suggested? (Making all numbers real instead of integers)
I tried your code and this makes a difference (as it is written in your first post, it does not calculate things correctly). Try this and see if the problem persists. /Henrik 

March 24, 2009, 09:48 

#5 
Member
shubham
Join Date: Mar 2009
Posts: 48
Rep Power: 8 
hi hanriks..
it still shows no value for velocity... one more thing my model is a 3d one with hight in y direction and z is perpendicular to the plane in xy palne and the fluid enters from the z direction towards the palne... plz help me out..where i m making the mistake 

March 24, 2009, 11:33 

#6 
Member
Henrik Ström
Join Date: Mar 2009
Posts: 32
Rep Power: 8 
Given the change I suggested, there is no mistake in the UDF. I tested it and it works.
Maybe your mesh is different from what you think? Make sure you have no negative Ycoordinates, for example (that Y is really bound by 0.0 and 0.062 at the inlet). Also make sure you are hooking it to the Zcomponent of velocity and not the velocity magnitude etc... 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
How to apply velocity profile at inlet  Sam  CFX  12  April 1, 2012 06:52 
Prescribed inflow velocity profile  how to?  Alan  Main CFD Forum  10  October 28, 2005 12:14 
UDF problem : inlet velocity in cyl. coord. system  Jongdae Kim  FLUENT  0  June 15, 2004 11:21 
Terrible Mistake In Fluid Dynamics History  Abhi  Main CFD Forum  12  July 8, 2002 09:11 
fluid flow fundas  ram  Main CFD Forum  5  June 17, 2000 21:31 