CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   UDF 2D inlet profile (

Thomashoffmann January 16, 2013 07:40

UDF 2D inlet profile
Hi all.

I'm up to write a UDF inlet profile. The inlet profile should be given by:

By studying other examples I've come to the code shown here below. But I get an error in line 11 'no function prototype', when I try to interpret it. Can anybody help?

#include "udf.h"
DEFINE_PROFILE(inlet_velocity_x, t, i)
real x[ND_ND]; /* this will hold the position vector*/
real y;
face_t f;
F_PROFILE(f,t,i) = 0.001474*(1-((0.024-y)/0.024)^3)

Thomashoffmann January 16, 2013 09:40

Ok, I figured it out... I forgot the semicolons in line 10 and 11, and for some reason it is not allowed to use '^3', so I just wrote: ((0.024-y)/0.024)*((0.024-y)/0.024)*((0.024-y)/0.024)...

coglione January 17, 2013 03:47

a more elegant way for x^y: pow(x,y)


Thomashoffmann January 17, 2013 04:38

I have never worked with C code before, but thanks for the input :)

All times are GMT -4. The time now is 09:29.