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.

APDL for average values

    • Noelly
      Subscriber

      Hello,


      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.

      /post1
      allsel,all

      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
      *ENDDO
      my_avestress1=tot_stress/Atot ! Calculate average stress.
      fini

      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.

    • peteroznewman
      Subscriber

      If you are using a recent version of ANYS, the average is provided in the Details window.

      I copied your exact code and it provided output, but that output did not agree with the result above.

      I don't write APDL code, so I can't comment on the discrepancy.

    • Noelly
      Subscriber

      Alright, I will use your method. I trust it more and it actually works in my Ansys.

      Thank you!

    • peteroznewman
      Subscriber

      Good choice.  Please mark my post with Is Solution so the topic gets marked as Solved.

    • namandoshi
      Subscriber
      .

      Hi,

      1. Name selection 'face_01' should be made before solving model.
      2. In end it should be 'finish' not 'fini'.
      3. Here they are using node area (narea) which i don't understand, can someone explain that.
      4. average stress/pressure on element face , can someone explain how to get it?
      5. Average stress directly available in ansys is = (sum of stresses over the selected face's nodes)/ (no of nodes)
      6. in 5th point, it may be possible that only some part of face is having stress but while calculating average stress, nodes having zero stress (on the selected face) is also included which can bring down average stress over the contact region.


      .
Viewing 4 reply threads
  • The topic ‘APDL for average values’ is closed to new replies.
[bingo_chatbox]