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

The udf.h headers are unable to open- in VISUAL STUDIO 13

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 24, 2015, 10:30
Default The udf.h headers are unable to open- in VISUAL STUDIO 13
  #1
Member
 
sanjeet Limbu
Join Date: Mar 2015
Posts: 91
Rep Power: 11
sanjeetlimbu is on a distinguished road
I tried getting the UDF define in C++. The real problem seems the inability of VS 13 to get the fluent related header file directly - as they are in C drive

I tried copying all headers .h file from C:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src and saved it local folder in home, but it shows error related to header files - so i think we cannot change header file from directory location
This bellow shows that the Visual studio is not getting the .h file file from fluent directory

he following is my code:

#include <stdafx.h>
//#include <iostream.h>
#include <C:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\udf.h>
//#include <C:\winapps\FEniCS\lib\gcc\mingw32\4.6.1\include\s sp\stdio.h>
//#include <C:\winapps\FEniCS\lib\gcc\mingw32\4.6.1\include\c ++\tr1\stdlib.h>
//#include "time.h"
//#include "math.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
DEFINE_PROFILE(inlet_x_velocity, thread, position)
{
// declaring variables
real x[ND_ND]; //this will hold the position vector
face_t f;
begin_f_loop(f, thread);
{
F_CENTROID(x, f, thread);
#if (dt) < 0.006)
F_PROFILE(for, thread, postion) = 1000 * dt;
#else if ( 0.006 < (dt) < 0.014)
F_PROFILE(for, thread, postion) = 0.5*dt;
#else if ( 0.01401 < (dt) < 0.028)
F_PROFILE(for, thread, postion) = 9.25;
#endif ( 0.02801 < (dt))
F_PROFILE(for, thread, postion) = 9.25 - (9.25 / 3)*(dt - 30);
return F_PROFILE;
}
end_f_loop(f, thread)
}

The above code is showing error related to udf.h , can u suggest possible changes needed in either code. As I am mechanical background I am not expert in coding in C++. The following were error shos- the udf.h is trouble:

Error 1 error C1083: Cannot open include file: 'localize.h': No such file or directory c:\program files\ansys inc\v150\fluent\fluent15.0.7\src\config.h 15 1 velocity2
8 IntelliSense: cannot open source file "localize.h" c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\config.h 15 1 velocity2
9 IntelliSense: cannot open source file "sys_master.h" c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\config.h 17 1 velocity2
10 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\config.h 118 2 velocity2
11 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\config.h 118 7 velocity2
20 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ctype.h 387 1 velocity2
21 IntelliSense: variable "_heapwalk" may not be initialized c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\malloc.h 169 53 velocity2
22 IntelliSense: identifier "_HEAPINFO" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\malloc.h 169 71 velocity2
23 IntelliSense: identifier "_EntryInfo" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\malloc.h 169 83 velocity2
24 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\malloc.h 289 1 velocity2
18 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\math.h 1008 1 velocity2
2 IntelliSense: explicit type is missing ('int' assumed) c:\Program Files (x86)\Windows Kits\8.1\Include\um\mpconfig.h 31 1 velocity2
3 IntelliSense: identifier "IMixerPinConfig" is undefined c:\Program Files (x86)\Windows Kits\8.1\Include\um\mpconfig.h 31 20 velocity2
4 IntelliSense: identifier "IUnknown" is undefined c:\Program Files (x86)\Windows Kits\8.1\Include\um\mpconfig.h 31 37 velocity2
5 IntelliSense: explicit type is missing ('int' assumed) c:\Program Files (x86)\Windows Kits\8.1\Include\um\mpconfig.h 129 1 velocity2
6 IntelliSense: identifier "IMixerPinConfig2" is undefined c:\Program Files (x86)\Windows Kits\8.1\Include\um\mpconfig.h 129 20 velocity2
7 IntelliSense: identifier "IMixerPinConfig" is undefined c:\Program Files (x86)\Windows Kits\8.1\Include\um\mpconfig.h 129 38 velocity2
25 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\setjmp.h 178 1 velocity2
17 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stddef.h 74 1 velocity2
12 IntelliSense: identifier "_onexit_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h 826 9 velocity2
13 IntelliSense: identifier "_onexit_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h 826 44 velocity2
14 IntelliSense: identifier "_onexit_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h 947 1 velocity2
15 IntelliSense: identifier "_onexit_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h 947 34 velocity2
16 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h 953 1 velocity2
19 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\string.h 434 1 velocity2
26 IntelliSense: cannot open source file "dll.h" c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 8 1 velocity2
27 IntelliSense: variable "FLUENT_EXPORT" is not a type name c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 13 1 velocity2
28 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 13 25 velocity2
29 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 14 1 velocity2
30 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 14 15 velocity2
31 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 18 1 velocity2
32 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 18 15 velocity2
33 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 20 1 velocity2
34 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 20 15 velocity2
35 IntelliSense: variable "FLUENT_EXPORT" is not a type name c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 21 1 velocity2
36 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 21 25 velocity2
37 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 23 1 velocity2
38 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 23 15 velocity2
39 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 24 1 velocity2
40 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 24 15 velocity2
41 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 25 1 velocity2
42 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 25 15 velocity2
43 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 26 1 velocity2
44 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 26 15 velocity2
45 IntelliSense: variable "FLUENT_EXPORT" is not a type name c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 27 1 velocity2
46 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 27 25 velocity2
47 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 28 1 velocity2
48 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 28 15 velocity2
49 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 29 1 velocity2
50 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 29 15 velocity2
51 IntelliSense: variable "FLUENT_EXPORT" is not a type name c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 30 1 velocity2
52 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 30 25 velocity2
53 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 31 1 velocity2
54 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 31 15 velocity2
55 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 33 1 velocity2
56 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 33 15 velocity2
57 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 34 1 velocity2
58 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 34 15 velocity2
59 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 35 1 velocity2
60 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 35 15 velocity2
61 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 36 1 velocity2
62 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 36 15 velocity2
63 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 37 1 velocity2
64 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 37 15 velocity2
65 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 38 1 velocity2
66 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 38 15 velocity2
67 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 39 1 velocity2
68 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 39 15 velocity2
69 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 40 1 velocity2
70 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 40 15 velocity2
71 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 41 1 velocity2
72 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 41 15 velocity2
73 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 42 1 velocity2
74 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 42 15 velocity2
75 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 43 1 velocity2
76 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 43 15 velocity2
77 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 50 1 velocity2
78 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 50 15 velocity2
79 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 54 1 velocity2
80 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 54 15 velocity2
81 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 56 1 velocity2
82 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 56 15 velocity2
83 IntelliSense: variable "FLUENT_EXPORT" is not a type name c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 57 1 velocity2
84 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 57 25 velocity2
85 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 59 1 velocity2
86 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 59 15 velocity2
87 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 60 1 velocity2
88 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 60 15 velocity2
89 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 61 1 velocity2
90 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 61 15 velocity2
91 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 62 1 velocity2
92 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 62 15 velocity2
93 IntelliSense: variable "FLUENT_EXPORT" is not a type name c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 63 1 velocity2
94 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 63 25 velocity2
95 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 64 1 velocity2
96 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 64 15 velocity2
97 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 66 1 velocity2
98 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 66 15 velocity2
99 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 67 1 velocity2
100 IntelliSense: expected a ';' c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 67 15 velocity2
101 IntelliSense: this declaration has no storage class or type specifier c:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\src\var.h 68 1 velocity2
sanjeetlimbu is offline   Reply With Quote

Old   March 24, 2015, 19:32
Default
  #2
`e`
Senior Member
 
Join Date: Mar 2015
Posts: 892
Rep Power: 18
`e` is on a distinguished road
Why are you editing and/or compiling the UDF source files directly in Visual Studio? I recommend editing files in a text editor with syntax highlighting (Notepad++ or SublimeText) and compiling/running the UDF in Fluent (see the FAQ section on compiling in Fluent).
`e` is offline   Reply With Quote

Old   March 25, 2015, 21:53
Default
  #3
Member
 
sanjeet Limbu
Join Date: Mar 2015
Posts: 91
Rep Power: 11
sanjeetlimbu is on a distinguished road
I got it in fluent. thanks
sanjeetlimbu is offline   Reply With Quote

Old   April 30, 2016, 10:08
Default c++ is unable to open #include"udf.h".
  #4
prt
New Member
 
preeti kumari
Join Date: Apr 2016
Posts: 4
Rep Power: 10
prt is on a distinguished road
senjeetlimbu. i go thorough to your post and i am facing the same problem and same errors while i am doing programming please help what should i do, thanks in advance. please reply
prt is offline   Reply With Quote

Old   May 2, 2016, 06:38
Default
  #5
Senior Member
 
Join Date: Nov 2013
Posts: 1,965
Rep Power: 27
pakk will become famous soon enough
You say you have the same problem as senjeetlimbu.
Did you notice that `e` gave an answer?
And did you see that senjeetlimbu said this solved his problem?
pakk is offline   Reply With Quote

Reply


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
[OpenFOAM.org] Patches to compile OpenFOAM 2.2 on Mac OS X gschaider OpenFOAM Installation 136 October 10, 2017 18:25
SparceImage v1.7.x Issue on MAC OS X rcarmi OpenFOAM Installation 4 August 14, 2014 07:42
OpenFOAM without MPI kokizzu OpenFOAM Installation 4 May 26, 2014 10:17
CFX11 + Fortran compiler ? Mohan CFX 20 March 30, 2011 19:56
[Commercial meshers] ST_Malloc: out of memory.malloc_storage: unable to malloc Velocity SA, cfdproject OpenFOAM Meshing & Mesh Conversion 0 April 14, 2009 16:45


All times are GMT -4. The time now is 13:43.