240 likes | 586 Views
Introduction. What is a User Defined Function?A UDF is a routine (programmed by the user) written in C which can be dynamically linked with the solver.Standard C functionse.g., trigonometric, exponential, control blocks, do-loops, file i/o, etc.Pre-Defined MacrosAllows access to field variable
E N D
1. User Defined Functions Much of this lecture comes from the Advanced UDF lecture. It should not be a big concern of users who are not familiar with C. The C that they need to know is very basic and can be picked up just as easily as one would have to pick up the internally-defined macros.
This lecture does not describe compiling UDFs. This detail takes away from the basics of creating UDFs.
Slides are self-explanatory. As with the Advanced UDF lecture, this one quickly jumps into an example which is the best way to show how one is written. Also let user’s know that the many examples that are available can be used as ‘templates’ when creating their own.Much of this lecture comes from the Advanced UDF lecture. It should not be a big concern of users who are not familiar with C. The C that they need to know is very basic and can be picked up just as easily as one would have to pick up the internally-defined macros.
This lecture does not describe compiling UDFs. This detail takes away from the basics of creating UDFs.
Slides are self-explanatory. As with the Advanced UDF lecture, this one quickly jumps into an example which is the best way to show how one is written. Also let user’s know that the many examples that are available can be used as ‘templates’ when creating their own.
2. Introduction What is a User Defined Function?
A UDF is a routine (programmed by the user) written in C which can be dynamically linked with the solver.
Standard C functions
e.g., trigonometric, exponential, control blocks, do-loops, file i/o, etc.
Pre-Defined Macros
Allows access to field variable, material property, and cell geometry data.
Why build UDF’s?
Standard interface cannot be programmed to anticipate all needs.
Customization of boundary conditions, source terms, reaction rates, material properties, etc.
Adjust functions (once per iteration)
Execute on Demand functions
Solution Initialization
3. User Access to Fluent Solver FLUENT is designed to allow users to access the solver at some strategic instances during the solution process: