


{"id":289988,"date":"2023-06-22T16:01:07","date_gmt":"2023-06-22T16:01:07","guid":{"rendered":"\/forum\/forums\/topic\/user-defined-function-not-working-as-intended\/"},"modified":"2023-06-22T16:01:07","modified_gmt":"2023-06-22T16:01:07","slug":"user-defined-function-not-working-as-intended","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/user-defined-function-not-working-as-intended\/","title":{"rendered":"User Defined Function not working as Intended"},"content":{"rendered":"<p>Shown below is contour plot of the mole fraction of a gas traveling from left to right.&nbsp;<\/p>\n<p>I am attempting to simulate the gas in question permeating into the circular holes (gas 1). A second gas is also permeating out on a 1:1 molar basis, &#8216;swapping&#8217; with the first gas (gas 2). 3 user defined functions have been made to mimic this behavior. One handles gas 1 permeating into the circles, the second handles gas 2 permeating out from the circles and the third is applied to the mass source term to handle the difference in molecular masses.&nbsp;<\/p>\n<p>I have run this simulation numerous times and get reasonable results until my fluid flows beyond my last row of circles. Both gas 1 and gas 2 sharply decrease at this point even though there is no surface that has the udf applied to it. I created multiple vertical planes at various points along the flow and used &#8220;Surface Report &#8211; Mass Weighted Average&#8221; to find mass percent&rsquo;s of both gas 1 and gas 2.&nbsp;<\/p>\n<p class=\"MsoNormal\">I would appreciate any guidance on what could be causing my issue.&nbsp;<\/p>\n<p class=\"MsoNormal\">Thank You&nbsp;<\/p>\n<p><img decoding=\"async\" src=\"\/forum\/wp-content\/uploads\/sites\/2\/2023\/06\/22-06-2023-1687448867-Capture.PNG\" alt=\"\"><\/p>\n","protected":false},"template":"","class_list":["post-289988","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["62419","199"],"_bbp_author_ip":["23.217.200.46"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["178"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["289988"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","62419"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["290085"],"_bbp_last_active_id":["290085"],"_bbp_last_active_time":["2023-06-23 13:20:20"]},"test":"ben-mccuenlunalabs-us"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/289988","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\/289988\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=289988"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}