CalculiX  2.13
A Free Software Three-Dimensional Structural Finite Element Program
springforc_f2f.f File Reference

Go to the source code of this file.

Functions/Subroutines

subroutine springforc_f2f (xl, vl, imat, elcon, nelcon, elas, fnl, ncmat_, ntmat_, nope, lakonl, t1l, kode, elconloc, plicon, nplicon, npmat_, senergy, nener, cstr, mi, springarea, nmethod, ne0, nstate_, xstateini, xstate, reltime, ielas, iloc, jfaces, igauss, pslavsurf, pmastsurf, clearini, venergy, kscale, konl, iout, nelem)
 

Function/Subroutine Documentation

◆ springforc_f2f()

subroutine springforc_f2f ( real*8, dimension(3,10)  xl,
real*8, dimension(0:mi(2),19)  vl,
integer  imat,
real*8, dimension(0:ncmat_,ntmat_,*)  elcon,
integer, dimension(2,*)  nelcon,
real*8, dimension(21)  elas,
real*8, dimension(3,19)  fnl,
integer  ncmat_,
integer  ntmat_,
integer  nope,
character*8  lakonl,
real*8  t1l,
integer  kode,
real*8, dimension(21)  elconloc,
real*8, dimension(0:2*npmat_,ntmat_,*)  plicon,
integer, dimension(0:ntmat_,*)  nplicon,
integer  npmat_,
real*8  senergy,
integer  nener,
real*8, dimension(6)  cstr,
integer, dimension(*)  mi,
real*8, dimension(2)  springarea,
integer  nmethod,
integer  ne0,
integer  nstate_,
real*8, dimension(nstate_,mi(1),*)  xstateini,
real*8, dimension(nstate_,mi(1),*)  xstate,
real*8  reltime,
integer  ielas,
integer  iloc,
integer  jfaces,
integer  igauss,
real*8, dimension(3,*)  pslavsurf,
real*8, dimension(6,*)  pmastsurf,
real*8, dimension(3,9,*)  clearini,
real*8  venergy,
integer  kscale,
integer, dimension(26)  konl,
integer  iout,
integer  nelem 
)
26 !
27 ! calculates the force of the spring (face-to-face penalty)
28 !
29  implicit none
30 !
31  character*8 lakonl
32 !
33  integer i,j,k,imat,ncmat_,ntmat_,nope,iflag,mi(*),
34  & kode,niso,id,nplicon(0:ntmat_,*),npmat_,nelcon(2,*),nener,
35  & nmethod,ne0,nstate_,ielas,jfaces,kscale,konl(26),
36  & iloc,igauss,nopes,nopem,nopep,iout,nelem
37 !
38  real*8 xl(3,10),elas(21),t1l,al(3),vl(0:mi(2),19),stickslope,
39  & pl(3,19),xn(3),alpha,beta,fnl(3,19),tp(3),te(3),ftrial(3),
40  & t(3),dftrial,elcon(0:ncmat_,ntmat_,*),pproj(3),clear,
41  & xi,et,elconloc(21),plconloc(82),xk,val,xiso(20),yiso(20),
42  & plicon(0:2*npmat_,ntmat_,*),um,senergy,cstr(6),dg,venergy,
43  & dfshear,dfnl,springarea(2),overlap,pres,clearini(3,9,*),
44  & xstate(nstate_,mi(1),*),xstateini(nstate_,mi(1),*),t1(3),t2(3),
45  & dt1,dte,alnew(3),reltime,weight,xsj2m(3),xs2m(3,7),shp2m(7,9),
46  & xsj2s(3),xs2s(3,7),shp2s(7,9),pslavsurf(3,*),pmastsurf(6,*)
47 !
48  include "gauss.f"
49 !
50  iflag=2
51 !
52  if(nener.eq.1) venergy=0.d0
53 !
54 ! # of master nodes
55 !
56  nopem=ichar(lakonl(8:8))-48
57 !
58 ! # of slave nodes
59 !
60  nopes=nope-nopem
61 !
62 ! actual positions of the master nodes belonging to the contact spring
63 !
64 c if(nmethod.ne.2) then
65  do i=1,nopem
66  do j=1,3
67  pl(j,i)=xl(j,i)+vl(j,i)
68  enddo
69  enddo
70 c else
71 c!
72 c! for frequency calculations the eigenmodes are freely
73 c! scalable, leading to problems with contact finding
74 c!
75 c do i=1,nopem
76 c do j=1,3
77 c pl(j,i)=xl(j,i)
78 c enddo
79 c enddo
80 c endif
81 !
82 ! actual positions of the slave nodes belonging to the contact spring
83 !
84  if(nmethod.ne.2) then
85  do i=nopem+1,nope
86  do j=1,3
87  pl(j,i)=xl(j,i)+clearini(j,i-nopem,jfaces)*reltime
88  & +vl(j,i)
89  enddo
90  enddo
91  else
92 !
93 ! for frequency calculations the eigenmodes are freely
94 ! scalable, leading to problems with contact finding
95 !
96  do i=nopem+1,nope
97  do j=1,3
98  pl(j,i)=xl(j,i)+clearini(j,i-nopem,jfaces)*reltime
99  enddo
100  enddo
101  endif
102 !
103 ! location of integration point in slave face
104 !
105  xi=pslavsurf(1,igauss)
106  et=pslavsurf(2,igauss)
107  weight=pslavsurf(3,igauss)
108 !
109  iflag=1
110  if(nopes.eq.9) then
111  call shape9q(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
112  elseif(nopes.eq.8) then
113  call shape8q(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
114  elseif(nopes.eq.4) then
115  call shape4q(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
116  elseif(nopes.eq.6) then
117  call shape6tri(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
118  elseif(nopes.eq.7) then
119  call shape7tri(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
120  else
121  call shape3tri(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
122  endif
123 !
124  nopep=nope+1
125 !
126  do k=1,3
127  pl(k,nopep)=0.d0
128  vl(k,nopep)=0.d0
129  do j=1,nopes
130  pl(k,nopep)=pl(k,nopep)+shp2s(4,j)*pl(k,nopem+j)
131  vl(k,nopep)=vl(k,nopep)+shp2s(4,j)*vl(k,nopem+j)
132  enddo
133  enddo
134 !
135 ! corresponding location in the master face
136 !
137  xi=pmastsurf(1,igauss)
138  et=pmastsurf(2,igauss)
139 !
140 ! determining the jacobian vector on the surface
141 !
142  iflag=2
143  if(nopem.eq.9) then
144  call shape9q(xi,et,pl,xsj2m,xs2m,shp2m,iflag)
145  elseif(nopem.eq.8) then
146  call shape8q(xi,et,pl,xsj2m,xs2m,shp2m,iflag)
147  elseif(nopem.eq.4) then
148  call shape4q(xi,et,pl,xsj2m,xs2m,shp2m,iflag)
149  elseif(nopem.eq.6) then
150  call shape6tri(xi,et,pl,xsj2m,xs2m,shp2m,iflag)
151  elseif(nopem.eq.7) then
152  call shape7tri(xi,et,pl,xsj2m,xs2m,shp2m,iflag)
153  else
154  call shape3tri(xi,et,pl,xsj2m,xs2m,shp2m,iflag)
155  endif
156 !
157  do i=1,3
158  pproj(i)=0.d0
159  do j=1,nopem
160  pproj(i)=pproj(i)+shp2m(4,j)*pl(i,j)
161  enddo
162  enddo
163 !
164 ! distance vector between both
165 !
166  do i=1,3
167  al(i)=pl(i,nopep)-pproj(i)
168  enddo
169 !
170 ! normal on the master face
171 !
172  xn(1)=pmastsurf(4,igauss)
173  xn(2)=pmastsurf(5,igauss)
174  xn(3)=pmastsurf(6,igauss)
175 !
176 ! distance from surface along normal (= clearance)
177 !
178  clear=al(1)*xn(1)+al(2)*xn(2)+al(3)*xn(3)
179 !
180 ! check for a reduction of the initial penetration, if any
181 !
182  if(nmethod.eq.1) then
183  clear=clear-springarea(2)*(1.d0-reltime)
184  endif
185  if(clear.le.0.d0) cstr(1)=clear
186 !
187 !
188  if(int(elcon(3,1,imat)).eq.1) then
189 !
190 ! exponential overclosure
191 !
192  if(dabs(elcon(2,1,imat)).lt.1.d-30) then
193  elas(1)=0.d0
194  beta=1.d0
195  else
196 !
197  alpha=elcon(2,1,imat)*springarea(1)
198  beta=elcon(1,1,imat)
199  if(-beta*clear.gt.23.d0-dlog(alpha)) then
200  beta=(dlog(alpha)-23.d0)/clear
201  endif
202  elas(1)=dexp(-beta*clear+dlog(alpha))
203  endif
204  if(nener.eq.1) then
205  senergy=elas(1)/beta;
206  endif
207  elseif((int(elcon(3,1,imat)).eq.2).or.
208  & (int(elcon(3,1,imat)).eq.4)) then
209 !
210 ! linear overclosure/tied overclosure
211 !
212  elas(1)=-springarea(1)*elcon(2,1,imat)*clear/kscale
213  if(nener.eq.1) then
214  senergy=-elas(1)*clear/2.d0;
215  endif
216  elseif(int(elcon(3,1,imat)).eq.3) then
217 !
218 ! tabular overclosure
219 !
220 ! interpolating the material data
221 !
222  call materialdata_sp(elcon,nelcon,imat,ntmat_,i,t1l,
223  & elconloc,kode,plicon,nplicon,npmat_,plconloc,ncmat_)
224  overlap=-clear
225  niso=int(plconloc(81))
226  do i=1,niso
227  xiso(i)=plconloc(2*i-1)
228  yiso(i)=plconloc(2*i)
229  enddo
230  call ident(xiso,overlap,niso,id)
231  if(id.eq.0) then
232  pres=yiso(1)
233  if(nener.eq.1) then
234  senergy=yiso(1)*overlap;
235  endif
236  elseif(id.eq.niso) then
237  pres=yiso(niso)
238  if(nener.eq.1) then
239  senergy=yiso(1)*xiso(1)
240  do i=2,niso
241  senergy=senergy+(xiso(i)-xiso(i-1))*
242  & (yiso(i)+yiso(i-1))/2.d0
243  enddo
244  senergy=senergy+(pres-xiso(niso))*yiso(niso)
245  endif
246  else
247  xk=(yiso(id+1)-yiso(id))/(xiso(id+1)-xiso(id))
248  pres=yiso(id)+xk*(overlap-xiso(id))
249  if(nener.eq.1) then
250  senergy=yiso(1)*xiso(1)
251  do i=2, id
252  senergy=senergy+(xiso(i)-xiso(i-1))*
253  & (yiso(i)+yiso(i-1))/2.d0
254  enddo
255  senergy=senergy+(overlap-xiso(id))*(pres+yiso(id))/2.d0
256  endif
257  endif
258  elas(1)=springarea(1)*pres
259  if(nener.eq.1) senergy=springarea(1)*senergy
260  endif
261 !
262 ! forces in the nodes of the contact element
263 !
264  do i=1,3
265  fnl(i,nopep)=-elas(1)*xn(i)
266  enddo
267  cstr(4)=elas(1)/springarea(1)
268 !
269 ! Coulomb friction for static calculations
270 !
271  if((int(elcon(3,1,imat)).eq.4).and.(ncmat_.lt.7)) then
272  write(*,*) '*ERROR in springforc_f2f: for contact'
273  write(*,*) ' with pressure-overclosure=tied'
274  write(*,*) ' a stick slope using the *FRICTION'
275  write(*,*) ' card is mandatory'
276  call exit(201)
277  endif
278 !
279  if(ncmat_.ge.7) then
280 !
281 ! tied contact
282 !
283  if(int(elcon(3,1,imat)).eq.4) then
284  um=1.d30
285  else
286  um=elcon(6,1,imat)
287  endif
288  stickslope=elcon(7,1,imat)/kscale
289 !
290  if(um.gt.0.d0) then
291  if(1.d0 - dabs(xn(1)).lt.1.5231d-6) then
292 !
293 ! calculating the local directions on master surface
294 !
295  t1(1)=-xn(3)*xn(1)
296  t1(2)=-xn(3)*xn(2)
297  t1(3)=1.d0-xn(3)*xn(3)
298  else
299  t1(1)=1.d0-xn(1)*xn(1)
300  t1(2)=-xn(1)*xn(2)
301  t1(3)=-xn(1)*xn(3)
302  endif
303  dt1=dsqrt(t1(1)*t1(1)+t1(2)*t1(2)+t1(3)*t1(3))
304  do i=1,3
305  t1(i)=t1(i)/dt1
306  enddo
307  t2(1)=xn(2)*t1(3)-xn(3)*t1(2)
308  t2(2)=xn(3)*t1(1)-xn(1)*t1(3)
309  t2(3)=xn(1)*t1(2)-xn(2)*t1(1)
310 !
311 ! linear stiffness of the shear stress versus
312 ! slip curve
313 !
314  xk=stickslope*springarea(1)
315 !
316 ! calculating the relative displacement between the slave node
317 ! and its projection on the master surface
318 !
319  do i=1,3
320  alnew(i)=vl(i,nopep)
321  do j=1,nopem
322  alnew(i)=alnew(i)-shp2m(4,j)*vl(i,j)
323  enddo
324  enddo
325 !
326 ! calculating the difference in relative displacement since
327 ! the start of the increment = lamda^*
328 !
329  do i=1,3
330  al(i)=alnew(i)-xstateini(3+i,1,ne0+iloc)
331  enddo
332 !
333 ! ||lambda^*||
334 !
335  val=al(1)*xn(1)+al(2)*xn(2)+al(3)*xn(3)
336 !
337 ! update the relative tangential displacement
338 !
339  do i=1,3
340  t(i)=xstateini(6+i,1,ne0+iloc)+al(i)-val*xn(i)
341  enddo
342 !
343 ! store the actual relative displacement and
344 ! the actual relative tangential displacement
345 !
346  do i=1,3
347  xstate(3+i,1,ne0+iloc)=alnew(i)
348  xstate(6+i,1,ne0+iloc)=t(i)
349  enddo
350 !
351 ! size of normal force
352 !
353  dfnl=dsqrt(fnl(1,nopep)**2+fnl(2,nopep)**2+
354  & fnl(3,nopep)**2)
355 !
356 ! maximum size of shear force
357 !
358  if(int(elcon(3,1,imat)).eq.4) then
359  dfshear=1.d30
360  else
361  dfshear=um*dfnl
362  endif
363 !
364 ! plastic and elastic slip
365 !
366  do i=1,3
367  tp(i)=xstateini(i,1,ne0+iloc)
368  te(i)=t(i)-tp(i)
369  enddo
370  dte=dsqrt(te(1)*te(1)+te(2)*te(2)+te(3)*te(3))
371 !
372 ! trial force
373 !
374  do i=1,3
375  ftrial(i)=xk*te(i)
376  enddo
377  dftrial=xk*dte
378 c dftrial=dsqrt(ftrial(1)**2+ftrial(2)**2+ftrial(3)**2)
379 !
380 ! check whether stick or slip
381 !
382  if((dftrial.lt.dfshear).or.(dftrial.le.0.d0).or.
383  & (ielas.eq.1)) then
384 !
385 ! stick
386 !
387  do i=1,3
388  fnl(i,nopep)=fnl(i,nopep)+ftrial(i)
389  xstate(i,1,ne0+iloc)=tp(i)
390  enddo
391  cstr(5)=(ftrial(1)*t1(1)+ftrial(2)*t1(2)+
392  & ftrial(3)*t1(3))/springarea(1)
393  cstr(6)=(ftrial(1)*t2(1)+ftrial(2)*t2(2)+
394  & ftrial(3)*t2(3))/springarea(1)
395 !
396 ! shear elastic energy
397 !
398  if(nener.eq.1) senergy=senergy+dftrial*dte
399  else
400 !
401 ! slip
402 !
403  dg=(dftrial-dfshear)/xk
404  do i=1,3
405  ftrial(i)=te(i)/dte
406  fnl(i,nopep)=fnl(i,nopep)+dfshear*ftrial(i)
407  xstate(i,1,ne0+iloc)=tp(i)+dg*ftrial(i)
408  enddo
409  cstr(5)=(dfshear*ftrial(1)*t1(1)+
410  & dfshear*ftrial(2)*t1(2)+
411  & dfshear*ftrial(3)*t1(3))/springarea(1)
412  cstr(6)=(dfshear*ftrial(1)*t2(1)+
413  & dfshear*ftrial(2)*t2(2)+
414  & dfshear*ftrial(3)*t2(3))/springarea(1)
415 !
416 ! shear elastic and viscous energy
417 !
418  if(nener.eq.1) then
419  senergy=senergy+dfshear*dfshear/xk
420  venergy=dg*dfshear
421  endif
422 !
423  endif
424  endif
425 !
426 ! storing the tangential displacements
427 !
428  cstr(2)=t(1)*t1(1)+t(2)*t1(2)+t(3)*t1(3)
429  cstr(3)=t(1)*t2(1)+t(2)*t2(2)+t(3)*t2(3)
430  endif
431 !
432 ! force in the master nodes
433 !
434  do i=1,3
435  do j=1,nopem
436  fnl(i,j)=-shp2m(4,j)*fnl(i,nopep)
437  enddo
438  enddo
439 !
440 ! forces in the nodes of the slave face
441 !
442  do i=1,3
443  do j=1,nopes
444  fnl(i,nopem+j)=shp2s(4,j)*fnl(i,nopep)
445  enddo
446  enddo
447 !
448 ! write statements for Malte Krack
449 !
450 c if(iout.gt.0) then
451 c write(*,*) 'contact element: ',nelem
452 c write(*,*) 'undeformed location of the integration point'
453 c write(*,*) ((pl(j,nopep)-vl(j,nopep)),j=1,3)
454 c write(*,*) 'deformed location of the integration point'
455 c write(*,*) (pl(j,nopep),j=1,3)
456 c write(*,*) 'nodes and shape values'
457 c do j=1,nopem
458 c write(*,*) konl(j),-shp2m(4,j)
459 c enddo
460 c do j=1,nopes
461 c write(*,*) konl(nopem+j),shp2s(4,j)
462 c enddo
463 c write(*,*) 'contact force'
464 c write(*,*) fnl(1,nopep),fnl(2,nopep),fnl(3,nopep)
465 c write(*,*) 'slave area'
466 c write(*,*) springarea(1)
467 c endif
468 !
469  return
subroutine ident(x, px, n, id)
Definition: ident.f:26
subroutine shape9q(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape9q.f:20
subroutine shape8q(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape8q.f:20
subroutine shape3tri(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape3tri.f:20
subroutine shape7tri(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape7tri.f:20
subroutine shape4q(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape4q.f:20
subroutine materialdata_sp(elcon, nelcon, imat, ntmat_, i, t1l, elconloc, kode, plicon, nplicon, npmat_, plconloc, ncmat_)
Definition: materialdata_sp.f:20
subroutine shape6tri(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape6tri.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)