General Mechanical

General Mechanical

Topics relate to Mechanical Enterprise, Motion, Additive Print and more

How to export response PSDs with APDL

    • deltav
      Subscriber
      Hi,nI ran a random vibration analysis in Workbench and I need to export the acceleration response PSD for a number of nodes automatically via APDL.nSo far I always right clicked on the table results and exported the table manually.nHow would the equivalent APDL code look like?nI tried to adapt similar code snippets but only received zero vectors in my written output file.nHelp would be really appreciated!n
    • Chandra Sekaran
      Ansys Employee
      In APDL you would use POST26 to calculate the response PSD. Typical commands to calculate response PSD are:n/post26nstore,psd,10nnsol,2,199,u,y ! store UY displacement at node 199. store it as variable 2n ! you would use ESOL for element quantities such as stresses, RSOL for reactions and so forthnrpsd,3,2,2,.... ! calculate the response PSD of UY at node 199 . store it in variable 3. n ! you can calculate displacement, velocity or acceleration. Also you can calculate relative or absolute response PSDnnOnce the above rpsd is executed and the result stored in a variable like 3 above then you can use simple PRVAR command to print this to a file like below:nnLINES,1e6 ! this command just removes headers that come up every 50 lines n/output,d:\rpsd3,dat ! send output of subsequent commands to file rpsd3.dat on d:\ foldernPRVAR,3 ! print variable 3n/output ! reset the output to screeYou can also look at VGET command (along with *DIM command ) to get the variable 3 value into an array and then use *VWRITE to write the array to a file. However PRVAR is the simplest approach.
    • deltav
      Subscriber
      Thanks a lot for the quick answer, it works like a charm. Now, I would like to choose the nodes from a component cm1 created in mechanical and export the psd for all those nodes. I tried the following but can't get it to run. Is there maybe an even easier solution with VGET and VWRITE? n/POST26nstore,psd,10ncmsel,s,cm1,node               ! get nodes in component cm1n*get,currn,node,0,num,min      ! get node with lowest idn*get,num_of_nodes,node,0,count ! get number of all selected nodesn*do,I,1,num_of_nodes           ! iterate over selected nodesn nsol,2,currn,u,y           ! get nodal resultn rpsd,3,2,,3,1              ! get psd resultsn LINES,1e6                  ! removes headern /output,c:
      psd4,dat,,append   ! append to rpsd4 filen PRVAR,3n /outputn *get,currn,node,currn,nxth ! get node with next higher idn*enddon
Viewing 2 reply threads
  • You must be logged in to reply to this topic.