Fluids

Fluids

Topics related to Fluent, CFX, Turbogrid and more.

DPM boundary UDF for a filter

    • jchen17
      Subscriber

      hi all, I'm using DPM to simulate a filter, namely, when a bunch of particles flow to a surface, if the particle size is big then reflect. otherwise, pass through. The problem is the small particles stick on the surface, instead of pass through.

      the figure is my results. I only tested small particles (in the code, it's < 120 um. big particles are fine, they can reflected) as can be seen, the particles trapped on the surface.

      What I'd like to do is

      if (particle diameter > D_filter_size)

      {

      boundary condition is reflect;

      }

      if (particle diameter < D_filter_size)

      {

      boundary condition interior;

      }

       

       

      the following is my code. it only contains the big particle case. However, I also tried to manipulate the small paritcle position and velocity, the results are same. particles < 120 um trapped on the surface.

      #include "udf.h"
      #include "dpm.h"
      #include "surf.h"
      #include "random.h"
      #include
      #include
      /* 
      define a user-defined dpm boundary condition routine
      * bc_reflect: name
      * p: the tracked particle
      * t: the touched face thread
      * f: the touched face
      * f_normal: normal vector of touched face
      * dim: dimension of the problem (2 in 2d and 2d-axi-swirl, 3 in 3d)
      *
      * return is the status of the particle, see enumeration of Path_Status
      * in dpm.h
      */

       

      DEFINE_DPM_BC(bc_filter, p, t, f, f_normal, dim)
      {
          real alpha; /* angle of particle path with face normal */
          real vn = 0.;
          real vns = 0.;
          real nor_coeff = 0.5;
          real tan_coeff = 0.7;
          real normal[3];
          int i, idim = dim;
          real NV_VEC(x);


          for (i = 0; i        normal[i] = f_normal[i];

          if (P_DIAM(p) >= 0.00012)
          {
              if (p->type == DPM_TYPE_INERT)
                  alpha = M_PI / 2. - acos(MAX(-1., MIN(1., NV_DOT(normal, P_VEL(p)) / MAX(NV_MAG(P_VEL(p)), DPM_SMALL))));
              if ((NNULLP(t)) && (THREAD_TYPE(t) == THREAD_F_WALL))
                  F_CENTROID(x, f, t);
              // calculate the normal component, rescale its magnitude by the coefficient of restitution and subtract the change 
              //Compute normal velocity. 
              
              for (i = 0; i            vn += P_VEL(p)[i] * normal[i];
              // Subtract off normal velocity. 
              for (i = 0; i            P_VEL(p)[i] -= vn*normal[i];
              // Apply tangential coefficient of restitution. 
              for (i = 0; i            P_VEL(p)[i] *= tan_coeff;
              // Add reflected normal velocity. 
              for (i = 0; i            P_VEL(p)[i] -= nor_coeff*vn*normal[i];
              // Store new velocity in P_VEL0 of particle 
              
              for (i = 0; i            P_VEL0(p)[i] = P_VEL(p)[i];
              return PATH_ACTIVE;
          }

          return PATH_ACTIVE;
          
      }

       

      Anyone could help me?

    • Rob
      Forum Moderator

      What did you set the interior DPM fate to be? 

    • jchen17
      Subscriber

      if (particle diameter > D_filter_size)

      {

      boundary condition is DPM_BC_REFLECT;

      }

      if (particle diameter < D_filter_size)

      {

      boundary condition DPM_BC_INTERIOR;

      }

      For interior DPM, it's just like the "porous jump" boundary, interior for DPM, and particles can pass through the boundary without anything happening ("filter" surface in my figure).

    • Rob
      Forum Moderator

      You set the result of the particle passing a location,  https://ansyshelp.ansys.com/account/Secured?returnurl=/Views/Secured/corp/v221/en/flu_udf/flu_udf_sec_define_dpm_bc.html  not the boundary condition on a surface. Remember DPM is tracked in the Lagrangian frame, not the Euler. 

      • jchen17
        Subscriber

        Thanks for your reply Rob, but I didnt get your meaning. What I would like to do is set the middle surface as porous jump boundary condition. for DPM, when big particles hit it, reflect, when small particle hit it, pass through.    if it's not "DEFINE_DPM_BC", what udf should I use? Thanks!

    • Rob
      Forum Moderator

      Example 3. 

Viewing 4 reply threads
  • The topic ‘DPM boundary UDF for a filter’ is closed to new replies.