CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   urgent: velocity inlet profile when pipe is 40% fill (https://www.cfd-online.com/Forums/fluent/62928-urgent-velocity-inlet-profile-when-pipe-40-fill.html)

shubham208011 March 24, 2009 04:07

urgent: velocity inlet profile when pipe is 40% fill
 
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....

HenrikS March 24, 2009 06:33

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

shubham208011 March 24, 2009 06:56

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..

HenrikS March 24, 2009 07:33

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

shubham208011 March 24, 2009 08:48

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

HenrikS March 24, 2009 10:33

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 Y-coordinates, 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 Z-component of velocity and not the velocity magnitude etc...


All times are GMT -4. The time now is 18:38.