|
[Sponsors] |
April 18, 2016, 13:16 |
UDF compiling and Interpreting error
|
#1 |
New Member
Aduramo LASODE
Join Date: Apr 2016
Posts: 2
Rep Power: 0 |
This is my first time writing and using fluent udf in ANSYS. My code executed on a windows machine, but due to restricted license I had to switch to a linux workstation and my UDF stopped working.
Within ANSYS fluent v16.1, I got a syntax error when I tried to compile and interpret. I am not sure what the problem is; I might be missing something. I would appreciate any help, because this is holding up a very important project I need to complete for graduation. Below is my code: #include "udf.h" /*define constants*/ #define UMEAN 1.0 /*#define 0.0*/ #define Re 1 #define VISC 2/Re #define Symmetry 180 #define Phi 0.0 /*pass in thread associated with boundary zone; the udf will need to do the looping over all faces*/ DEFINE_PROFILE(x_velocity, thread, index) { real r, theta, ulocal, y, x[3]; /*radius, theta, local velocity, x array for coordinates*/ face_t f; /*f is face thread index*/ begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, index)= (-r*sin(theta)*UMEAN*sin(theta))+(cos(theta)*-UMEAN*cos(theta)); } end_f_loop(f,thread) } DEFINE_PROFILE(y_velocity, thread, index) { real r, theta, ulocal, y, x[3]; /*radius, theta, local velocity, x array for coordinates*/ face_t f; /*f is face thread index*/ begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, index)= (r*cos(theta)*cos(Phi)*UMEAN*sin(theta))+(sin(thet a)*cos(Phi)*-UMEAN*cos(theta)); } end_f_loop(f,thread) } DEFINE_PROFILE(z_velocity, thread, index) { real r, theta, ulocal, y, x[3]; /*radius, theta, local velocity, x array for coordinates*/ face_t f; /*f is face thread index*/ begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f, thread, index)= (r*cos(theta)*sin(Phi)*UMEAN*sin(theta))+(sin(thet a)*sin(Phi)*-UMEAN*cos(theta)); } end_f_loop(f,thread) } |
|
April 18, 2016, 19:20 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
What was the compilation error? Try removing all comments or replace them with the one-line comment syntax (I've had similar issues with Linux compilers):
Code:
// comment here |
|
April 19, 2016, 00:00 |
|
#3 |
New Member
Aduramo LASODE
Join Date: Apr 2016
Posts: 2
Rep Power: 0 |
When I take care of the comments, I get this error on my DEFINE_PROFILE() line:
"error: expected constructor, destructor, or type conversion before '(' token" Any ideas on how to deal with this one? |
|
April 19, 2016, 22:09 |
|
#4 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
What is your updated code and have you identified at which line this error occurs?
|
|
Tags |
compiling issues, fluent, syntax error, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
Compile/Interperet UDF--Fluent 14.5 | Schumacher00 | Fluent UDF and Scheme Programming | 2 | July 14, 2015 19:59 |
something wrong when compiling udf, however the code is correct when interpreting | richard ben | Fluent UDF and Scheme Programming | 7 | May 11, 2013 08:36 |
parse error while interpreting udf | Kristin | Fluent UDF and Scheme Programming | 3 | March 15, 2012 07:43 |
Error message while compiling UDF | Rajneesh | FLUENT | 2 | November 7, 2005 20:24 |