


{"id":387689,"date":"2024-10-01T14:30:33","date_gmt":"2024-10-01T14:30:33","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/"},"modified":"2024-10-01T14:30:33","modified_gmt":"2024-10-01T14:30:33","slug":"particle-count-issue","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/","title":{"rendered":"Particle count issue"},"content":{"rendered":"<p>&lt;p&gt;Hello,&lt;\/p&gt;&lt;p&gt;I have written a UDF where I count the number of particles that hit a wall and gets stuck to it under certain conditions.&nbsp;&lt;\/p&gt;&lt;p&gt;I see that the number of particles hitting this wall is 22k while I only count 4.5k particles at the inlet. Why do you think this might be happening?&lt;\/p&gt;&lt;div&gt;&lt;div&gt;\/* reflect boundary condition for inert particles *\/&lt;\/div&gt;&lt;div&gt;#include &lt;stdlib.h&gt;&lt;\/div&gt;&lt;div&gt;#include &#8220;udf.h&#8221;&lt;\/div&gt;&lt;div&gt;#include &#8220;dpm.h&#8221;&lt;\/div&gt;&lt;div&gt;#include &#8220;mem.h&#8221;&lt;\/div&gt;&lt;div&gt;#include &#8220;sg.h&#8221;&lt;\/div&gt;&lt;div&gt;#include &#8220;stdio.h&#8221;&lt;\/div&gt;&lt;div&gt;#include &#8220;math.h&#8221;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;#define g -9.81&lt;\/div&gt;&lt;div&gt;#define mu 0.5&lt;\/div&gt;&lt;div&gt;#define NUM_UDM 7&lt;\/div&gt;&lt;div&gt;#define PI 3.141592654&lt;\/div&gt;&lt;br&gt;&lt;br&gt;&lt;div&gt;FILE *fp1;&lt;\/div&gt;&lt;div&gt;FILE *fp2;&lt;\/div&gt;&lt;div&gt;FILE *fp3;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;real FD(real diam, real velocidad)&lt;\/div&gt;&lt;div&gt;{&lt;\/div&gt;&lt;div&gt;&nbsp; return ((1\/2) * 1.225 * 0.44 * M_PI*(((diam)*(diam))\/4) * (velocidad*velocidad));&lt;\/div&gt;&lt;div&gt;}&lt;\/div&gt;&lt;br&gt;&lt;div&gt;DEFINE_DPM_BC(bc_reflect,p,t,f,f_normal,dim)&lt;\/div&gt;&lt;div&gt;{&lt;\/div&gt;&lt;div&gt;&nbsp; real alpha; &nbsp;\/* angle of particle path with face normal *\/&lt;\/div&gt;&lt;div&gt;&nbsp; real vn=0.;&lt;\/div&gt;&lt;div&gt;&nbsp; real nor_coeff = 1.;&lt;\/div&gt;&lt;div&gt;&nbsp; real tan_coeff = 0.3;&lt;\/div&gt;&lt;div&gt;&nbsp; real normal[3];&lt;\/div&gt;&lt;div&gt;&nbsp; int i, idim = dim;&lt;\/div&gt;&lt;div&gt;&nbsp; \/\/real NV_VEC(x);&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; real posx, posy, posz;&lt;\/div&gt;&lt;div&gt;&nbsp; \/\/ real NV_VEC(x);&lt;\/div&gt;&lt;div&gt;&nbsp; real x[ND_ND];&lt;\/div&gt;&lt;div&gt;&nbsp; real A[ND_ND];&lt;\/div&gt;&lt;div&gt;&nbsp; Domain* d;&lt;\/div&gt;&lt;div&gt;&nbsp; real Area;&lt;\/div&gt;&lt;div&gt;&nbsp; real Flux_density, tem_MFR;&lt;\/div&gt;&lt;div&gt;&nbsp; real tem_MFR_2, Flux_density_2, Area_2;&lt;\/div&gt;&lt;div&gt;&nbsp; \/\/ FILE *fp1;&lt;\/div&gt;&lt;div&gt;&nbsp; real w, drag_force, F, nf, ff, ff123;&lt;\/div&gt;&lt;div&gt;&nbsp; Thread *tcell = P_CELL_THREAD(p);&lt;\/div&gt;&lt;div&gt;&nbsp; cell_t c = P_CELL(p);&lt;\/div&gt;&lt;div&gt;&nbsp; real relVel[ND_3], dvtdn, fluidVel[ND_3];&lt;\/div&gt;&lt;br&gt;&lt;br&gt;&lt;div&gt;&nbsp; \/\/ mass of particles&lt;\/div&gt;&lt;div&gt;&nbsp; real tem_particle_dia = 0;&lt;\/div&gt;&lt;br&gt;&lt;br&gt;&lt;div&gt;&nbsp; NV_D(fluidVel, =, C_U(c, tcell), C_V(c, tcell), C_W(c, tcell)); &nbsp; &nbsp; \/\/assigning fluid velocity components to vector&lt;\/div&gt;&lt;div&gt;&nbsp; NV_VV(relVel, =, fluidVel, -, P_VEL(p)); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\/\/calculating relative velocity of flow on particle by subtracting absolute particle velocity from fluid velocity&lt;\/div&gt;&lt;div&gt;&nbsp; dvtdn = NV_MAG(relVel); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/calculation of relative velocity magnitude&lt;\/div&gt;&lt;div&gt;&nbsp; \/\/ P_USER_REAL(p, 0) = FD(drag_force, C_MU_L(c, tcell), P_RHO(p), P_DIAM(p), P_MASS(p), dvtdn); \/*Drag force*\/&lt;\/div&gt;&lt;div&gt;&nbsp; P_USER_REAL(p, 0) = FD(P_DIAM(p), dvtdn); \/*Drag force*\/&lt;\/div&gt;&lt;div&gt;&nbsp; P_USER_REAL(p, 1) = dvtdn;&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; \/\/ fprintf( fp1 , &#8220;%e %f %e %f %f %e %e\\n&#8221;, P_USER_REAL(p, 0), P_USER_REAL(p, 1), P_USER_REAL(p, 2), drag_force, P_DIAM(p), F, P_USER_REAL(p, 3));&lt;\/div&gt;&lt;div&gt;&nbsp; real diameter_squared = P_DIAM(p) * P_DIAM(p);&lt;\/div&gt;&lt;div&gt;&nbsp; real area_term = (diameter_squared) \/ 4;&lt;\/div&gt;&lt;div&gt;&nbsp; real velocity_term = dvtdn * dvtdn;&lt;\/div&gt;&lt;div&gt;&nbsp; real constant_factor = (1.0 \/ 2.0) * 1.225 * 0.3 * PI;&lt;\/div&gt;&lt;div&gt;&nbsp; F = constant_factor * area_term * velocity_term * (10000000);&lt;\/div&gt;&lt;div&gt;&nbsp; P_USER_REAL(p, 2) = F;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; nf = C_P(c, tcell) * (PI \/ 4.0) * diameter_squared *10000000;&lt;\/div&gt;&lt;div&gt;&nbsp; ff = mu * nf;&lt;\/div&gt;&lt;div&gt;&nbsp; ff123 = ff;&lt;\/div&gt;&lt;div&gt;&nbsp; P_USER_REAL(p, 3) = ff123;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; fp1=fopen (&#8220;Impact-2-drag-data-mod.txt&#8221; , &#8220;a&#8221;);&lt;\/div&gt;&lt;div&gt;&nbsp; fprintf(fp1, &#8220;Area Term: %e, Velocity Term: %e, F (final): %e, Constant factor: %e, friction force: %e, Normal force: %e\\n&#8221;, area_term, velocity_term, P_USER_REAL(p, 2), constant_factor, P_USER_REAL(p, 3), nf);&lt;\/div&gt;&lt;div&gt;&nbsp; fprintf(fp1, &#8220;Pressure: %e, &nbsp;ff123: %e\\n&#8221;, C_P(c, tcell), ff123);&lt;\/div&gt;&lt;div&gt;&nbsp; fclose(fp1);&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; Message(&#8220;Inside the first section&#8221;);&lt;\/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div&gt;&nbsp;#if RP_2D&lt;\/div&gt;&lt;div&gt;&nbsp; \/* dim is always 2 in 2D compilation. Need special treatment for 2d&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp;axisymmetric and swirl flows *\/&lt;\/div&gt;&lt;div&gt;&nbsp; if (rp_axi_swirl)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; real R = sqrt(P_POS(p)[1]*P_POS(p)[1] +&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_POS(p)[2]*P_POS(p)[2]);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; if (R &gt; 1.e-20)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; idim = 3;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; normal[0] = f_normal[0];&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; normal[1] = (f_normal[1]*P_POS(p)[1])\/R;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; normal[2] = (f_normal[1]*P_POS(p)[2])\/R;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; }&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; else&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for (i=0; i&lt;idim; i++)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; normal[i] = f_normal[i];&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; }&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; }&lt;\/div&gt;&lt;div&gt;&nbsp; else&lt;\/div&gt;&lt;div&gt;&nbsp;#endif&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; for (i=0; i&lt;idim; i++)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; normal[i] = f_normal[i];&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; if(p-&gt;type==DPM_TYPE_INERT)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; {&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; if (fabs(P_USER_REAL(p, 2)) &lt; fabs(P_USER_REAL(p, 3)))&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; \/\/ Particle bounce: Aerodynamic force &gt; Pressure force on particle. So particle must be resuspended to the flow.&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; {&lt;\/div&gt;&lt;br&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; for(i=0; i&lt;dim; i++)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_VEL(p)[i] = 0;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_USER_REAL(p, 7) += 1.;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; posx = P_POS(p)[0];&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; posy = P_POS(p)[1];&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; posz = P_POS(p)[2];&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_USER_REAL(p, 4) = posx;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_USER_REAL(p, 5) = posy;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_USER_REAL(p, 6) = posz;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C_UDMI(c, tcell, 0) += 1.0;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C_UDMI(c, tcell, 1) += P_FLOW_RATE(p);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/P_USER_REAL(p, 8) += P_FLOW_RATE(p);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; tem_MFR = P_FLOW_RATE(p);&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; F_AREA(A,f,t);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Area=NV_MAG(A);&lt;\/div&gt;&lt;br&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/\/ why do you have tem_MFR instead of&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Flux_density = tem_MFR\/ Area;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; C_UDMI(c, tcell, 2) = Flux_density;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fp2=fopen (&#8220;Impact-Stick-mod.txt&#8221; , &#8220;a&#8221;);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fprintf(fp2 , &#8220;tem_MFR: %e, Area: %e, Particle flux density: %f, Force due to aero (Fa): %f, Friction force (ff): %f, How many stick? = %f, x coordinate: %f, y coorfdinate: %f, z coordinate: %f\\n&#8221;, tem_MFR, Area, Flux_density, P_USER_REAL(p, 2), P_USER_REAL(p, 3), P_USER_REAL(p, 7), P_USER_REAL(p, 4), P_USER_REAL(p, 5), P_USER_REAL(p, 6));&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fflush(fp2);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fclose(fp2);&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return PATH_ABORT;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; }&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; else&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; {&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; alpha = M_PI\/2. &#8211; acos(MAX(-1.,MIN(1.,NV_DOT(normal,P_VEL(p))\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MAX(NV_MAG(P_VEL(p)),DPM_SMALL))));&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; if ((NNULLP(t)) &amp;&amp; (THREAD_TYPE(t) == THREAD_F_WALL))&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; F_CENTROID(x,f,t);&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* calculate the normal component, rescale its magnitude by&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; the coefficient of restitution and subtract the change *\/&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* Compute normal velocity. *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; for(i=0; i&lt;idim; i++)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vn += P_VEL(p)[i]*normal[i];&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* Subtract off normal velocity. *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; for(i=0; i&lt;idim; i++)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_VEL(p)[i] -= vn*normal[i];&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* Apply tangential coefficient of restitution. *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; for(i=0; i&lt;idim; i++)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_VEL(p)[i] *= tan_coeff;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* Add reflected normal velocity. *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; for(i=0; i&lt;idim; i++)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_VEL(p)[i] -= nor_coeff*vn*normal[i]; &nbsp;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; \/* Store new velocity in P_VEL0 of particle *\/&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; for(i=0; i&lt;idim; i++)&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_VEL0(p)[i] = P_VEL(p)[i];&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; C_UDMI(c, tcell, 3) += 1.0;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; C_UDMI(c, tcell, 4) += P_FLOW_RATE(p);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; P_USER_REAL(p, 8) += P_FLOW_RATE(p);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; tem_MFR_2 = P_FLOW_RATE(p);&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; F_AREA(A,f,t);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; Area_2=NV_MAG(A);&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; Flux_density_2 = tem_MFR_2\/ Area_2;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; C_UDMI(c, tcell, 5) = Flux_density_2;&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; P_USER_REAL(p, 9) += 1.;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; fp3=fopen (&#8220;Impact-Bounce-mod.txt&#8221; , &#8220;a&#8221;) ;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; fprintf(fp3 ,&#8221;Force due to aero (Fa): %f, Friction force (ff): %f, Number of particles bounced: %f\\n&#8221;, P_USER_REAL(p, 2), P_USER_REAL(p, 3), P_USER_REAL(p, 8));&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; fflush(fp3);&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; fclose(fp3);&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; &nbsp; return PATH_ACTIVE;&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; &nbsp; }&lt;\/div&gt;&lt;div&gt;&nbsp; }&lt;\/div&gt;&lt;br&gt;&lt;div&gt;&nbsp; return PATH_ABORT;&lt;\/div&gt;&lt;div&gt;}&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;I tried debugging this but I do not seem to understand why this might happen, your suggestions would be greatly appreciated.&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;Thanks,&lt;br&gt;Kiran&lt;\/div&gt;&lt;\/div&gt;<\/p>\n","protected":false},"template":"","class_list":["post-387689","topic","type-topic","status-publish","hentry","topic-tag-dpm","topic-tag-udf"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"Hello,I have written a UDF where I count the number of particles that hit a wall and gets stuck to it under certain conditions. I see that the number of particles hitting this wall is 22k while I only count 4.5k particles at the inlet. Why do you think this might be happening?\/* reflect boundary condition\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Learning Forum | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Particle count issue | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"Hello,I have written a UDF where I count the number of particles that hit a wall and gets stuck to it under certain conditions. I see that the number of particles hitting this wall is 22k while I only count 4.5k particles at the inlet. Why do you think this might be happening?\/* reflect boundary condition\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-10-01T14:30:33+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-10-01T14:30:33+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Particle count issue | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Hello,I have written a UDF where I count the number of particles that hit a wall and gets stuck to it under certain conditions. I see that the number of particles hitting this wall is 22k while I only count 4.5k particles at the inlet. Why do you think this might be happening?\/* reflect boundary condition\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/particle-count-issue\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/udf\\\/#listItem\",\"name\":\"udf\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/udf\\\/#listItem\",\"position\":3,\"name\":\"udf\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/udf\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/particle-count-issue\\\/#listItem\",\"name\":\"Particle count issue\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/particle-count-issue\\\/#listItem\",\"position\":4,\"name\":\"Particle count issue\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic-tag\\\/udf\\\/#listItem\",\"name\":\"udf\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/particle-count-issue\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/particle-count-issue\\\/\",\"name\":\"Particle count issue | Ansys Learning Forum\",\"description\":\"Hello,I have written a UDF where I count the number of particles that hit a wall and gets stuck to it under certain conditions. I see that the number of particles hitting this wall is 22k while I only count 4.5k particles at the inlet. Why do you think this might be happening?\\\/* reflect boundary condition\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/particle-count-issue\\\/#breadcrumblist\"},\"datePublished\":\"2024-10-01T14:30:33+00:00\",\"dateModified\":\"2024-10-01T14:30:33+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"Particle count issue | Ansys Learning Forum","description":"Hello,I have written a UDF where I count the number of particles that hit a wall and gets stuck to it under certain conditions. I see that the number of particles hitting this wall is 22k while I only count 4.5k particles at the inlet. Why do you think this might be happening?\/* reflect boundary condition","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/forum","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","position":2,"name":"Topics","item":"https:\/\/innovationspace.ansys.com\/forum\/topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/udf\/#listItem","name":"udf"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/udf\/#listItem","position":3,"name":"udf","item":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/udf\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/#listItem","name":"Particle count issue"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/#listItem","position":4,"name":"Particle count issue","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/udf\/#listItem","name":"udf"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization","name":"Ansys Learning Forum","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/forum\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/","name":"Particle count issue | Ansys Learning Forum","description":"Hello,I have written a UDF where I count the number of particles that hit a wall and gets stuck to it under certain conditions. I see that the number of particles hitting this wall is 22k while I only count 4.5k particles at the inlet. Why do you think this might be happening?\/* reflect boundary condition","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/#breadcrumblist"},"datePublished":"2024-10-01T14:30:33+00:00","dateModified":"2024-10-01T14:30:33+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/forum\/#website","url":"https:\/\/innovationspace.ansys.com\/forum\/","name":"Ansys Learning Forum","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Learning Forum | Ansys Innovation Space","og:type":"article","og:title":"Particle count issue | Ansys Learning Forum","og:description":"Hello,I have written a UDF where I count the number of particles that hit a wall and gets stuck to it under certain conditions. I see that the number of particles hitting this wall is 22k while I only count 4.5k particles at the inlet. Why do you think this might be happening?\/* reflect boundary condition","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/","article:published_time":"2024-10-01T14:30:33+00:00","article:modified_time":"2024-10-01T14:30:33+00:00","twitter:card":"summary_large_image","twitter:title":"Particle count issue | Ansys Learning Forum","twitter:description":"Hello,I have written a UDF where I count the number of particles that hit a wall and gets stuck to it under certain conditions. I see that the number of particles hitting this wall is 22k while I only count 4.5k particles at the inlet. Why do you think this might be happening?\/* reflect boundary condition"},"aioseo_meta_data":{"post_id":"387689","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"content","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":true,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2024-10-28 16:25:20","updated":"2024-10-28 16:25:20","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/topics\/\" title=\"Topics\">Topics<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/udf\/\" title=\"udf\">udf<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tParticle count issue\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/forum"},{"label":"Topics","link":"https:\/\/innovationspace.ansys.com\/forum\/topics\/"},{"label":"udf","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic-tag\/udf\/"},{"label":"Particle count issue","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/particle-count-issue\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["288381","199"],"_bbp_author_ip":["2607:fea8:7a61:4800:ed39:eb63:e43a:4a08"],"_btv_view_count":["295"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["387689"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","288381"],"_bbp_voice_count":["2"],"_bbp_reply_count":["3"],"_bbp_last_reply_id":["387827"],"_bbp_last_active_id":["387827"],"_bbp_last_active_time":["2024-10-02 13:10:29"]},"test":"kiran-purushothamakeshavanontariotechu-net"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/387689","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics"}],"about":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/387689\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=387689"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}