8.1.1. Process Overview

Step 1: Define Your Problem
Step 2: Create a C Source File
Step 3: Start ANSYS Fluent and Read (or Set Up) the Case File
Step 4: Interpret or Compile the Source File
Step 5: Hook the UDF to ANSYS Fluent
Step 6: Run the Calculation
Step 7: Analyze the Numerical Solution and Compare to Expected Results

To begin the process, you’ll need to define the problem you want to solve using a UDF (Step 1). For example, suppose you want to use a UDF to define a custom boundary profile for your model. You will first need to define the set of mathematical equations that describes the profile.

Next you will need to translate the mathematical equation (conceptual design) into a function written in the C programming language (Step 2). You can do this using any text editor. Save the file with a .c suffix (for example, udfexample.c) in your working folder. (See Appendix A: C Programming Basics for some basic information on C programming.)

After you have written the C function, you are ready to start ANSYS Fluent and read in (or set up) your case file (Step 3). You will then need to interpret or compile the source code, debug it (Step 4), and then hook the function to ANSYS Fluent (Step 5). Finally you’ll run the calculation (Step 6), analyze the results from your simulation, and compare them to expected results (Step 7). You may loop through this entire process more than once, depending on the results of your analysis. Follow the step-by-step process in the sections below to see how this is done.


Release 18.2 - © ANSYS, Inc. All rights reserved.