Compiling and Loading User Defined Functions using Microsoft Visual C++ 2005 Express Edition in FLUENT V6.3 Parallel


Microsoft Visual C++ 2005 Express Edition will NOT work if you are running FLUENT 6.3.26 64-bit.

Recently Microsoft announced that they were giving away a FREE compiler. The compiler is called Microsoft C++ 2005 Express Edition which can be located at this link:

<a target=_blank href="http://msdn.microsoft.com/vstudio/express/visualc/download/default.aspx">http://msdn.microsoft.com/vstudio/express/visualc/download/default.aspx</a>http://msdn.microsoft.com/vstudio/express/visualc/download/default.aspx

Steps for Building Compiled Windows UDFs using Microsoft Visual C++ 2005 Express Edition

1.Install Microsoft Visual C++ 2005 Express Edition (Refer to the Microsoft Visual C++ 2005 Express 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.2.6), 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.
After Environment Edits (FLUENT 6.3.26 32-bit)

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 Express 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.

FLUENT 6.3.26 32-bit

Select the Start Menu, Programs, Microsoft Visual Studio 2005, Visual Studio, Tools, choose Visual Studio 2005 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.

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!