CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

UDF compiling and Interpreting error

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 18, 2016, 13:16
Default UDF compiling and Interpreting error
  #1
New Member
 
Aduramo LASODE
Join Date: Apr 2016
Posts: 2
Rep Power: 0
aduramolasode95 is on a distinguished road
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)
}
aduramolasode95 is offline   Reply With Quote

Old   April 18, 2016, 19:20
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
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
`e` is offline   Reply With Quote

Old   April 19, 2016, 00:00
Default
  #3
New Member
 
Aduramo LASODE
Join Date: Apr 2016
Posts: 2
Rep Power: 0
aduramolasode95 is on a distinguished road
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?
aduramolasode95 is offline   Reply With Quote

Old   April 19, 2016, 22:09
Default
  #4
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
What is your updated code and have you identified at which line this error occurs?
`e` is offline   Reply With Quote

Reply

Tags
compiling issues, fluent, syntax error, udf


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 00:36.