|
[Sponsors] |
Problem in compiling UDF with ANSYS Fluent 17.1 and Visual Studio 14.0 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 27, 2016, 06:03 |
Problem in compiling UDF with ANSYS Fluent 17.1 and Visual Studio 14.0
|
#1 | |
New Member
Join Date: Oct 2016
Posts: 13
Rep Power: 10 |
Hi guys,
I have a problem compiling my UDF file with the above mentioned software. The function contains a math header that needs to be used. Here the simple code: Code:
#include "udf.h" #include <math.h> #define F = 100; #define w = 0.85; #define x_wheel = 0; #define y_wheel = 0.4; DEFINE_SOURCE(xmom_source,c,t,ds,eqn) { real theta, source; real x_diff; real y_diff; real x[ND_ND]; C_CENTROID(x,c,t); x_diff = x[0]-x_wheel; y_diff = x[1]-y_wheel; theta = atan (x_diff/y_diff); source = F*(sqrt (x_diff*x_diff+y_diff*y_diff)*w)*(sqrt (x_diff*x_diff+y_diff*y_diff)*w)*cos (theta); ds[eqn] = 2*F*(sqrt (x_diff*x_diff+y_diff*y_diff)*w)*cos (theta); return source; } And this is the error message: Quote:
Unfortunately, I can't go back to an older Visual Studio Version as I need the current version for another program. Please help me! |
||
October 27, 2016, 06:33 |
|
#2 |
Senior Member
Join Date: Mar 2015
Posts: 892
Rep Power: 18 |
Remove the equals signs and semicolons from your preprocessor directives because these are currently included in the compiler.
Code:
#define F 100 #define w 0.85 #define x_wheel 0 #define y_wheel 0.4 |
|
October 27, 2016, 10:09 |
|
#3 |
New Member
Join Date: Oct 2016
Posts: 13
Rep Power: 10 |
Shame on me.
Problem solved! Thanks! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
problem with compiling udf through visual studio | chem engineer | Fluent UDF and Scheme Programming | 2 | August 17, 2015 11:46 |
UDF Compilation Error - Loading Library - COMMON Problem! Help! | robtheslob | Fluent UDF and Scheme Programming | 8 | July 24, 2015 01:53 |
CFX11 + Fortran compiler ? | Mohan | CFX | 20 | March 30, 2011 19:56 |
How to install CGNS under windows xp? | lzgwhy | Main CFD Forum | 1 | January 11, 2011 19:44 |
CGNS lib and Fortran compiler | manaliac | Main CFD Forum | 2 | November 29, 2010 07:25 |