


{"id":161513,"date":"2021-08-23T02:36:57","date_gmt":"2021-08-23T02:36:57","guid":{"rendered":"\/forum\/forums\/topic\/problem-in-compiling-specific-heat-udf\/"},"modified":"2021-08-28T12:24:10","modified_gmt":"2021-08-28T12:24:10","slug":"problem-in-compiling-specific-heat-udf","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/problem-in-compiling-specific-heat-udf\/","title":{"rendered":"Problem in compiling specific heat UDF"},"content":{"rendered":"<div class=\"Item-Body\">\n<div class=\"Message userContent\">\n<p>Hello everyone. Please find below the specific heat UDF which I intend to compile in 2021R1 academic version of fluent. I receive the following error message shown in the image.&nbsp;<\/p>\n<p>ji.c<\/p>\n<p>&#8230;.srcji.c(81) : error C2143: syntax error : missing &#039;)&#039; before &#039;constant&#039;<\/p>\n<p>&#8230;.srcji.c(81) : error C2143: syntax error : missing &#039;{&#039; before &#039;constant&#039;<\/p>\n<p>&#8230;.srcji.c(81) : error C2059: syntax error : &#039;constant&#039;<\/p>\n<p>&#8230;.srcji.c(81) : error C2059: syntax error : &#039;)&#039;<\/p>\n<p>NMAKE : fatal error U1077: &#039;&quot;C:Program Files (x86)Microsoft Visual Studio 12.0VCBINx86_amd64cl.EXE&quot;&#039; : return code &#039;0x2&#039;<\/p>\n<p>Stop.<\/p>\n<p>Done.<\/p>\n<p><\/p>\n<\/p>\n<p>Line 81 is the very first&nbsp;line of my UDF.&nbsp;DEFINE_SPECIFIC_HEAT(my_udf_sp,T,Tref,h,yi), also mentioned in bold letter.<\/p>\n<p><\/p>\n<\/p>\n<p><strong>DEFINE_SPECIFIC_HEAT(my_udf_sp,T,Tref,h,yi)<\/strong><\/p>\n<p>{<\/p>\n<p>&nbsp;real Cp;<\/p>\n<p>real gamma;<\/p>\n<p>if (T &gt;= 298.0 &amp;&amp; T &lt;= 855.0)<\/p>\n<p>{<\/p>\n<p>gamma = 0;<\/p>\n<p>}<\/p>\n<p>else if (T &gt; 855.0 &amp;&amp; T &lt; 925.0)<\/p>\n<p> {<\/p>\n<p>gamma = (T &#8211; 855.0) \/ (925.0 &#8211; 855.0);<\/p>\n<p>}<\/p>\n<p>else if (T &gt;= 925.0 &amp;&amp; T&lt;=2790)<\/p>\n<p>{<\/p>\n<p>gamma = 1.0;<\/p>\n<p>}<\/p>\n<p>else<\/p>\n<p>{<\/p>\n<p> gamma = 0;<\/p>\n<p>}<\/p>\n<p>if (T &gt;= 298.0 &amp;&amp; T &lt;= 855.0)<\/p>\n<p>{<\/p>\n<p>Cp = 900.0 + 0.3*(T &#8211; 298.0);<\/p>\n<p>}<\/p>\n<p>else if (T &gt; 855.0 &amp;&amp; T &lt; 925.0)<\/p>\n<p>{<\/p>\n<p>Cp = (1 &#8211; gamma)*(900.0 + 0.3*(T &#8211; 298.0)) + gamma*1170.0;<\/p>\n<p>}<\/p>\n<p>else if (T &gt;=925.0)<\/p>\n<p>{<\/p>\n<p>Cp = 1170.0;<\/p>\n<p>}<\/p>\n<p>*h = Cp*(T &#8211; Tref);<\/p>\n<p>return Cp;<\/p>\n<p>}<\/p>\n<p><\/p>\n<\/p>\n<p>Can someone please help me in identifying the problem.?<\/p>\n<p>Thank you for your time and support.<\/p>\n","protected":false},"template":"","class_list":["post-161513","topic","type-topic","status-closed","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_author_ip":[""],"_bbp_view_count":["236"],"_bbp_likes_count":["0","0"],"_bbp_forum_subforum_count":["0"],"_btv_view_count":["562"],"_bbp_subscription":["246586"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["161513"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","22555","205540"],"_bbp_voice_count":["3"],"_bbp_reply_count":["7"],"_bbp_last_reply_id":["189683"],"_bbp_last_active_id":["189683"],"_bbp_last_active_time":["2021-08-28 12:24:10"]},"test":"wicky-malik88gmail-com"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/161513","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\/161513\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=161513"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}