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

Go to the source code of this file.

Functions/Subroutines

subroutine springdamp_n2f (xl, elas, voldl, s, imat, elcon, ncmat_, ntmat_, nope, iperturb, springarea, nmethod, mi, reltime, nasym)
 

Function/Subroutine Documentation

◆ springdamp_n2f()

subroutine springdamp_n2f ( real*8, dimension(3,10)  xl,
real*8, dimension(21)  elas,
real*8, dimension(0:mi(2),10)  voldl,
real*8, dimension(60,60)  s,
integer  imat,
real*8, dimension(0:ncmat_,ntmat_,*)  elcon,
integer  ncmat_,
integer  ntmat_,
integer  nope,
integer, dimension(*)  iperturb,
real*8, dimension(2)  springarea,
integer  nmethod,
integer, dimension(*)  mi,
real*8  reltime,
integer  nasym 
)
22 !
23 ! calculates the contact damping matrix (node-to-face penalty)
24 !
25  implicit none
26 !
27  integer i,j,imat,ncmat_,ntmat_,k,l,nope,nterms,iflag,i1,
28  & iperturb(*),nmethod,mi(*),nasym
29 !
30  real*8 xl(3,10),elas(21),ratio(9),pproj(3),val,shp2(7,9),
31  & al(3),s(60,60),voldl(0:mi(2),10),pl(3,10),xn(3),dm,
32  & c1,c2,c3,c4,elcon(0:ncmat_,ntmat_,*),xm(3),xmu(3,3,10),
33  & dxmu(3,10),dval(3,10),fpu(3,3,10),xi,et,xs2(3,7),xk,
34  & a11,a12,a22,b1(3,10),b2(3,10),dal(3,3,10),qxxy(3),fnl(3),
35  & qxyy(3),dxi(3,10),det(3,10),determinant,c11,c12,c22,
36  & qxyx(3),qyxy(3),springarea(2),dist,tu(3,3,10),
37  & clear,reltime
38 !
39  data iflag /4/
40 !
41 ! actual positions of the nodes belonging to the contact spring
42 ! (otherwise no contact force)
43 !
44  do i=1,nope
45  do j=1,3
46  pl(j,i)=xl(j,i)+voldl(j,i)
47  enddo
48  enddo
49 !
50 ! contact springs
51 !
52  nterms=nope-1
53 !
54 ! vector al connects the actual position of the slave node
55 ! with its projection on the master face
56 !
57  do i=1,3
58  pproj(i)=pl(i,nope)
59  enddo
60  call attach(pl,pproj,nterms,ratio,dist,xi,et)
61  do i=1,3
62  al(i)=pl(i,nope)-pproj(i)
63  enddo
64 !
65 ! determining the jacobian vector on the surface
66 !
67  if(nterms.eq.9) then
68  call shape9q(xi,et,pl,xm,xs2,shp2,iflag)
69  elseif(nterms.eq.8) then
70  call shape8q(xi,et,pl,xm,xs2,shp2,iflag)
71  elseif(nterms.eq.4) then
72  call shape4q(xi,et,pl,xm,xs2,shp2,iflag)
73  elseif(nterms.eq.6) then
74  call shape6tri(xi,et,pl,xm,xs2,shp2,iflag)
75  elseif(nterms.eq.7) then
76  call shape7tri(xi,et,pl,xm,xs2,shp2,iflag)
77  else
78  call shape3tri(xi,et,pl,xm,xs2,shp2,iflag)
79  endif
80 !
81 ! dxi(i,j) is the derivative of xi w.r.t. pl(i,j),
82 ! det(i,j) is the derivative of eta w.r.t. pl(i,j)
83 !
84 ! dxi and det are determined from the orthogonality
85 ! condition
86 !
87  a11=-(xs2(1,1)*xs2(1,1)+xs2(2,1)*xs2(2,1)+xs2(3,1)*xs2(3,1))
88  & +al(1)*xs2(1,5)+al(2)*xs2(2,5)+al(3)*xs2(3,5)
89  a12=-(xs2(1,1)*xs2(1,2)+xs2(2,1)*xs2(2,2)+xs2(3,1)*xs2(3,2))
90  & +al(1)*xs2(1,6)+al(2)*xs2(2,6)+al(3)*xs2(3,6)
91  a22=-(xs2(1,2)*xs2(1,2)+xs2(2,2)*xs2(2,2)+xs2(3,2)*xs2(3,2))
92  & +al(1)*xs2(1,7)+al(2)*xs2(2,7)+al(3)*xs2(3,7)
93 !
94  do i=1,3
95  do j=1,nterms
96  b1(i,j)=shp2(4,j)*xs2(i,1)-shp2(1,j)*al(i)
97  b2(i,j)=shp2(4,j)*xs2(i,2)-shp2(2,j)*al(i)
98  enddo
99  b1(i,nope)=-xs2(i,1)
100  b2(i,nope)=-xs2(i,2)
101  enddo
102 !
103  determinant=a11*a22-a12*a12
104  c11=a22/determinant
105  c12=-a12/determinant
106  c22=a11/determinant
107 !
108  do i=1,3
109  do j=1,nope
110  dxi(i,j)=c11*b1(i,j)+c12*b2(i,j)
111  det(i,j)=c12*b1(i,j)+c22*b2(i,j)
112  enddo
113  enddo
114 !
115 ! dal(i,j,k) is the derivative of al(i) w.r.t pl(j,k)
116 ! ( d al / d u_k)
117 !
118  do i=1,nope
119  do j=1,3
120  do k=1,3
121  dal(j,k,i)=-xs2(j,1)*dxi(k,i)-xs2(j,2)*det(k,i)
122  enddo
123  enddo
124  enddo
125  do i=1,nterms
126  do j=1,3
127  dal(j,j,i)=dal(j,j,i)-shp2(4,i)
128  enddo
129  enddo
130  do j=1,3
131  dal(j,j,nope)=dal(j,j,nope)+1.d0
132  enddo
133 !
134 ! d2q/dxx x dq/dy
135 !
136  qxxy(1)=xs2(2,5)*xs2(3,2)-xs2(3,5)*xs2(2,2)
137  qxxy(2)=xs2(3,5)*xs2(1,2)-xs2(1,5)*xs2(3,2)
138  qxxy(3)=xs2(1,5)*xs2(2,2)-xs2(2,5)*xs2(1,2)
139 !
140 ! dq/dx x d2q/dyy
141 !
142  qxyy(1)=xs2(2,1)*xs2(3,7)-xs2(3,1)*xs2(2,7)
143  qxyy(2)=xs2(3,1)*xs2(1,7)-xs2(1,1)*xs2(3,7)
144  qxyy(3)=xs2(1,1)*xs2(2,7)-xs2(2,1)*xs2(1,7)
145 !
146 ! Modified by Stefan Sicklinger
147 !
148 ! dq/dx x d2q/dxy
149 !
150  qxyx(1)=xs2(2,1)*xs2(3,6)-xs2(3,1)*xs2(2,6)
151  qxyx(2)=xs2(3,1)*xs2(1,6)-xs2(1,1)*xs2(3,6)
152  qxyx(3)=xs2(1,1)*xs2(2,6)-xs2(2,1)*xs2(1,6)
153 !
154 ! d2q/dxy x dq/dy
155 !
156  qyxy(1)=xs2(2,6)*xs2(3,2)-xs2(3,6)*xs2(2,2)
157  qyxy(2)=xs2(3,6)*xs2(1,2)-xs2(1,6)*xs2(3,2)
158  qyxy(3)=xs2(1,6)*xs2(2,2)-xs2(2,6)*xs2(1,2)
159 !
160 !
161 ! End modifications
162 !
163 ! normal on the surface
164 !
165  dm=dsqrt(xm(1)*xm(1)+xm(2)*xm(2)+xm(3)*xm(3))
166  do i=1,3
167  xn(i)=xm(i)/dm
168  enddo
169 !
170 ! distance from surface along normal (= clearance)
171 !
172  clear=al(1)*xn(1)+al(2)*xn(2)+al(3)*xn(3)
173  if(nmethod.eq.1) then
174  clear=clear-springarea(2)*(1.d0-reltime)
175  endif
176 !
177 ! representative area: usually the slave surface stored in
178 ! springarea; however, if no area was assigned because the
179 ! node does not belong to any element, the master surface
180 ! is used
181 !
182  if(springarea(1).le.0.d0) then
183  if(nterms.eq.3) then
184  springarea(1)=dm/2.d0
185  else
186  springarea(1)=dm*4.d0
187  endif
188  endif
189 !
190  elas(2)=-springarea(1)*elcon(5,1,imat)
191  elas(1)=elas(2)*clear
192 !
193 ! contact force
194 !
195  do i=1,3
196  fnl(i)=-elas(1)*xn(i)
197  enddo
198 !
199 ! derivatives of the jacobian vector w.r.t. the displacement
200 ! vectors (d m / d u_k)
201 !
202  do k=1,nterms
203  xmu(1,1,k)=0.d0
204  xmu(2,2,k)=0.d0
205  xmu(3,3,k)=0.d0
206  xmu(1,2,k)=shp2(1,k)*xs2(3,2)-shp2(2,k)*xs2(3,1)
207  xmu(2,3,k)=shp2(1,k)*xs2(1,2)-shp2(2,k)*xs2(1,1)
208  xmu(3,1,k)=shp2(1,k)*xs2(2,2)-shp2(2,k)*xs2(2,1)
209  xmu(1,3,k)=-xmu(3,1,k)
210  xmu(2,1,k)=-xmu(1,2,k)
211  xmu(3,2,k)=-xmu(2,3,k)
212  enddo
213  do i=1,3
214  do j=1,3
215  xmu(i,j,nope)=0.d0
216  enddo
217  enddo
218 !
219 ! correction due to change of xi and eta
220 !
221  do k=1,nope
222  do j=1,3
223  do i=1,3
224 !
225 ! modified by Stefan Sicklinger
226 !
227  xmu(i,j,k)=xmu(i,j,k)+(qxxy(i)+qxyx(i))*dxi(j,k)
228  & +(qxyy(i)+qyxy(i))*det(j,k)
229  enddo
230  enddo
231  enddo
232 !
233 ! derivatives of the size of the jacobian vector w.r.t. the
234 ! displacement vectors (d ||m||/d u_k)
235 !
236  do k=1,nope
237  do i=1,3
238  dxmu(i,k)=xn(1)*xmu(1,i,k)+xn(2)*xmu(2,i,k)+
239  & xn(3)*xmu(3,i,k)
240  enddo
241 !
242 ! auxiliary variable: (d clear d u_k)*||m||
243 !
244  do i=1,3
245  dval(i,k)=al(1)*xmu(1,i,k)+al(2)*xmu(2,i,k)+
246  & al(3)*xmu(3,i,k)-clear*dxmu(i,k)+
247  & xm(1)*dal(1,i,k)+xm(2)*dal(2,i,k)+xm(3)*dal(3,i,k)
248  enddo
249 !
250  enddo
251 !
252  c1=1.d0/dm
253  c2=c1*c1
254  c3=elas(2)*c2
255  c4=elas(1)*c1
256 !
257 ! derivatives of the forces w.r.t. the displacement vectors
258 !
259  do k=1,nope
260  do j=1,3
261  do i=1,3
262  fpu(i,j,k)=-c3*xm(i)*dval(j,k)
263  & +c4*(xn(i)*dxmu(j,k)-xmu(i,j,k))
264  enddo
265  enddo
266  enddo
267 !
268 ! tangential damping
269 !
270  if(elcon(8,1,imat).gt.0.d0) then
271 !
272 ! stiffness of shear stress versus slip curve
273 !
274  xk=elcon(8,1,imat)*elcon(5,1,imat)*springarea(1)
275 !
276 ! d al/d u_k -> d al^*/d u_k
277 ! notice: xi & et are const.
278 !
279  do k=1,nope
280  do i=1,3
281  do j=1,3
282  dal(i,j,k)=0.d0
283  enddo
284  enddo
285  enddo
286 !
287  do i=1,nterms
288  do j=1,3
289  dal(j,j,i)=-shp2(4,i)
290  enddo
291  enddo
292 !
293  do j=1,3
294  dal(j,j,nope)=1.d0
295  enddo
296 !
297 ! (d al/d u_k).||m|| -> (d al^*/d u_k).||m||
298 !
299  do k=1,nope
300  do i=1,3
301  dval(i,k)=al(1)*xmu(1,i,k)+al(2)*xmu(2,i,k)
302  & +al(3)*xmu(3,i,k)-val*dxmu(i,k)
303  & +xm(1)*dal(1,i,k)+xm(2)*dal(2,i,k)
304  & +xm(3)*dal(3,i,k)
305  enddo
306  enddo
307 !
308 ! d t/d u_k
309 !
310  do k=1,nope
311  do j=1,3
312  do i=1,3
313  tu(i,j,k)=dal(i,j,k)
314  & -c1*(xn(i)*(dval(j,k)-val*dxmu(j,k))
315  & +val*xmu(i,j,k))
316  enddo
317  enddo
318  enddo
319 !
320 ! damping matrix
321 !
322  do k=1,nope
323  do j=1,3
324  do i=1,3
325  fpu(i,j,k)=fpu(i,j,k)+xk*tu(i,j,k)
326  enddo
327  enddo
328  enddo
329  endif
330 !
331 ! determining the damping matrix contributions
332 !
333 ! complete field shp2
334 !
335  shp2(1,nope)=0.d0
336  shp2(2,nope)=0.d0
337  shp2(4,nope)=-1.d0
338 !
339  do k=1,nope
340  do l=1,nope
341  do i=1,3
342  i1=i+(k-1)*3
343  do j=1,3
344  s(i1,j+(l-1)*3)=-shp2(4,k)*fpu(i,j,l)
345  & -shp2(1,k)*fnl(i)*dxi(j,l)
346  & -shp2(2,k)*fnl(i)*det(j,l)
347  enddo
348  enddo
349  enddo
350  enddo
351 !
352 ! symmetrizing the matrix
353 ! this is done in the absence of friction or for modal dynamic
354 ! calculations
355 !
356  if((nasym.eq.0).or.((nmethod.eq.4).and.(iperturb(1).le.1))) then
357  do j=1,3*nope
358  do i=1,j-1
359  s(i,j)=(s(i,j)+s(j,i))/2.d0
360  enddo
361  enddo
362  endif
363 !
364  return
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
static double * c1
Definition: mafillvcompmain.c:30
static double * dist
Definition: radflowload.c:42
subroutine shape4q(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape4q.f:20
static double * a11
Definition: mafillkmain.c:30
static double * b1
Definition: mafillkmain.c:30
subroutine shape6tri(xi, et, xl, xsj, xs, shp, iflag)
Definition: shape6tri.f:20
subroutine attach(pneigh, pnode, nterms, ratio, dist, xil, etl)
Definition: attach.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)