Compiling and Loading User Defined Functions using Microsoft Visual Studio 2008 Standard Edition running FLUENT V6.3 in Parallel


Steps for Building Compiled Windows UDFs using Microsoft Visual Studio 2008 Standard Edition

1.Install Microsoft Visual Studio 2008 Standard Edition (Refer to the Microsoft Visual Studio 2008 Standard Edition Installation Guide for installation instructions.)

2.You will be starting FLUENT from a Command Prompt so you will have to set the FLUENT.INC Environment Variables.
a.Select the Start Menu, Programs, Fluent Inc Products, Fluent 6.3.26, Set Environment. Choose YES to Modify.
b.Edit the environment variable values so they don't have a local installation path, for example, C: Fluent.Inc, as all computers you are using to run FLUENT in network parallel must have access to the FLUENT.INC environment variables.
c.Select the Start menu, Settings, Control Panel, System. Choose the Advanced Tab, choose Environment Variables.
d.Edit the FLUENT_INC variable value using the network path format followed by the computer name where FLUENT is installed.
e.Edit the Path variable value using the network path format followed by the computer name where FLUENT is installed.

3.Share the directory that the case, data, and compiled UDF reside.
-- Right-click on the directory and choose Sharing from the menu.
-- Click "Share this folder"
-- Click OK.

Note: When the directory is shared you will notice a "hand" under the directory. If you don't see the "Sharing" option contact your System Administrator. The share name, by default, will be the name of the folder/directory. The share name can be changed.

4.The installation of Microsoft Visual Studio 2008 Standard Edition does not set environment variables necessary to run from a command line, therefore, in order to compile UDF's within FLUENT you will need to set the Visual Studio environment variables as outlined below in Step 4 depending on the version of Fluent you are using.

FLUENT 6.3.26 32-bit :
Select the Start Menu, Programs, Microsoft Visual Studio 2008, Visual Studio Tools, choose Visual Studio 2008 Command Prompt

FLUENT 6.3.26 64-bit :
Select the Start Menu, Programs, Microsoft Visual Studio 2008, Visual Studio Tools, choose Visual Studio 2008 x64 Win64 Command Prompt

You MUST launch FLUENT in this Command Prompt window!!

5.In this Command Prompt window change directory to the working directory where the source file (.c) and case and data file are located and launch FLUENT.

6.In FLUENT, select Define, User Defined, Functions, Compiled.

7.Select the Add button to add your source file.

8.Select Build.

9.After the UDF has been successfully built it is necessary to type in the network path to the compiled UDF in the Library Name panel BEFORE loading the UDF.

10.In front of the directory, libudf, type in the name of the computer where the UDF resides using the format and the name of the shared directory. In the example below, the shared directory name is "working".

11.Click Load.

After you have compiled the UDF the working directory would include a new subdirectory called libudf.

If you compiled the UDF using the 32-bit version of FLUENT there will be an ntx86 subdirectory.

If you compiled the UDF using the 64-bit version of FLUENT there will be a win64 subdirectory.

See attached Resolution Document.

keywords: compile compiler compiled compiles udf VS2008





Show Form
No comments yet. Be the first to add a comment!