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.
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.
In your working folder, make a folder that will store
your UDF library (for example, libudf).
Make a folder below this called src.
Put all your UDF source files into this folder (for
example, libudf\src).
Make an architecture folder below the library folder
called win64 for Intel systems running Windows
(for example, libudf\win64).
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:
|
|
single-precision 2D |
|
|
single-precision 3D |
|
|
double-precision 2D |
|
|
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.
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).
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.
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.
In your working directory, make a directory that will store your UDF library (for example, libudf).
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.
In the library directory you just created in Step 1, make a directory that will store your source file and name it src.
Copy your source file (for example, myudf.c) to the source directory (/src).
Copy makefile.udf from
path/ansys_inc/v182/fluent/fluent18.2.0/src/makefile.udf2
to the /src directory, and name it Makefile.
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.
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).
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:
|
|
single-precision 2D |
|
|
single-precision 3D |
|
|
double-precision 2D |
|
|
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.
Copy user.udf from
to all the version sub-folders that you have made (for example,
path/ansys_inc/v182/fluent/fluent18.2.0/src/user.udflibudf/lnamd64/3d_node and
libudf/lnamd64/3d_host).