|
[Sponsors] |
September 8, 2011, 08:39 |
problem with udf
|
#1 |
New Member
Harpreet
Join Date: May 2011
Posts: 21
Rep Power: 14 |
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 |
|
September 9, 2011, 09:10 |
|
#2 |
Member
Laurent B
Join Date: Jun 2009
Location: Lille, FRANCE
Posts: 70
Rep Power: 16 |
Hi,
You can add after F_CENTROID line : printf("x-coord = %f y-coord = %f", x[0], x[1]); |
|
September 9, 2011, 09:46 |
|
#3 |
Senior Member
Mohammad
Join Date: Feb 2010
Location: Shiraz, Iran
Posts: 108
Rep Power: 16 |
hi,
check if you are hooking udf in correct boundary. does the boundary have variable y-coordinate? your case is 2d or 3d? |
|
September 11, 2011, 00:45 |
|
#4 |
New Member
Harpreet
Join Date: May 2011
Posts: 21
Rep Power: 14 |
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.
|
|
September 12, 2011, 07:06 |
|
#5 |
New Member
Join Date: Mar 2009
Posts: 15
Rep Power: 17 |
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] |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 06:05 |
Problem with my udf | july | Fluent UDF and Scheme Programming | 3 | June 20, 2010 06:56 |
UDF problem | mansha goraya | FLUENT | 0 | October 29, 2007 00:31 |
udf compiling problem | akr | FLUENT | 3 | August 22, 2007 07:14 |
UDF problem | chiseung | FLUENT | 4 | January 10, 2002 09:58 |