


{"id":359420,"date":"2024-03-28T11:06:13","date_gmt":"2024-03-28T11:06:13","guid":{"rendered":"\/forum\/forums\/topic\/user-defined-function-error-invalid-type-for-binary-expression\/"},"modified":"2024-03-28T11:06:13","modified_gmt":"2024-03-28T11:06:13","slug":"user-defined-function-error-invalid-type-for-binary-expression","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/user-defined-function-error-invalid-type-for-binary-expression\/","title":{"rendered":"User Defined Function Error &#8211; Invalid type for binary expression"},"content":{"rendered":"<p>Hi everyone,<\/p>\n<p>I am trying to upload a User Defined Function to Ansys and it gives me the following error:<\/p>\n<p>line 18: invalid type for binary expression: int + pointer to structure.<\/p>\n<p>Here is the code that I am trying use:<\/p>\n<p>#include&#8221;udf.h&#8221;<br \/>DEFINE_PROPERTY(moving_wall, thread, u)<br \/>{<\/p>\n<p>\/* Declare variables *\/<br \/>float t, speed;<br \/>face_t f;<\/p>\n<p>\/* Get time *\/<br \/>t = RP_Get_Real(&#8220;flow-time&#8221;);<\/p>\n<p>\/* Calculate speed *\/<br \/>speed = 1.6 * sin(3.8 * t);<\/p>\n<p>\/* Apply speed to face *\/<br \/>begin_f_loop(f, thread)<br \/>{<br \/>F_PROFILE(f, thread, u) = speed;<br \/>}<br \/>end_f_loop(f, thread)<br \/>}<\/p>\n<p>*PS &#8211; I am new to Ansys and coding so please dont use any shorthand explanations, if possible.<\/p>\n<p>Thank you!<\/p>\n","protected":false},"template":"","class_list":["post-359420","topic","type-topic","status-closed","hentry","topic-tag-fluent","topic-tag-user-defined-functions"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["342421","2887"],"_bbp_author_ip":["23.52.43.81"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["436"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["359420"],"_bbp_forum_id":["27792"],"_bbp_engagement":["2887","342421"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["361167"],"_bbp_last_active_id":["361167"],"_bbp_last_active_time":["2024-04-08 16:51:34"]},"test":"15753433sun-ac-za"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/359420","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\/359420\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=359420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}