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

Go to the source code of this file.

Functions/Subroutines

subroutine springstiff_f2f_th (xl, voldl, s, imat, elcon, nelcon, ncmat_, ntmat_, nope, lakonl, kode, elconloc, plicon, nplicon, npmat_, springarea, nmethod, mi, reltime, jfaces, igauss, pslavsurf, pmastsurf, clearini, matname, plkcon, nplkcon, node, noel, istep, iinc, timeend)
 

Function/Subroutine Documentation

◆ springstiff_f2f_th()

subroutine springstiff_f2f_th ( real*8, dimension(3,19), intent(in)  xl,
real*8, dimension(0:mi(2),19), intent(in)  voldl,
real*8, dimension(60,60), intent(inout)  s,
integer, intent(in)  imat,
real*8, dimension(0:ncmat_,ntmat_,*), intent(in)  elcon,
integer, dimension(2,*), intent(in)  nelcon,
integer, intent(in)  ncmat_,
integer, intent(in)  ntmat_,
integer, intent(in)  nope,
character*8, intent(in)  lakonl,
integer, intent(in)  kode,
real*8, dimension(21), intent(inout)  elconloc,
real*8, dimension(0:2*npmat_,ntmat_,*), intent(in)  plicon,
integer, dimension(0:ntmat_,*), intent(in)  nplicon,
integer, intent(in)  npmat_,
real*8, dimension(2), intent(in)  springarea,
integer, intent(in)  nmethod,
integer, dimension(*), intent(in)  mi,
real*8, intent(in)  reltime,
integer, intent(in)  jfaces,
integer, intent(in)  igauss,
real*8, dimension(3,*), intent(in)  pslavsurf,
real*8, dimension(6,*), intent(in)  pmastsurf,
real*8, dimension(3,9,*), intent(in)  clearini,
character*80, dimension(*), intent(in)  matname,
real*8, dimension(0:2*npmat_,ntmat_,*), intent(in)  plkcon,
integer, dimension(0:ntmat_,*), intent(in)  nplkcon,
integer, intent(in)  node,
integer, intent(in)  noel,
integer, intent(in)  istep,
integer, intent(in)  iinc,
real*8, dimension(2)  timeend 
)
24 !
25 ! calculates the stiffness of a spring (face-to-face penalty)
26 !
27  implicit none
28 !
29  character*8 lakonl
30 !
31  character*80 matname(*),slname,msname
32 !
33  integer i,j,imat,ncmat_,ntmat_,k,nope,iflag,npred,
34  & kode,niso,id,nplicon(0:ntmat_,*),npmat_,nelcon(2,*),
35  & nmethod,mi(*),node,noel,jfaces,igauss,nopem,nopes,nopep,
36  & nplkcon(0:ntmat_,*),istep,iinc
37 !
38  real*8 xl(3,19),pproj(3),shp2m(7,9),ak(5),
39  & al(3),s(60,60),voldl(0:mi(2),19),pl(3,19),xn(3),
40  & alpha,beta,elcon(0:ncmat_,ntmat_,*),xm(3),
41  & xi,et,dpresdoverlap,xs2(3,7),elconloc(21),plconloc(802),
42  & xk,temp(2),xiso(20),yiso(20),plicon(0:2*npmat_,ntmat_,*),d(2),
43  & springarea(2),overlap,clear,timeend(2),reltime,
44  & xsj2s(3),xs2s(3,7),shp2s(7,9),weight,pslavsurf(3,*),
45  & pmastsurf(6,*),clearini(3,9,*),t1ls,t1lm,tmean,predef(2),
46  & plkcon(0:2*npmat_,ntmat_,*),pressure,dtemp,flowm(2),
47  & constant,coords(3),conductance
48 !
49  intent(in) xl,voldl,imat,elcon,nelcon,
50  & ncmat_,ntmat_,nope,lakonl,kode,plicon,
51  & nplicon,npmat_,springarea,nmethod,mi,
52  & reltime,jfaces,igauss,pslavsurf,pmastsurf,clearini,matname,
53  & plkcon,nplkcon,node,noel,istep,iinc
54 !
55  intent(inout) s,elconloc
56 !
57  iflag=1
58 !
59 ! # of master nodes
60 !
61  read(lakonl(8:8),'(i1)') nopem
62 !
63 ! # of slave nodes
64 !
65  nopes=nope-nopem
66 !
67 ! actual positions of the nodes belonging to the contact spring
68 ! (otherwise no contact force)
69 !
70  do i=1,nopem
71  do j=1,3
72  pl(j,i)=xl(j,i)+voldl(j,i)
73  enddo
74  enddo
75 !
76  do i=nopem+1,nope
77  do j=1,3
78  pl(j,i)=xl(j,i)+voldl(j,i)+clearini(j,i-nopem,jfaces)
79  & *reltime
80  enddo
81  enddo
82 !
83 ! contact springs
84 !
85  read(lakonl(8:8),'(i1)') nopem
86  nopes = nope - nopem
87 !
88  xi=pslavsurf(1,igauss)
89  et=pslavsurf(2,igauss)
90  weight=pslavsurf(3,igauss)
91 !
92  if(nopes.eq.9) then
93  call shape9q(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
94  elseif(nopes.eq.8) then
95  call shape8q(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
96  elseif(nopes.eq.4) then
97  call shape4q(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
98  elseif(nopes.eq.6) then
99  call shape6tri(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
100  elseif(nopes.eq.7) then
101  call shape7tri(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
102  else
103  call shape3tri(xi,et,pl(1,nopem+1),xsj2s,xs2s,shp2s,iflag)
104  endif
105 !
106  nopep=nope+1
107 !
108  do k=1,3
109  pl(k,nopep)=0.d0
110  enddo
111  t1ls=0.d0
112  do j=1,nopes
113  do k=1,3
114  pl(k,nopep)=pl(k,nopep)+shp2s(4,j)*pl(k,nopem+j)
115  enddo
116  t1ls=t1ls+shp2s(4,j)*voldl(0,nopem+j)
117  enddo
118 !
119  xi=pmastsurf(1,igauss)
120  et=pmastsurf(2,igauss)
121 !
122 ! determining the jacobian vector on the surface
123 !
124  if(nopem.eq.9) then
125  call shape9q(xi,et,pl,xm,xs2,shp2m,iflag)
126  elseif(nopem.eq.8) then
127  call shape8q(xi,et,pl,xm,xs2,shp2m,iflag)
128  elseif(nopem.eq.4) then
129  call shape4q(xi,et,pl,xm,xs2,shp2m,iflag)
130  elseif(nopem.eq.6) then
131  call shape6tri(xi,et,pl,xm,xs2,shp2m,iflag)
132  elseif(nopem.eq.7) then
133  call shape7tri(xi,et,pl,xm,xs2,shp2m,iflag)
134  else
135  call shape3tri(xi,et,pl,xm,xs2,shp2m,iflag)
136  endif
137 !
138  t1lm=0.d0
139  do i=1,3
140  pproj(i)=0.d0
141  enddo
142  do j=1,nopem
143  do i=1,3
144  pproj(i)=pproj(i)+shp2m(4,j)*pl(i,j)
145  enddo
146  t1lm=t1lm+shp2m(4,j)*voldl(0,j)
147  enddo
148 !
149  do i=1,3
150  al(i)=pl(i,nopep)-pproj(i)
151  enddo
152 !
153 ! normal vector on master face
154 !
155  xn(1)=pmastsurf(4,igauss)
156  xn(2)=pmastsurf(5,igauss)
157  xn(3)=pmastsurf(6,igauss)
158 !
159 ! distance from surface along normal (= clearance)
160 !
161  clear=al(1)*xn(1)+al(2)*xn(2)+al(3)*xn(3)
162  if(nmethod.eq.1) then
163  clear=clear-springarea(2)*(1.d0-reltime)
164  endif
165 !
166 ! pressure-overclosure relationship
167 !
168  if(int(elcon(3,1,imat)).eq.1) then
169 !
170 ! exponential overclosure
171 !
172  if(dabs(elcon(2,1,imat)).lt.1.d-30) then
173  pressure=0.d0
174  else
175  alpha=elcon(2,1,imat)
176  beta=elcon(1,1,imat)
177  if(-beta*clear.gt.23.d0-dlog(alpha)) then
178  beta=(dlog(alpha)-23.d0)/clear
179  endif
180  pressure=dexp(-beta*clear+dlog(alpha))
181  endif
182  elseif((int(elcon(3,1,imat)).eq.2).or.
183  & (int(elcon(3,1,imat)).eq.4)) then
184 !
185 ! linear overclosure
186 !
187  pressure=-elcon(2,1,imat)*clear
188  elseif(int(elcon(3,1,imat)).eq.3) then
189 !
190 ! tabular overclosure
191 !
192 ! interpolating the material data
193 !
194  call materialdata_sp(elcon,nelcon,imat,ntmat_,i,tmean,
195  & elconloc,kode,plicon,nplicon,npmat_,plconloc,ncmat_)
196  overlap=-clear
197  niso=int(plconloc(81))
198  do i=1,niso
199  xiso(i)=plconloc(2*i-1)
200  yiso(i)=plconloc(2*i)
201  enddo
202  call ident(xiso,overlap,niso,id)
203  if(id.eq.0) then
204  pressure=yiso(1)
205  elseif(id.eq.niso) then
206  pressure=yiso(niso)
207  else
208  dpresdoverlap=(yiso(id+1)-yiso(id))/(xiso(id+1)-xiso(id))
209  pressure=yiso(id)+dpresdoverlap*(overlap-xiso(id))
210  endif
211  endif
212 !
213 ! calculating the temperature difference across the contact
214 ! area and the mean temperature for the determination of the
215 ! conductance
216 !
217  dtemp=t1lm-t1ls
218  tmean=(t1lm+t1ls)/2.d0
219 !
220 ! interpolating the material data according to temperature
221 !
222  call materialdata_sp(elcon,nelcon,imat,ntmat_,i,tmean,
223  & elconloc,kode,plkcon,nplkcon,npmat_,plconloc,ncmat_)
224 !
225 ! interpolating the material data according to pressure
226 !
227  niso=int(plconloc(801))
228 !
229  if(niso.eq.0) then
230 !
231 ! user subroutine for the conductance
232 !
233  d(1)=clear
234  d(2)=pressure
235  temp(1)=t1ls
236  temp(2)=t1lm
237  do k=1,3
238  coords(k)=0.d0
239  do j=1,nopes
240  coords(k)=coords(k)+shp2s(4,j)*xl(k,nopem+j)
241  enddo
242  enddo
243  call gapcon(ak,d,flowm,temp,predef,timeend,matname(imat),
244  & slname,msname,coords,noel,node,npred,istep,iinc,
245  & springarea)
246  conductance=ak(1)
247  else
248  do i=1,niso
249  xiso(i)=plconloc(2*i-1)
250  yiso(i)=plconloc(2*i)
251  enddo
252  call ident(xiso,pressure,niso,id)
253  if(id.eq.0) then
254  xk=0.d0
255  conductance=yiso(1)
256  elseif(id.eq.niso) then
257  xk=0.d0
258  conductance=yiso(niso)
259  else
260  xk=(yiso(id+1)-yiso(id))/(xiso(id+1)-xiso(id))
261  conductance=yiso(id)+xk*(pressure-xiso(id))
262  endif
263  endif
264 !
265 ! assembling the upper triangle of the element matrix
266 !
267  constant=conductance*springarea(1)
268 !
269  do i=1,nopem
270  do j=i,nopem
271  s(i,j)=shp2m(4,i)*shp2m(4,j)*constant
272  enddo
273  enddo
274 !
275  do i=1,nopem
276  do j=1,nopes
277  s(i,nopem+j)=-shp2m(4,i)*shp2s(4,j)*constant
278  enddo
279  enddo
280 !
281  do i=1,nopes
282  do j=i,nopes
283  s(nopem+i,nopem+j)=shp2s(4,i)*shp2s(4,j)*constant
284  enddo
285  enddo
286 !
287  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 gapcon(ak, d, flowm, temp, predef, time, ciname, slname, msname, coords, noel, node, npred, kstep, kinc, area)
Definition: gapcon.f:21
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)