


{"id":160700,"date":"2021-07-26T14:18:49","date_gmt":"2021-07-26T14:18:49","guid":{"rendered":"\/forum\/forums\/topic\/udf-about-accessing-solid-temperature-data\/"},"modified":"2021-07-27T07:44:51","modified_gmt":"2021-07-27T07:44:51","slug":"udf-about-accessing-solid-temperature-data","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/udf-about-accessing-solid-temperature-data\/","title":{"rendered":"UDF about accessing Solid temperature data"},"content":{"rendered":"<div class=\"Item-Body\">\n<div class=\"Message userContent\">\n<p>Hi,<\/p>\n<p>I have 2 zones in the same position which contains solid type and fluid type zone simultaneously by using TUI command:<\/p>\n<p>mesh\/modify-zones\/copy-move-cell-zone<\/p>\n<p>Assuming the boundary condition is set well, I&#039;m trying using UDF to access solid zone temperature data mentioned through C_T(c,t) macro. However, I found that I get fluid temperature data while debugging.<\/p>\n<p>According to UDF MANUAL, UDF can access &quot;Flow variable&quot; by using C_T ,C_R, etc . Therefore , I&#039;m wondering if there&#039;s any way to access solid temperature data of each cell? <\/p>\n<p>Thanks,<\/p>\n<p>Here&#039;s simply UDF code:<\/p>\n<p>DEFINE_SOURCE&nbsp;(Porous_solid_energy,&nbsp;c,&nbsp;t,&nbsp;dS,&nbsp;eqn)<\/p>\n<p>{<\/p>\n<p>&nbsp;&nbsp; real&nbsp;source;&nbsp;\/\/&nbsp;Heat&nbsp;flux&nbsp;between&nbsp;Porous&nbsp;solid&nbsp;and&nbsp;Porous&nbsp;fluid&nbsp;source&nbsp;term<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;real&nbsp;TS&nbsp;=C_T(c,t)&nbsp;&nbsp;;&nbsp;\/\/Solid&nbsp;temperature<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;real&nbsp;TF&nbsp;=&nbsp;100&nbsp;;&nbsp;\/\/Fluid&nbsp;temperature<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;source&nbsp;&nbsp;=&nbsp;&nbsp;0.0; \/\/ Ignore<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;dS[eqn]&nbsp;=&nbsp;0.0; \/\/ Ignore<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;Message(&quot;TS&nbsp;=&nbsp;%g&nbsp;<br \/>\n&quot;,C_T(c,t));&nbsp;<\/p>\n<p>&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;source;<\/p>\n<p>}<\/p>\n","protected":false},"template":"","class_list":["post-160700","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_author_ip":[""],"_bbp_old_reply_author_name_id":["Anonymous"],"_bbp_old_is_reply_anonymous_id":["false"],"_btv_view_count":["698"],"_bbp_likes_count":["0"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["160700"],"_bbp_forum_id":["27792"],"_bbp_engagement":["22555","187703"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["186720"],"_bbp_last_active_id":["186720"],"_bbp_last_active_time":["2021-07-27 07:44:51"]},"test":"eric_lee"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/160700","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\/160700\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=160700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}