Ansys Assistant will be unavailable on the Learning Forum starting January 30. An upgraded version is coming soon. We apologize for any inconvenience and appreciate your patience. Stay tuned for updates.
General Mechanical

General Mechanical

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

How to get elastic force of a large number of spring connections in a model using APDL command?

    • AmbarNaik13
      Subscriber
      In my model, I have various clinched joints which are modeled using spring connections between the two plates. For each joining point there is a reference co-ordinate system, the origin of which is the center of clinched joint. There 3 spring connections defined; one in each major axis.nIn ANSYS, in the solution tree, the elastic force in spring connection can be checked using spring probe. However, it is a tedious task to check elastic force in 111 spring connections individually considering the evaluation. nIt would be nice if someone can suggest me an APDL commant in which I can retrieve these results all at once like in a row and column format. For eg. force in a spring connection (X-direction); along-with the name of the spring connection:n nSpring 1 xxx nSpring 2 xxxnnI am not an advanced user when it comes to scripting. It would be nice if somebody could provide me with a command. Thank you in advance.n
    • Ashish Khemka
      Forum Moderator
      nnPlease refer the following link:nnYou can implemenet the same within a *do loop.nnRegards,nAshish Khemkan
    • JJ_Thompson
      Subscriber
      Hello, you can try the following:*dim,force_X,array,111,2 nesel,,ename,,COMBIN14 slencm,spring,elem n!now loop over all springs n*do,i,1,111, nCmsel,,springnnslen*GET,max_elem,ELEM,,NUM,MAXnesel,,elem,,max_elemnnslen*GET,REAL_NO,ELEM,max_elem,ATTR,REALncmsel,,springnesel,r,real,,REAL_NOnesel,r,ename,,combin14nnsleneslnnfsum,n*get,_FX,fsum,fxnforce_X(i,1)=real_nonforce_X(i,2)=_FXncmsel,,springnesel,u,real,,real_nonnslencm,spring,elemn*enddon*cfopen,FORCE_XX,txtn*vwrite,force_X(1,1),force_X(1,2)n%G %Gn*cfclosennYou should go to the mechanical folder where you work and find force_XX.txt. You can replace the spring real constant with the location of the spring and add two more columns to the table. I do not know what kind of spring you are using so you can modify the code for your use.
    • AmbarNaik13
      Subscriber
      @JJ_thompson Do I have to use this code as APDL command?n
    • JJ_Thompson
      Subscriber
      Yes, you have to add it as a command snippet in the solution section of the project tree in Ansys Mechanical. What version of Ansys are you using? You should also back up your workbench files before you start. n
    • AmbarNaik13
      Subscriber
      I am using ANSYS 2019 R2. I tried to open the text file of the results. It says, it is too big to be opened using notepad.n
    • peteroznewman
      Subscriber
      Get Notepad++ which is a free text editor that can handle large files and is much faster at opening large files than Notepad.nhttps://notepad-plus-plus.org/downloads/n
    • JJ_Thompson
      Subscriber
      nHello AmbarNaik13,Did you try Peter's suggestion? I have opened notepad files with lots of contact definitions containing lots of columns and rows; I did not have a problem. nYou can also try breaking the file into two or more parts. Or import it into an external program like Matlab. n
    • AmbarNaik13
      Subscriber
      nI tried opening that file in Notepad++, it says its too big to be opened. The file size is around 10 GB.n
    • peteroznewman
      Subscriber
      nIs this model a Transient Structural analysis? Those are notorious for creating very large result files. The trick to avoiding excessively large files is to set an appropriate value on the frequency of writing output. Under Analysis Settings, is Output Controls and under that is a pull down for Store Results At and I have typed a Value of 100. That means ANSYS will only write output 1 time in 100 increments. That would take a 10,000 MB file and make it 100 MB.n
    • AmbarNaik13
      Subscriber
      Hi. It is static structural analysis. I will try your suggestion and revert back.n
    • AmbarNaik13
      Subscriber
      Asking this question just for clarification. The results are stored in file.rst ?nI tried opening such file of another project which is only 100 MB. But it looks like the file is encoded. nn
    • peteroznewman
      Subscriber
      I thought you were using the code provided. Don't open the .rst file, that is binary.nGo to the mechanical folder where you work and find force_XX.txt as described in JJ_thompson's post.n
    • AmbarNaik13
      Subscriber
      The file generated is completely blank. I also don't understand how to make changes in that code related to spring real constant. I am bit unfamiliar with the coding.n
    • peteroznewman
      Subscriber
      I am a novice at coding, but I have successfully used code someone wrote for me that created a text file. If you can share your project, I can try out JJ_tompson's code.n
    • AmbarNaik13
      Subscriber
      Unfortunately, due to confidentiality I cannot share the project here.n
    • AmbarNaik13
      Subscriber
      I had to share the above mentioned file in another thread. Could you use those files to write the code so that the text file is generated?n
Viewing 16 reply threads
  • The topic ‘How to get elastic force of a large number of spring connections in a model using APDL command?’ is closed to new replies.
[bingo_chatbox]