CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF problems - velocity profile (http://www.cfd-online.com/Forums/fluent-udf/47174-udf-problems-velocity-profile.html)

Oli January 30, 2008 06:47

UDF problems - velocity profile
 
Hi everybody.

I'm trying to create a non uniform velocity profile at inlet ; the same as you can find it in the Fluent Docs.

The source code is

#include "udf.h"

DEFINE_PROFILE(x_velocity,thread,index)

{

real x[ND_ND];

real y;

face_t f;

begin_f_loop(f,thread)

{

F_CENTROID(x,f,thread);

y = x[1];

F_PROFILE(f,thread,index) = 30.0-30.0*(y*y)/(1.5*1.5)

}

end_f_loop(f,thread)

}

now i try to compile the source code

--> Define --> User Defined Functions --> Interpreted (as it is shown in the Fluent Docu)

But I always get the error : Error: /.../... : line 2 : syntax Error

Do i overlook something?

Fluent is running on a Linux operating system.


BG January 30, 2008 16:15

Re: UDF problems - velocity profile
 
F_PROFILE(f,thread,index) = 30.0-30.0*(y*y)/(1.5*1.5)

You forgot the semi colon at the line end


Oli January 31, 2008 04:37

Re: UDF problems - velocity profile
 
oh yes, thx

but there's still the same error :( ... other udf's (for example residence_time with DEFINE_SOURCE) are working without problems....

shehab abdelrahman February 3, 2008 05:13

Re: UDF problems - velocity profile
 
hi try replace the (index) in line 2, with just(i)... best regards, shehab

yunusrulz September 30, 2013 15:39

Velocity Profile
 
Hi, I want to keep velocity inlet in compressible flow.. since compressible flow allows mass flow inlet I kept same mass flow inlet profile... but it keeps changing as simulation progresses. so i wanna keep velocity inlet in a compressible flow problem.. but the simulation strucks some where.. it shows divergence error.. so is there any way to keep velocity inlet in compressible flow with pressure based solver and laminar flow ??


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