UDF Error
Hi,
I'm trying to create a tranverse velocity profile UDF to use it as velocity inlet boundary condition to simulate flow in a water tank. The UDF is as follows: #include "udf.h" DEFINE_PROFILE(inlet_x_velocity,thread,index) { real x[ND_ND]; /* this will hold the position vector*/ real z; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); z=x[2]; if (0.1<z<0.4) F_PROFILE(f,thread,index) =0.063*pow((z/(0.1)),0.21) else F_PROFILE(f,theard,index)=log((z/(0.8))*0.15/0.41 } end_f_loop(f,thread) } i got the following error when trying to interpret my Velocity2.c file in fluent: cpp -I"C:\Fluent.Inc\fluent6.3.26/src" -I"C:\Fluent.Inc\fluent6.3.26/cortex/src" -I"C:\Fluent.Inc\fluent6.3.26/client/src" -I"C:\Fluent.Inc\fluent6.3.26/multiport/src" -I. -DUDFCONFIG_H="<udfconfig.h>" "C:\Users\amir\Desktop\Velocity2.c" Error: C:\Users\amir\Desktop\Velocity2.c: line 13: parse error. Thanks in advance! |
Typo...
F_PROFILE(f,theard,index)=log((z/(0.8))*0.15/0.41 |
thanks my friend...
my problem is not solved yet!!!!!!!!! |
Try using some ";" at the end of lines
|
it doesn't work!!!
#include "udf.h" DEFINE_PROFILE(inlet_x_velocity,thread,index) { real x[ND_ND]; /* this will hold the position vector*/ real z; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread) z=x[2]; if (0.1<z<0.4) F_PROFILE(f,thread,index) =0.063*pow((z/(0.1)),0.21); else F_PROFILE(f,thread,index)=log((z./(0.8)).*(0.15./0.41); } end_f_loop(f,thread) } |
Did you copy parts of the UDF from the manual?
Then it contains "invisible" signs which prevent the UDF from being interpreted properly. |
if (z > 0.1 && z < 0.4) ...
|
All times are GMT -4. The time now is 10:12. |