General Mechanical

General Mechanical

APDL for average values

    • Noelly


      I'm trying to find the average stress value on a face in Static Structural (the maximum value is the design criterion but for this application, I also need to report the average value). I've never used APDL before so I found this code online for a command:

      !   Commands inserted into this file will be executed immediately after the ANSYS /POST1 command.

      ! Active UNIT system in Workbench when this object was created: U.S. Customary (in, lbm, lbf, s, V, A)
      ! NOTE: Any data that requires units (such as mass) is assumed to be in the consistent solver unit system.
      ! See Solving Units in the help system for more information.


      set,last ! Read result set
      cmsel,s,face_01,node ! Select the node group
      Atot=0.0 ! Reset total area value.
      tot_stress=0.0 ! Reset total volume times stress value.
      *GET,NNUM,NODE,0,COUNT ! Get total number of nodes in the name selection
      ncounter = 0 ! Node number counter reset to zero

      *DO,I,1,NNUM,1 ! Loop over all the selected nodes
      ncounter = ndnext(ncounter) ! Acess the next node in the selection
      narea = arnode(ncounter) ! Calculate the area associated with this node
      *GET,vonmises,NODE,ncounter,s,EQV ! Calculate the stress at this node.
      tot_stress = tot_stress + narea*vonmises
      Atot = narea + Atot
      my_avestress1=tot_stress/Atot ! Calculate average stress.

      And I defined the face of interest as "face_01":

      But there is no solution... I think the problem is to access the result set but I don't know why it does not work. 

      I also tried using the probe but it does not give average values.

Viewing 0 reply threads
  • You must be logged in to reply to this topic.