CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF interpretation trough TUI (

David March 14, 2005 16:50

UDF interpretation trough TUI
Hi everybody, I am working on a pulsatile flow simulation. I use a UDF to define a parabolic velocity profile at inlet of my model with a time-dependent centerline velocity.

My problem is that I cannot "interpret" the UDF through text commands but it seems that I cannot link the interpreted UDF to the appropriate boundary condition (in my case the UDF is used for the x-velocity component). Fluent prompts for file name and file data. I tried entering my UDF source code file without success.

I would be grateful for any advice anyone might have on this.

Best Regards David

Melaku Habte March 15, 2005 03:55

Re: UDF interpretation trough TUI

You would get much more help if you put the error that fluent gave you up here, also your UDF...if there are some bugs ppl can see it.


Melaku Habte

david March 18, 2005 15:26

Re: UDF interpretation trough TUI
Hi Melaku,

I am still struggling with this so I would appreciate your help. As mentionned previously, I need a certain UDF for inlet velocity. When using text commands, I am having problem "hooking" the UDF at velocity inlet once it has been interpreted succesfully. Also I cannot use an boundary profile file because the inlet condition has a time and space dependency. (See UDF)

Below I have copied part of the transcript file. Look closely to the definition of the velocity inlet condition. More precisely:

profile name [""] "square_wave" data name [""] "square_wave"

where square_wave is the name of my UDF. Am I doing somethig wrong? (See below Transcript File)

Also, bear in mind that I do not get an error message as you might have tought from my previous message. Nevertheless when I verify, with GUI, the x-velocity component for the velocity inlet has not been updated has I would like.

/*Partial Transcript File*/

> /define/user-defined/interpreted-functions UDF Source File Name [""] "c:libudfsquare_wave0.c" CPP Command Name ["cpp"] "cpp" virtual machine stack size [10000] 10000 display assembly code listing? [no] no

cpp -IC:\FLUENT.INC\fluent6.1.22/src -IC:\FLUENT.INC\fluent6.1.22/cortex/src -IC:\FLUENT.INC\fluent6.1.22/client/src -IC:\FLUENT.INC\fluent6.1.22/multiport/src -I. -DUDFCONFIG_H="<udfconfig.h>" c:\libudf\square_wave0.c

> /define/boundary-conditions/velocity-inlet (velocity_inlet.11) zone id/name [velocity_inlet.11] 3 Velocity Specification Method: Magnitude and Direction [no] no Velocity Specification Method: Components [no] yes Reference Frame: Absolute [yes] yes Use Profile for X-Velocity? [no] yes profile name [""] "square_wave" data name [""] "square_wave" Use Profile for Y-Velocity? [no] "no 0

The UDF that I would like to use is as follows. But again I do not think the problem lies there has Fluent interprets it succcesfully:

#include "udf.h" DEFINE_PROFILE (square_wave,thread,position) {

#define PI 3.14159

real x[ND_ND];

face_t f;

real z,y,test;


if (z<0.30)

test =0;

else if (z<0.70)


else if (z<1.3)


else if (z<1.7)


else if (z<2.3)


else if (z<2.7)


else if (z<3.3)


else if (z<3.7)


else if (z<4.3)




begin_f_loop(f, thread)




y = x[1];

F_PROFILE(f,thread,position) = test - y*y/(.0065*.0065)*test;


end_f_loop(f, thread)


Any comments or observations would be of great help.

Regards, David

All times are GMT -4. The time now is 10:55.