


{"id":223245,"date":"2022-08-04T07:53:10","date_gmt":"2022-08-04T07:53:10","guid":{"rendered":"\/forum\/?post_type=topic&#038;p=223245"},"modified":"2022-08-04T07:53:10","modified_gmt":"2022-08-04T07:53:10","slug":"dpm-boundary-udf-for-a-filter","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/dpm-boundary-udf-for-a-filter\/","title":{"rendered":"DPM boundary UDF for a filter"},"content":{"rendered":"<p>hi all, I&#8217;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.<\/p>\n<p>the figure is my results. I only tested small particles (in the code, it&#8217;s &lt; 120 um. big particles are fine, they can reflected) as can be seen, the particles trapped on the surface.<\/p>\n<p><img decoding=\"async\" src=\"\/forum\/wp-content\/uploads\/sites\/2\/2022\/08\/04-08-2022-1659599549-80um.JPG\" alt=\"\"><\/p>\n<p>What I&#8217;d like to do is<\/p>\n<p>if (particle diameter &gt; D_filter_size)<\/p>\n<p>{<\/p>\n<p>boundary condition is reflect;<\/p>\n<p>}<\/p>\n<p>if (particle diameter &lt; D_filter_size)<\/p>\n<p>{<\/p>\n<p>boundary condition interior;<\/p>\n<p>}<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>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 &lt; 120 um trapped on the surface.<\/p>\n<p>#include &#8220;udf.h&#8221;<br \/>#include &#8220;dpm.h&#8221;<br \/>#include &#8220;surf.h&#8221;<br \/>#include &#8220;random.h&#8221;<br \/>#include &lt;stdlib.h&gt;<br \/>#include &lt;time.h&gt;<br \/>\/*&nbsp;<br \/>define a user-defined dpm boundary condition routine<br \/>* bc_reflect: name<br \/>* p: the tracked particle<br \/>* t: the touched face thread<br \/>* f: the touched face<br \/>* f_normal: normal vector of touched face<br \/>* dim: dimension of the problem (2 in 2d and 2d-axi-swirl, 3 in 3d)<br \/>*<br \/>* return is the status of the particle, see enumeration of Path_Status<br \/>* in dpm.h<br \/>*\/<\/p>\n<p>&nbsp;<\/p>\n<p>DEFINE_DPM_BC(bc_filter, p, t, f, f_normal, dim)<br \/>{<br \/>&nbsp; &nbsp; real alpha; \/* angle of particle path with face normal *\/<br \/>&nbsp; &nbsp; real vn = 0.;<br \/>&nbsp; &nbsp; real vns = 0.;<br \/>&nbsp; &nbsp; real nor_coeff = 0.5;<br \/>&nbsp; &nbsp; real tan_coeff = 0.7;<br \/>&nbsp; &nbsp; real normal[3];<br \/>&nbsp; &nbsp; int i, idim = dim;<br \/>&nbsp; &nbsp; real NV_VEC(x);<\/p>\n<p>&nbsp; &nbsp; for (i = 0; i&lt;idim; i++)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; normal[i] = f_normal[i];<\/p>\n<p>&nbsp; &nbsp; if (P_DIAM(p) &gt;= 0.00012)<br \/>&nbsp; &nbsp; {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if (p-&gt;type == DPM_TYPE_INERT)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; alpha = M_PI \/ 2. &#8211; acos(MAX(-1., MIN(1., NV_DOT(normal, P_VEL(p)) \/ MAX(NV_MAG(P_VEL(p)), DPM_SMALL))));<br \/>&nbsp; &nbsp; &nbsp; &nbsp; if ((NNULLP(t)) &amp;&amp; (THREAD_TYPE(t) == THREAD_F_WALL))<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; F_CENTROID(x, f, t);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ calculate the normal component, rescale its magnitude by the coefficient of restitution and subtract the change&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/Compute normal velocity.&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; for (i = 0; i&lt;idim; i++)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vn += P_VEL(p)[i] * normal[i];<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Subtract off normal velocity.&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; for (i = 0; i&lt;idim; i++)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_VEL(p)[i] -= vn*normal[i];<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Apply tangential coefficient of restitution.&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; for (i = 0; i&lt;idim; i++)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_VEL(p)[i] *= tan_coeff;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Add reflected normal velocity.&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; for (i = 0; i&lt;idim; i++)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_VEL(p)[i] -= nor_coeff*vn*normal[i];<br \/>&nbsp; &nbsp; &nbsp; &nbsp; \/\/ Store new velocity in P_VEL0 of particle&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; for (i = 0; i&lt;idim; i++)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; P_VEL0(p)[i] = P_VEL(p)[i];<br \/>&nbsp; &nbsp; &nbsp; &nbsp; return PATH_ACTIVE;<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp; return PATH_ACTIVE;<br \/>&nbsp; &nbsp;&nbsp;<br \/>}<\/p>\n<p>&nbsp;<\/p>\n<p>Anyone could help me?<\/p>\n","protected":false},"template":"","class_list":["post-223245","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"hi all, I&#039;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\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/dpm-boundary-udf-for-a-filter\/\" \/>\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=\"DPM boundary UDF for a filter | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"hi all, I&#039;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\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/dpm-boundary-udf-for-a-filter\/\" \/>\n\t\t<meta property=\"og:image\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forum\/wp-content\/uploads\/sites\/2\/2022\/08\/04-08-2022-1659599549-80um.JPG\" \/>\n\t\t<meta property=\"og:image:secure_url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forum\/wp-content\/uploads\/sites\/2\/2022\/08\/04-08-2022-1659599549-80um.JPG\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2022-08-04T07:53:10+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2022-08-04T07:53:10+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"DPM boundary UDF for a filter | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"hi all, I&#039;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\" \/>\n\t\t<meta name=\"twitter:image\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forum\/wp-content\/uploads\/sites\/2\/2022\/08\/04-08-2022-1659599549-80um.JPG\" \/>\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\\\/dpm-boundary-udf-for-a-filter\\\/#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\\\/dpm-boundary-udf-for-a-filter\\\/#listItem\",\"name\":\"DPM boundary UDF for a filter\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/dpm-boundary-udf-for-a-filter\\\/#listItem\",\"position\":3,\"name\":\"DPM boundary UDF for a filter\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}}]},{\"@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\\\/dpm-boundary-udf-for-a-filter\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/dpm-boundary-udf-for-a-filter\\\/\",\"name\":\"DPM boundary UDF for a filter | Ansys Learning Forum\",\"description\":\"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\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/dpm-boundary-udf-for-a-filter\\\/#breadcrumblist\"},\"datePublished\":\"2022-08-04T07:53:10+00:00\",\"dateModified\":\"2022-08-04T07:53:10+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":"DPM boundary UDF for a filter | Ansys Learning Forum","description":"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","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/dpm-boundary-udf-for-a-filter\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/dpm-boundary-udf-for-a-filter\/#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\/dpm-boundary-udf-for-a-filter\/#listItem","name":"DPM boundary UDF for a filter"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/dpm-boundary-udf-for-a-filter\/#listItem","position":3,"name":"DPM boundary UDF for a filter","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}}]},{"@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\/dpm-boundary-udf-for-a-filter\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/dpm-boundary-udf-for-a-filter\/","name":"DPM boundary UDF for a filter | Ansys Learning Forum","description":"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","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/dpm-boundary-udf-for-a-filter\/#breadcrumblist"},"datePublished":"2022-08-04T07:53:10+00:00","dateModified":"2022-08-04T07:53:10+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":"DPM boundary UDF for a filter | Ansys Learning Forum","og:description":"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","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/dpm-boundary-udf-for-a-filter\/","og:image":"https:\/\/innovationspace.ansys.com\/forum\/forum\/wp-content\/uploads\/sites\/2\/2022\/08\/04-08-2022-1659599549-80um.JPG","og:image:secure_url":"https:\/\/innovationspace.ansys.com\/forum\/forum\/wp-content\/uploads\/sites\/2\/2022\/08\/04-08-2022-1659599549-80um.JPG","article:published_time":"2022-08-04T07:53:10+00:00","article:modified_time":"2022-08-04T07:53:10+00:00","twitter:card":"summary_large_image","twitter:title":"DPM boundary UDF for a filter | Ansys Learning Forum","twitter:description":"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","twitter:image":"https:\/\/innovationspace.ansys.com\/forum\/forum\/wp-content\/uploads\/sites\/2\/2022\/08\/04-08-2022-1659599549-80um.JPG"},"aioseo_meta_data":{"post_id":"223245","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 19:12:34","updated":"2024-10-28 19:12:34","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\tDPM boundary UDF for a filter\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":"DPM boundary UDF for a filter","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/dpm-boundary-udf-for-a-filter\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_author_ip":["23.218.93.111"],"_bbp_subscription":["181230","199"],"_btv_view_count":["1103"],"_bbp_likes_count":["1"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["223245"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","181230"],"_bbp_voice_count":["2"],"_bbp_reply_count":["5"],"_bbp_last_reply_id":["230848"],"_bbp_last_active_id":["230848"],"_bbp_last_active_time":["2022-08-10 10:37:50"]},"test":"jchen17"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/223245","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\/223245\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=223245"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}