Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
v3d4_nl_arruda_boyce.f90
Go to the documentation of this file.
1 !*********************************************************************
2 !* Illinois Open Source License *
3 !* *
4 !* University of Illinois/NCSA *
5 !* Open Source License *
6 !* *
7 !* Copyright@2008, University of Illinois. All rights reserved. *
8 !* *
9 !* Developed by: *
10 !* *
11 !* Center for Simulation of Advanced Rockets *
12 !* *
13 !* University of Illinois *
14 !* *
15 !* www.csar.uiuc.edu *
16 !* *
17 !* Permission is hereby granted, free of charge, to any person *
18 !* obtaining a copy of this software and associated documentation *
19 !* files (the "Software"), to deal with the Software without *
20 !* restriction, including without limitation the rights to use, *
21 !* copy, modify, merge, publish, distribute, sublicense, and/or *
22 !* sell copies of the Software, and to permit persons to whom the *
23 !* Software is furnished to do so, subject to the following *
24 !* conditions: *
25 !* *
26 !* *
27 !* @ Redistributions of source code must retain the above copyright *
28 !* notice, this list of conditions and the following disclaimers. *
29 !* *
30 !* @ Redistributions in binary form must reproduce the above *
31 !* copyright notice, this list of conditions and the following *
32 !* disclaimers in the documentation and/or other materials *
33 !* provided with the distribution. *
34 !* *
35 !* @ Neither the names of the Center for Simulation of Advanced *
36 !* Rockets, the University of Illinois, nor the names of its *
37 !* contributors may be used to endorse or promote products derived *
38 !* from this Software without specific prior written permission. *
39 !* *
40 !* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, *
41 !* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES *
42 !* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND *
43 !* NONINFRINGEMENT. IN NO EVENT SHALL THE CONTRIBUTORS OR *
44 !* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *
45 !* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, *
46 !* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE *
47 !* USE OR OTHER DEALINGS WITH THE SOFTWARE. *
48 !*********************************************************************
49 !* Please acknowledge The University of Illinois Center for *
50 !* Simulation of Advanced Rockets in works and publications *
51 !* resulting from this software or its derivatives. *
52 !*********************************************************************
53  SUBROUTINE v3d4_nl_arruda_boyce(coor,matcstet,lmcstet,R_in,d, &
54  s11,s22,s33,s12,s23,s13, &
55  numnp,nstart,nend,numcstet,numat_vol, &
56  mu,kapp)
57 
58 !!****f* Rocfrac/Rocfrac/Source/v3d4_NL_ARRUDA_BOYCE.f90
59 !!
60 !! NAME
61 !! v3d4_NL_ARRUDA_BOYCE
62 !!
63 !! FUNCTION
64 !!
65 !! Computes the internal force for a large deformation,
66 !! hyperelastic arruda-boyce 4-node tetrahedral.
67 !!
68 !! INPUTS
69 !!
70 !! NumNP -- Number of nodes
71 !! numcstet -- Number of elements
72 !! Coor -- number of coordinates
73 !! Matcstet -- Material id
74 !! d -- nodal displacement
75 !! mu -- shear modulus
76 !! kappa -- bulk modulus
77 !!
78 !! lmcstet -- Nodal connectivity
79 !! nstart, nend -- element beginning and end loop counter
80 !! numat_vol -- number of materials
81 !!
82 !! OUTPUT
83 !!
84 !! Rin -- internal force vector
85 !! S11,S22,S33,S12,S23,S13 -- Stresses at gauss points
86 !!
87 !!****
88 
89 
90  IMPLICIT NONE
91 !---- Global variables
92  INTEGER :: numnp ! number of nodal points
93  INTEGER :: numcstet ! number of CSTet elements
94  INTEGER :: numat_vol ! number of volumetric materials
95 !-- coordinate array
96  REAL*8, DIMENSION(1:3,1:numnp) :: coor
97 !-- internal force
98  REAL*8, DIMENSION(1:3*numnp) :: r_in
99 !-- displacement vector
100  REAL*8, DIMENSION(1:3*numnp) :: d
101 !-- CSTet stress
102  REAL*8, DIMENSION(1:numcstet) :: s11, s22, s33, s12, s23, s13
103 !-- x, y and z displacements of nodes
104  REAL*8 :: u1,u2,u3,u4,v1,v2,v3,v4,w1,w2,w3,w4
105 !-- coordinate holding variable
106  REAL*8 :: x1,x2,x3,x4,y1,y2,y3,y4,z1,z2,z3,z4
107 !-- 6*volume, inverse(6*volume), and the volume
108  REAL*8 :: vx6, vx6inv, vol
109 !-- spacial derivatives
110  REAL*8 :: b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12
111 !-- partial derivatives of the displacement
112  REAL*8 :: dudx,dvdy,dwdz,dudy,dvdx,dvdz,dwdy,dudz,dwdx
113 !-- strains
114  REAL*8 :: e11,e22,e33,e12,e23,e13
115 ! -- connectivity table for CSTet
116  INTEGER, DIMENSION(1:4,1:numcstet) :: lmcstet
117 ! -- mat number for CST element
118  INTEGER, DIMENSION(1:numcstet) :: matcstet
119 ! -- node numbers
120  INTEGER :: n1,n2,n3,n4
121 ! -- dummy and counters
122  INTEGER :: i,j,nstart,nend
123  INTEGER :: k1n1,k1n2,k1n3,k1n4,k2n1,k2n2,k2n3,k2n4
124  INTEGER :: k3n1,k3n2,k3n3,k3n4
125 !-- Coordinate subtractions
126  REAL*8 :: x14, x24, x34, y14, y24, y34, z14, z24, z34
127 !-- Coordinate subtractions: These are to speed up B calculation
128  REAL*8 :: x12, x13, y12, y13, z12, z13
129  REAL*8 :: val11, val21, val31
130 ! --
131  REAL*8 :: f11, f12, f13, f21, f22, f23, f31, f32, f33
132  REAL*8, DIMENSION(1:numat_vol) :: mu, kapp
133  REAL*8, DIMENSION(1:3,1:3) :: fij, cij
134 
135  INTEGER :: kk,ll,mm
136 
137  DO i = nstart, nend
138  j = matcstet(i)
139 
140  n1 = lmcstet(1,i)
141  n2 = lmcstet(2,i)
142  n3 = lmcstet(3,i)
143  n4 = lmcstet(4,i)
144 
145  k3n1 = 3*n1
146  k3n2 = 3*n2
147  k3n3 = 3*n3
148  k3n4 = 3*n4
149 
150  k2n1 = k3n1 - 1
151  k2n2 = k3n2 - 1
152  k2n3 = k3n3 - 1
153  k2n4 = k3n4 - 1
154 
155  k1n1 = k3n1 - 2
156  k1n2 = k3n2 - 2
157  k1n3 = k3n3 - 2
158  k1n4 = k3n4 - 2
159  ! k#n# dummy variables replaces:
160  u1 = d(k1n1) ! (3*n1-2)
161  u2 = d(k1n2) ! (3*n2-2)
162  u3 = d(k1n3) ! (3*n3-2)
163  u4 = d(k1n4) ! (3*n4-2)
164  v1 = d(k2n1) ! (3*n1-1)
165  v2 = d(k2n2) ! (3*n2-1)
166  v3 = d(k2n3) ! (3*n3-1)
167  v4 = d(k2n4) ! (3*n4-1)
168  w1 = d(k3n1) ! (3*n1)
169  w2 = d(k3n2) ! (3*n2)
170  w3 = d(k3n3) ! (3*n3)
171  w4 = d(k3n4) ! (3*n4)
172 
173  x1 = coor(1,n1)
174  x2 = coor(1,n2)
175  x3 = coor(1,n3)
176  x4 = coor(1,n4)
177  y1 = coor(2,n1)
178  y2 = coor(2,n2)
179  y3 = coor(2,n3)
180  y4 = coor(2,n4)
181  z1 = coor(3,n1)
182  z2 = coor(3,n2)
183  z3 = coor(3,n3)
184  z4 = coor(3,n4)
185 
186 
187  x12 = x1 - x2 ! not used in vol. calc
188  x13 = x1 - x3 ! not used in vol. calc
189  x14 = x1 - x4
190  x24 = x2 - x4
191  x34 = x3 - x4
192  y12 = y1 - y2 ! not used in vol. calc
193  y13 = y1 - y3 ! not used in vol. calc
194  y14 = y1 - y4
195  y24 = y2 - y4
196  y34 = y3 - y4
197  z12 = z1 - z2 ! not used in vol. calc
198  z13 = z1 - z3 ! not used in vol. calc
199  z14 = z1 - z4
200  z24 = z2 - z4
201  z34 = z3 - z4
202 
203  val11 = y24*z34 - z24*y34
204  val21 = -( x24*z34 - z24*x34 )
205  val31 = x24*y34 - y24*x34
206 
207  vx6 = -( x14*val11 + y14*val21 + z14*val31 )
208 
209  vx6inv = 1.d0 / vx6
210 
211 ! See the maple worksheet 'V3D4.mws' for the derivation of [B]
212 ! NOTE: Factored for a more equivalent/compact form then maple's
213 
214  b1 = (y34*z24 - y24*z34) * vx6inv
215  b2 = (z34*x24 - z24*x34) * vx6inv
216  b3 = (x34*y24 - x24*y34) * vx6inv
217  b4 = (y13*z14 - y14*z13) * vx6inv
218  b5 = (z13*x14 - z14*x13) * vx6inv
219  b6 = (x13*y14 - x14*y13) * vx6inv
220  b7 = (y14*z12 - y12*z14) * vx6inv
221  b8 = (z14*x12 - z12*x14) * vx6inv
222  b9 = (x14*y12 - x12*y14) * vx6inv
223  b10 = (y12*z13 - y13*z12) * vx6inv
224  b11 = (z12*x13 - z13*x12) * vx6inv
225  b12 = (x12*y13 - x13*y12) * vx6inv
226 !
227 ! deformation gradients F
228 !
229  f11 = 1.d0 + ( b1*u1 + b4*u2 + b7*u3 + b10*u4 ) ! 1 + ( dudx )
230  f22 = 1.d0 + ( b2*v1 + b5*v2 + b8*v3 + b11*v4 ) ! 1 + ( dvdy )
231  f33 = 1.d0 + ( b3*w1 + b6*w2 + b9*w3 + b12*w4 ) ! 1 + ( dwdz )
232  f12 = b2*u1 + b5*u2 + b8*u3 + b11*u4 ! dudy
233  f21 = b1*v1 + b4*v2 + b7*v3 + b10*v4 ! dvdx
234  f23 = b3*v1 + b6*v2 + b9*v3 + b12*v4 ! dvdz
235  f32 = b2*w1 + b5*w2 + b8*w3 + b11*w4 ! dwdy
236  f13 = b3*u1 + b6*u2 + b9*u3 + b12*u4 ! dudz
237  f31 = b1*w1 + b4*w2 + b7*w3 + b10*w4 ! dwdx
238 !
239 ! Arruda-Boyce Nonlinear Elasticity Model
240 !
241 ! -- NOTE: ci(7,j) : shear modulus
242 
243 
244 !-- (1) Deformation Gradient Fij
245 
246  fij(1,1) = f11
247  fij(1,2) = f12
248  fij(1,3) = f13
249  fij(2,1) = f21
250  fij(2,2) = f22
251  fij(2,3) = f23
252  fij(3,1) = f31
253  fij(3,2) = f32
254  fij(3,3) = f33
255 
256 !-- (2) right Cauchy-Green deformation Tensor Cij = Fmi Fmj
257 ! T
258 ! C = F F
259 
260  DO kk=1,3
261  DO ll=1,3
262  cij(kk,ll) = 0.d0
263  DO mm=1,3
264  cij(kk,ll)=cij(kk,ll)+fij(mm,kk)*fij(mm,ll)
265  ENDDO
266  ENDDO
267  ENDDO
268 
269  CALL arruda_boyce(cij, &
270  s11(i),s22(i),s33(i),s12(i),s23(i),s13(i),i, &
271  mu(j),kapp(j))
272 
273 ! calculate the volume
274 
275  vol = vx6 / 6.d0
276 
277 ! ASSEMBLE THE INTERNAL FORCE VECTOR
278 !
279 ! local node 1
280  r_in(k1n1) = r_in(k1n1) - vol* &
281  ( s11(i)*b1*f11 + s22(i)*b2*f12 + s33(i)*b3*f13 &
282  + s12(i)*( b2*f11 + b1*f12 ) &
283  + s23(i)*( b3*f12 + b2*f13 ) &
284  + s13(i)*( b3*f11 + b1*f13 ) )
285  r_in(k2n1) = r_in(k2n1) - vol* &
286  ( s11(i)*b1*f21 + s22(i)*b2*f22 + s33(i)*b3*f23 &
287  + s12(i)*( b1*f22 + b2*f21 ) &
288  + s23(i)*( b3*f22 + b2*f23 ) &
289  + s13(i)*( b3*f21 + b1*f23 ) )
290  r_in(k3n1) = r_in(k3n1) - vol* &
291  ( s11(i)*b1*f31 + s22(i)*b2*f32 + s33(i)*b3*f33 &
292  + s12(i)*( b2*f31 + b1*f32 ) &
293  + s23(i)*( b3*f32 + b2*f33 ) &
294  + s13(i)*( b3*f31 + b1*f33 ) )
295 ! local node 2
296  r_in(k1n2) = r_in(k1n2) - vol* &
297  ( s11(i)*b4*f11 + s22(i)*b5*f12 + s33(i)*b6*f13 &
298  + s12(i)*( b5*f11 + b4*f12 ) &
299  + s23(i)*( b6*f12 + b5*f13 ) &
300  + s13(i)*( b6*f11 + b4*f13 ) )
301  r_in(k2n2) = r_in(k2n2) - vol* &
302  ( s11(i)*b4*f21 + s22(i)*b5*f22 + s33(i)*b6*f23 &
303  + s12(i)*( b4*f22 + b5*f21 ) &
304  + s23(i)*( b6*f22 + b5*f23 ) &
305  + s13(i)*( b6*f21 + b4*f23 ) )
306  r_in(k3n2) = r_in(k3n2) - vol* &
307  ( s11(i)*b4*f31 + s22(i)*b5*f32 + s33(i)*b6*f33 &
308  + s12(i)*( b5*f31 + b4*f32 ) &
309  + s23(i)*( b6*f32 + b5*f33 ) &
310  + s13(i)*( b6*f31 + b4*f33 ) )
311 ! local node 3
312  r_in(k1n3) = r_in(k1n3) - vol* &
313  ( s11(i)*b7*f11 + s22(i)*b8*f12 + s33(i)*b9*f13 &
314  + s12(i)*( b8*f11 + b7*f12 ) &
315  + s23(i)*( b9*f12 + b8*f13 ) &
316  + s13(i)*( b9*f11 + b7*f13 ) )
317  r_in(k2n3) = r_in(k2n3) - vol* &
318  ( s11(i)*b7*f21 + s22(i)*b8*f22 + s33(i)*b9*f23 &
319  + s12(i)*( b7*f22 + b8*f21 ) &
320  + s23(i)*( b9*f22 + b8*f23 ) &
321  + s13(i)*( b9*f21 + b7*f23 ) )
322  r_in(k3n3) = r_in(k3n3) - vol* &
323  ( s11(i)*b7*f31 + s22(i)*b8*f32 + s33(i)*b9*f33 &
324  + s12(i)*( b8*f31 + b7*f32 ) &
325  + s23(i)*( b9*f32 + b8*f33 ) &
326  + s13(i)*( b9*f31 + b7*f33 ) )
327 ! local node 4
328  r_in(k1n4) = r_in(k1n4) - vol* &
329  ( s11(i)*b10*f11 + s22(i)*b11*f12+s33(i)*b12*f13 &
330  + s12(i)*( b11*f11 + b10*f12 ) &
331  + s23(i)*( b12*f12 + b11*f13 ) &
332  + s13(i)*( b12*f11 + b10*f13 ) )
333  r_in(k2n4) = r_in(k2n4) - vol* &
334  ( s11(i)*b10*f21 + s22(i)*b11*f22+s33(i)*b12*f23 &
335  + s12(i)*( b10*f22 + b11*f21 ) &
336  + s23(i)*( b12*f22 + b11*f23 ) &
337  + s13(i)*( b12*f21 + b10*f23 ) )
338  r_in(k3n4) = r_in(k3n4) - vol* &
339  ( s11(i)*b10*f31 + s22(i)*b11*f32+s33(i)*b12*f33 &
340  + s12(i)*( b11*f31 + b10*f32 ) &
341  + s23(i)*( b12*f32 + b11*f33 ) &
342  + s13(i)*( b12*f31 + b10*f33 ) )
343 
344  x1 = coor(1,n1) + u1
345  x2 = coor(1,n2) + u2
346  x3 = coor(1,n3) + u3
347  x4 = coor(1,n4) + u4
348  y1 = coor(2,n1) + v1
349  y2 = coor(2,n2) + v2
350  y3 = coor(2,n3) + v3
351  y4 = coor(2,n4) + v4
352  z1 = coor(3,n1) + w1
353  z2 = coor(3,n2) + w2
354  z3 = coor(3,n3) + w3
355  z4 = coor(3,n4) + w4
356 
357  x14 = x1 - x4
358  x24 = x2 - x4
359  x34 = x3 - x4
360  y14 = y1 - y4
361  y24 = y2 - y4
362  y34 = y3 - y4
363  z14 = z1 - z4
364  z24 = z2 - z4
365  z34 = z3 - z4
366 
367  val11 = y24*z34 - z24*y34
368  val21 = -( x24*z34 - z24*x34 )
369  val31 = x24*y34 - y24*x34
370 
371  vx6 = -( x14*val11 + y14*val21 + z14*val31 )
372 
373  IF(vx6.LT.0.d0) THEN
374  print*,'ROCFRAC :: ERROR * ERROR * ERROR'
375  print*,'ROCFRAC :: DEFORMED ELEMENT VOLUME TURNED NEGATIVE'
376  stop
377  ENDIF
378 
379  ENDDO
380 
381  RETURN
382  END
383 
subroutine v3d4_nl_arruda_boyce(coor, matcstet, lmcstet, R_in, d, S11, S22, S33, S12, S23, S13, numnp, nstart, nend, numcstet, numat_vol, mu, kapp)
const NT & d
blockLoc i
Definition: read.cpp:79
virtual std::ostream & print(std::ostream &os) const
j indices j
Definition: Indexing.h:6
subroutine arruda_boyce(Cij, S11, S22, S33, S12, S23, S13, ielem, mu, kappa)