


{"id":165422,"date":"2022-01-10T19:38:19","date_gmt":"2022-01-10T19:38:19","guid":{"rendered":"\/forum\/forums\/topic\/how-can-we-run-the-udf-codes-in-the-visual-studio-code\/"},"modified":"2022-01-11T17:42:07","modified_gmt":"2022-01-11T17:42:07","slug":"how-can-we-run-the-udf-codes-in-the-visual-studio-code","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/how-can-we-run-the-udf-codes-in-the-visual-studio-code\/","title":{"rendered":"How can we run the UDF codes in the Visual Studio Code."},"content":{"rendered":"<div class=\"Item-Body\">\n<div class=\"Message userContent\">\n<p>Dear Friends, <\/p>\n<p>I would like to write the program for my project using the UDF in Ansys 18.1. Generally, <\/p>\n<p>I write the c program in the notepad++ and interpret using the function&gt; interpreted&gt; browse (upload my c file)&gt; click on interpret. If everything works fine it shows me the link of path link in the TUI of Ansys. <\/p>\n<p>cpp -I&quot;C:PROGRA~1ANSYSI~1v181fluentfluent18.1.0\/src\/main&quot; &#8211;<\/p>\n<p>..<\/p>\n<p>..<\/p>\n<p>..<\/p>\n<p>-I&quot;C:PROGRA~1ANSYSI~1v181fluentfluent18.1.0\/cortex\/src&quot; -I&quot;C:PROGRA~1ANSYSI~1v181fluentfluent18.1.0\/client\/src&quot; -I&quot;C:PROGRA~1ANSYSI~1v181fluentfluent18.1.0\/multiport\/src&quot; -I. -DUDFCONFIG_H=&quot;&lt;udfconfig.h&gt;&quot; &quot;C:\/Users\/XXXX\/Desktop\/XXXbox\/1\/XXXXSimulation\/xxxxx\/Simulation\/Run05examp\/XXXX_UDF.c&quot;<\/p>\n<p>I moved forward to add this UDF into the boundary conditions. Can we use both compile and interpret functions in Ansys for any User-defined C program? <\/p>\n<p>A. When I used the compiled for the c program then I just use function&gt; compiled&gt;add (source fuel)&gt; build&gt; load (is it the right way ). Do I need to add something in header files too? Do we need to create a different library for each program?<\/p>\n<p>B. Can we use the visual studio code instead of the visual studio? will it make difference? I am using the latest visual studio code V1.63.2 available? I have installed already Code Runner and Mingw for the C compilation. <\/p>\n<div class=\"embedExternal embedImage\">\n<div class=\"embedExternal-content\">\n<a class=\"embedImage-link\" href=\"\/forum\/wp-content\/uploads\/forum-uploads\/187\/G76DCV8DK1E0.png\" rel=\"nofollow noopener\" target=\"_blank\"><br \/>\n<img decoding=\"async\" class=\"embedImage-img\" src=\"\/forum\/wp-content\/uploads\/forum-uploads\/187\/G76DCV8DK1E0.png\" alt=\"image.png\" \/><br \/>\n<\/a><\/p>\n","protected":false},"template":"","class_list":["post-165422","topic","type-topic","status-closed","hentry","topic-tag-C-1","topic-tag-cfd-udf-fleunt","topic-tag-udf-fluent","topic-tag-visual-studio-1","topic-tag-windows-compilers-1"],"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":["2962"],"_bbp_likes_count":["0"],"_bbp_subscription":["241431"],"_edit_lock":["1659342476:76739"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["165422"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","22555","166775"],"_bbp_voice_count":["3"],"_bbp_reply_count":["4"],"_bbp_last_reply_id":["202400"],"_bbp_last_active_id":["202400"],"_bbp_last_active_time":["2022-01-11 17:42:07"]},"test":"88134c33056105b8e0ece9694a640e55816f65a4"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/165422","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\/165422\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=165422"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}