# Problem with spring -- ansys APDL

In summary, the engineer wants to create a system for the three coil springs. First, they define the three coil springs. Next, they create the body for the springs, and last, they create the system for the springs.f

Hi,
could you help me with my parametric model please? I have a problem with the end of spring. At the end of load (displacement) is problem with solve stress because there is concentrated stress and it shouldn't be. I didn't define contact between coils yet. I need to repair this fail at first. So if you could help me with to solve this problem it will be fine.

Here is the code of the spring:

!-----------------------
! POCATECNI PODMINKY
!-----------------------
finish
/clear

ELEV=3 !Stoupani pruziny [mm]
D=1.2 !Prumer dratu [mm]
DIV=150 !Deleni pri sweepu
YOUNG=210000 !Modul pruznosti v tahu [MPa]
G=81500 !Modul pruznosti ve smyku [MPa]
PI=3.141592653589793
n=5 !Pocet cinnych zavitu [-]
POSUV=500 !Stlaceni pruziny [mm]
!FORCE=100 !Zatizeni pruziny [N]

P2=D/(2*PI)
/prep7
!--------------------
! PRVEK A MATERIAL
!--------------------
et,1,solid186 !Definuje prvni element
et,2,plane183 !Definuje druhy element
et,3,solid187 !Definuje treti element
mp,ex ,1,YOUNG !Younguv modul
mp,prxy,1,(YOUNG-2*G)/(2*G) !Poisson
!---------------------------------------------------------------------------------------------------------
! TVORBA TELESA
!---------------------------------------------------------------------------------------------------------
!---------------------------------------
!TVORBA POCATECNIHO ZAVERNEHO ZAVITU
!---------------------------------------
local,11,cylin,0,0,0,0,0,0,0,0 !Vytvori valcovy souradnicovy system pruziny
csys,11 !Prepnuti do souradnicoveho systemu pruziny
wpcsys,1,11 !Posune pracovni rovinu do souradneho systemu pruziny

*do,i,1,8 !Vytvori body pro pocatecni uzavreny zavit
*enddo

*do,i,1,7 !Pospojuje body do sroubovice
l,i,i+1
*enddo

lcomb,all !Vytvori strednici zaverneho zavitu

local,12,cart,,,,,PSI*(180/PI)+90 !Vytvori system pro prurez dratu
wpcsys,1,12 !Vytvori system pro prurez dratu

extopt,attr,0,0,1 !Zpusobi ze prurez se potahne kolmo ke strednici
vdrag,1,,,,,,1 !Potahne prurez po sroubovici

local,13,cart,0,0,(D/4)*cos(PSI) !Vytvori system pro srazeni zavitu
wpcsys,1,13 !Vytvori system pro srazeni zavitu
cyl4,0,0,RADIUS+D, , , ,-D !Vytvori valec

vsbv,1,2, ,DELETE,DELETE !Provede rozdil teles
ldele,1 !Odstrani puvodni strednici
!---------------------------------------
!TVORBA CINNYCH ZAVITU
!---------------------------------------
local,14,cylin,0,0,P2*(7/4)*PI,-45,0,0,0,0 !Vytvori valcovy souradnicovy system pruziny
wpcsys,1,14 !Posune pracovni rovinu do souradneho systemu pruziny

*do,i,1,2 !Vytvori body pro dokonceni zaverneho zavitu
*enddo

*do,i,1,(n*8) !Vytvori body tvorici cinne zavity
*enddo

*do,i,20*(n+3)+1,20*(n+3)+2+n*8 !Pospojuje body tvorici sroubovici
l,i,i+1
*enddo

lsla,u !Odstrani z vyberu cary lezici na carach
lcomb,all !Vytvori jednu sroubovici

extopt,attr,0,0,1
vdrag,6,,,,,,1 !Vytvori cinne zavity pruziny
ldele,1 !Odstani puvodni strednici
!---------------------------------------
!TVORBA KONCOVEHO ZAVERNEHO ZAVITU
!---------------------------------------
local,15,cylin,0,0,n*ELEV+4*P2*PI,0,180,0,0,0 !Vytvori valcovy souradnicovy system pruziny
csys,15 !Prepnuti do souradnicoveho systemu pruziny
wpcsys,1,15 !Posune pracovni rovinu do souradneho systemu pruziny

*do,i,1,8 !Vytvori body pro pocatecni uzavreny zavit
*enddo

*do,i,1+30*(n+3),30*(n+3)+7 !Pospojuje body do sroubovice
l,i,i+1
*enddo

lsla,u !Odstrani z vyberu cary lezici na carach
lcomb,all !Vytvori jednu sroubovici

local,16,cart,0,0,n*ELEV+4*P2*PI,180,-PSI*(180/PI)+90,180,0,0
wpcsys,1,16
extopt,attr,0,0,1 !Zpusobi ze prurez se potahne kolmo k sroubovici
vdrag,7,,,,,,1 !Potahne prurez po sroubovici

local,17,cart,0,0,n*ELEV+4*P2*PI-(D/4)*cos(PSI),0,,180,0,0
wpcsys,1,17 !Vytvori SS pro dokonceni zakonceni
cyl4,0,0,RADIUS+D, , , ,-D !Vytvori valec
vsbv,2,4, ,DELETE,DELETE !Provede rozdil teles
nummrg,kp,1e-5 !Pospojuje keypointy
!-------------------
! ZESITOVANI
!-------------------
vsel,s,,,1 !Vybere cinne zavity
latt,1,,2
extopt,esize,DIV,0 !Nastavi velikost elementu
vsweep,1,6,5 !Provede sweep cinnymi zavity

vsel,inve !Vybere zaverne zavity
vatt,1,,3
mopt,tetexpnd,1 !Definuje podminky pro mesh
desize,3,1,50,8,13 !Nastavi velikosti
vmesh,all !Provede zesitovani zavernych zavitu

!-------------------
! KONTAKT
!-------------------

!-------------------
! OKRAJOVE PODMINKY
!-------------------
da,28,all,0 !Na konec pruziny definuje vetknuti
da,16,uz,-POSUV !Na konec pruziny definuje deformacni podminku
!-------------------
! RESENI
!-------------------
csys,1 !Prepnuti do cylindrickeho SS
wpcsys,1,1 !Prepnuti do cylindrickeho SS
/solu
antype,static !Definice analyzy
allsel,all !Vybere vsechno
solve !Spusti reseni
finish
/post1

plnsol,s,eqv,0,1.0 !Vykresli napeti podle podminky HMH

#### Attachments

• 1.png
93 KB · Views: 719
• 2.jpg
41.4 KB · Views: 824
It looks as though the geometry you have specified has a single point in the mesh near your boundary condition, which is in turn causing a stress discontinuity. I recommend re-visiting your mesh geometry or geometry creation to make sure you don't have any sharp corners or points, but even in that case if you're applying a fixed deformation at that surface your maximum stress will probably continue to show up in that region near the boundary condition.

I tried to set a finer mesh but the maximum of nodes which I can use is only 32 000 because I have only student licence. I worked only with beams yet so I'm little bit confused. It's my first solid model which I need to my bachelor thesis. I tried to apply without fixed deformation a pressure but the solution was same. Someone said me that I should to turn on a midside nodes but when I tried it so I get only error. Is there any other way to define compression of spring? I know a lengths of spring like L0, L1, L8 and L9 so I need to define compression.

What element type are you using? You'll need to use the appropriate element to allow use of mid-side nodes.

Keep in mind that FEA models (especially ones with limited node/elements) will have both "real" and "artificial" stress concentrations. It's your job as an engineer to understand which is which, and have some justification as to why that is the case.

Yes, I understand. But in my opinion in this area shouldn!t be stress concrentrations. For sweep I used solid 186 and last coil is meshed with solid187. I tried to mesh with mesh200 but it's not possible.

Yes, I have. The sweep mesh is only on the portion of the spring which has a constant cross-section. Only the coil which have not a constant cross-section is meshed by free mesh.

This is my mesh.

Last edited:
Nice work. What kind of boundary conditions are you applying to the spring to compress it?

On one side I set all DOFS as zero and on second side I defined only uz. I can't apply pressure because I don't know but displacement I know.

Your stress concentration in your mesh is expected, as it is a result of the flat grind on the end of the spring. Because the DOF's are set to zero at all nodes on that surface, the flexible element nearest the flat surface sees an abnormal amount of stress; in essence, it's like being welded to another infinitely rigid surface. A few options to reduce or eliminate this stress are:
1. Get rid of the flat ground surfaces, constrain at the wire ends instead
2. Use a flexible body to compress the spring with potentially non-linear boundary conditions
3. Utilize a "compression only" support at the flat surfaces and then separately constrain rigid body motion using nodal supports at a few key vertices
No amount of mesh optimization will completely eliminate this stress concentration, only increase the precision at which you're calculating the stress there. Does this make sense?