6.3. Hooking Multiphase UDFs

This section contains methods for hooking UDFs to Ansys Fluent that have been defined using DEFINE macros (described in Multiphase DEFINE Macros), and interpreted or compiled using methods (described in Interpreting UDFs or Compiling UDFs), respectively.

6.3.1. Hooking DEFINE_BOILING_PROPERTY UDFs

After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_BOILING_PROPERTY UDF, the name of the function you supplied as a DEFINE macro argument will become visible and selectable in the Boiling Model dialog box (Figure 6.84: The Boiling Model Dialog Box) in Ansys Fluent. Note that this type of UDF can be applied only to the Eulerian multiphase boiling model.

To hook the UDF to Ansys Fluent:

  1. In the Multiphase Model dialog box, select the Eulerian model (Models tab).

     Setup Models Multiphase   Edit...

  2. In the Sub-Models group box, select Boiling Model.

  3. Click Apply.

  4. In the Phase Interaction > Heat, Mass, Reactions > Mass tab, set the Number of Mass Transfer Mechanisms and select boiling from the Mechanism drop-down list. The Boiling Model dialog box will open where you can hook your boiling parameter UDFs, as shown in Figure 6.84: The Boiling Model Dialog Box.

    Figure 6.84: The Boiling Model Dialog Box

    The Boiling Model Dialog Box

  5. Click Apply.

See DEFINE_BOILING_PROPERTY for details about DEFINE_BOILING_PROPERTY functions.

6.3.2. Hooking DEFINE_CAVITATION_RATE UDFs

After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_CAVITATION_RATE UDF, the name of the function you supplied as a DEFINE macro argument will become visible and selectable in the User-Defined Function Hooks dialog box (Figure 6.86: The User-Defined Function Hooks Dialog Box) in Ansys Fluent. Note that cavitation rate UDFs can be applied only to the mixture multiphase model.

To hook the UDF to Ansys Fluent:

  1. In the Multiphase Model dialog box, select the Mixture model (Models tab).

     Setup Models Multiphase   Edit...

  2. Click Apply.

  3. Enable the following text command: solve/set/advanced/singhal-et-al-cavitation-model.

  4. In the Phase Interaction > Heat, Mass, Reactions tab of the Multiphase Model dialog box, enable Singhal-Et-Al Cavitation Model (Figure 6.85: The Multiphase Model Dialog Box - Heat, Mass, Reactions Tab), and click OK.

    Figure 6.85: The Multiphase Model Dialog Box - Heat, Mass, Reactions Tab

    The Multiphase Model Dialog Box - Heat, Mass, Reactions Tab

  5. Open the User-Defined Function Hooks dialog box (Figure 6.86: The User-Defined Function Hooks Dialog Box).

     Parameters & Customization User Defined Functions  Function Hooks...

    Figure 6.86: The User-Defined Function Hooks Dialog Box

    The User-Defined Function Hooks Dialog Box

  6. To hook the UDF to Ansys Fluent, select the function name (for example, c_rate::libudf) in the Cavitation Mass Rate drop-down list (Figure 6.86: The User-Defined Function Hooks Dialog Box), and click OK.

  7. Click Apply and close the Multiphase Model dialog box.

See DEFINE_CAVITATION_RATE for details about DEFINE_CAVITATION_RATE functions.

6.3.3. Hooking DEFINE_EXCHANGE_PROPERTY UDFs

After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_EXCHANGE_RATE UDF, the name of the function you supplied as a DEFINE macro argument will become visible and selectable in Ansys Fluent.

To hook an exchange property UDF to Ansys Fluent:

  1. Open the Multiphase Model dialog box.

     Setup Models Multiphase   Edit...

    Customized mass transfer UDFs can be applied to VOF, Mixture, and Eulerian multiphase models. Drag coefficient UDFs can be applied to Mixture and Eulerian models, while heat transfer and lift coefficient UDFs can be applied only to the Eulerian model. Select the appropriate model from the Model list in the Multiphase Model dialog box.


    Important:  For the Mixture model, make sure that you enable Slip Velocity in the Mixture Parameters group box (Models tab) in order to display the drag coefficient in the Forces tab of the Multiphase Model dialog box.


  2. Click Apply.

  3. In the Phase Interaction > Forces tab, select user-defined from the drop-down list for the corresponding exchange property (for example, for Coefficient (Drag Coefficient group box)).

    Figure 6.87: The Multiphase Model Dialog Box - Forces Tab

    The Multiphase Model Dialog Box - Forces Tab

  4. In the User-Defined Functions dialog box that opens, select the function name (for example, custom_drag::libudf) from the list of UDFs (Figure 6.88: The User-Defined Functions Dialog Box) and click OK.

    Figure 6.88: The User-Defined Functions Dialog Box

    The User-Defined Functions Dialog Box

  5. Click Apply and close the Multiphase Model dialog box.

See DEFINE_EXCHANGE_PROPERTY for details about DEFINE_EXCHANGE_PROPERTY functions.

6.3.4. Hooking DEFINE_HET_RXN_RATE UDFs

After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_HET_RXN_RATE 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:

  1. Select Species Transport from the Model list of the Species Model dialog box.

     Setup Models Species   Edit...

  2. In the Multiphase Model dialog box, make a selection from the Model list.

     Setup Models Multiphase   Edit...

  3. Click Apply.

  4. Go to the Phase Interaction > Heat, Mass, Reactions > Reactions tab (Figure 6.89: The Multiphase Model Dialog Box - Reactions Tab).

    Figure 6.89: The Multiphase Model Dialog Box - Reactions Tab

    The Multiphase Model Dialog Box - Reactions Tab

  5. Enter a nonzero number in the Total Number of Heterogeneous Reactions field.

  6. Select the function name (for example, user_evap_condens_react::libudf) from the Reaction Rate Function drop-down list.

  7. Click Apply and close the Multiphase Model dialog box.

See DEFINE_HET_RXN_RATE for details about DEFINE_HET_RXN_RATE functions.

6.3.5. Hooking DEFINE_LINEARIZED_MASS_TRANSFER UDFs

After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_LINEARIZED_MASS_TRANSFER UDF, the name of the function you supplied as a DEFINE macro argument will become visible and selectable in the Phase Interaction tab of the Multiphase Model dialog box.

To hook the UDF to Ansys Fluent:

  1. Make a selection from the Model list of the Multiphase Model dialog box.

     Setup Models Multiphase   Edit...

  2. Click Apply.

  3. Go to the Phase Interaction > Heat, Mass, Reactions tab (Figure 6.90: The Multiphase Model Dialog Box - Heat, Mass, Reactions Tab).

  4. Specify the Number of Mass Transfer Mechanisms greater than .

    The Mechanism drop-down list will appear.

  5. Select user-defined from the Mechanism drop-down list.

  6. In the User-Defined Functions dialog box that opens (Figure 6.91: The User-Defined Functions Dialog Box), select the function name and click OK.

    The UDF name will appear in the field below the Mechanism drop-down list in the Heat, Mass, Reactions tab of the Multiphase Model dialog box.

  7. Click Apply and close the Multiphase Model dialog box.

See DEFINE_LINEARIZED_MASS_TRANSFER for details about DEFINE_LINEARIZED_MASS_TRANSFER functions.

6.3.6. Hooking DEFINE_MASS_TRANSFER UDFs

After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_MASS_TRANSFER UDF, the name of the function you supplied as a DEFINE macro argument will become visible and selectable in the Phase Interaction > Heat, Mass, Reactions tab of the Multiphase Model dialog box (Figure 6.90: The Multiphase Model Dialog Box - Heat, Mass, Reactions Tab).

To hook the UDF to Ansys Fluent:

  1. Make a selection from the Model list of the Multiphase Model dialog box.

     Setup Models Multiphase   Edit...

  2. Click Apply.

  3. Go to the Phase Interaction > Heat, Mass, Reactions tab (Figure 6.90: The Multiphase Model Dialog Box - Heat, Mass, Reactions Tab).

    Figure 6.90: The Multiphase Model Dialog Box - Heat, Mass, Reactions Tab

    The Multiphase Model Dialog Box - Heat, Mass, Reactions Tab

  4. Specify the Number of Mass Transfer Mechanisms greater than .

  5. Select user-defined from the Mechanism drop-down list to open the User-Defined Functions dialog box (Figure 6.91: The User-Defined Functions Dialog Box).

    Figure 6.91: The User-Defined Functions Dialog Box

    The User-Defined Functions Dialog Box

  6. Select the function name (for example, liq_gas_source::udf) and click OK.

    The UDF name will appear in the field below the Mechanism drop-down list in the Heat, Mass, Reactions tab of the Multiphase Model dialog box.

  7. Click Apply and close the Multiphase Model dialog box.

See DEFINE_MASS_TRANSFER for details about DEFINE_MASS_TRANSFER functions.

6.3.7. Hooking DEFINE_VECTOR_EXCHANGE_PROPERTY UDFs

After you have interpreted (Interpreting UDFs) or compiled (Compiling UDFs) your DEFINE_VECTOR_EXCHANGE_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 (Figure 6.93: The User-Defined Functions Dialog Box) in Ansys Fluent.

To hook the UDF, select the name of your function in the appropriate drop-down list (such as Slip Velocity, Turbulent Dispersion, Blending Method for flow regime modelling).

For example, to hook the slip velocity UDF to Ansys Fluent:

  1. Select Mixture from the Model list of the Multiphase Model dialog box and make sure that the Slip Velocity option is enabled.

     Setup Models Multiphase   Edit...

  2. Click Apply.

  3. Go to the Phase Interaction > Forces tab (Figure 6.92: The Multiphase Model Dialog Box - Force Tab).

    Figure 6.92: The Multiphase Model Dialog Box - Force Tab

    The Multiphase Model Dialog Box - Force Tab

  4. In the Force Setup group box, select user-defined from the drop-down list for the Slip Velocity.

    Figure 6.93: The User-Defined Functions Dialog Box

    The User-Defined Functions Dialog Box

  5. In the User-Defined Functions dialog box that opens automatically, select the function name (for example, custom_slip::libudf) from the list of UDFs displayed in the User-Defined Functions dialog box (Figure 6.93: The User-Defined Functions Dialog Box), and click OK.

  6. Click Apply and close the Multiphase dialog box.

See DEFINE_VECTOR_EXCHANGE_PROPERTY for details about DEFINE_VECTOR_EXCHANGE_PROPERTY functions.