|
[Sponsors] | |||||
Syntax error while interpreting a simple velocity profile UDF |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|
|
#1 |
|
New Member
Pavel
Join Date: Aug 2017
Posts: 8
Rep Power: 10 ![]() |
Hi everyone,
I am trying to interpret a UDF file. I am doing this for the first time, so right before I go with my particular problem, I tried to add this simple UDF (an example which I took from the FLuent library) just to check whether or not FLuent will recognize it. However, after I put my file in the adequate folder, browsed it and clicked interpret file, I get the following massage: Error: /home/pmihailovski/velocity_profile.c: line 2: syntax error. Can you help me with this line 2: syntax error? I am sending you the well-known example of the code right below: Looking forward to hearing from you. Pavel #include "udf.h" DEFINE_PROFILE(velocity_profile,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) = 1.1e5 - y*y/(.0745*.0745)*0.1e5; } end_f_loop(f,t) } |
|
|
|
|
|
|
|
|
#2 |
|
Member
Join Date: Feb 2015
Posts: 32
Rep Power: 12 ![]() |
Hi,
did you try to compile the UDF instead of interpret it? Are you sure you have a compiler on your computer? Fanch |
|
|
|
|
|
|
|
|
#3 | |
|
New Member
Pavel
Join Date: Aug 2017
Posts: 8
Rep Power: 10 ![]() |
Quote:
looking forward to hearing from you again, cheers! |
||
|
|
|
||
|
|
|
#4 |
|
Senior Member
nm
Join Date: Mar 2013
Posts: 100
Rep Power: 14 ![]() |
The code is fine. No syntax error.
Was this udf created on the same Linux machine? Seems like a "line ending" error. If it was on a windows machine Dos2Unix might be of help. Or you could use notepad++ and save it with appropriate encoding. |
|
|
|
|
|
|
|
|
#5 | |
|
New Member
Pavel
Join Date: Aug 2017
Posts: 8
Rep Power: 10 ![]() |
Quote:
Thanks |
||
|
|
|
||
|
|
|
#6 |
|
Senior Member
nm
Join Date: Mar 2013
Posts: 100
Rep Power: 14 ![]() |
||
|
|
|
|
|
|
|
#7 | |
|
New Member
Pavel
Join Date: Aug 2017
Posts: 8
Rep Power: 10 ![]() |
Quote:
|
||
|
|
|
||
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 3D UDF Paraboilc Velocity Profile (Can't Maintain) | Sing | FLUENT | 12 | August 7, 2017 07:25 |
| velocity profile in a simple cylindrical flow tube | Diger | FLUENT | 0 | December 29, 2016 22:05 |
| UDF syntax error | Ratel | Fluent UDF and Scheme Programming | 4 | May 23, 2015 06:15 |
| 3D Velocity profile for turbulent flow | Kirill | Fluent UDF and Scheme Programming | 3 | July 17, 2014 09:42 |
| udf for velocity profile in a geometry having two inlets | shubham208011 | Fluent UDF and Scheme Programming | 0 | April 6, 2009 16:13 |