


{"id":382776,"date":"2024-09-16T14:12:46","date_gmt":"2024-09-16T14:12:46","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/using-apdl-to-extract-stresses-on-a-beam-element\/"},"modified":"2024-09-16T14:12:46","modified_gmt":"2024-09-16T14:12:46","slug":"using-apdl-to-extract-stresses-on-a-beam-element","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/using-apdl-to-extract-stresses-on-a-beam-element\/","title":{"rendered":"Using APDL to extract stresses on a beam element."},"content":{"rendered":"<p>&lt;p class=&#8221;MsoNormal&#8221;&gt;I have been attempting to automate the extraction of principal stresses from a beam element model. This seems to be a little tricky, and I&rsquo;m now having an issue exporting the principal stresses using APDL. I can see the principal stresses mapped onto the nodes in a stress plot, giving me an example maximum principal stress value here of 1.8e5 Pa. Using my APDL script, the principal stress I extract is 0.7e-30 Pa.&lt;\/p&gt;&lt;p class=&#8221;MsoNormal&#8221;&gt;I have used this script successfully with shells and understand there is some difficulty in reading nodal stress outputs from beam elements. However, even in this model I have a maximum principal stress of 1.2e8 Pa on my shell node whereas the script picks up -0.2e-2 Pa. Stranger still, it reads the middle and minimum principal stresses fine for the shell.&lt;\/p&gt;&lt;p class=&#8221;MsoNormal&#8221;&gt;Anyone know what the problem is here please?&nbsp;&lt;\/p&gt;&lt;p class=&#8221;MsoNormal&#8221;&gt;I will include the script below for reference:&lt;\/p&gt;&lt;div&gt;\/OUTRES,DATAFILE,TXT&lt;\/div&gt;&lt;div&gt;FINISH&lt;\/div&gt;&lt;div&gt;\/POST1&lt;\/div&gt;&lt;div&gt;SET,LAST&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;!&nbsp; &nbsp;Name a text file and write headers for columns.&lt;\/div&gt;&lt;div&gt;FNAME = &#8216;NodeStress'&lt;\/div&gt;&lt;div&gt;*CFOPEN,%FNAME%,TXT&lt;\/div&gt;&lt;div&gt;*VWRITE,&#8217;No.&#8217;,&#8217;MaxPrinc&#8217;,&#8217;MidPrinc&#8217;,&#8217;MinPrinc'&lt;\/div&gt;&lt;div&gt;(A,&#8217;,&#8217;A,&#8217;,&#8217;A,&#8217;,&#8217;A)&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;!&nbsp; &nbsp;Select all nodes, and then call upon the node numbers we&#8217;re interested in. Name these using an&lt;\/div&gt;&lt;div&gt;!&nbsp; &nbsp;incremental value such that the names can be sequentially read.&nbsp;&lt;\/div&gt;&lt;div&gt;ALLSEL&lt;\/div&gt;&lt;div&gt;NS1 = 23&lt;\/div&gt;&lt;div&gt;NS2 = 88&lt;\/div&gt;&lt;div&gt;NS3 = 426&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;Nos = 3&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;!&nbsp; &nbsp;&#8216;D&#8217; is used as an integer describing the number of iterations performed.&lt;\/div&gt;&lt;div&gt;D = 1&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;!&nbsp; &nbsp;Do loop for finding the node, getting the maximum\/middle\/minimum principal stresses.&lt;\/div&gt;&lt;div&gt;*DO,A,1,Nos,1&lt;\/div&gt;&lt;div&gt;NSEL,S,NODE,,NS%A%&lt;\/div&gt;&lt;div&gt;*GET,Snom1%A%,NODE,NS%A%,S,1&lt;\/div&gt;&lt;div&gt;*GET,Snom2%A%,NODE,NS%A%,S,2&lt;\/div&gt;&lt;div&gt;*GET,Snom3%A%,NODE,NS%A%,S,3&lt;\/div&gt;&lt;div&gt;ALLSEL&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;!&nbsp; &nbsp;Write the stress values to the text file.&lt;\/div&gt;&lt;div&gt;*VWRITE,%D%,NS%A%,Snom1%A%,Snom2%A%,Snom3%A%&lt;\/div&gt;&lt;div&gt;(F8.0,&#8217;,&#8217;F8.0,&#8217;,&#8217;E16.10,&#8217;,&#8217;E16.10,&#8217;,&#8217;E16.10)&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;!&nbsp; &nbsp;Increase the iteration count by one before restarting the loop.&lt;\/div&gt;&lt;div&gt;D = D + 1&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;*ENDDO&lt;\/div&gt;&lt;div&gt;&nbsp;&lt;\/div&gt;&lt;div&gt;!&nbsp; &nbsp;Close the text file and end script.&lt;\/div&gt;&lt;div&gt;\/OUTRES&lt;\/div&gt;&lt;div&gt;*CFCLOSE<img decoding=\"async\" src=\"https:\/\/innovationspace.ansys.com\/forum\/wp-content\/uploads\/sites\/2\/2024\/09\/16-09-2024-1726495871-Help1.png\" alt=\"\" \/>&lt;\/div&gt;<\/p>\n","protected":false},"template":"","class_list":["post-382776","topic","type-topic","status-publish","hentry","topic-tag-ansys-mechanical-apdl"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_subscription":["456579","490"],"_bbp_author_ip":["86.145.142.47"],"_btv_view_count":["1950"],"_bbp_topic_status":["unanswered"],"_bbp_topic_id":["382776"],"_bbp_forum_id":["27791"],"_bbp_engagement":["490","456579"],"_bbp_voice_count":["2"],"_bbp_reply_count":["1"],"_bbp_last_reply_id":["383012"],"_bbp_last_active_id":["383012"],"_bbp_last_active_time":["2024-09-18 13:55:58"]},"test":"ben-gilmourachelous-co-uk"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/382776","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\/382776\/revisions"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=382776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}