2.5.17.  DEFINE_FILM_REGIME

2.5.17.1. Description

You can use DEFINE_FILM_REGIME to set the particle variables for user-defined regimes of particle impingement. Fluent supports up to 10 user-defined regimes:

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

DEFINE_FILM_REGIME (name, regime, tp, pp, f, t, f_normal, update)

Argument Type

Description

symbol name

UDF name.

int regime

The particle impingement regime.

Tracked_Particle *tp

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

Particle *pp

Pointer to the Particle data structure where particles pp are stored in a linked list.

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 f_normal[]

Array that contains the unit vector which is normal to the face
int update Variable indicating whether the particle performs a sub-iteration, or a full tracking step. The value is 0 for sub-iteration and 1 for a full tracking step.

Function returns

void

There are eight arguments to DEFINE_FILM_REGIME: name, regime, tp, pp, f, t, f_normal, and update. You supply the name of your user-defined function. regime, tp, pp, f, t, f_normal, and update are passed by the ANSYS Fluent solver to your UDF. Your function will need to compute the particle parameters and variables corresponding to the user-defined regime and modify the Tracked_Particle *tp and Particle *pp structures accordingly.


Note:  If you are defining multiple user-defined regimes, they must all be defined within a single DEFINE_FILM_REGIME UDF.


2.5.17.3. Example

The following UDF, named dry_breakup, describes a user-defined impingement regime where the impinging droplet particle bounces off the wall surface and breaks up into smaller droplets without any film formation. The ratio of the initial droplet diameter to the diameter after reflection is defined by the parameter D_RATIO. The UDF uses the ANSYS Fluent function Reflect_Particle to compute the particle velocities after impingement. The reflected droplet’s new diameter and mass, as well as the number in parcel and flowrate are updated in the Tracked_Particle *tp structure. Note that the mass and diameter of the current and previous time steps, as well as the initial values must be updated. The initial mass and diameter must also be adjusted in Particle structure *pp at the end of the tracking step.

#include "udf.h"
#define D_RATIO 5
#define DIAM_FROM_VOL(V) ((real)pow((6.0 * (V) / M_PI), 1./3.))

DEFINE_FILM_REGIME(dry_breakup, regime, tp, pp, f, t, f_normal, update)
{
  real d1 = TP_DIAM(tp);
  real d2 = MAX(TP_DIAM(tp)/D_RATIO,dpm_par.lowest_diam);
  real drat_cubed;

  if (regime == FILM_USER_0)
    { 
      TP_ON_WALL(tp) = FALSE;
      tp->tracking_scheme = tp->free_stream_tracking_scheme;
      TP_FILM_FACE(tp) = NULL_FACE;
      TP_FILM_THREAD(tp) = NULL;
      tp->gvtp.n_rebound ++ ;
      Reflect_Particle(tp,f_normal,ND_ND,f,t, NULL, NULL_FACE);
      drat_cubed = CUB(d2/d1);      
      TP_DIAM(tp) = d2;
      TP_N(tp) /= drat_cubed;
      TP_MASS(tp) *= drat_cubed;
      TP_FLOW_RATE(tp) /= drat_cubed;
      /* after diameter change all relevant variables in previous and initial states must be consistent */
      /* initialize the previous state mass and diameter to the current */
      TP_MASS0(tp) = TP_MASS(tp);
      TP_DIAM0(tp) = TP_DIAM(tp);
      /* initialize the initial state mass and diameter to the current */
      TP_INIT_MASS(tp) *= drat_cubed;
      TP_INIT_DIAM(tp) = DIAM_FROM_VOL(  TP_INIT_MASS(tp) /  TP_INIT_RHO(tp) );
      /* at the end of the iteration step update the initial mass
         and diameter in the stored particle list */
      if (update)
        {
          PP_INIT_MASS(pp) *= drat_cubed;
          PP_INIT_DIAM(pp) = DIAM_FROM_VOL(  PP_INIT_MASS(pp) /  PP_INIT_RHO(pp) );      
        }
    }
  else
    {
      Error("User defined impingement regime not implemented: %d.\n",regime);  
    }
}

2.5.17.4. Hooking a Film Regime UDF to ANSYS Fluent

After the UDF that you have defined using DEFINE_FILM_REGIME 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_FILM_REGIME UDFs for details on how to hook your DEFINE_FILM_REGIME UDF to ANSYS Fluent.


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