-
-
October 30, 2019 at 7:41 pm
AaronP
SubscriberHello 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.
-
- The topic ‘Nodal Solutions Commands (APDL)’ is closed to new replies.
-
2999
-
970
-
857
-
761
-
599
© 2025 Copyright ANSYS, Inc. All rights reserved.