


{"id":167542,"date":"2022-03-21T10:48:27","date_gmt":"2022-03-21T10:48:27","guid":{"rendered":"\/forum\/forums\/topic\/thermal-steady-state-analysis-with-ansys-mechanical-apdl-and-matlab\/"},"modified":"2022-03-23T17:13:26","modified_gmt":"2022-03-23T17:13:26","slug":"thermal-steady-state-analysis-with-ansys-mechanical-apdl-and-matlab","status":"closed","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/thermal-steady-state-analysis-with-ansys-mechanical-apdl-and-matlab\/","title":{"rendered":"thermal steady state analysis with Ansys Mechanical APDL and Matlab"},"content":{"rendered":"<div class=\"Item-Body\">\n<div class=\"Message userContent\">\n<p>Hi everybody,<\/p>\n<p>i&#039;m launching a Steady State Thermal analysis with an Ansys Mechanical APDL macro code from Matlab in order to automatize a decoupled CHT caculus, but i&#039;m facing with some issues. The matlab string used to launch the simulation is the following: <\/p>\n<p><\/p>\n<\/p>\n<p>&quot;!&quot;C:Program FilesANSYS directoryANSYS192.exe&quot; -b -i input.mac -o output.txt&quot;<\/p>\n<p><\/p>\n<\/p>\n<p>where the file &quot;input.mac&quot; has been created in ANSYS Mechanical with the command &quot;write input file&quot; and contains either all the informations about geometry, mesh, boundary conditions, and the command &quot;solve&quot; in \/solu environment, or the manually written macro code for the results export (written in \/post1 environment after the &quot;solve&quot; command).<\/p>\n<p> The main issue is that commands written after &quot;solve&quot; are not considered, no matter what i write (i tried to write some random digits but it doesnt give any errors\/warnings) included the macro code for the results export.T he output file doesn&#039;t show any errors and at the end &quot;solution converged after XX iterations&quot; is written.<\/p>\n<p>For a further test i tried to load the macro code on Ansys Mechanical APDL with the graphical interface. After the loading, solution data are not available and a manually written &quot;\/solu solve&quot; is needed.<\/p>\n<p>I report the \/solu and the \/post1 environments of &quot;input.mac&quot; here:<\/p>\n<p><\/p>\n<\/p>\n<p>\/com,****************************************************************************<\/p>\n<p>\/com,*************************&nbsp;&nbsp;SOLUTION&nbsp;&nbsp;&nbsp;&nbsp;********************************<\/p>\n<p>\/com,****************************************************************************<\/p>\n<p>\/solu<\/p>\n<p>antype,0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! static analysis<\/p>\n<p>!eqsl,sparse&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! using sparse solver which is default so no eqsl command needed<\/p>\n<p>cntr,print,1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! print out contact info and also make no initial contact an error<\/p>\n<p>rescontrol,,none&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! Do not keep any restart files<\/p>\n<p>dmpoption,emat,no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! Don&#039;t combine emat file for DANSYS<\/p>\n<p>dmpoption,esav,no&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! Don&#039;t combine esav file for DANSYS<\/p>\n<p>\/com,****************************************************<\/p>\n<p>\/com,******************* SOLVE FOR LS 1 OF 1 ****************<\/p>\n<p>esel,s,type,,18<\/p>\n<p>nsle<\/p>\n<p>sf,all,hflux,5000<\/p>\n<p>!OTHER BOUNDARY CONDITIONS ARE NOT REPORTED<\/p>\n<p>nsel,all<\/p>\n<p>esel,all<\/p>\n<p>autots,on<\/p>\n<p>nsub,1,10,1<\/p>\n<p>time,1.<\/p>\n<p>outres,erase<\/p>\n<p>outres,all,none<\/p>\n<p>outres,nsol,all<\/p>\n<p>outres,rsol,all<\/p>\n<p>outres,eangl,all<\/p>\n<p>outres,etmp,all<\/p>\n<p>outres,veng,all<\/p>\n<p>outres,fflux,all<\/p>\n<p>outres,cont,all<\/p>\n<p>\/nopr<\/p>\n<p>esel,s,type,,22<\/p>\n<p>esel,a,type,,23,49<\/p>\n<p>cm,_elmisc,elem<\/p>\n<p>esel,all<\/p>\n<p>\/gopr<\/p>\n<p>outres,misc,all,_elmisc<\/p>\n<p>cnvtol,heat,,.001,,1.e-006&nbsp;&nbsp;! Program Controlled. Set MINREF equivalent of 1e-6 Watts<\/p>\n<p>! *********** WB SOLVE COMMAND ***********<\/p>\n<p>! check interactive state<\/p>\n<p>*get,ANSINTER_,active,,int<\/p>\n<p>*if,ANSINTER_,ne,0,then<\/p>\n<p>\/eof<\/p>\n<p>*endif<\/p>\n<p>solve<\/p>\n<p>!PROBLEM: COMMANDS WRITTEN BELOW ARE SKIPPED<\/p>\n<p>\/com *************** Write FE CONNECTORS *********&nbsp;<\/p>\n<p>CEWRITE,file,ce,,INTE<\/p>\n<p>\/com,****************************************************<\/p>\n<p>\/com,*************** FINISHED SOLVE FOR LS 1 *************<\/p>\n<p>*get,_wallasol,active,,time,wall<\/p>\n<p><\/p>\n<\/p>\n<p>\/post1<\/p>\n<p>\/INPUT,&#039;postpr&#039;,&#039;dat&#039;,&#039;C:Users<br \/>\nafanelliDocumentsITER1A&#039;,, 0&nbsp;&nbsp;!MACRO FOR POSTPROCESS<\/p>\n<p>xmlo,ENCODING,ISO-8859-1<\/p>\n<p>xmlo,parm<\/p>\n<p>\/xml,parm,xml<\/p>\n<p>fini<\/p>\n<p>\/gopr<\/p>\n<p>*get,_walldone,active,,time,wall<\/p>\n<p>_preptime=(_wallbsol-_wallstrt)*3600<\/p>\n<p>_solvtime=(_wallasol-_wallbsol)*3600<\/p>\n<p>_posttime=(_walldone-_wallasol)*3600<\/p>\n<p>_totaltim=(_walldone-_wallstrt)*3600<\/p>\n<p>*get,_dlbratio,active,0,solu,dlbr<\/p>\n<p>\/com,&#8212; Number of total nodes = %_numnode%<\/p>\n<p>\/com,&#8212; Number of total elements = %_numelem%<\/p>\n<p>\/com,&#8212; Element load balance ratio = %_dlbratio%<\/p>\n<p><\/p>\n<\/p>\n<p>\/wb,file,end&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;! done with WB generated input<\/p>\n<p><\/p>\n<p><\/p>\n<\/p>\n<p>I think there is a problem with the solution command but i&#039;m not able to figure out.<\/p>\n<p>Thank you so much<\/p>\n","protected":false},"template":"","class_list":["post-167542","topic","type-topic","status-closed","hentry","topic-tag-ansys-apdl","topic-tag-apdl-command","topic-tag-APDLthermal-1","topic-tag-matlab","topic-tag-mechanical-apdl"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_btv_view_count":["1604"],"_bbp_likes_count":["0"],"_bbp_subscription":["251712"],"_bbp_topic_status":["unanswered"],"_bbp_status":["publish"],"_bbp_topic_id":["167542"],"_bbp_forum_id":["27791"],"_bbp_engagement":["88","23687","79912","251712"],"_bbp_voice_count":["4"],"_bbp_reply_count":["3"],"_bbp_last_reply_id":["209064"],"_bbp_last_active_id":["209064"],"_bbp_last_active_time":["2022-03-23 17:13:26"]},"test":"isacco-rafanelliunifi-it"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/167542","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\/167542\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=167542"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}