General Mechanical

General Mechanical

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

Post-Processing Stress Using APDL

TAGGED: 

    • Nick Jankowski
      Subscriber

      Hello all,

      I'm rather new to using APDL, and would like to write a command that takes each component in the geometry tree, finds the max stress of only that component, and stores it in a table that is exported. What I'm having difficulty in understanding is how APDL finds and initializes each component, or an easy way to loop over every component in an assembly. The error I keep getting is 'Component is not defined' and I believe it's because APDL doesn't know where to pull the name from? Any help is appreciated

    • Erik Kostson
      Ansys Employee

       

       

      Hi

      It is outside what we (ansys empl.) can help here with (provide apdl code for this).

       

      Perhaps other forum members can help.

       

      There is a post that does this using Mechanical scripting though.

      https://discuss.ansys.com/discussion/3542/write-max-vm-stress-for-each-part-in-named-selection-to-file

       

      Below is also a course and info on mehanical scripting:

      https://www.youtube.com/watch?v=Q0MpwVSiFGs

       

      Hope it all helps.

       

      Erik

       

       

    • Nick Jankowski
      Subscriber

      Hello,

      That post is really helpful! But I don't think the script runs properly. I have been attempting to rename each body 'under the hood' of Ansys and use the new name (body_1,body_2...) to post-process results easily in APDL. However, now Ansys is returning the error: 

      15:09:41
       Empty parentheses.                                                     
       *** ERROR ***                           CP =       0.062   TIME= 15:09:41
       The above error occurred processing field= BODY.GETGEOBODY().ID        

      I've looked through the documentation of GetGeoBody().Id and I feel as though I'm deploying it correctly? Here is the snippet of code:
       
      for body in bodies:       
          if body.Suppressed is False:
              nb_bodies += 1
              with Transaction():
                  new_snippet = body.AddCommandSnippet()
                  string1 = 'body_'+str(nb_bodies) + ' = body.GetGeoBody().Ids \n'
    • Nick Jankowski
      Subscriber

      Got it working! Had to do some rearranging

Viewing 3 reply threads
  • The topic ‘Post-Processing Stress Using APDL’ is closed to new replies.