General Mechanical

General Mechanical

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

Requested Data is not stored for node 1

    • jmcclos8
      Subscriber

      Hi I am trying to write some nodal deformation relative to a user defined coordinate system to some txt files for postprocessing. I am using a command block in the solution portion of Ansys Workbench. I am unable to retieve the nodal deformation. I'm curious if this is result of an error in my code or if I am not outputting the correct information when I run the simulation?

      Here is the code:

      /post1
      file,file,rst !select result file 

      SET, LAST

      ! Define the base file path for saving the output files 
      FilePath = 'C:\\Users\\Admin\\Documents\\Simulation and Analysis\\MIRMOS\\Thermal Model\\Ansys_Raw_Data_Warm\\'

      ! Define the single named selection
      NamedSelection = 'Fold1_RZ'  
      CoordSystem = 111  

      ! Check if the coordinate system exists
      RSYS, CoordSystem  

      ! Log the selected coordinate system and named selection
      *CFOPEN, FilePath + 'Debug.txt', txt
      *VWRITE, 'Coordinate System: ', CoordSystem
      (A, F8.0)

      *VWRITE, 'Named Selection: ', NamedSelection
      (A, F8.0)

      *CFCLSE

      ! Apply the Named Selection (ensure the selection is active)
      CMSEL,S,NamedSelection

      ! Check if nodes were selected
      *GET, nsel, NODE, 0, COUNT  ! Get number of selected nodes
      *IF, nsel, LT, 1, THEN
          *VWRITE, 'No nodes found in the selected Named Selection: ', NamedSelection
          (A)
          *EXIT  ! Exit if no nodes were selected
      *ENDIF

      ! Open separate files for each displacement direction
      *CFOPEN, FilePath + NamedSelection + ' 0 deg X.txt', txt
      *VWRITE, 'Node ID', 'Displacement X'
      (A, A)

      *CFOPEN, FilePath + NamedSelection + ' 0 deg Y.txt', txt
      *VWRITE, 'Node ID', 'Displacement Y'
      (A, A)

      *CFOPEN, FilePath + NamedSelection + ' 0 deg Z.txt', txt
      *VWRITE, 'Node ID', 'Displacement Z'
      (A, A)

      ! Loop through the nodes in the Named Selection and output displacement values
      *DO, i, 1, nsel

          ! Get node coordinates
          *GET, nodeX, NODE, i, LOC, X
          *GET, nodeY, NODE, i, LOC, Y
          *GET, nodeZ, NODE, i, LOC, Z

          ! Get displacement values in X, Y, Z 
          *GET, dispX, NODE, i, U, X
          *GET, dispY, NODE, i, U, Y
          *GET, dispZ, NODE, i, U, Z

          ! Write node coordinates and displacement values to each corresponding file
          *VWRITE, nodeX, nodeY, nodeZ, dispX
          (F10.4, F10.4, F10.4, F10.4) 

          *VWRITE, nodeX, nodeY, nodeZ, dispY
          (F10.4, F10.4, F10.4, F10.4)

          *VWRITE, nodeX, nodeY, nodeZ, dispZ
          (F10.4, F10.4, F10.4, F10.4)
      *ENDDO

      *CFCLSE

      FINISH

      Here is an warning I recieve when I attempting to access the nodal deformations. Note, I am able to access the element locations.

      *DO LOOP ON PARAMETER= I FROM  1.0000     TO  2214.0     BY  1.0000   

       *GET  NODEX     FROM  NODE         1  ITEM=LOC  X     VALUE=-0.191897697    

       *GET  NODEY     FROM  NODE         1  ITEM=LOC  Y     VALUE=-0.648200003E-001

       *GET  NODEZ     FROM  NODE         1  ITEM=LOC  Z     VALUE= 0.862828271    

       *** WARNING ***                         CP =      24.281   TIME= 14:41:33
       Requested data is not stored for node 1.                               
        Line= *GET, loc_defX, NODE, i, U, X                                   
        The *GET command is ignored.          

       

       

      Here are the simulation output controls:

       

      Thank you for any assistance you can provide.

    • Mike Rife
      Ansys Employee

      Hi jmcclos8

      There seems to be a gap in the node nubering IDs.  So there is no node #1.  There are several ways to address this but the most generic/defensive programming method would be to use ndnext(N) which returns the ID of the next selected node after N.  So after the component selection capture the lowest node ID number in the selected set:

      CMSEL,S,NamedSelection

      n_num = ndnext(0)

      Then in the *GET commands replace the 'i' with n_num.  Then right before the *ENDDO command use:

      n_num = ndnext(n_num)

      to advance the variable.

      Mike

      p.s. the ndnext is one in a series of short-cut versions of specific *GET commands.

       

      • jmcclos8
        Subscriber

        Hi Mike,

        I apperciate you getting back to me. ndnext does not seem to be a post1 command, so the compiler just ends up ignoring it: 

        *** WARNING ***                         CP =      22.891   TIME= 13:34:09
         NDNEXT is not a recognized POST1 command, abbreviation, or macro.      
          This command will be ignored

    • Mike Rife
      Ansys Employee

      Weird.  Please send a screen shot of the beginning of the solve.out showing the version and license used by MAPDL.

      Mike

      p.s. ndnext is just a short cut to *get command that would do the same function.  And works in any MAPDL processor...you're not using a custom version of MAPDL are you?

      • jmcclos8
        Subscriber

        Hi Mike

        See attatched.

    • Mike Rife
      Ansys Employee

      Could you please send a test model that shows the behavior?  I've not been able to recreate this.

    • Mike Rife
      Ansys Employee

      We should also test the full version of the *get command.  Instead of "n_num = ndnext(0)" try *get,n_num,node,0,nxth

      Then for the "n_num = ndnext(n_num)" use instead *get,n_num,nodel,n_num,nxth

      What happens?  

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