Ansys Learning Forum › Forums › Discuss Simulation › General Mechanical › Using UPFs in Ansys Workbench installed on Linux › Reply To: Using UPFs in Ansys Workbench installed on Linux

David Weed
Ansys Employee

Hello,

There are some subtle differences between invoking a UPF in Linux vs. Windows that I'll explain here. But firstly, one similarity is that the ACT R19 extension is not needed for either OS; it is entirely possible to invoke a UPF using APDL commands instead.

One difference between Windows and Linux is that, in Linux, if you are using the /UPF method, you do need to set the environment variable ANS_USE_UPF like you do in Windows. If using the shared library method in Linux, you will need to point to the shared library file (*.so) using the environment variable ANS_USER_PATH (see section 1.9. Compiling and Linking UPFs on Linux Systems of the MAPDL Programmer's Reference for more details on this; this also shows the other environment variables for compilers which need to be set).

In terms of compilers supported for 2023 R1, please see the Linux Installation Guide 2.4. Compiler Requirements for Linux Systems. The
following items are supported:

Intel 2019.3 Parallel Studio XE (FORTRAN, C, C++)

GCC 8.2.0 (for user-programmable features)

Please see the note on where to get GCC 8.2.0 from; you will need to download this from the ANSYS customer portal.

Once you have the compilers installed and environment variables set properly, you can follow the procedure detailed in the Knowledge Resource you initially linked to (but skip the step for setting the ANS_USE_UPF variable if using the /UPF method). It is recommended to put a write/print statement in your Fortran code so that when the the simulation is run, output will be print to the screen indicating wether the UPF is actually being invoked. If I recall, write(*,*) may not print to the screen in Linux and, in that case, you can try write(6,*) instead.