CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   Cannot set correct inlet velocity by UDF?!? (

Bob March 21, 2003 11:44

Cannot set correct inlet velocity by UDF?!?

While performing simulations of tracer transport in a reactor, I encountered the following problem. By a UDF DEFINE_PROFILE, I set a fixed normal velocity at the inlet (see UDF below). The velocities returned by Fluent are smaller than the imposed ones however. When imposing a velocity of e.g. 0.213 m/s, Fluent returns 0.194 m/s. Setting boundary mass fractions for scalars with DEFINE_PROFILE returns correct values. Is this a bug in Fluent 6.1? And how should I deal with the problem?

Thanks a lot in advance.

best regards, Bob De Clercq

DEFINE_PROFILE(inlet_vel_tracertest, t, i) {

real time;

face_t f;

int k, j = 0;

real surface = 0.745;

float dat_time[902] = {};

float dat_flow[902] = {};

time = RP_Get_Real("flow-time");

for (j=0; j<= 901; ++j)


if (time > dat_time[j])



begin_f_loop(f, t)


if (time >= dat_time[901])

F_PROFILE(f,t,i) = dat_flow[901]/surface;


F_PROFILE(f, t, i) = dat_flow[k]/surface;


end_f_loop(f, t) }

sam March 26, 2003 13:39

Re: Cannot set correct inlet velocity by UDF?!?
I've had same problem, in fact Fluent default plot may mis-guide you.

If you are using x(whatever) vs timestep plot, it will plot the "first cell value" of the selected surface. In otherwords, your udf value on the seleted surface won't be plotted but the first cell values.

I have noticed that there is no direct plot you can check your udf values. Check your node and cell values and see if 0.194m/s can be found.

Alex Munoz March 26, 2003 16:11

Re: Cannot set correct inlet velocity by UDF?!?

I think you gays are missing one piece in the picture If I follow you case correctly.

Do you impose a velocity profile to a particle (tracer) or to the continuous phase?

If you impose a velocity profile to a particle and you don't get the same velocity profile at the outlet means that your step lengh is to high to accurate compute the velocity of the particle. Therefore, decrease the step time in a factor of 1E-02 and repeat the calculation.

Keep in mind that the relaxation time for a particle it is proportional to the particle diameter^2/dinamic viscosity, therefore your time step should be lower than the relaxation time.

Then the step lengh is equal to the time step/(particle velocity + continuous phase velocity).

Best regards

Alex Munoz

Bob March 27, 2003 03:47

Re: Cannot set correct inlet velocity by UDF?!?
Hi Alex and Sam,

Thanks for your replies.

I do impose a velocity to the continuous phase. Whereas I did not have problems in Fluent 5 and 6.0, I get lower flow rates when computing it in reports/surface integrals. Of course, also the velocities are too low when you plot them with xy-plot.

The helpdesk of Fluent is looking at the problem, but they haven't returned to me with a solution. Hopefully it isn't a bug in Fluent 6.1!

cheers, bob

Alex Munoz March 27, 2003 04:02

Re: Cannot set correct inlet velocity by UDF?!?

I am working with Fluent 6.1, but I have not getting different velocity profiles that the one impose at the inlet.

Could you please tell me more about your simmulation??


Alex Munoz

Bob March 27, 2003 04:17

Re: Cannot set correct inlet velocity by UDF?!?
Hi Alex,

I use an incompressible fluid with two scalars (solids settling in a tank, and a tracer transported with the main flow). At the inlet of the settling tank, I impose time-varying concentrations for both scalars (by means of UDFs). After checking them, they seem to be correct. It is the flow velocity (also UDF) that gives problems however.

Concerning turbulence, I set a turbulence intensity and hydraulic perimeter at the inlet; they do not change in time though.

About numerical algorithms, I apply QUICK for scalars, turbulence and momentum; body-force weighted for pressure, and PISO for the pressure-velocity coupling. But this should not make any difference since I look at a boundary condition which should be invariable.

Is this the information you asked for, or is it more system related information?

Cheers, Bob

All times are GMT -4. The time now is 03:06.