syntax error when interpreting UDF
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. |
Re: syntax error when interpreting UDF
Try writting the first line as #include <udf.h>
|
Re: syntax error when interpreting UDF
That doesn't seem to work. But thank you for your response
|
Re: syntax error when interpreting UDF
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) } |
All times are GMT -4. The time now is 07:25. |