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

questions about the UDF( DEFINE_DPM_BC )

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 2, 2019, 01:38
Default questions about the UDF( DEFINE_DPM_BC )
  #1
New Member
 
Jim
Join Date: Jun 2019
Posts: 6
Rep Power: 7
CrystalEternity is on a distinguished road
The following program is an example from the help document.When I wanted to use it, some problems bothered me.
1.f_normal contains the unit vector which is normal to the face,but in or out?(maybe it doesn't matter,I just want to know it)
2.if(p->type==DPM_TYPE_INERT)
I know: #define DPM_TYPE_INERT 1(from dpm_types.h)
P-> structural member (the number"1" passed by FLUENT
indicates the particle type, only in my opinion)
So,Is the particle type only for INERT particles to execute the program?
To "p->type" ,is it assigned to 1?
3.if ((NNULLP(t)) && (THREAD_TYPE(t) == THREAD_F_WALL))
F_CENTROID(x,f,t);
how to understand it?

Maybe my problem will be naive, but for me as a beginner, it is really important.I hope to get help, but whatever the result, I appreciate your browsing and thinking.
Thanks again!


/* reflect boundary condition for inert particles */
#include "udf.h"
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_POS(p)[1]*P_POS(p)[1] +
P_POS(p)[2]*P_POS(p)[2]);
if (R > 1.e-20)
{
idim = 3;
normal[0] = f_normal[0];
normal[1] = (f_normal[1]*P_POS(p)[1])/R;
normal[2] = (f_normal[1]*P_POS(p)[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_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<idim; i++)
vn += P_VEL(p)[i]*normal[i];

/* Subtract off normal velocity. */
for(i=0; i<idim; i++)
P_VEL(p)[i] -= vn*normal[i];

/* Apply tangential coefficient of restitution. */
for(i=0; i<idim; i++)
P_VEL(p)[i] *= tan_coeff;

/* Add reflected normal velocity. */
for(i=0; i<idim; i++)
P_VEL(p)[i] -= nor_coeff*vn*normal[i];

/* Store new velocity in P_VEL0 of particle */
for(i=0; i<idim; i++)
P_VEL0(p)[i] = P_VEL(p)[i];

return PATH_ACTIVE;
}
return PATH_ABORT;
}
CrystalEternity is offline   Reply With Quote

Old   June 8, 2019, 23:00
Default
  #2
New Member
 
Jim
Join Date: Jun 2019
Posts: 6
Rep Power: 7
CrystalEternity is on a distinguished road
Is there anyone who can help answer these questions
CrystalEternity is offline   Reply With Quote

Reply

Tags
define_dpm_bc, fluent, udf


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
udf for valve closing a pipe using dynamic mesh chem engineer Fluent UDF and Scheme Programming 2 May 13, 2017 10:39
some questions about the udf for specificed heat in the FLUENT 14.5 V uuusheng Fluent UDF and Scheme Programming 0 July 8, 2014 14:33
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
some questions about DPM and UDF zhaoxinyu Fluent UDF and Scheme Programming 0 April 29, 2010 10:01
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 05:03


All times are GMT -4. The time now is 16:20.