UDF 2D inlet profile
Hi all.
I'm up to write a UDF inlet profile. The inlet profile should be given by: v=0.001474*(1-(r/R)^3). 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? Thanks __________________ #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; begin_f_loop(f,t) { F_CENTROID(x,f,t); y=x[1] F_PROFILE(f,t,i) = 0.001474*(1-((0.024-y)/0.024)^3) } end_f_loop(f,t) } |
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)...
|
a more elegant way for x^y: pow(x,y)
cheers |
I have never worked with C code before, but thanks for the input :)
|
All times are GMT -4. The time now is 18:40. |