We have an exciting announcement about badges coming in May 2025. Until then, we will temporarily stop issuing new badges for course completions and certifications. However, all completions will be recorded and fulfilled after May 2025.
General Mechanical

General Mechanical

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

Using APDL to extract stresses on a beam element.

    • ben.gilmour
      Subscriber

      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’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.

      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.

      Anyone know what the problem is here please? 

      I will include the script below for reference:

      /OUTRES,DATAFILE,TXT
      FINISH
      /POST1
      SET,LAST
       
      !   Name a text file and write headers for columns.
      FNAME = 'NodeStress'
      *CFOPEN,%FNAME%,TXT
      *VWRITE,'No.','MaxPrinc','MidPrinc','MinPrinc'
      (A,','A,','A,','A)
       
      !   Select all nodes, and then call upon the node numbers we're interested in. Name these using an
      !   incremental value such that the names can be sequentially read. 
      ALLSEL
      NS1 = 23
      NS2 = 88
      NS3 = 426
       
      Nos = 3
       
      !   'D' is used as an integer describing the number of iterations performed.
      D = 1
       
      !   Do loop for finding the node, getting the maximum/middle/minimum principal stresses.
      *DO,A,1,Nos,1
      NSEL,S,NODE,,NS%A%
      *GET,Snom1%A%,NODE,NS%A%,S,1
      *GET,Snom2%A%,NODE,NS%A%,S,2
      *GET,Snom3%A%,NODE,NS%A%,S,3
      ALLSEL
       
      !   Write the stress values to the text file.
      *VWRITE,%D%,NS%A%,Snom1%A%,Snom2%A%,Snom3%A%
      (F8.0,','F8.0,','E16.10,','E16.10,','E16.10)
       
      !   Increase the iteration count by one before restarting the loop.
      D = D + 1
       
      *ENDDO
       
      !   Close the text file and end script.
      /OUTRES
      *CFCLOSE
    • danielshaw
      Ansys Employee

      The low stress value obtained by *GET probably just means that quantity was not available.  What message was issued to the solve.out file when that *GET was issued? 

      1Did you try just issuing *GET for 1 node/element before embedding the *GET commands inside a *DOLOOP?

      1Why are you attempting to extract nodal stresses for beam elements?  What is the relevance of the nodal stress from a beam element?  Typically you are interested in the beam results.

       

      .

Viewing 1 reply thread
  • You must be logged in to reply to this topic.