When creating ACT extensions for ANSYS Fluent, in an extension's XML definition file,
the <simdata> block can contain a child
<udf> block for specifying the location of a folder
containing UDF libraries. When supplying the path for a UDF folder, you use the same
logic as when supplying the path for the extension's IronPython script, where
src is the path relative to the extension
folder:
<script src="main.py"/>
While paths for both the <script> block and
<udf> block are relative to the extension folder, the
<script> block requires a file relative
path, and the <udf> block requires a
folder relative path. An example of the XML code for an
extension with a <udf> block follows:
<extension name="FluentTest" version="1" icon="icon.png"> <guid>36DB3B25-C5E2-4E43-9A04-BA53AA7DC05A</guid> <author>ANSYS, Inc.</author> <interface context="Fluent"></interface> <description>A sample extension for Fluent with UDF encapsulation</description> <script src="main.py" /> <simdata context="Fluent"> <udf folder="udf_library"></udf> </simdata> </extension>
Because the UDF libraries in the specified folder are packaged with the extension, when this extension is installed, ACT can load these libraries.
When you specify the UDF folder name in the <udf> block, you
do not specify a Fluent version. The ACT extension automatically appends the Fluent
version in which the extension is running to the name of the folder. However, because
UDF libraries are version-dependent, you must name each of the real UDF folders with the
specified name followed by an underscore and the version.
In the previous example, the name specified for the UDF folder is
udf_library. However, the real folders are named
udf_library_180, udf_library_181, and
udf_library_182. The extension searches for the name given in
the <udf> block followed by the Fluent version in which you
are running the extension.
Thus, the naming convention of the UDF folder in the XML file is
foldername, and the naming convention for the real folder is
foldername_version.