![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
ANSYS FLUENT allows you to build a shared library for precompiled object files that are derived from external sources using the text user interface (TUI) option. For example, you can link precompiled objects derived from FORTRAN sources ( .o objects from .f sources) to ANSYS FLUENT for use by a UDF. The following sections describe the procedures for doing this on a Windows system and a UNIX/Linux system.
Windows Systems
ntx86/2d
,
ntx86/3d
).
|
The object files should be compiled using similar flags to those used by
ANSYS FLUENT (e.g.,
/c /Za).
|
UNIX and Linux Systems
|
The object files should be compiled using similar flags to those used for
ANSYS FLUENT. Common flags used by
ANSYS FLUENT are:
-KPIC,
-O, and
-ansi which often have equivalents such as
-fpic,
-O3, and
-xansi.
|
SOURCES = | Put the names of your UDF C files here. They will |
be calling the functions in the User Objects. | |
FLUENT_INC = | the path to your release directory. |
USER_OBJECTS = | the precompiled object file(s) that you want to |
build a shared library for (e.g., myobject1.o). | |
Use a space delimiter to specify multiple object files | |
(e.g., myobject1.o myobject2.o). | |
An excerpt from a sample makefile is shown below:
#-----------------------------------------------------------#
# makefile for user defined functions
#
#-----------------------------------------------------------#
#-----------------------------------------------------------#
# User modifiable section.
#-----------------------------------------------------------#
SOURCES=udf_source1.c
FLUENT_INC= /
path
/ansys_inc/v120/fluent
# Precompiled User Object files (for example .o files from .f
sources)
USER_OBJECTS= myobject1.o myobject2.o
#-----------------------------------------------------------#
# Build targets (do not modify below this line).
#-----------------------------------------------------------#
.
.
.
Note that in the previous example, path represents the directory where you installed ANSYS FLUENT.
make "FLUENT_ARCH=ultra" |
The following messages will be displayed:
# linking to ../../src/makefile in ultra/2d # building library in ultra/2d # linking to ../../src/makefile in ultra/3d # building library in ultra/3d |