CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Reflect Condition dpm (https://www.cfd-online.com/Forums/fluent-udf/217425-reflect-condition-dpm.html)

FlavioC May 11, 2019 21:20

Reflect Condition dpm
 
Hello to everyone. I am studying the reflect condition for inert particles, I use the code that appears in the udf fluent manual

Code:

DEFINE_DPM_BC(bc_reflect,p,t,f,f_normal,dim)
{
  real alpha;
  /* angle of particle path with face normal */
  real vn=0.;
  real nor_coeff = 1.;
  real tan_coeff = 0.3;
  real normal[3];
  int i, idim = dim;   
  real NV_VEC(x);
  #if RP_2D
  /* dim is always 2 in 2D compilation. Need special treatment for 2d axisymmetric and swirl flows */
  if (rp_axi_swirl)
  {
      real R = sqrt(p->state.pos[1]*p->state.pos[1] + p->state.pos[2]*p->state.pos[2]);
      if (R > 1.e-20)
      {
        idim = 3;
        normal[0] = f_normal[0];
        normal[1] = (f_normal[1]*p->state.pos[1])/R;
        normal[2] = (f_normal[1]*p->state.pos[2])/R;
      }
      else
      {
        for (i=0; i<idim; i++)
        normal[i] = f_normal[i];
      }
  }
  else
  #endif
  for (i=0; i<idim; i++)
  normal[i] = f_normal[i];
  if(p->type==DPM_TYPE_INERT)
  {
      alpha = M_PI/2. - acos(MAX(-1.,MIN(1.,NV_DOT(normal,p->state.V)/ MAX(NV_MAG(p->state.V),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<idim; i++)
      vn += p->state.V[i]*normal[i];
      /* Subtract off normal velocity. */
      for(i=0; i<idim; i++)
      p->state.V[i] -= vn*normal[i];
      /* Apply tangential coefficient of restitution. */
      for(i=0; i<idim; i++)
      p->state.V[i] *= tan_coeff;
      /* Add reflected normal velocity. */
      for(i=0; i<idim; i++)
      p->state.V[i] -= nor_coeff*vn*normal[i]; 
      /* Store new velocity in state0 of particle */
      for(i=0; i<idim; i++)
      p->state0.V[i] = p->state.V[i];
      return PATH_ACTIVE;
  }
  return PATH_ABORT;
}

But I change the tangent coefficient value setting it to one since the collision should be elastic. Then, I compare the particles trajectories using the UDF and the boundary condition type :reflect. The trajectories are so different. Can someone please explain it to me?


All times are GMT -4. The time now is 14:56.