


{"id":349834,"date":"2024-02-08T09:19:37","date_gmt":"2024-02-08T09:19:37","guid":{"rendered":"\/forum\/forums\/topic\/udf-for-phases-interactions\/"},"modified":"2024-02-08T09:21:20","modified_gmt":"2024-02-08T09:21:20","slug":"udf-for-phases-interactions","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/udf-for-phases-interactions\/","title":{"rendered":"UDF for multiphase flow"},"content":{"rendered":"<p>Good morning to everyone.<\/p>\n<p>I am simulating the flow field in a cylindrical 3D bubble column using the Eulerian-Eulerian approach.<\/p>\n<p>I need to define a drag coefficient that depends on the distance from the wall.&nbsp; My idea was to use the C_CENTROID macro to calculate the distance from the column centre and consequently define the drag coefficient, but it did not work.<\/p>\n<p>Can anyone help me?<\/p>\n<p>In the following, how I calculate the spatial coordinate to define the dependency of the drag coefficient on the radial coordinate.<\/p>\n<p><span style=\"font-size: 10pt\">begin_c_loop_all(c,t)<\/span><br \/><span style=\"font-size: 10pt\">&nbsp; &nbsp; {<\/span><br \/><span style=\"font-size: 10pt\">&nbsp; &nbsp; &nbsp; &nbsp; C_CENTROID(xc,c,t);<\/span><br \/><span style=\"font-size: 10pt\">&nbsp; &nbsp; &nbsp; &nbsp; r=pow(xc[0]*xc[0]+xc[2]*xc[2],0.5);&nbsp; \/\/distance from the column centre. The coordinate y is the column axis<br \/><\/span><span style=\"font-size: 10pt\">&nbsp; &nbsp; &nbsp; &nbsp; CD= a*r&nbsp; \/\/ just an example<br \/><\/span><span style=\"font-size: 10pt\">&nbsp; &nbsp; &nbsp; &nbsp;}<\/span><br \/><span style=\"font-size: 10pt\">end_c_loop_all(c,t)<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"template":"","class_list":["post-349834","topic","type-topic","status-closed","hentry","topic-tag-eulerian-multiphase","topic-tag-udf"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["137676","199"],"_bbp_author_ip":["96.7.218.223"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["580"],"_bbp_topic_status":["unanswered"],"_edit_lock":["1707384039:287384"],"_bbp_topic_id":["349834"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","137676"],"_bbp_voice_count":["2"],"_bbp_reply_count":["15"],"_bbp_last_reply_id":["350150"],"_bbp_last_active_id":["350150"],"_bbp_last_active_time":["2024-02-09 15:03:58"]},"test":"nicolo-varallopolimi-it"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/349834","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":1,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/349834\/revisions"}],"predecessor-version":[{"id":349837,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/349834\/revisions\/349837"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=349834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}