General Mechanical

General Mechanical

How to get the rotational velocity of one node in Post1?

    • manu87
      Subscriber

      Hi,everyone. I'm trying to simulate a dynamic model using the Beam188 element. In the simulation,there are a series of loadsteps. And, my object is to obtain the rotational velocity of one node in a loadstep, and use it to calculate another parameter, which will finally be applied as a boundary condition. 


      So, it forms a loop, the rotational velocity and the parameter are obtained and calculated again and again.


      Based on the former experience, there are some parameters which could be obtained by *get command, combined with ETABLE. 


      Actually, it's interactive between the /solu and /post1 processer, and the *get command is allowed in the *do-*enddo loop.


      But, when it comes to the rotational velocity of a node, the key is that you cannot obtain the value, using *get command or ETABLE. You can only print or list it by PRNSOL or PLNSOL.


      So, my qustion is, since the rotaional velocity can be printed or listed in POST1, is there any method to 'get' it? If, I can conduct my simulation.


      If you got any idead, please contact with me. Thanks. Bless.

    • Rohith Patchigolla
      Ansys Employee

      Hello Manu, 


      Unfortunately, there is no option to get rotational velocity of a node via *get command. 


      However, you can the below workaround. 


      - Use /OUTPUT & PRNSOL commands to write angular velocities in a file


      - Then read the file back via *SREAD with settings (skipping lines, start/end positions of the text corresponding to angular velocity of the required node) along with commands such as STRSUB and STRCOMP, such that, the angular velocity value is parsed and stored into a parameter. 


      Please try this approach and let me know if you have any questions. I pasted a test script below, which extracts the angular velocity in X direction at node 2, into an array 'tt'


      set,last

      nsel,s,,,2

      /out,mydata,txt

      prnsol,omg,comp

      /out

      *sread,tt,mydata,txt,,,20,1

      tt(1)=strsub(tt(1),11,7)

      tt(1)=STRCOMP(tt(1))

      *stat,tt

      Hope this helps. 


      Best regards,


      Rohith


       

    • manu87
      Subscriber

      rgpatchi,


      Thank you for your help. The method you proposed is  really smart, which represents that you have a deep insight into APDL. Great.


      However, it fails to work. There are some errors (shown as follows):


      1.


      PARAMETER STATUS- TT  (     47 PARAMETERS DEFINED)


                        (INCLUDING       21 INTERNAL PARAMETERS)


       


       *** NOTE ***                            CP =      59.359   TIME= 14:06:44


       Parameter name ( TT ) on *STAT command is undefined.   


      2.


      The array of tt cannot be found in Parameters.So, where I can get it?


       


      Additionally, can this commands be used in the /solu process? IF, the loop 'solu-get the velocity of a node-solu' can be established.


      Finally, Sir. Can you provide the email of you? We can communicate more effectively.

    • manu87
      Subscriber

      rgpatchi,
      In addition, it's blank in the mydata.txt file. 


      Does the command /out  fails?

    • Rohith Patchigolla
      Ansys Employee

      Hello Manu, 


      The script I've mentioned only works during Post-Processing i.e. under /POST1, since PRNSOL command is valid only under /POST1. 


      I believe, you tried using in between load steps in /SOLU. Hence, mydata.txt is empty (since PRNSOL,omg,comp command is ignored) --> hence, *SREAD did not create the array, tt, as the file, mydata.txt was empty. 


      Please try initially, for a single load step after solve under /POST1, to do a sanity check. 


      Also, I missed adding one more command, to convert the extracted String Number to actual number. Modified commands below. 


      /post1

      set,last

      nsel,s,,,2

      /out,mydata,txt

      prnsol,omg,comp

      /out

      allsel,all

      *sread,tt,mydata,txt,,,20,1

      tt(1)=strsub(tt(1),11,7)

      tt(1)=STRCOMP(tt(1))

      my_omega = valchr(tt(1))

      If you want to use these commands in between load steps, you would need to use restart. Unfortunately, there is no other way. 


      - After each load step, exit /SOLU, enter /POST1, extract omega with above script


      - Re-enter /SOLU with antype,,restart command. Also, you need to save restart points at end of each load step (RESCONTROL command)


      Please have a look in ANSYS help doc on these commands (ANTYPE,,RESTART & RESCONTROL) for more explanation.


      Hope this helps.


      Best regards,


      Rohith


       

    • manu87
      Subscriber

      Hello, Rohith(may be this is more suitable)


      Thanks for your help. I'll check the content you menthioned. Keep contact.


      Regards.

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