6.4. Hooking Discrete Phase Model (DPM) UDFs

This section contains methods for hooking UDFs to Ansys Fluent that have been

6.4.1. Hooking DEFINE_DPM_BC 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).

Figure 6.94: The Wall Dialog Box

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 OK.

See DEFINE_DPM_BC for details about DEFINE_DPM_BC functions.

6.4.2. Hooking DEFINE_DPM_BODY_FORCE UDFs

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...

Figure 6.95: The Discrete Phase Model Dialog Box

The Discrete Phase Model Dialog Box

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 OK.

See DEFINE_DPM_BODY_FORCE for details about DEFINE_DPM_BODY_FORCE functions.

6.4.3. Hooking DEFINE_DPM_DRAG UDFs

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.

Figure 6.96: The Set Injection Properties Dialog Box

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 OK. (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.

6.4.4. Hooking DEFINE_DPM_EROSION UDFs

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...

Figure 6.97: The Discrete Phase Model Dialog Box

The Discrete Phase Model Dialog Box

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 OK.

See DEFINE_DPM_EROSION for details about DEFINE_DPM_EROSION functions.

6.4.5. Hooking DEFINE_DPM_HEAT_MASS UDFs

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 OK.

Next, create a particle injection in the Injections dialog box.

 Setup Models Discrete Phase Injections New...

Figure 6.98: The Set Injections Dialog Box

The Set Injections Dialog Box

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 OK.

See DEFINE_DPM_INJECTION_INIT for details about DEFINE_DPM_INJECTION_INIT functions.

6.4.6. Hooking DEFINE_DPM_INJECTION_INIT UDFs

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...

Figure 6.99: The Injections Dialog Box

The Injections Dialog Box

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 OK.

See DEFINE_DPM_INJECTION_INIT for details about DEFINE_DPM_INJECTION_INIT functions.

6.4.7. Hooking DEFINE_DPM_LAW UDFs

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).

Figure 6.100: The Custom Laws Dialog Box

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 OK.

See DEFINE_DPM_LAW for details about DEFINE_DPM_LAW functions.

6.4.8. Hooking DEFINE_DPM_OUTPUT UDFs

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...

Figure 6.101: The Sample Trajectories Dialog Box

The Sample Trajectories Dialog Box

  1. Select the appropriate injection in the Release From Injections list.

  2. Indicate where the sample will be written (for example, make a selection in the Planes list (in 3D) or Lines list (in 2D)).

  3. Select the function name (for example, discrete_phase_sample::libudf) from the Output drop-down list under User-Defined Functions.

  4. 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 Apply. 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.

6.4.9. Hooking DEFINE_DPM_PROPERTY UDFs

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).

Figure 6.102: The Create/Edit Materials Dialog Box

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.


Figure 6.103: The User-Defined Functions Dialog Box

The User-Defined Functions 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 OK. 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.

6.4.10. Hooking DEFINE_DPM_SCALAR_UPDATE UDFs

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...

Figure 6.104: The Discrete Phase Model Dialog Box

The Discrete Phase Model Dialog Box

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 OK.

See DEFINE_DPM_SCALAR_UPDATE for details about DEFINE_DPM_SCALAR_UPDATE functions.

6.4.11. Hooking DEFINE_DPM_SOURCE UDFs

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...

Figure 6.105: The Discrete Phase Model Dialog Box

The Discrete Phase Model Dialog Box

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 OK.

See DEFINE_DPM_SOURCE for details about DEFINE_DPM_SOURCE functions.

6.4.12. Hooking DEFINE_DPM_SPRAY_COLLIDE UDFs

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...

Figure 6.106: The Discrete Phase Model Dialog Box

The Discrete Phase Model Dialog Box

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 OK.

See DEFINE_DPM_SPRAY_COLLIDE for details about DEFINE_DPM_SPRAY_COLLIDE functions.

6.4.13. Hooking DEFINE_DPM_SWITCH UDFs

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).

Figure 6.107: The Custom Laws Dialog Box

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 OK.

See DEFINE_DPM_SWITCH for details about DEFINE_DPM_SWITCH functions.

6.4.14. Hooking DEFINE_DPM_TIMESTEP UDFs

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...

Figure 6.108: The Discrete Phase Model Dialog Box

The Discrete Phase Model Dialog Box

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 OK.

See DEFINE_DPM_TIMESTEP for details about DEFINE_DPM_TIMESTEP functions.

6.4.15. Hooking DEFINE_DPM_VP_EQUILIB UDFs

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).

Figure 6.109: The Create/Edit Materials Dialog Box

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 OK. Then click Change/Create in the Create/Edit Materials dialog box.

Figure 6.110: The User-Defined Functions Dialog Box

The User-Defined Functions Dialog Box

See DEFINE_DPM_VP_EQUILIB for details about DEFINE_DPM_VP_EQUILIBRIUM functions.

6.4.16. Hooking DEFINE_IMPINGEMENT UDFs

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:

  1. Open the Discrete Phase Model dialog box.

     Setup Models Discrete Phase   Edit...

  2. Click the Injections... button and create an injection using the Injections dialog box. Close the Injections dialog box.

  3. 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.

  4. 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.

    Figure 6.111: The Discrete Phase Model Dialog Box

    The Discrete Phase Model Dialog Box

See DEFINE_IMPINGEMENT for details about DEFINE_IMPINGEMENT functions.

6.4.17. Hooking DEFINE_FILM_REGIME UDFs

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:

  1. Open the Discrete Phase Model dialog box.

     Setup Models Discrete Phase   Edit...

  2. Click the Injections... button and create an injection using the Injections dialog box. Close the Injections dialog box.

  3. 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.

  4. 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.

    Figure 6.112: The Discrete Phase Model Dialog Box

    The Discrete Phase Model Dialog Box

See DEFINE_FILM_REGIME for details about DEFINE_FILM_REGIME functions.

6.4.18. Hooking DEFINE_SPLASHING_DISTRIBUTION UDFs

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:

  1. Open the Discrete Phase Model dialog box.

     Setup Models Discrete Phase   Edit...

  2. Click the Injections... button and create an injection using the Injections dialog box. Close the Injections dialog box.

  3. 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.

  4. 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.

    Figure 6.113: The Discrete Phase Model Dialog Box

    The Discrete Phase Model Dialog Box

See DEFINE_SPLASHING_DISTRIBUTION for details about DEFINE_SPLASHING_DISTRIBUTION functions.