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