|
[Sponsors] |
Syntax error while interpreting a simple velocity profile UDF |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 7, 2018, 09:26 |
Syntax error while interpreting a simple velocity profile UDF
|
#1 |
New Member
Pavel
Join Date: Aug 2017
Posts: 8
Rep Power: 8 |
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) } |
|
February 8, 2018, 12:13 |
|
#2 |
Member
Join Date: Feb 2015
Posts: 32
Rep Power: 11 |
Hi,
did you try to compile the UDF instead of interpret it? Are you sure you have a compiler on your computer? Fanch |
|
February 8, 2018, 14:12 |
|
#3 | |
New Member
Pavel
Join Date: Aug 2017
Posts: 8
Rep Power: 8 |
Quote:
looking forward to hearing from you again, cheers! |
||
February 8, 2018, 14:17 |
|
#4 |
Senior Member
nm
Join Date: Mar 2013
Posts: 100
Rep Power: 13 |
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. |
|
February 8, 2018, 14:20 |
|
#5 | |
New Member
Pavel
Join Date: Aug 2017
Posts: 8
Rep Power: 8 |
Quote:
Thanks |
||
February 8, 2018, 14:22 |
|
#6 |
Senior Member
nm
Join Date: Mar 2013
Posts: 100
Rep Power: 13 |
||
February 8, 2018, 14:24 |
|
#7 | |
New Member
Pavel
Join Date: Aug 2017
Posts: 8
Rep Power: 8 |
Quote:
|
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
3D UDF Paraboilc Velocity Profile (Can't Maintain) | Sing | FLUENT | 12 | August 7, 2017 06:25 |
velocity profile in a simple cylindrical flow tube | Diger | FLUENT | 0 | December 29, 2016 21:05 |
UDF syntax error | Ratel | Fluent UDF and Scheme Programming | 4 | May 23, 2015 05:15 |
3D Velocity profile for turbulent flow | Kirill | Fluent UDF and Scheme Programming | 3 | July 17, 2014 08:42 |
udf for velocity profile in a geometry having two inlets | shubham208011 | Fluent UDF and Scheme Programming | 0 | April 6, 2009 15:13 |