fluent Udf error
Hi,
I ran into a problem which I can't seem to find a resolution for. I've been running FLUENT on the Linux environment recently.Now the problem that I am getting is that I can't get my UDF running.I also tried doc2unix, but still there is an error. my udf is, #include "udf.h" DEFINE_PROFILE(unsteady_velocity,thread,position) { face_t f; real t_cycle=0.1; real A=20.0; real time; begin_f_loop(f,thread) { real t=RP_Get_Real("flow-time") if(t>=t_cycle) time=(t/t_cycle-(int)(t/t_cycle))*t_cycle; else time=t; if(time<=t_cycle/2.0) F_PROFILE(f,thread,position)=A; else F_PROFILE(f,thread,position)=0; } end_f_loop(f,thread) } I am using ansys 14.0 fluent in Linux environment. The udf could be used in window. I had compiled my udf by vi in Linux. The error always: cpp -I"/ansys_inc/v130/fluent/fluent13.0.0/src" -I"/ansys_inc/v130/fluent/fluent13.0.0/cortex/src" -I"/ansys_inc/v130/fluent/fluent13.0.0/client/src" -I"/ansys_inc/v130/fluent/fluent13.0.0/multiport/src" -I. -DUDFCONFIG_H="<udfconfig.h>" "/fibus/fs3/1a/cin3179/test/dbsfile/test2.c" Error: /fibus/fs3/1a/cin3179/test/dbsfile/test2.c: line 12: syntax error. Error: /fibus/fs3/1a/cin3179/test/dbsfile/test2.c: line 14: syntax error. I could not find a resolution for. Could you help to check? Thank you very much! |
Code:
time=(t/t_cycle-(int)(t/t_cycle))*t_cycle; Operator is missing betwenn (int) and (t/t_cycle). Use {} in if blocks. Move real t=RP_Get_Real("flow-time") to before begin_f_loop, where other variables are declared. PS: the command is dos2unix not doc2unix |
my problem has been solved and thank you!
Quote:
I have changed my program just now according to your suggestion and it passed interprete! Thank you very much! |
All times are GMT -4. The time now is 08:45. |