|
[Sponsors] |
September 26, 2006, 09:14 |
syntax error when interpreting UDF
|
#1 |
Guest
Posts: n/a
|
I have a problem when I interprete a UDF in Fluent. I think my C source code is correct, but when interpreting I get a syntax error in line 2.
My C source code is: #include "udf.h" /* this line must be at the beginning of every UDF-file */ DEFINE_PROFILE(inlet_velocity,t,i) { float x[3]; /* this will hold the position vector */ float z; /* define z as a floating Data Type */ face_t f; begin_f_loop(f, t) /* Loop over all faces in the thread passed in the DEFINE macro argument */ { F_CENTROID(x,f,t); z = x[3]; if (z <= 0.0143) { F_PROFILE(f, t, i) = 5.0 * (double power(z/0.0143, 1.0/7.0)); } else { F_PROFILE(f, t, i) = 5.0 } } end_f_loop(f,t) } I hope somebody can help me with this problem. |
|
September 26, 2006, 21:51 |
Re: syntax error when interpreting UDF
|
#2 |
Guest
Posts: n/a
|
Try writting the first line as #include <udf.h>
|
|
September 27, 2006, 03:59 |
Re: syntax error when interpreting UDF
|
#3 |
Guest
Posts: n/a
|
That doesn't seem to work. But thank you for your response
|
|
September 27, 2006, 08:52 |
Re: syntax error when interpreting UDF
|
#4 |
Guest
Posts: n/a
|
I have modified it a little and it compiles.
#include "udf.h" /* this line must be at the beginning of every UDF-file */ DEFINE_PROFILE(inlet_velocity,t,i) { real x[3]; /* this will hold the position vector */ real z; /* define z as a floating Data Type */ face_t f; begin_f_loop(f, t) /* Loop over all faces in the thread passed in the DEFINE macro argument */ { F_CENTROID(x,f,t); z = x[2]; if (z <= 0.0143) { F_PROFILE(f, t, i) = 5.0 * (pow(z/0.0143, 1.0/7.0)); } else { F_PROFILE(f, t, i) = 5.0; } } end_f_loop(f,t) } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Parse Error:- Interpreting UDF on remote terminal | moataz.che | FLUENT | 1 | March 7, 2017 15:13 |
parse error while interpreting udf | Kristin | Fluent UDF and Scheme Programming | 3 | March 15, 2012 07:43 |
UDF: DEFINE_CG_MOTION for vertical jump motion of an electrode! | alban | Fluent UDF and Scheme Programming | 2 | June 8, 2010 19:54 |
parse error with interpreting UDF | ivanbuz | Fluent UDF and Scheme Programming | 2 | August 13, 2009 19:29 |
error while compiling the USER Sub routine | CFD user | CFX | 3 | November 25, 2002 16:16 |