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

Go to the source code of this file.

Functions/Subroutines

subroutine springstiff_n2f_th (xl, voldl, s, imat, elcon, nelcon, ncmat_, ntmat_, nope, kode, plkcon, nplkcon, npmat_, iperturb, springarea, mi, timeend, matname, node, noel, istep, iinc)
 

Function/Subroutine Documentation

◆ springstiff_n2f_th()

subroutine springstiff_n2f_th ( real*8, dimension(3,10), intent(in)  xl,
real*8, dimension(0:mi(2),10), 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,
integer, intent(in)  kode,
real*8, dimension(0:2*npmat_,ntmat_,*), intent(in)  plkcon,
integer, dimension(0:ntmat_,*), intent(in)  nplkcon,
integer, intent(in)  npmat_,
integer, dimension(*), intent(in)  iperturb,
real*8, intent(inout)  springarea,
integer, dimension(*), intent(in)  mi,
real*8, dimension(2), intent(in)  timeend,
character*80, dimension(*), intent(in)  matname,
integer, intent(in)  node,
integer, intent(in)  noel,
integer, intent(in)  istep,
integer, intent(in)  iinc 
)
23 !
24 ! calculates the stiffness of a spring
25 !
26  implicit none
27 !
28  character*80 matname(*),slname,msname
29 !
30  integer i,j,imat,ncmat_,ntmat_,k,nope,nterms,iflag,
31  & kode,niso,id,nplkcon(0:ntmat_,*),npmat_,nelcon(2,*),
32  & iperturb(*),mi(*),node,noel,istep,iinc,npred
33 !
34  real*8 xl(3,10),ratio(9),q(3),val,shp2(7,9),ak(5),
35  & al(3),s(60,60),voldl(0:mi(2),10),pl(3,10),xn(3),dm,
36  & alpha,beta,elcon(0:ncmat_,ntmat_,*),xm(3),pressure,
37  & xi,et,xs2(3,7),t1l,elconloc(21),plconloc(802),xk,
38  & xiso(200),yiso(200),plkcon(0:2*npmat_,ntmat_,*),
39  & springarea,dist,eps,pi,constant,conductance,dtemp,temp(2),
40  & predef(2),coords(3),tmean,d(2),timeend(2),flowm(2)
41 !
42  intent(in) xl,voldl,imat,elcon,nelcon,
43  & ncmat_,ntmat_,nope,kode,plkcon,
44  & nplkcon,npmat_,iperturb,mi,timeend,matname,
45  & node,noel,istep,iinc
46 !
47  intent(inout) s,springarea
48 !
49  iflag=4
50 !
51 ! actual positions of the nodes belonging to the contact spring
52 !
53  if(iperturb(2).eq.0) then
54  do i=1,nope
55  do j=1,3
56  pl(j,i)=xl(j,i)
57  enddo
58  enddo
59  else
60  do i=1,nope
61  do j=1,3
62  pl(j,i)=xl(j,i)+voldl(j,i)
63  enddo
64  enddo
65  endif
66 !
67 ! contact springs
68 !
69  nterms=nope-1
70 !
71 ! vector al connects the actual position of the slave node
72 ! with its projection on the master face
73 !
74  do i=1,3
75  q(i)=pl(i,nope)
76  enddo
77  call attach(pl,q,nterms,ratio,dist,xi,et)
78  do i=1,3
79  al(i)=pl(i,nope)-q(i)
80  enddo
81 !
82 ! determining the jacobian vector on the surface
83 !
84  if(nterms.eq.9) then
85  call shape9q(xi,et,pl,xm,xs2,shp2,iflag)
86  elseif(nterms.eq.8) then
87  call shape8q(xi,et,pl,xm,xs2,shp2,iflag)
88  elseif(nterms.eq.4) then
89  call shape4q(xi,et,pl,xm,xs2,shp2,iflag)
90  elseif(nterms.eq.6) then
91  call shape6tri(xi,et,pl,xm,xs2,shp2,iflag)
92  elseif(nterms.eq.7) then
93  call shape7tri(xi,et,pl,xm,xs2,shp2,iflag)
94  else
95  call shape3tri(xi,et,pl,xm,xs2,shp2,iflag)
96  endif
97 !
98 !
99 ! normal on the surface
100 !
101  dm=dsqrt(xm(1)*xm(1)+xm(2)*xm(2)+xm(3)*xm(3))
102  do i=1,3
103  xn(i)=xm(i)/dm
104  enddo
105 !
106 ! distance from surface along normal
107 !
108  val=al(1)*xn(1)+al(2)*xn(2)+al(3)*xn(3)
109 !
110 ! representative area: usually the slave surface stored in
111 ! springarea; however, if no area was assigned because the
112 ! node does not belong to any element, the master surface
113 ! is used
114 !
115  if(springarea.le.0.d0) then
116  if(nterms.eq.3) then
117  springarea=dm/2.d0
118  else
119  springarea=dm*4.d0
120  endif
121  endif
122 !
123 ! alpha and beta, taking the representative area into account
124 ! (conversion of pressure into force)
125 !
126  if(elcon(1,1,imat).gt.0.d0) then
127 !
128 ! exponential overclosure
129 !
130  if(dabs(elcon(2,1,imat)).lt.1.d-30) then
131  pressure=0.d0
132  else
133  alpha=elcon(2,1,imat)
134  beta=elcon(1,1,imat)
135  if(-beta*val.gt.23.d0-dlog(alpha)) then
136  beta=(dlog(alpha)-23.d0)/val
137  endif
138  pressure=dexp(-beta*val+dlog(alpha))
139  endif
140  else
141 !
142 ! linear overclosure
143 !
144  pi=4.d0*datan(1.d0)
145  eps=elcon(1,1,imat)*pi/elcon(2,1,imat)
146  pressure=-elcon(2,1,imat)*val*
147  & (0.5d0+datan(-val/eps)/pi)
148  endif
149 !
150 ! calculating the temperature difference across the contact
151 ! area and the mean temperature for the determination of the
152 ! conductance
153 !
154  t1l=0.d0
155  do j=1,nterms
156  t1l=t1l+ratio(j)*voldl(0,j)
157  enddo
158  dtemp=t1l-voldl(0,nope)
159  tmean=(voldl(0,nope)+t1l)/2.d0
160 !
161 ! interpolating the material data according to temperature
162 !
163  call materialdata_sp(elcon,nelcon,imat,ntmat_,i,tmean,
164  & elconloc,kode,plkcon,nplkcon,npmat_,plconloc,ncmat_)
165 !
166 ! interpolating the material data according to pressure
167 !
168  niso=int(plconloc(801))
169 !
170  if(niso.eq.0) then
171 !
172 ! user subroutine for the conductance
173 !
174  d(1)=val
175  d(2)=pressure
176  temp(1)=voldl(0,nope)
177  temp(2)=t1l
178  do j=1,3
179  coords(j)=xl(j,nope)
180  enddo
181  call gapcon(ak,d,flowm,temp,predef,timeend,matname(imat),
182  & slname,msname,coords,noel,node,npred,istep,iinc,
183  & springarea)
184  conductance=ak(1)
185  else
186  do i=1,niso
187  xiso(i)=plconloc(2*i-1)
188  yiso(i)=plconloc(2*i)
189  enddo
190  call ident(xiso,pressure,niso,id)
191  if(id.eq.0) then
192  xk=0.d0
193  conductance=yiso(1)
194  elseif(id.eq.niso) then
195  xk=0.d0
196  conductance=yiso(niso)
197  else
198  xk=(yiso(id+1)-yiso(id))/(xiso(id+1)-xiso(id))
199  conductance=yiso(id)+xk*(pressure-xiso(id))
200  endif
201  endif
202 !
203 ! assembling the upper triangle of the element matrix
204 !
205  constant=conductance*springarea
206  s(nope,nope)=constant
207  do k=1,nterms
208  s(k,nope)=-shp2(4,k)*constant
209  enddo
210  do i=1,nterms
211  do j=i,nterms
212  s(i,j)=shp2(4,i)*shp2(4,j)*constant
213  enddo
214  enddo
215 !
216  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
static double * dist
Definition: radflowload.c:42
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
subroutine attach(pneigh, pnode, nterms, ratio, dist, xil, etl)
Definition: attach.f:20
Hosted by OpenAircraft.com, (Michigan UAV, LLC)