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


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

1.Install Microsoft Visual Studio 2005 Standard Edition (Refer to the Microsoft Visual Studio 2005 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 2005 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 2005, Visual Studio, Tools, choose Visual Studio 2005 Command Prompt.

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

If you don't have the Visual Studio 2005 X64 Win64 Command Prompt do the following:

Windows XP/2003 Server
Control Panel, Add/Remove Programs, Select Microsoft Visual Studio 2005 Standard or Professional Edition and click the Change/Remove button. This will bring you into Maintenance Mode. Choose Add/Remove Features. Add X64 Compilers and Tools.

Windows Vista
Control Panel, Programs and Features, Select the Microsoft Visual Studio 2005 Standard or Professional Edition application then choose Uninstall/Change. This will bring you into Maintenance Mode. Select C++ then check X64 Compilers and Tools.

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 for instructions to compile and load FLUENT udfs.

keywords: compile compiler compiled compiles udf VS2005





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