Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
v3d10_thermalExp.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 v3d10_thermalexp(coor,matcstet,lmcstet,R_in,ci, &
54  s11l,s22l,s33l,&
55  numnp,nstart,nend,numcstet,numat_vol, coeffexp,temperature,temperature0)
56 
57 !!****f* Rocfrac/Rocfrac/Source/v3d10_thermalExp.f90
58 !!
59 !! NAME
60 !! v3d10_thermalExp
61 !!
62 !! FUNCTION
63 !!
64 !! Computes the internal force for a small deformation,
65 !! linear elastic 10-node tetrahedral with thermal expansion
66 !!
67 !! INPUTS
68 !!
69 !! NumNP -- Number of nodes
70 !! numcstet -- Number of elements
71 !! Coor -- number of coordinates
72 !! Matcstet -- Material id
73 !! d -- nodal displacement
74 !! ci -- compliance matrix
75 !!
76 !! stored in the follow format:
77 !!
78 !! [ ci(1) ci(2) ci(4) ]
79 !! [ ci(3) ci(5) ]
80 !! [ ci(6) ]
81 !! [ ci(7) ]
82 !! [ ci(8) ]
83 !! [ ci(9) ]
84 !!
85 !! CoeffExp -- coeffecient of thermal expansion
86 !! Temperature - nodal temperature
87 !! Temperature0 - reference temperature
88 !!
89 !!
90 !! lmcstet -- Nodal connectivity
91 !! nstart, nend -- element beginning and end loop counter
92 !! numat_vol -- number of materials
93 !!
94 !! OUTPUT
95 !!
96 !! Rin -- internal force vector
97 !! S11l,S22l,S33l,S12l,S23l,S13l -- Stresses at gauss points
98 !!
99 !!****
100 
101 !----- 4 Guass points
102  IMPLICIT NONE
103 !-----Global variables
104  INTEGER :: numnp ! number of nodes
105  INTEGER :: numat_vol ! number of volumetric materials
106  INTEGER :: numcstet ! number of LSTets
107 !-- coordinate array
108  REAL*8, DIMENSION(1:3,1:numnp) :: coor
109 !-- elastic stiffness consts
110  REAL*8, DIMENSION(1:9,1:numat_vol) :: ci
111 
112  REAL*8, DIMENSION(1:numat_vol) :: coeffexp
113 
114 !-- internal force
115  REAL*8, DIMENSION(1:3*numnp) :: r_in
116 !-- CSTet stress
117  REAL*8, DIMENSION(1:4,1:numcstet) :: s11l, s22l, s33l
118 
119  REAL*8, DIMENSION(1:4) :: strssth11, strssth22, strssth33
120 
121 
122 !-- connectivity table for CSTet
123  INTEGER, DIMENSION(1:10,1:numcstet) :: lmcstet
124 !-- mat number for CSTet element
125  INTEGER, DIMENSION(1:numcstet) :: matcstet
126 !---- Local variables
127 !-- node numbers
128  INTEGER :: n1,n2,n3,n4,n5,n6,n7,n8,n9,n10
129 !-- 6*volume and inverse of 6*volume
130  REAL*8 :: vx6, vx6inv
131 !-- spacial derivatives
132  REAL*8 :: b1,b2,b3,b4,b5,b6,b7,b8,b9,b10
133  REAL*8 :: b11,b12,b13,b14,b15,b16,b17,b18,b19,b20
134  REAL*8 :: b21,b22,b23,b24,b25,b26,b27,b28,b29,b30
135 !-- strains
136  REAL*8 :: e11,e22,e33,e12,e23,e13
137 !-- coordinate holding variable
138  REAL*8 :: x1,x2,x3,x4,x5,x6,x7,x8,x9,x10
139  REAL*8 :: y1,y2,y3,y4,y5,y6,y7,y8,y9,y10
140  REAL*8 :: z1,z2,z3,z4,z5,z6,z7,z8,z9,z10
141 !-- dummy and counters
142  INTEGER :: i,j,nstart,nend
143  REAL*8 :: aux1,aux2,aux3,aux4,aux5,aux6,aux7,aux8,aux9,aux10,aux11,aux12
144 !-- partial internal force
145  REAL*8 :: r1,r2,r3,r4,r5,r6,r7,r8,r9,r10,r11,r12,r13,r14,r15,r16,r17,r18
146  REAL*8 :: r19,r20,r21,r22,r23,r24,r25,r26,r27,r28,r29,r30
147  REAL*8 :: g1, g2, g3, g4
148  REAL*8 :: xn1, xn2, xn3, xn4
149 !-- Coordinate subtractions
150  REAL*8 :: x14, x24, x34, y14, y24, y34, z14, z24, z34
151 !--
152  REAL*8 :: c11, c21, c31
153  INTEGER :: k1n1,k1n2,k1n3,k1n4,k1n5,k1n6,k1n7,k1n8,k1n9,k1n10
154  INTEGER :: k2n1,k2n2,k2n3,k2n4,k2n5,k2n6,k2n7,k2n8,k2n9,k2n10
155  INTEGER :: k3n1,k3n2,k3n3,k3n4,k3n5,k3n6,k3n7,k3n8,k3n9,k3n10
156 
157  REAL*8, DIMENSION(1:NumNP) :: temperature
158  REAL*8 :: temperaturegauss,temperature0
159 
160 
161  REAL*8,DIMENSION(1:4,1:4) :: gaussintpt = reshape( &
162  (/0.58541020d0,0.13819660d0,0.13819660d0,0.13819660d0, &
163  0.13819660d0,0.58541020d0,0.13819660d0,0.13819660d0, &
164  0.13819660d0,0.13819660d0,0.58541020d0,0.13819660d0, &
165  0.13819660d0,0.13819660d0,0.13819660d0,0.58541020d0/),(/4,4/) )
166 
167  INTEGER :: igpt
168 
169  DO i = nstart, nend
170 
171  j = matcstet(i)
172 
173  n1 = lmcstet(1,i)
174  n2 = lmcstet(2,i)
175  n3 = lmcstet(3,i)
176  n4 = lmcstet(4,i)
177  n5 = lmcstet(5,i)
178  n6 = lmcstet(6,i)
179  n7 = lmcstet(7,i)
180  n8 = lmcstet(8,i)
181  n9 = lmcstet(9,i)
182  n10 = lmcstet(10,i)
183 
184  k3n1 = 3*n1
185  k3n2 = 3*n2
186  k3n3 = 3*n3
187  k3n4 = 3*n4
188  k3n5 = 3*n5
189  k3n6 = 3*n6
190  k3n7 = 3*n7
191  k3n8 = 3*n8
192  k3n9 = 3*n9
193  k3n10 = 3*n10
194 
195  k2n1 = k3n1 - 1
196  k2n2 = k3n2 - 1
197  k2n3 = k3n3 - 1
198  k2n4 = k3n4 - 1
199  k2n5 = k3n5 - 1
200  k2n6 = k3n6 - 1
201  k2n7 = k3n7 - 1
202  k2n8 = k3n8 - 1
203  k2n9 = k3n9 - 1
204  k2n10 = k3n10 - 1
205 
206  k1n1 = k3n1 - 2
207  k1n2 = k3n2 - 2
208  k1n3 = k3n3 - 2
209  k1n4 = k3n4 - 2
210  k1n5 = k3n5 - 2
211  k1n6 = k3n6 - 2
212  k1n7 = k3n7 - 2
213  k1n8 = k3n8 - 2
214  k1n9 = k3n9 - 2
215  k1n10 = k3n10 - 2
216  ! k#n# dummy variables replaces:
217  x1 = coor(1,n1)
218  x2 = coor(1,n2)
219  x3 = coor(1,n3)
220  x4 = coor(1,n4)
221  y1 = coor(2,n1)
222  y2 = coor(2,n2)
223  y3 = coor(2,n3)
224  y4 = coor(2,n4)
225  z1 = coor(3,n1)
226  z2 = coor(3,n2)
227  z3 = coor(3,n3)
228  z4 = coor(3,n4)
229 
230  x14 = x1 - x4
231  x24 = x2 - x4
232  x34 = x3 - x4
233  y14 = y1 - y4
234  y24 = y2 - y4
235  y34 = y3 - y4
236  z14 = z1 - z4
237  z24 = z2 - z4
238  z34 = z3 - z4
239 
240  c11 = y24*z34 - z24*y34
241  c21 = -( x24*z34 - z24*x34 )
242  c31 = x24*y34 - y24*x34
243 
244  vx6 = -( x14*c11 + y14*c21 + z14*c31 )
245 
246 ! Vx6 = x2*y3*z4 - x2*y4*z3 - y2*x3*z4 + y2*x4*z3 + z2*x3*y4
247 ! $ - z2*x4*y3 - x1*y3*z4 + x1*y4*z3 + x1*y2*z4 - x1*y2*z3
248 ! $ - x1*z2*y4 + x1*z2*y3 + y1*x3*z4 - y1*x4*z3 - y1*x2*z4
249 ! $ + y1*x2*z3 + y1*z2*x4 - y1*z2*x3 - z1*x3*y4 + z1*x4*y3
250 ! $ + z1*x2*y4 - z1*x2*y3 - z1*y2*x4 + z1*y2*x3
251 
252  vx6inv = 1.d0 / vx6
253 
254  aux1 = -(y3*z4 - y4*z3 - y2*z4 + y2*z3 + z2*y4 - z2*y3)
255  aux2 = (x3*z4 - x4*z3 - x2*z4 + x2*z3 + z2*x4 - z2*x3)
256  aux3 = -(x3*y4 - x4*y3 - x2*y4 + x2*y3 + y2*x4 - y2*x3)
257  aux4 = (y3*z4 - y4*z3 - y1*z4 + y1*z3 + z1*y4 - z1*y3)
258  aux5 = -(x3*z4 - x4*z3 - x1*z4 + x1*z3 + z1*x4 - z1*x3)
259  aux6 = (x3*y4 - x4*y3 - x1*y4 + x1*y3 + y1*x4 - y1*x3)
260  aux7 = -(y2*z4 - z2*y4 - y1*z4 + y1*z2 + z1*y4 - z1*y2)
261  aux8 = (x2*z4 - z2*x4 - x1*z4 + x1*z2 + z1*x4 - z1*x2)
262  aux9 = -(x2*y4 - y2*x4 - x1*y4 + x1*y2 + y1*x4 - y1*x2)
263  aux10 = (y2*z3 - z2*y3 - y1*z3 + y1*z2 + z1*y3 - z1*y2)
264  aux11 =-(x2*z3 - z2*x3 - x1*z3 + x1*z2 + z1*x3 - z1*x2)
265  aux12 = (x2*y3 - y2*x3 - x1*y3 + x1*y2 + y1*x3 - y1*x2)
266 
267  r1 = 0.
268  r2 = 0.
269  r3 = 0.
270  r4 = 0.
271  r5 = 0.
272  r6 = 0.
273  r7 = 0.
274  r8 = 0.
275  r9 = 0.
276  r10 = 0.
277  r11 = 0.
278  r12 = 0.
279  r13 = 0.
280  r14 = 0.
281  r15 = 0.
282  r16 = 0.
283  r17 = 0.
284  r18 = 0.
285  r19 = 0.
286  r20 = 0.
287  r21 = 0.
288  r22 = 0.
289  r23 = 0.
290  r24 = 0.
291  r25 = 0.
292  r26 = 0.
293  r27 = 0.
294  r28 = 0.
295  r29 = 0.
296  r30 = 0.
297 
298  DO igpt = 1, 4
299 
300  g1 = gaussintpt(igpt,1)
301  g2 = gaussintpt(igpt,2)
302  g3 = gaussintpt(igpt,3)
303  g4 = gaussintpt(igpt,4)
304 
305  xn1 = (4.d0*g1-1.d0) ! derivative of shape function
306  xn2 = (4.d0*g2-1.d0) ! dN_i/dzeta_i
307  xn3 = (4.d0*g3-1.d0)
308  xn4 = (4.d0*g4-1.d0)
309 ! xN5 = 4.d0*g1*g2
310 ! xN6 = 4.d0*g2*g3
311 ! xN7 = 4.d0*g3*g1
312 ! xN8 = 4.d0*g1*g4
313 ! xN9 = 4.d0*g2*g4
314 ! xN10= 4.d0*g3*g4
315 
316  b1 = aux1*xn1
317  b2 = aux2*xn1
318  b3 = aux3*xn1
319  b4 = aux4*xn2
320  b5 = aux5*xn2
321  b6 = aux6*xn2
322  b7 = aux7*xn3
323  b8 = aux8*xn3
324  b9 = aux9*xn3
325  b10 = aux10*xn4
326  b11 = aux11*xn4
327  b12 = aux12*xn4
328 
329  b13 = 4.d0*(g2*aux1 + g1*aux4)
330  b14 = 4.d0*(g2*aux2 + g1*aux5)
331  b15 = 4.d0*(g2*aux3 + g1*aux6)
332 
333  b16 = 4.d0*(g3*aux4 + g2*aux7)
334  b17 = 4.d0*(g3*aux5 + g2*aux8)
335  b18 = 4.d0*(g3*aux6 + g2*aux9)
336 
337  b19 = 4.d0*(g1*aux7 + g3*aux1)
338  b20 = 4.d0*(g1*aux8 + g3*aux2)
339  b21 = 4.d0*(g1*aux9 + g3*aux3)
340 
341  b22 = 4.d0*(g4*aux1 + g1*aux10)
342  b23 = 4.d0*(g4*aux2 + g1*aux11)
343  b24 = 4.d0*(g4*aux3 + g1*aux12)
344 
345  b25 = 4.d0*(g4*aux4 + g2*aux10)
346  b26 = 4.d0*(g4*aux5 + g2*aux11)
347  b27 = 4.d0*(g4*aux6 + g2*aux12)
348 
349  b28 = 4.d0*(g4*aux7 + g3*aux10)
350  b29 = 4.d0*(g4*aux8 + g3*aux11)
351  b30 = 4.d0*(g4*aux9 + g3*aux12)
352 
353 
354 ! interpolate Temperature from nodes to Gauss Point
355 
356  temperaturegauss = g1*(2.d0*g1-1.d0)*temperature(n1) + &
357  g2*(2.d0*g2-1.d0)*temperature(n2) + &
358  g3*(2.d0*g3-1.d0)*temperature(n3) + &
359  g4*(2.d0*g4-1.d0)*temperature(n4) + &
360  4.d0*g1*g2*temperature(n5) + 4.d0*g2*g3*temperature(n6) + &
361  4.d0*g3*g1*temperature(n7) + 4.d0*g1*g4*temperature(n8) + &
362  4.d0*g2*g4*temperature(n9) + 4.d0*g3*g4*temperature(n10)
363 
364  strssth11(igpt) = -ci(1,j)*coeffexp(j)*( temperaturegauss - temperature0 ) !* Vx6inv
365  strssth22(igpt) = -ci(3,j)*coeffexp(j)*( temperaturegauss - temperature0 ) !* Vx6inv
366  strssth33(igpt) = -ci(6,j)*coeffexp(j)*( temperaturegauss - temperature0 ) !* Vx6inv
367 
368 
369  r1 = r1 + strssth11(igpt)*b1
370  r2 = r2 + strssth22(igpt)*b2
371  r3 = r3 + strssth33(igpt)*b3
372 
373  r4 = r4 + strssth11(igpt)*b4
374  r5 = r5 + strssth22(igpt)*b5
375  r6 = r6 + strssth33(igpt)*b6
376 
377  r7 = r7 + strssth11(igpt)*b7
378  r8 = r8 + strssth22(igpt)*b8
379  r9 = r9 + strssth33(igpt)*b9
380 
381  r10 = r10 + strssth11(igpt)*b10
382  r11 = r11 + strssth22(igpt)*b11
383  r12 = r12 + strssth33(igpt)*b12
384 
385  r13 = r13 + strssth11(igpt)*b13
386  r14 = r14 + strssth22(igpt)*b14
387  r15 = r15 + strssth33(igpt)*b15
388 
389  r16 = r16 + strssth11(igpt)*b16
390  r17 = r17 + strssth22(igpt)*b17
391  r18 = r18 + strssth33(igpt)*b18
392 
393  r19 = r19 + strssth11(igpt)*b19
394  r20 = r20 + strssth22(igpt)*b20
395  r21 = r21 + strssth33(igpt)*b21
396 
397  r22 = r22 + strssth11(igpt)*b22
398  r23 = r23 + strssth22(igpt)*b23
399  r24 = r24 + strssth33(igpt)*b24
400 
401  r25 = r25 + strssth11(igpt)*b25
402  r26 = r26 + strssth22(igpt)*b26
403  r27 = r27 + strssth33(igpt)*b27
404 
405  r28 = r28 + strssth11(igpt)*b28
406  r29 = r29 + strssth22(igpt)*b29
407  r30 = r30 + strssth33(igpt)*b30
408 
409  s11l(igpt,i) = s11l(igpt,i) + strssth11(igpt)
410  s22l(igpt,i) = s22l(igpt,i) + strssth22(igpt)
411  s33l(igpt,i) = s33l(igpt,i) + strssth33(igpt)
412 
413  ENDDO
414 
415 ! PRINT*,i, S11l(1:4,i)
416 
417 ! Wi (i.e. weight) for 4 guass integration is 1/4
418 
419 ! Wi * 1/6 because the volume of a reference tetrahedra in
420 ! volume coordinates is 1/6
421 
422 ! ASSEMBLE THE INTERNAL FORCE VECTOR
423 !
424 ! local node 1
425  r_in(k1n1) = r_in(k1n1) - r1*0.04166666666666667d0
426  r_in(k2n1) = r_in(k2n1) - r2*0.04166666666666667d0
427  r_in(k3n1) = r_in(k3n1) - r3*0.04166666666666667d0
428 ! local node 2
429  r_in(k1n2) = r_in(k1n2) - r4*0.04166666666666667d0
430  r_in(k2n2) = r_in(k2n2) - r5*0.04166666666666667d0
431  r_in(k3n2) = r_in(k3n2) - r6*0.04166666666666667d0
432 ! local node 3
433  r_in(k1n3) = r_in(k1n3) - r7*0.04166666666666667d0
434  r_in(k2n3) = r_in(k2n3) - r8*0.04166666666666667d0
435  r_in(k3n3) = r_in(k3n3) - r9*0.04166666666666667d0
436 ! local node 4
437  r_in(k1n4) = r_in(k1n4) - r10*0.04166666666666667d0
438  r_in(k2n4) = r_in(k2n4) - r11*0.04166666666666667d0
439  r_in(k3n4) = r_in(k3n4) - r12*0.04166666666666667d0
440 ! local node 5
441  r_in(k1n5) = r_in(k1n5) - r13*0.04166666666666667d0
442  r_in(k2n5) = r_in(k2n5) - r14*0.04166666666666667d0
443  r_in(k3n5) = r_in(k3n5) - r15*0.04166666666666667d0
444 ! local node 6
445  r_in(k1n6) = r_in(k1n6) - r16*0.04166666666666667d0
446  r_in(k2n6) = r_in(k2n6) - r17*0.04166666666666667d0
447  r_in(k3n6) = r_in(k3n6) - r18*0.04166666666666667d0
448 ! local node 7
449  r_in(k1n7) = r_in(k1n7) - r19*0.04166666666666667d0
450  r_in(k2n7) = r_in(k2n7) - r20*0.04166666666666667d0
451  r_in(k3n7) = r_in(k3n7) - r21*0.04166666666666667d0
452 ! local node 8
453  r_in(k1n8) = r_in(k1n8) - r22*0.04166666666666667d0
454  r_in(k2n8) = r_in(k2n8) - r23*0.04166666666666667d0
455  r_in(k3n8) = r_in(k3n8) - r24*0.04166666666666667d0
456 ! local node 9
457  r_in(k1n9) = r_in(k1n9) - r25*0.04166666666666667d0
458  r_in(k2n9) = r_in(k2n9) - r26*0.04166666666666667d0
459  r_in(k3n9) = r_in(k3n9) - r27*0.04166666666666667d0
460 ! local node 10
461  r_in(k1n10) = r_in(k1n10) - r28*0.04166666666666667d0
462  r_in(k2n10) = r_in(k2n10) - r29*0.04166666666666667d0
463  r_in(k3n10) = r_in(k3n10) - r30*0.04166666666666667d0
464 
465  ENDDO
466 
467  RETURN
468 END SUBROUTINE v3d10_thermalexp
469 
470 
471 
472 
subroutine v3d10_thermalexp(coor, matcstet, lmcstet, R_in, ci, S11l, S22l, S33l, numnp, nstart, nend, numcstet, numat_vol, CoeffExp, Temperature, Temperature0)
blockLoc i
Definition: read.cpp:79
j indices j
Definition: Indexing.h:6