Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
General Mechanical

General Mechanical

Topics related to Mechanical Enterprise, Motion, Additive Print and more.

Visualize Principal Stress with Largest Absolute Value in Mechanical Using APDL

    • dongsuk.kim
      Subscriber

      Hello ANSYS Community,

      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.

      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.

      Here is a brief overview of what I have done so far:

      1. Used APDL to calculate the principal stress with the largest absolute value.
      2. Stored the results in a parameter or named selection.
      3. Attempted to create a user-defined result in Mechanical to visualize these results.

      Could someone please guide me on how to properly visualize these APDL-calculated results in Mechanical? Any help or suggestions would be greatly appreciated.

      Thank you in advance for your assistance!

      PS. Below is the snippet Command I put in Solution.

      /POST1
      SET,LAST
      *DIM,LARGEST_SIG,ARRAY,NUMNP  ! Create an array to store LARGEST_SIG for each node
      *DO,I,1,NUMNP  ! Loop over all nodes
        *GET,S1,NODE,I,S,1,PRIN  ! Get the first principal stress
        *GET,S3,NODE,I,S,3,PRIN  ! Get the third principal stress
        *IF,ABS(S3),GT,ABS(S1),THEN
          LARGEST_SIG(I) = S1
        *ELSE
          LARGEST_SIG(I) = S3
        *ENDIF
      *ENDDO

    • Subodh Adake
      Ansys Employee

      Hello,

      I would suggest trying out a user-defined result with the following expression: max(abs(s1),abs(s3)) in mechanical instead of going for APDL commands.

      Regards,

      Subodh

    • dongsuk.kim
      Subscriber

      Hello, Subodh

      Thank you for the answer. I want to let it display the value itself instead of the absolute value so I am trying to implement using APDL. Would you help with APDL code?

      regards,

      Dongsuk

Viewing 2 reply threads
  • You must be logged in to reply to this topic.
[bingo_chatbox]