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.

Nodal Solutions Commands (APDL)

    • AaronP
      Subscriber

      Hello Ansys community


      I have a FEA model in Ansys Workbench 2019 R2 which solves for, among others, the stress intensity at each of the mesh nodes (196828 nodes) for each of the applied load steps (50 steps). I wish to extract all node positions, with the stress intensity at those nodes for all of these load steps in various text files. My post-processing commands (APDL) macro goes as follows:


      ----


      /POST1


       


      my_loadSteps = 0


       


      set,LAST,LAST  ! one has to be at the end of the runs to extract the total number of steps 


      *GET, my_loadSteps , ACTIVE, 0, SOLU,NCMLS


      fname = '_TS_NodalResults_T'


       


      *do, loadIndex,1,my_loadSteps ! cycle over steps


      *cfopen,STRCAT(fname,CHRVAL(loadIndex)),txt


       


              !*SET,loadIndex,LAST


              


              *GET, my_NoNodes, NODE, 0, COUNT !Get number of nodes


              *DIM, ANODES, TABLE, my_NoNodes, 4 !Declare table to save coordinates and displacements


              


              *VGET, NODELIST, NODE, ALL, NLIST


          


              /OUTPUT, OutputFile,TXT,,APPEND


              


                  *VWRITE,'NodeNum','XLoc (m)','YLoc (m)','ZLoc (m)','S.I.(Pa)'


                  (20A18)


                  


                  *DO, J, 1, my_NoNodes,1


                      *GET, ANODES(J,1), NODE, NODELIST(J), LOC, X


                      *GET, ANODES(J,2), NODE, NODELIST(J), LOC, Y


                      *GET, ANODES(J,3), NODE, NODELIST(J), LOC, Z


                      *GET, ANODES(J,4), NODE, NODELIST(J), S, INT


                  *ENDDO


                  


                  *VWRITE, NODELIST(1), ANODES(1,1), ANODES(1,2), ANODES(1,3), ANODES(1,4)


                  (G30.15, ' ',G30.15, ' ',G30.15, ' ',G30.15, ' ',G30.15)


       


              /OUTPUT


          


          *cfclose


      *ENDDO


      ---


      Which outputs the node positions just fine, but the stress intensity at each node point has some problems. It works for the first 30200 or so nodes with the expected values and then suddenly all other nodes are equal to 0 (while the positions remain OK). I am also not sure on how to retrieve all the stress intensities for all load steps (no substeps).


      Problem: Some nodes have stress intensity values while other nodes are just equal to 0 Pa. I have no clue if this code would retrieve the stress intensity for the proper load steps.
      Expected Result: 50 files containing 5 columns as follows: Node Index, Node X location, Node Y location, Node Z location, Stress Intensity for the respective load step 
      Actual Result: 50 files containing 5 columns the above columns. All node locations are outputted properly, however the stress intensity is suddenly drops to 0 for the majority of the load steps (it shouldn't do that according to the stress intensity module sets in the tree outline). I am not sure on how to retrieve all the stress intensities for all load steps (no substeps). "RMB>export>export to textfile" for each stress intensity for all set solutions works fine, but it way to tideous for all load-steps.

Viewing 0 reply threads
  • The topic ‘Nodal Solutions Commands (APDL)’ is closed to new replies.