CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   problem with udf (

Harpreet September 8, 2011 08:39

problem with udf

pls help

i am trying to vary the inlet velocity profile for which i have made a following udf
#include "udf.h"
real x[ND_ND];
real y;
face_t f;
but the problem with it is that it is giving a constant velocity at the inlet that is 7.36. I think that probably it is not taking the coordinate into the equation.

pls help me. its urgent

laurentb September 9, 2011 09:10

You can add after F_CENTROID line :
printf("x-coord = %f y-coord = %f", x[0], x[1]);

m2montazari September 9, 2011 09:46

check if you are hooking udf in correct boundary. does the boundary have variable y-coordinate?
your case is 2d or 3d?

Harpreet September 11, 2011 00:45

my case is 2d, and i am hooking it in velocity inlet boundary condition.Another thing i noticed that, if i scale my in unit of 'm', the variation in velocity is obserable, but the same is not the case when it is scaled in 'mm' units.

bohis September 12, 2011 07:06

the UDF takes units of your mesh scaled in Fluent interface, just check in SCALE panel.
Further, check whether your position in UDF is y position or x position. If it is x, you have to write x = x[0]. If it is y, you write y=x[1]

All times are GMT -4. The time now is 16:02.