HI:
I have include precice solve interface in udf.c, it’s ok when combile udf.c, but faliue when run in fluent,
why?
first picture: udf.c
second picture: error info
Hi,
fluent compiles the udf.c in the background, which works fine as the include files are found by the compiler. However, the udf needs access to the symbols in the shared library to run. The shared library isn’t loaded, resulting in the issue.
There has recently been some activity in the adapter. Maybe that can help you:
# preCICE-adapter for the CFD code ANSYS Fluent
**This adapter is valid for FLUENT 19.5 and preCICE v2.2 on Ubuntu 20.04**
The Fluent preCICE adapter operates using Fluent's User-Defined Function (UDF) feature. UDFs are functions written in the C programming language that are dynamically loaded with the Fluent
solver and can be used to enhance and generalize its standard features. For example, UDFs can be used to:
- Customize boundary conditions, material property definitions, or source functions.
- Customize different numerical/physics models being employed: multiphase mixture models, discrete phase models, radiation models, chemical reaction models, diffusivity models, etc.
- Execute code at different stages of a solution: at solution initialization, at every iteration, upon reaching convergence, etc.
- Many other things, as long as one can code it in C.
## Fluent UDF Requirements
Details about UDFs can be found in the UDF Manual provided by ANSYS Fluent. A summary of the major requirements follows.
### File requirements
UDFs are identified by a .c file extension (for example fsi_udf.c). UDFs must be defined using DEFINE macros supplied by Fluent. These macros are pre-defined functions that access the Fluent
solver and perform other tasks. The .c file containing the UDFs (fsi_udf.c) must contain an include statement for a udf header file (#include "udf.h"). The udf header file is provided with the Fluent application and will be found upon UDF execution. It contains the DEFINE macros, among other things.
This file has been truncated. show original
1 Like
system
Closed
January 5, 2024, 11:02am
3
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.