CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Reflect Condition dpm

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 11, 2019, 21:20
Default Reflect Condition dpm
  #1
New Member
 
Join Date: Apr 2019
Posts: 5
Rep Power: 7
FlavioC is on a distinguished road
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?
FlavioC is offline   Reply With Quote

Reply

Tags
condition, dpm, reflect, udf reflect


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Force DPM boundary conditions on a sliding interface zone? juliahartig FLUENT 0 May 31, 2018 17:43
Symmetry boundary condition + DPM sfn Fluent Multiphase 1 May 31, 2018 17:16
updating boundary condition after one iteration and permanently babakflame OpenFOAM Programming & Development 2 June 22, 2017 22:15
Time dependant pressure boundary condition yosuke1984 OpenFOAM Verification & Validation 3 May 6, 2015 06:16
CFX fails to calculate a diffuser pipe flow shenying0710 CFX 7 March 26, 2013 04:13


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