


{"id":379704,"date":"2024-08-21T18:44:34","date_gmt":"2024-08-21T18:44:34","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/"},"modified":"2024-08-21T18:44:34","modified_gmt":"2024-08-21T18:44:34","slug":"erro-when-trying-to-write-a-txt-file-using-udf","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/","title":{"rendered":"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF"},"content":{"rendered":"<p>I want to get the heat flux values for a p20 steel solid 2d rectangular shape. I want the values for each node in the y-axis written in a .txt file. Whenever I compiled my udf it builds but when loading I get this error.<\/p>\n<p><span>ERROR: The UDF library you are trying to load (libudf) is not compiled for parallel use on the current platform (win64).<\/span><\/p>\n<p><span>The system cannot find the file specified.<\/span><\/p>\n<p>this is the code:<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p>#include &#8220;udf.h&#8221;<br \/>#include &#8220;stdio.h&#8221;&nbsp;&nbsp;<\/p>\n<p>DEFINE_EXECUTE_AT_END(write_heat_transfer_to_file)<br \/>{<br \/>&nbsp; &nbsp; Domain *domain;<br \/>&nbsp; &nbsp; Thread *t;<br \/>&nbsp; &nbsp; cell_t c;<br \/>&nbsp; &nbsp; real thermal_conductivity;<br \/>&nbsp; &nbsp; real temperature;<br \/>&nbsp; &nbsp; real heat_flux;<\/p>\n<p>&nbsp; &nbsp; FILE *file;&nbsp;&nbsp;<br \/>&nbsp; &nbsp; char filename[] = &#8220;written_heat_transfer_values.txt&#8221;;&nbsp;<\/p>\n<p>&nbsp; &nbsp; domain = Get_Domain(1);&nbsp;<\/p>\n<p>&nbsp; &nbsp;&nbsp;<br \/>&nbsp; &nbsp; file = fopen(filename, &#8220;w&#8221;);<br \/>&nbsp; &nbsp; if (file == NULL)<br \/>&nbsp; &nbsp; {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; Message(&#8220;Error opening file %s\\n&#8221;, filename);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; return;<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp;&nbsp;<br \/>&nbsp; &nbsp; thread_loop_c(t, domain)<br \/>&nbsp; &nbsp; {<br \/>&nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; begin_c_loop(c, t)<br \/>&nbsp; &nbsp; &nbsp; &nbsp; {<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; thermal_conductivity = C_K_L(c, t);&nbsp;&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; temperature = C_T(c, t);&nbsp;&nbsp;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; heat_flux = thermal_conductivity * temperature;&nbsp;&nbsp;<\/p>\n<p>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br \/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fprintf(file, &#8220;Cell ID: %d, Thermal Conductivity: %g W\/m*K, Heat Flux: %g W\/m^2\\n&#8221;, c, thermal_conductivity, heat_flux);<br \/>&nbsp; &nbsp; &nbsp; &nbsp; }<br \/>&nbsp; &nbsp; &nbsp; &nbsp; end_c_loop(c, t)<br \/>&nbsp; &nbsp; }<\/p>\n<p>&nbsp; &nbsp;&nbsp;<br \/>&nbsp; &nbsp; fclose(file);<\/p>\n<p>&nbsp; &nbsp;<br \/>&nbsp; &nbsp; Message(&#8220;Heat fluxvalues written to %s\\n&#8221;, filename);<br \/>}<br \/>}<\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n","protected":false},"template":"","class_list":["post-379704","topic","type-topic","status-publish","hentry"],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO 4.9.10 - aioseo.com -->\n\t<meta name=\"description\" content=\"I want to get the heat flux values for a p20 steel solid 2d rectangular shape. I want the values for each node in the y-axis written in a .txt file. Whenever I compiled my udf it builds but when loading I get this error.ERROR: The UDF library you are trying to load (libudf) is\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<link rel=\"canonical\" href=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO (AIOSEO) 4.9.10\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"Ansys Learning Forum | Ansys Innovation Space\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF | Ansys Learning Forum\" \/>\n\t\t<meta property=\"og:description\" content=\"I want to get the heat flux values for a p20 steel solid 2d rectangular shape. I want the values for each node in the y-axis written in a .txt file. Whenever I compiled my udf it builds but when loading I get this error.ERROR: The UDF library you are trying to load (libudf) is\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2024-08-21T18:44:34+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2024-08-21T18:44:34+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF | Ansys Learning Forum\" \/>\n\t\t<meta name=\"twitter:description\" content=\"I want to get the heat flux values for a p20 steel solid 2d rectangular shape. I want the values for each node in the y-axis written in a .txt file. Whenever I compiled my udf it builds but when loading I get this error.ERROR: The UDF library you are trying to load (libudf) is\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/erro-when-trying-to-write-a-txt-file-using-udf\\\/#breadcrumblist\",\"itemListElement\":[{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"position\":2,\"name\":\"Topics\",\"item\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/\",\"nextItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/erro-when-trying-to-write-a-txt-file-using-udf\\\/#listItem\",\"name\":\"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF\"},\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum#listItem\",\"name\":\"Home\"}},{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/erro-when-trying-to-write-a-txt-file-using-udf\\\/#listItem\",\"position\":3,\"name\":\"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF\",\"previousItem\":{\"@type\":\"ListItem\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/topics\\\/#listItem\",\"name\":\"Topics\"}}]},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/erro-when-trying-to-write-a-txt-file-using-udf\\\/#webpage\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/erro-when-trying-to-write-a-txt-file-using-udf\\\/\",\"name\":\"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF | Ansys Learning Forum\",\"description\":\"I want to get the heat flux values for a p20 steel solid 2d rectangular shape. I want the values for each node in the y-axis written in a .txt file. Whenever I compiled my udf it builds but when loading I get this error.ERROR: The UDF library you are trying to load (libudf) is\",\"inLanguage\":\"en-US\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\"},\"breadcrumb\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/forums\\\/topic\\\/erro-when-trying-to-write-a-txt-file-using-udf\\\/#breadcrumblist\"},\"datePublished\":\"2024-08-21T18:44:34+00:00\",\"dateModified\":\"2024-08-21T18:44:34+00:00\"},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#website\",\"url\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/\",\"name\":\"Ansys Learning Forum\",\"description\":\"Ansys Innovation Space\",\"inLanguage\":\"en-US\",\"publisher\":{\"@id\":\"https:\\\/\\\/innovationspace.ansys.com\\\/forum\\\/#organization\"}}]}\n\t\t<\/script>\n\t\t<!-- All in One SEO -->\n\n","aioseo_head_json":{"title":"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF | Ansys Learning Forum","description":"I want to get the heat flux values for a p20 steel solid 2d rectangular shape. I want the values for each node in the y-axis written in a .txt file. Whenever I compiled my udf it builds but when loading I get this error.ERROR: The UDF library you are trying to load (libudf) is","canonical_url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"BreadcrumbList","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/#breadcrumblist","itemListElement":[{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","position":1,"name":"Home","item":"https:\/\/innovationspace.ansys.com\/forum","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","position":2,"name":"Topics","item":"https:\/\/innovationspace.ansys.com\/forum\/topics\/","nextItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/#listItem","name":"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF"},"previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum#listItem","name":"Home"}},{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/#listItem","position":3,"name":"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF","previousItem":{"@type":"ListItem","@id":"https:\/\/innovationspace.ansys.com\/forum\/topics\/#listItem","name":"Topics"}}]},{"@type":"Organization","@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization","name":"Ansys Learning Forum","description":"Ansys Innovation Space","url":"https:\/\/innovationspace.ansys.com\/forum\/"},{"@type":"WebPage","@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/#webpage","url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/","name":"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF | Ansys Learning Forum","description":"I want to get the heat flux values for a p20 steel solid 2d rectangular shape. I want the values for each node in the y-axis written in a .txt file. Whenever I compiled my udf it builds but when loading I get this error.ERROR: The UDF library you are trying to load (libudf) is","inLanguage":"en-US","isPartOf":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#website"},"breadcrumb":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/#breadcrumblist"},"datePublished":"2024-08-21T18:44:34+00:00","dateModified":"2024-08-21T18:44:34+00:00"},{"@type":"WebSite","@id":"https:\/\/innovationspace.ansys.com\/forum\/#website","url":"https:\/\/innovationspace.ansys.com\/forum\/","name":"Ansys Learning Forum","description":"Ansys Innovation Space","inLanguage":"en-US","publisher":{"@id":"https:\/\/innovationspace.ansys.com\/forum\/#organization"}}]},"og:locale":"en_US","og:site_name":"Ansys Learning Forum | Ansys Innovation Space","og:type":"article","og:title":"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF | Ansys Learning Forum","og:description":"I want to get the heat flux values for a p20 steel solid 2d rectangular shape. I want the values for each node in the y-axis written in a .txt file. Whenever I compiled my udf it builds but when loading I get this error.ERROR: The UDF library you are trying to load (libudf) is","og:url":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/","article:published_time":"2024-08-21T18:44:34+00:00","article:modified_time":"2024-08-21T18:44:34+00:00","twitter:card":"summary_large_image","twitter:title":"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF | Ansys Learning Forum","twitter:description":"I want to get the heat flux values for a p20 steel solid 2d rectangular shape. I want the values for each node in the y-axis written in a .txt file. Whenever I compiled my udf it builds but when loading I get this error.ERROR: The UDF library you are trying to load (libudf) is"},"aioseo_meta_data":{"post_id":"379704","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"content","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":true,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"limit_modified_date":false,"created":"2024-10-28 16:32:06","updated":"2024-10-28 16:32:06","ai":null,"breadcrumb_settings":null,"seo_analyzer_scan_date":null},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\" title=\"Home\">Home<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\t<a href=\"https:\/\/innovationspace.ansys.com\/forum\/topics\/\" title=\"Topics\">Topics<\/a>\n\t\t<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t\t\tERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF\n\t\t<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/innovationspace.ansys.com\/forum"},{"label":"Topics","link":"https:\/\/innovationspace.ansys.com\/forum\/topics\/"},{"label":"ERRO WHEN TRYING TO WRITE A .TXT FILE USING UDF","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/erro-when-trying-to-write-a-txt-file-using-udf\/"}],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["350446","199"],"_bbp_author_ip":["129.100.226.99"]," _bbp_last_reply_id":["0"]," _bbp_likes_count":["0"],"_btv_view_count":["192"],"_bbp_topic_status":["unanswered"],"_bbp_notification_enabled":["350446","350446"],"_bbp_topic_id":["379704"],"_bbp_forum_id":["27792"],"_bbp_engagement":["199","350446"],"_bbp_voice_count":["2"],"_bbp_reply_count":["2"],"_bbp_last_reply_id":["380515"],"_bbp_last_active_id":["380515"],"_bbp_last_active_time":["2024-08-26 23:58:07"]},"test":"csolanovuwo-ca"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/379704","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\/379704\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=379704"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}