This section contains methods for hooking UDFs to Ansys Fluent that have been
defined using
DEFINE
macros described in Discrete Phase Model (DPM)DEFINE
Macros, andinterpreted or compiled using methods described in Interpreting UDFs or Compiling UDFs, respectively.
For more information, see the following sections:
- 6.4.1. Hooking DEFINE_DPM_BC UDFs
- 6.4.2. Hooking DEFINE_DPM_BODY_FORCE UDFs
- 6.4.3. Hooking DEFINE_DPM_DRAG UDFs
- 6.4.4. Hooking DEFINE_DPM_EROSION UDFs
- 6.4.5. Hooking DEFINE_DPM_HEAT_MASS UDFs
- 6.4.6. Hooking DEFINE_DPM_INJECTION_INIT UDFs
- 6.4.7. Hooking DEFINE_DPM_LAW UDFs
- 6.4.8. Hooking DEFINE_DPM_OUTPUT UDFs
- 6.4.9. Hooking DEFINE_DPM_PROPERTY UDFs
- 6.4.10. Hooking DEFINE_DPM_SCALAR_UPDATE UDFs
- 6.4.11. Hooking DEFINE_DPM_SOURCE UDFs
- 6.4.12. Hooking DEFINE_DPM_SPRAY_COLLIDE UDFs
- 6.4.13. Hooking DEFINE_DPM_SWITCH UDFs
- 6.4.14. Hooking DEFINE_DPM_TIMESTEP UDFs
- 6.4.15. Hooking DEFINE_DPM_VP_EQUILIB UDFs
- 6.4.16. Hooking DEFINE_IMPINGEMENT UDFs
- 6.4.17. Hooking DEFINE_FILM_REGIME UDFs
- 6.4.18. Hooking DEFINE_SPLASHING_DISTRIBUTION UDFs
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_BC
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the appropriate
boundary condition dialog box (Figure 6.94: The Wall Dialog Box) in Ansys Fluent.
To hook the UDF, first create an injection using the Injections dialog box.
Setup → Models → Discrete Phase → Injections New...
Next, open the Boundary Conditions task page.
Setup → Boundary Conditions
Select the boundary in the Zone list and click Edit... to open the boundary condition dialog box (for example, the Wall dialog box, as shown in Figure 6.94: The Wall Dialog Box).
Click the DPM tab and select user_defined from the Boundary Cond. Type drop-down list in the Discrete Phase Model Conditions group box. This will expand the dialog box to allow you to select the function name (for example, bc_reflect::libudf) from the Boundary Cond. Function drop-down list (Figure 6.94: The Wall Dialog Box). Click .
See
DEFINE_DPM_BC
for details
about DEFINE_DPM_BC
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_BODY_FORCE
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Discrete Phase Model dialog box (Figure 6.95: The Discrete Phase Model Dialog Box) in Ansys Fluent.
To hook the UDF, first open the Discrete Phase Model dialog box.
Setup → Models → Discrete Phase Edit...
Click the Injections... button to open the Injections dialog box. Create an injection and then click Close in the Injections dialog box.
Next, click the UDF tab in the Discrete Phase Model dialog box. Select the function name (for example, particle_body_force::libudf) from the Body Force drop-down list under User-Defined Functions (Figure 6.95: The Discrete Phase Model Dialog Box), and click .
See
DEFINE_DPM_BODY_FORCE
for
details about DEFINE_DPM_BODY_FORCE
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_DRAG
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Set Injection Properties dialog box (Figure 6.96: The Set Injection Properties Dialog Box) in Ansys Fluent.
To hook the UDF, open the Injections dialog box by clicking Discrete Phase and selecting Injections... in the Setting Up Physics ribbon tab (Model Specific group box) or by clicking Injections... in the Discrete Phase Model dialog box. In the Injections dialog box, Set... or Create the injection that the user-defined DPM drag function specifies. This will bring up the Set Injection Properties dialog box.
Click the Physical Models tab in the Set Injection Properties dialog box. Select the function name (for example, particle_drag_force::libudf) from the Drag Law drop-down list in the Drag Parameters group box (Figure 6.96: The Set Injection Properties Dialog Box), and click . (Note that function names listed in the drop-down list are preceded by the word udf, as in udf particle_drag_force::libudf.)
See
DEFINE_DPM_DRAG
for details
about DEFINE_DPM_DRAG
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_EROSION
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Discrete Phase Model dialog box (Figure 6.97: The Discrete Phase Model Dialog Box) in Ansys Fluent.
To hook the UDF, first open the Discrete Phase Model dialog box.
Setup → Models → Discrete Phase Edit...
Click the Injections... button to open the Injections dialog box. Create an injection and then click Close in the Injections dialog box.
Next, enable the Interaction with Continuous Phase option under Interaction in the Discrete Phase Model dialog box. Then, click the Physical Models tab and enable the Erosion/Accretion option. Finally, click the UDF tab and select the function name (for example, dpm_accr::libudf) from the Erosion/Accretion drop-down list in the User-Defined Functions group box (Figure 6.96: The Set Injection Properties Dialog Box), and click .
See
DEFINE_DPM_EROSION
for details
about DEFINE_DPM_EROSION
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_HEAT_MASS
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Set Injection Properties dialog box (Figure 6.98: The Set Injections Dialog Box) in Ansys Fluent.
To hook the UDF, first set up your species transport model in the Species Model dialog box.
Setup → Models → Species Edit...
Select Species Transport from the Model list and click .
Next, create a particle injection in the Injections dialog box.
Setup → Models → Discrete Phase → Injections New...
Set up the particle injection in the Set Injection Properties dialog box, being sure to select Multicomponent in the Particle Type group box. Then click the UDF tab, and select the function name (for example, multivap::libudf) from the Heat/Mass Transfer drop-down list in the User-Defined Functions group box. Click .
See
DEFINE_DPM_INJECTION_INIT
for
details about DEFINE_DPM_INJECTION_INIT
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_INJECTION_INIT
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Set Injection Properties dialog box (Figure 6.99: The Injections Dialog Box) in Ansys Fluent.
To hook the UDF, first create a particle injection in the Injections dialog box.
Setup → Models → Discrete Phase → Injections New...
Set up the particle injection in the Set Injection Properties dialog box. Then click the UDF tab and select the function name (for example, init_bubbles::libudf) from the Initialization drop-down list under User-Defined Functions. Click .
See
DEFINE_DPM_INJECTION_INIT
for
details about DEFINE_DPM_INJECTION_INIT
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_LAW
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Custom Laws dialog box (Figure 6.100: The Custom Laws Dialog Box) in Ansys Fluent.
To hook the UDF to Ansys Fluent, first create a particle injection in the Injections dialog box.
Setup → Models → Discrete Phase → Injections New...
Enable the Custom option in the Laws group box in the Set Injection Properties dialog box, in order to open the Custom Laws dialog box (Figure 6.100: The Custom Laws Dialog Box).
In the Custom Laws dialog box, select the function name (for example, Evapor_Swelling_Law::libudf) from the appropriate drop-down list located to the left of each of the particle laws (for example, First Law), and click .
See
DEFINE_DPM_LAW
for details
about DEFINE_DPM_LAW
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_OUTPUT
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Sample Trajectories dialog box (Figure 6.101: The Sample Trajectories Dialog Box) in Ansys Fluent.
In order to hook the UDF, you must first set up the discrete phase model (for example, create a particle injection). After you have run the calculation and generated data, open the Sample Trajectories dialog box (Figure 6.101: The Sample Trajectories Dialog Box).
Results → Reports → Discrete Phase → Sample Edit...
Select the appropriate injection in the Release From Injections list.
Indicate where the sample will be written (for example, make a selection in the Planes list (in 3D) or Lines list (in 2D)).
Select the function name (for example, discrete_phase_sample::libudf) from the Output drop-down list under User-Defined Functions.
Click Compute (for steady calculations) or Start (for transient calculations).
Note: If you want to use your DEFINE_DPM_OUTPUT
UDF only for the
VOF-to-DPM lump conversion transcript, you can just select the function name from the
Output drop-down list and click . In this
case, no injection must be selected in the Release From Injections
list.
See
DEFINE_DPM_OUTPUT
for details
about DEFINE_DPM_OUTPUT
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_PROPERTY
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the User-Defined Functions dialog box.
To hook the UDF to Ansys Fluent, you will first need to open the Materials task page.
Setup → Materials
Select a material from Materials list and click the Create/Edit... button to open the Create/Edit Materials dialog box (Figure 6.102: The Create/Edit Materials Dialog Box).
Select user-defined in the drop-down list for one of the properties (for example, Particle Emissivity) in the Create/Edit Materials dialog box, in order to open the User-Defined Functions dialog box (Figure 6.103: The User-Defined Functions Dialog Box).
Important: In order for the Particle Emissivity property to be displayed in the sample dialog box shown above, you must enable a radiation model, turn on the Particle Radiation Interaction option in the Discrete Phase Model dialog box, and introduce a particle injection in the Injections dialog box.
Select the function name (for example, coal_emissivity::libudf) from the list of UDFs displayed in the User-Defined Functions dialog box, and click . The name of the function will subsequently be displayed under the selected property (for example, Particle Emissivity) in the Create/Edit Materials dialog box.
See
DEFINE_PROPERTY
UDFs for details
about DEFINE_DPM_PROPERTY
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_SCALAR_UPDATE
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Discrete Phase Model dialog box (Figure 6.104: The Discrete Phase Model Dialog Box) in Ansys Fluent.
To hook the UDF, first open the Discrete Phase Model dialog box.
Setup → Models → Discrete Phase Edit...
Click the Injections... button to open the Injections dialog box. Create an injection and then click Close in the Injections dialog box.
Next, click the UDF tab in the Discrete Phase Model dialog box. Select the function name (for example, melting_index::libudf) from the Scalar Update drop-down list under User-Defined Functions (Figure 6.104: The Discrete Phase Model Dialog Box), and click .
See
DEFINE_DPM_SCALAR_UPDATE
for
details about DEFINE_DPM_SCALAR_UPDATE
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_SOURCE
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Discrete Phase Model dialog box (Figure 6.105: The Discrete Phase Model Dialog Box) in Ansys Fluent.
To hook the UDF, first open the Discrete Phase Model dialog box.
Setup → Models → Discrete Phase Edit...
Click the Injections... button to open the Injections dialog box. Create an injection and then click Close in the Injections dialog box.
Next, click the UDF tab in the Discrete Phase Model dialog box. Select the function name (for example, dpm_source::libudf) from the Source drop-down list under User-Defined Functions (Figure 6.105: The Discrete Phase Model Dialog Box), and click .
See
DEFINE_DPM_SOURCE
for details
about DEFINE_DPM_SOURCE
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_SPRAY_COLLIDE
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Discrete Phase Model dialog box (Figure 6.106: The Discrete Phase Model Dialog Box) in Ansys Fluent.
To hook the UDF, first open the Discrete Phase Model dialog box.
Setup → Models → Discrete Phase Edit...
Click the Injections... button to open the Injections dialog box. Create an injection and then click Close in the Injections dialog box.
Next, click the Physical Models tab in the Discrete Phase Model dialog box and enable the Droplet Collision option in the Spray Model group box. Then, click the UDF tab and select the function name (for example, mean_spray_collide::libudf) from the Spray Collide Function drop-down list in the User-Defined Functions group box (Figure 6.96: The Set Injection Properties Dialog Box), and click .
See
DEFINE_DPM_SPRAY_COLLIDE
for
details about DEFINE_DPM_SPRAY_COLLIDE
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_SWITCH
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in the Custom Laws dialog box (Figure 6.107: The Custom Laws Dialog Box) in Ansys Fluent.
To hook the UDF to Ansys Fluent, first create a particle injection in the Injections dialog box.
Setup → Models → Discrete Phase → Injections New...
Enable the Custom option in the Laws group box in the Set Injection Properties dialog box, in order to open the Custom Laws dialog box (Figure 6.107: The Custom Laws Dialog Box).
In the Custom Laws dialog box, select the function name (for example, dpm_switch::libudf) from the Switching drop-down list and click .
See
DEFINE_DPM_SWITCH
for details
about DEFINE_DPM_SWITCH
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_TIMESTEP
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable in Ansys Fluent.
To hook the UDF, first open the Discrete Phase Model dialog box.
Setup → Models → Discrete Phase Edit...
Click the Injections... button to open the Injections dialog box. Create an injection and then click Close in the Injections dialog box.
Next, click the UDF tab in the Discrete Phase Model dialog box. Select the function name (for example, limit_to_e_minus_four::libudf) from the DPM Time Step drop-down list under User-Defined Functions (Figure 6.108: The Discrete Phase Model Dialog Box), and click .
See
DEFINE_DPM_TIMESTEP
for details
about DEFINE_DPM_TIMESTEP
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_DPM_VP_EQUILIB
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable from the Create/Edit Materials dialog box in Ansys Fluent.
To hook the UDF, first set up your species transport and combustion models in the Species Model dialog box.
Setup → Models → Species Edit...
Then, create a particle injection using the Injections dialog box.
Setup → Models → Discrete Phase → Injections New...
Set up the particle injection, making sure to select Multicomponent for the Particle Type.
Next, open the Materials task page.
Setup → Materials
Select the appropriate material in the Materials list (for example, particle-mixture-template) and click Create/Edit to open the Create/Edit Materials dialog box (Figure 6.109: The Create/Edit Materials Dialog Box).
Select user-defined from the drop-down list for Vapor-Particle-Equilibrium in the Properties group box. This will open the User-Defined Functions dialog box. Select the UDF name (for example, raoult_vp::libudf) from the list of UDFs displayed and click . Then click Change/Create in the Create/Edit Materials dialog box.
See
DEFINE_DPM_VP_EQUILIB
for
details about DEFINE_DPM_VP_EQUILIBRIUM
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_IMPINGEMENT
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable from in the Discrete Phase Model dialog box in Ansys Fluent.
To hook the UDF, follow these steps:
Open the Discrete Phase Model dialog box.
Setup → Models → Discrete Phase Edit...
Click the Injections... button and create an injection using the Injections dialog box. Close the Injections dialog box.
Do one of the following:
In the boundary conditions dialog box for the wall of interest, select wall-film in the Discrete Phase BC Type entry on the DPM tab.
Enable the Eulerian Wall Film model.
In the Discrete Phase Model dialog box, open the UDF tab and select your function (for example, dry_impingement::libudf) from the Impingement Model drop-down list.
See
DEFINE_IMPINGEMENT
for details
about DEFINE_IMPINGEMENT
functions.
After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_FILM_REGIME
UDF, the name of the function you supplied as a DEFINE
macro argument will become visible and selectable from in the Discrete Phase Model dialog box in Ansys Fluent.
To hook the UDF, follow these steps:
Open the Discrete Phase Model dialog box.
Setup → Models → Discrete Phase Edit...
Click the Injections... button and create an injection using the Injections dialog box. Close the Injections dialog box.
Do one of the following:
In the boundary conditions dialog box for the wall of interest, select wall-film in the Discrete Phase BC Type entry on the DPM tab.
Enable the Eulerian Wall Film model.
In the Discrete Phase Model dialog box, open the UDF tab and select your function (for example, dry_breakup::libudf) from the Film Regime drop-down list.
See
DEFINE_FILM_REGIME
for details
about DEFINE_FILM_REGIME
functions.
After you have compiled (Compiling UDFs) your DEFINE_SPLASHING_DISTRIBUTION
UDF,
the name of the function you supplied as a DEFINE
macro argument will become visible and selectable from in the Discrete Phase Model dialog box in Ansys Fluent.
To hook the UDF, follow these steps:
Open the Discrete Phase Model dialog box.
Setup → Models → Discrete Phase Edit...
Click the Injections... button and create an injection using the Injections dialog box. Close the Injections dialog box.
Do one of the following:
In the boundary conditions dialog box for the wall of interest, select wall-film in the Discrete Phase BC Type entry on the DPM tab.
Enable the Eulerian Wall Film model.
In the Discrete Phase Model dialog box, open the UDF tab and select your function (for example, splash::libudf) from the Splash Distribution drop-down list.
See
DEFINE_SPLASHING_DISTRIBUTION
for details
about DEFINE_SPLASHING_DISTRIBUTION
functions.