|
[Sponsors] |
October 15, 2014, 10:30 |
fluent Udf error
|
#1 |
New Member
Jenifer
Join Date: Oct 2014
Posts: 5
Rep Power: 12 |
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! |
|
October 16, 2014, 05:31 |
|
#2 |
Senior Member
Rick
Join Date: Oct 2010
Posts: 1,016
Rep Power: 27 |
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 Last edited by ghost82; October 16, 2014 at 10:49. |
|
October 16, 2014, 06:03 |
my problem has been solved and thank you!
|
#3 | |
New Member
Jenifer
Join Date: Oct 2014
Posts: 5
Rep Power: 12 |
Quote:
I have changed my program just now according to your suggestion and it passed interprete! Thank you very much! |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[blockMesh] blockMesh with double grading. | spwater | OpenFOAM Meshing & Mesh Conversion | 92 | January 12, 2019 10:00 |
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch | gschaider | OpenFOAM Installation | 225 | August 25, 2015 20:43 |
ParaView for OF-1.6-ext | Chrisi1984 | OpenFOAM Installation | 0 | December 31, 2010 07:42 |
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! | alban | Fluent UDF and Scheme Programming | 2 | June 8, 2010 19:54 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |