4.3. User-Defined Functions for Fluid Structure Interaction

Beginning in release 2022 R2, Ansys Forte provides a capability for users to define their own fluid structure interaction by compiling a user-defined function (UDF) library. Instructions for using the API are included in the README.txt file in the user_defined_functions folder of the Forte installation. To use a UDF to control a boundaries motion, add a new UDF from the FSI toolbar and select the boundary that will be controlled by the UDF. If a coordinate frame other than Global Origin is selected for the UDF, the boundary vertices will be transformed into this specified reference frame before being passed to the UDF API. This allows the UDF to be made more general. For example, if the UDF is intended to apply slider-crank–type motion, it might be useful to define a reference frame at the crank shaft with the Z-axis pointing up at the piston. In this way, the UDF can be used to translate vertices up and down in the Z-direction, regardless of the orientation of the piston with respect to global origin.

One or more solution variables may be added to the UDF, although this is not a requirement. A UDF may therefore be used to drive motion arbitrarily, perhaps based on a custom kinematics use case. When one or more fields are selected, the UDF API will pass the solution field values interpolated to each surface vertex on through the API, in CGS units.

A documented UDF example is provided in the file fsi_user_defined_functions.cpp in the user_defined_functions/fsi/cpp folder of the Forte installation. See the README.txt file in the same location for instructions on building.


Note:  Currently, only a C++ version of the UDF API for fluid structure interaction is available.