


{"id":409276,"date":"2025-02-10T15:23:42","date_gmt":"2025-02-10T15:23:42","guid":{"rendered":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/visualizing-principal-stress-with-largest-absolute-value-in-mechanical-using-apd\/"},"modified":"2025-02-10T15:27:41","modified_gmt":"2025-02-10T15:27:41","slug":"visualizing-principal-stress-with-largest-absolute-value-in-mechanical-using-apd","status":"publish","type":"topic","link":"https:\/\/innovationspace.ansys.com\/forum\/forums\/topic\/visualizing-principal-stress-with-largest-absolute-value-in-mechanical-using-apd\/","title":{"rendered":"Visualize Principal Stress with Largest Absolute Value in Mechanical Using APDL"},"content":{"rendered":"<p>&lt;p&gt;&lt;p&gt;&lt;p dir=&#8221;auto&#8221;&gt;Hello ANSYS Community,&lt;\/p&gt;&lt;p dir=&#8221;auto&#8221;&gt;I am working on a project where I need to visualize the principal stress with the largest absolute value in ANSYS Mechanical. I have calculated the principal stresses and used APDL to determine which principal stress has the largest absolute value. However, I am having trouble displaying this result directly in Mechanical.&lt;\/p&gt;&lt;p dir=&#8221;auto&#8221;&gt;I have tried using the Commands (APDL) object to calculate and store the results, but I am unsure how to make these results accessible in Mechanical for visualization. Specifically, I would like to create a contour plot of the principal stress with the largest absolute value.&lt;\/p&gt;&lt;p dir=&#8221;auto&#8221;&gt;Here is a brief overview of what I have done so far:&lt;\/p&gt;&lt;\/p&gt;&lt;\/p&gt;<\/p>\n<ol>\n<li>Used APDL to calculate the principal stress with the largest absolute value.<\/li>\n<li>Stored the results in a parameter or named selection.<\/li>\n<li>Attempted to create a user-defined result in Mechanical to visualize these results.<\/li>\n<\/ol>\n<p>&lt;p&gt;&lt;p&gt;&lt;p dir=&#8221;auto&#8221;&gt;Could someone please guide me on how to properly visualize these APDL-calculated results in Mechanical? Any help or suggestions would be greatly appreciated.&lt;\/p&gt;&lt;p dir=&#8221;auto&#8221;&gt;Thank you in advance for your assistance!&lt;\/p&gt;&lt;p dir=&#8221;auto&#8221;&gt;PS. Below is the snippet Command I put in Solution.&lt;\/p&gt;&lt;div&gt;\/POST1&lt;\/div&gt;&lt;div&gt;SET,LAST&lt;\/div&gt;&lt;div&gt; &lt;\/div&gt;&lt;div&gt;*DIM,LARGEST_SIG,ARRAY,NUMNP&nbsp; ! Create an array to store LARGEST_SIG for each node&lt;\/div&gt;&lt;div&gt; &lt;\/div&gt;&lt;div&gt;*DO,I,1,NUMNP&nbsp; ! Loop over all nodes&lt;\/div&gt;&lt;div&gt;&nbsp; *GET,S1,NODE,I,S,1,PRIN&nbsp; ! Get the first principal stress&lt;\/div&gt;&lt;div&gt;&nbsp; *GET,S3,NODE,I,S,3,PRIN&nbsp; ! Get the third principal stress&lt;\/div&gt;&lt;div&gt; &lt;\/div&gt;&lt;div&gt;&nbsp; *IF,ABS(S3),GT,ABS(S1),THEN&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; LARGEST_SIG(I) = S1&lt;\/div&gt;&lt;div&gt;&nbsp; *ELSE&lt;\/div&gt;&lt;div&gt;&nbsp; &nbsp; LARGEST_SIG(I) = S3&lt;\/div&gt;&lt;div&gt;&nbsp; *ENDIF&lt;\/div&gt;&lt;div&gt;*ENDDO&lt;\/div&gt;&lt;\/p&gt;&lt;\/p&gt;<\/p>\n","protected":false},"template":"","class_list":["post-409276","topic","type-topic","status-publish","hentry"],"aioseo_notices":[],"acf":[],"custom_fields":[{"0":{"_bbp_forum_id":["27791"],"_bbp_topic_id":["409276"],"_bbp_subscription":["455222","24768"],"_bbp_author_ip":["141.43.131.225"],"_bbp_last_reply_id":["410274"],"_bbp_last_active_id":["410274"],"_bbp_last_active_time":["2025-02-11 07:47:31"],"_bbp_reply_count":["2"],"_bbp_reply_count_hidden":["0"],"_bbp_voice_count":["2"],"_bbp_engagement":["455222","24768"],"_btv_view_count":["245"],"_bbp_topic_status":["unanswered"],"_edit_last":["455222"],"_bbp_revision_log":["a:2:{i:409277;a:2:{s:6:\"author\";i:455222;s:6:\"reason\";s:0:\"\";}i:409278;a:2:{s:6:\"author\";i:455222;s:6:\"reason\";s:0:\"\";}}"]},"test":"dongsuk-kimb-tu-de"}],"_links":{"self":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/409276","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":2,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/409276\/revisions"}],"predecessor-version":[{"id":409278,"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/topics\/409276\/revisions\/409278"}],"wp:attachment":[{"href":"https:\/\/innovationspace.ansys.com\/forum\/wp-json\/wp\/v2\/media?parent=409276"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}