Professional Documents
Culture Documents
Table of Contents
1
ANSYS is not responsible for the correct installation of Microsoft Visual Studio. If you have
issues installing the compiler, please contact Microsoft or your IT staff.
NOTE: You will need to choose the selection in RED as well as the optional components on the
right hand side of the screenshot for the SDK, etc.
Download a UDF Batch File Fix for running Fluent without using the SDK
Window
1. In order to use the 2017 compiler with Fluent (until the release of 18.2) you will need to
download the attached file, udf-batch-file-2017.
2. Browse to C:\Program Files\ANSYS Inc\v18.x\fluent\ntbin\win64 and rename the existing
udf.bat.
3. Rename udf-batch-file-2017 to udf.bat and place it in the C:\Program Files\ANSYS
4. Inc\v18.x\fluent\ntbin\win64 directory
2
Note: The v18.x is an example. If you are running version 16 or 17 just browse to the correct
directory.
3
2. Create a working directory that contains the ANSYS Fluent case, data files and UDF source
code files. DO NOT COMPILE OR LOAD UDFS FROM FOLDERS WITH SPACES IN THE NAME
AND DO NOT INCLUDE SPACES IN THE NAME OF YOUR CASE AND DATA FILES.
3. Share the Working directory folder with Full Control
4. Map a drive letter to the shared folder, for example, U:\ (When compiling UDFs and
running in parallel (across machines) you must use a mapped drive letter to the shared
folder. Fluent will use this shared folder as its Working Directory in the Fluent Launcher.)
4
11. Read in your model
12. Select the Console tab (at the bottom of the Fluent window)
13. Select the User Defined tab
14. Choose Functions > Compiled
15. Select the Add button to add your source file (.c)
5
19. After you have compiled the UDF the working folder will include a new subfolder called
libudf.
Compiling ANSYS Fluent UDFs from the Command Line using the Visual
Studio 2017 x86 x64 Cross Tools Command Prompt (if using an earlier
version of Fluent than Release 18.2)
1. Open up the Visual Studio 2017 x86 x64 Cross Tools Command Prompt window and change to your
working directory where your case and data reside.
3. Drag the ANSYS Fluent shortcut into the Visual Studio 2017 x86 x64 Cross Tools Command
Prompt window.
6
4. Press Enter
5. ANSYS Fluent launches.
6. Follow the procedures below for compiling UDFs
7
Compiling Fluent UDFs in DMP (Distributed Memory) on Multiple
Computers
NOTE: If you running the ANSYS Fluent solver on multiple computers and will be compiling and loading
UDFs you need to follow the steps below. If you are running in local parallel you do not need to
share and map drives. Follow the steps above except choose Parallel and the number of cores
(processes) you wish to run on.
1. Share the ANSYS Inc folder located at C:\Program Files\ANSYS Inc\v18.x with Full
Control
2. Create a working directory that contains the ANSYS Fluent case, data files and UDF source
code files. DO NOT COMPILE OR LOAD UDFS FROM FOLDERS WITH SPACES IN THE NAME
AND DO NOT INCLUDE SPACES IN THE NAME OF YOUR CASE AND DATA FILES.
3. Share the Working directory folder with Full Control
4. Map a drive letter to the shared folder, for example, U:\ (When compiling UDFs and
running in parallel (across machines) you must use a mapped drive letter to the shared
folder. Fluent will use this shared folder as its Working Directory in the Fluent Launcher.)
8
6. Select the Parallel Settings tab
7. Choose File Containing Machine Names
8. Choose the Text icon and enter the machine names once.
9. Click OK once you have entered and saved the machines.txt file.
10. Click OK to launch ANSYS Fluent
9
16. In the Library Name text box type in the \\Computer_name\share_name\libudf. It is
necessary to type in the network path to the compiled UDF in this text box if running across
multiple computers.
17. Select Build
18. Select Load
19. After you have compiled the UDF the working folder will include a new subfolder called
libudf.
10