CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   problem with udf (https://www.cfd-online.com/Forums/fluent-udf/92270-problem-udf.html)

Harpreet September 8, 2011 09:12

problem with udf
 
hello,

pls help

i am trying to vary the inlet velocity profile for which i have made a following udf
#include "udf.h"
DEFINE_PROFILE(variable_velocity,t,i)
{
real x[ND_ND];
real y;
face_t f;
begin_f_loop(f,t)
{
F_CENTROID(x,f,t);
y=x[1];
F_PROFILE(f,t,i)=7.36+0.368*y;
}
end_f_loop(f,t)
}
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

pranab_jha September 8, 2011 10:32

Did you check your units? Also, is your inlet parallel to Y-axis or X?
Just suggestions though. I don't know about your case file.

Harpreet September 8, 2011 12:59

yes i checked the unit, but don't know what effect will the inlet direction would make on the udf. although it is parallel to x axis

pranab_jha September 8, 2011 13:05

Your profile varies with y and not x. Hence, the result will be a constant on the inlet when the inlet is aligned to the x-direction. Interchange the x and y coordinates.

Harpreet September 8, 2011 13:27

thank u for ur reply
i tried with interchanging x & y, but still i am getting constant velocity

Harpreet September 8, 2011 14:13

when i try to read the mesh with scaling in M units, it is showing the variation, but when i try to read the file in mm units its showing constant velocity. why it is show

Harpreet September 8, 2011 14:13

when i try to read the mesh with scaling in M units, it is showing the variation, but when i try to read the file in mm units its showing constant velocity. why it is so. pls help me i am new to fluent

m2montazari September 9, 2011 10:25

hi,
it is a dupplicated thread!
if you have a function 7.36+0.368*y and the variation of y is about 10 mm then the variation of velocity would be about 0.0037 and you may think a constant velocity is set in inlet. but if the variation of y is about 10 m then variation of velocity would be about 0.3 and you will see a linear velocity profile in inlet easily.
just think about that ;)
yours,
mohammad

Harpreet September 11, 2011 00:51

thank you for ur answer. i am obliged


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