CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   UDF loading (https://www.cfd-online.com/Forums/fluent/186364-udf-loading.html)

minhoabc April 17, 2017 10:45

UDF loading
 
Hello,

I'm trying to compile body force udf function (example from the manual) in Fluent 16.2 Windows 10 Visual Studio 2017 and as everyone can imagine, been following the already discussed UDF compiling issue. However, I wasn't successful even though I've tried almost every written procedures found in the forum so I thought I might try step by step, and there were couple questions came up and if anyone can help, I would be very grateful.

So when I build the library, the building would be successful, but apparently, the libudf.dll file is missing, and from the reading on forum, it seems like the libudf.dll file should be created automatically if I compile the udf... right?

So if I grab the libudf.dll file from somewhere else, (from addon files) apparently Fluent use that file in the compiling process without any problem, except that the source file and the libudf.dll file doesn't match and the compilation would fail. That's how I got to the hypothesis(?) that the libudf.dll file must be automatically made when I build the library.

If anyone could help or give me any hints regarding this issue, I would be very grateful for your help.

Thank you and have a good day!

James

chaitanyaarige April 20, 2017 01:02

You need the following
 
1. A inbuilt C++ compiler
2. Download Visual Studio 2015.
3. Install -> Custom selection, Choose Programming language.
4. Uncheck all others.

5. After successful installation:
In this folder you need to find,
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat


6. Then switch to folder
C:\Program Files\ANSYS Inc\v180\fluent\ntbin\win64

find udf.bat

7. Open this in notepad++

8. Find the following lines

echo trying to find MS C compiler, version 140....

set MSVC_DEFAULT=%ProgramFiles(x86)%\Microsoft Visual Studio 14.0
if exist "%MSVC_DEFAULT%\VC\vcvarsall.bat" set MSVC=%MSVC_DEFAULT%
if not "%MSVC%" == "" goto msvc_env140

Thanks,
Krige

minhoabc April 20, 2017 09:54

It seems like switching folder did the job.

Thank you sir!

James


All times are GMT -4. The time now is 14:11.