FLUENT UDF in Intepreting
Hi
I have created a vel.c file for parabolic velocity BC at the inlet. The UDF.c is as shown below. During intepreting by the fluent, it has a syntax error at line 2. However, I dont find anything wrong with line 2. Anyone out there see the source of this syntax error, please help thanks #include "udf.h" DEFINE_PROFILE (inlet_x_velocity, thread, index) /*line 2*/ { 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) = 0.4*[-0.64*(y/0.1)^6 +3.9*(y/0.1)^5 - 9.2*(y/0.1)^4 m+ 11*(y/0.1)^3 - 6.9*(y/0.1)^2]; } end_f_loop(f, thread) } |
Hi NGH
I have examined your udf it has no problem in line2.But its problem is in line 12. I have solved this problem and it has been interpreted properly: #include"udf.h" DEFINE_PROFILE (inlet_x_velocity, thread, index) /*line 2*/ { 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) = 0.4*(-0.64*pow((y/0.1),6) +3.9*pow((y/0.1),5) - 9.2*pow((y/0.1),4)+ 11*pow((y/0.1),3) - 6.9*pow((y/0.1),2));/*line12*/ } end_f_loop(f, thread) } enjoy |
Hi alighaffari
Thanks a lot! I will try that again. |
problem in UDF on LINUX
Hey i have a same problem
the following is the UDF It runs fine when on windows 7. however on linux system gives me a syntax error in line 2. Pls help me out with this. #include "udf.h" DEFINE_PROFILE(inlet_x_velocity, thread, nv) { real x[3]; real y; face_t f; begin_f_loop(f, thread) { F_CENTROID(x,f,thread); y=x[1]; F_PROFILE(f, thread, nv) = 0.0015*(1-pow(((y-0.005)/0.005),2)); } end_f_loop(f, thread) } |
All times are GMT -4. The time now is 21:50. |