2.5.16.  DEFINE_IMPINGEMENT

2.5.16.1. Description

You can use DEFINE_IMPINGEMENT to customize the impingement regime selection criteria.

2.5.16.2. Usage

DEFINE_IMPINGEMENT (name, tp, rel_dot_n, f, t, y_s, E_imp)

Argument Type

Description

symbol name

UDF name.

Tracked_Particle *tp

Pointer to the Tracked_Particle data structure which contains data related to the particle being tracked.

real real_dot_n

The particle impingement velocity magnitude

face_t f

Index of the face that the particle is currently hitting

Thread *t

Pointer to the face thread the particle is currently hitting

real *y_s

Pointer to the fraction of particle mass that remains in the free stream after impact

real *E_imp

Pointer to the particle impingement parameter that is used as a regime selection criterion.

Function returns

int

There are seven arguments to DEFINE_IMPINGEMENT: name, tp, real_dot_n, f, t, y_s, and E_imp. You supply the name of your user-defined function. tp, real_dot_n, f, and t are passed by the ANSYS Fluent solver to your UDF. Your function will:

  • Compute the fraction of the particle mass that remains in the free stream after impact and store it in y_s

  • Compute the impingement parameter and store it in E_imp

    The variable E_imp calculated in your UDF replaces the impingement energy calculated by Equation 16–224 and will be used also in Equation 16–231 for the peak diameter of the splashed droplets.

  • Return the impingement regime

The impingement regime that you return can either be one of the four predefined impingement regimes in ANSYS Fluent, described in Interaction During Impact with a Boundary in the Fluent Theory Guide:

FILM_STICK
FILM_REBOUND
FILM_SPREAD
FILM_SPLASH

or one of the following user-defined regimes defined in a DEFINE_FILM_REGIME UDF:

FILM_USER_0
FILM_USER_1
FILM_USER_2
FILM_USER_3
FILM_USER_4
FILM_USER_5
FILM_USER_6
FILM_USER_7
FILM_USER_8
FILM_USER_9

2.5.16.3. Example

The following UDF, named dry_impingement, returns one of the pre-defined regimes, or the user-defined regime FILM_USER_0 for high wall temperature and high impact energy conditions. This function must be run as a compiled UDF.

#include "udf.h"
#define E_crit_0 16.
#define E_crit_1 3329.
#define E_crit_2 7500.
#define T_crit 1.5
DEFINE_IMPINGEMENT(dry_impingement, tp, rel_dot_n, f, t, y_s, E_imp)
{
  real one = 1.0, zero = 0.0;
  real fh = F_WALL_FILM_HEIGHT(f,t);
  real Re, denom;
  real abs_visc  = MAX(DPM_MU(tp),DPM_SMALL);
  real sigma = MAX(DPM_SURFTEN(tp),DPM_SMALL);
  real p_rho = MAX(TP_RHO(tp),DPM_SMALL);
  real d_0   = TP_DIAM(tp);
  real T_w = rf_energy ? F_T(f,t) : 300.0;
  real T_b = dpm_par.Tmax;
  int regime = FILM_STICK;
  
  *y_s = zero;
  Re = p_rho * d_0 * rel_dot_n / abs_visc;
  denom = sigma * (MIN(fh/d_0,1.0) + pow(Re,-0.5));
  *E_imp = SQR(rel_dot_n) * d_0 * p_rho / MAX(DPM_SMALL, denom);

  /* rf_energy is defined if Energy model is enabled. It is possible to use inert particle
  with isothermal conditions (Energy off). In that case the UDF returns FILM_STICK. */
  if (rf_energy && TP_LIQUID(tp))
    {
      Material *mb;
      if (TP_WET_COMBUSTION(tp))
        mb = TP_WET_COMB_MATERIAL(tp);
      else
        mb = TP_MATERIAL(tp);
      T_b = DPM_Boiling_Temperature(tp,mb);
    }
  else
    return FILM_STICK;
  
  if (T_w <= T_crit*T_b)
    {
      if (*E_imp <= E_crit_0)
        regime = FILM_STICK;
      else if (*E_imp > E_crit_0 && *E_imp <=  E_crit_1)
        regime = FILM_SPREAD;
      else if (*E_imp > E_crit_1)
        regime = FILM_SPLASH;
    }
  else
    {
      if (*E_imp < E_crit_1)
        regime = FILM_REBOUND;
      else
        regime = FILM_USER_0;
    }
  
  if ((regime == FILM_SPREAD) || (regime == FILM_STICK))
    *y_s = zero;
  else if ((regime == FILM_REBOUND)|| (regime == FILM_USER_0))
    *y_s = one;
  else if (regime == FILM_SPLASH)
    {
      if (*E_imp < E_crit_2)
        *y_s = MAX(0., 1.8e-4*(*E_imp - E_crit_1));
      else
        *y_s = 0.7;
    }
  return regime;
}

2.5.16.4. Hooking an Impingement UDF to ANSYS Fluent

After the UDF that you have defined using DEFINE_IMPINGEMENT is interpreted (Interpreting UDFs) or compiled (Compiling UDFs), the name that you supplied as the first DEFINE macro argument will become visible and selectable in the Discrete Phase Model dialog box in ANSYS Fluent. See Hooking DEFINE_IMPINGEMENT UDFs for details on how to hook your DEFINE_IMPINGEMENT UDF to ANSYS Fluent.


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