5.3.1. Set Up the Directory Structure

The folder/directory structures for Windows systems and Linux systems are different, so the procedure for setting up the folder/directory structure is described separately for each.

5.3.1.1. Windows Systems

For compiled UDFs on Windows systems, two ANSYS Fluent files are required to build your shared UDF library: makefile_nt.udf. The file user_nt.udf has a user-modifiable section that allows you to specify source file parameters.

The procedure below outlines steps that you must follow to set up the folder structure required for the shared library.

  1. In your working folder, make a folder that will store your UDF library (for example, libudf).

  2. Make a folder below this called src.

  3. Put all your UDF source files into this folder (for example, libudf\src).

  4. Make an architecture folder below the library folder called win64 for Intel systems running Windows (for example, libudf\win64).

  5. In the architecture folder (for example, libudf\win64), create folders for the ANSYS Fluent versions you want to build for your architecture. (for example, win64\2d_node and win64\2d_host). Possible versions are:

    2d_node and 2d_host

    single-precision 2D

    3d_node and 3d_host

    single-precision 3D

    2ddp_node and 2ddp_host

    double-precision 2D

    3ddp_node and 3ddp_host

    double-precision 3D


    Important:  Note that you must create two build folders for each version of the solver (two for the 3D version, two for the 2D double-precision version, and so on), regardless of the number of compute nodes.


  6. Copy user_nt.udf from

    path\ANSYS Inc\v182\fluent\fluent18.2.0\src\

    to all the version sub-folders you have made (for example, libudf\win64\3d_node and libudf\win64\3d_host).

    Note that path is the folder in which you have installed ANSYS Fluent (by default, the path is C:\Program Files).

  7. Copy makefile_nt.udf from

    path\ANSYS Inc\v182\fluent\fluent18.2.0\src\

    to all the version sub-folders you have made (for example, libudf\win64\3d_node and libudf\win64\3d_host) and rename it Makefile.

    Note that path is the folder in which you have installed ANSYS Fluent (by default, the path is C:\Program Files).


    Note:  If you are compiling a UDF outside of the Fluent environment, you need to add the FLUENT_INC=<your fluent path> and FLUENT_ARCH=<machine architecture> (for example, win64) environment variables to the <user>_nt.udf file.


5.3.1.2. Linux Systems

For compiled UDFs on Linux systems, three ANSYS Fluent files are required to build your shared UDF library: makefile.udf, makefile.udf2, and user.udf.

The procedure below outlines steps that you must follow to set up the directory structure required for the shared library.

  1. In your working directory, make a directory that will store your UDF library (for example, libudf).

  2. Copy makefile.udf2 from

    path/ansys_inc/v182/fluent/fluent18.2.0/src/makefile.udf2

    to the library directory (for example, libudf), and name it Makefile.

    Note that path is the directory in which you have installed ANSYS Fluent.

  3. In the library directory you just created in Step 1, make a directory that will store your source file and name it src.

  4. Copy your source file (for example, myudf.c) to the source directory (/src).

  5. Copy makefile.udf from

    path/ansys_inc/v182/fluent/fluent18.2.0/src/makefile.udf2

    to the /src directory, and name it Makefile.

  6. Identify the architecture name of the machine on which you are running (for example, lnamd64). This can be done by either typing the command (fluent-arch) in the ANSYS Fluent TUI window, or running the ANSYS Fluent utility program fluent_arch at the command line of a Linux shell.

  7. In the library directory (for example, libudf), create an architecture directory that is named after the architecture identifier determined in the previous step (for example, lnamd64).

  8. In the architecture directory, create directories named after the ANSYS Fluent versions for which you want to build shared libraries (for example, lnamd64/2d_node and lnamd64/2d_host). Possible versions are:

    2d_node and 2d_host

    single-precision 2D

    3d_node and 3d_host

    single-precision 3D

    2ddp_node and 2ddp_host

    double-precision 2D

    3ddp_node and 3ddp_host

    double-precision 3D


    Important:  Note that you must create two build directories for each version of the solver (two for the 3D version, two for the 2D double-precision version, and so on), regardless of the number of compute nodes.


  9. Copy user.udf from path/ansys_inc/v182/fluent/fluent18.2.0/src/user.udf to all the version sub-folders that you have made (for example, libudf/lnamd64/3d_node and libudf/lnamd64/3d_host).


Release 18.2 - © ANSYS, Inc. All rights reserved.