CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   UDF help for Rapid compression machine ECM. (https://www.cfd-online.com/Forums/fluent-udf/150219-udf-help-rapid-compression-machine-ecm.html)

sanjeetlimbu March 17, 2015 22:45

UDF help for Rapid compression machine ECM.
 
Dear all,


I am trying to create a user defined function udf for use in fluent ansys. Physics involved- i wanna get UDF- user defined function to get the following velocity profile for the body in ANSYS fluent- same velocities as piston motion stuff- for combustion test in fluent ANSYS software. The 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:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\tgrid\win64\3d_host\l ocalize.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
16 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\ctype.h 387 1 velocity2
17 IntelliSense: variable "_heapwalk" may not be initialized c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\malloc.h 169 53 velocity2
18 IntelliSense: identifier "_HEAPINFO" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\malloc.h 169 71 velocity2
19 IntelliSense: identifier "_EntryInfo" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\malloc.h 169 83 velocity2
20 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\malloc.h 289 1 velocity2
14 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
21 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\setjmp.h 178 1 velocity2
13 IntelliSense: expected a declaration c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stddef.h 74 1 velocity2
8 IntelliSense: identifier "_onexit_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h 826 9 velocity2
9 IntelliSense: identifier "_onexit_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h 826 44 velocity2
10 IntelliSense: identifier "_onexit_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h 947 1 velocity2
11 IntelliSense: identifier "_onexit_t" is undefined c:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\stdlib.h 947 34 velocity2


the localize.h is in C:\Program Files\ANSYS Inc\v150\fluent\fluent15.0.7\tgrid\win64\3d_host\l ocalize.h

Pl help . :)

regards
limbu


All times are GMT -4. The time now is 22:48.