Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
v3d4_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 v3d4_thermalexp(coor,matcstet,lmcstet,R_in,ci, &
54  s11,s22,s33,&
55  numnp,nstart,nend,numcstet,numat_vol,coeffexp,temperature,temperature0)
56 !________________________________________________________________________
57 !
58 ! V3D4 - Performs displacement based computations for Volumetric 3D
59 ! 4-node tetrahedra linear elastic elements with linear
60 ! interpolation functions. (constant strain tetrahedra).
61 ! Returns the internal force vector R_in.
62 !
63 ! DATE: 04.2000 AUTHOR: SCOT BREITENFELD
64 !________________________________________________________________________
65 
66  IMPLICIT NONE
67 !---- Global variables
68  INTEGER :: numnp ! number of nodal points
69  INTEGER :: numcstet ! number of CSTet elements
70  INTEGER :: numat_vol ! number of volumetric materials
71 !-- coordinate array
72  REAL*8, DIMENSION(1:3,1:numnp) :: coor
73 !-- elastic stiffness consts
74  REAL*8, DIMENSION(1:9,1:numat_vol) :: ci
75 
76  REAL*8, DIMENSION(1:numat_vol) :: coeffexp
77 !-- internal force
78  REAL*8, DIMENSION(1:3*numnp) :: r_in
79 !-- CSTet stress
80  REAL*8, DIMENSION(1:numcstet) :: s11, s22, s33
81 !-- connectivity table for CSTet
82  INTEGER, DIMENSION(1:4,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
88 !-- x, y, and z displacements of nodes
89  REAL*8 :: u1,u2,u3,u4,v1,v2,v3,v4,w1,w2,w3,w4
90 !-- 6*volume, inverse(6*volume), and the volume
91  REAL*8 :: vx6, vx6inv, vol
92 !-- spacial derivatives
93  REAL*8 :: b1,b2,b3,b4,b5,b6,b7,b8,b9,b10,b11,b12
94 !-- strains
95  REAL*8 :: e11,e22,e33,e12,e23,e13
96 !-- coordinate holding variable
97  REAL*8 :: x1,x2,x3,x4,y1,y2,y3,y4,z1,z2,z3,z4
98 !-- Coordinate subtractions
99  REAL*8 :: x14, x24, x34, y14, y24, y34, z14, z24, z34
100 !-- Coordinate subtractions: These are to speed up B calculation
101  REAL*8 :: x12, x13, y12, y13, z12, z13
102 !-- Dummy
103  REAL*8 :: c11, c21, c31
104 !-- dummy and counters
105  INTEGER :: i,j,nstart,nend
106  INTEGER :: k1n1,k1n2,k1n3,k1n4,k2n1,k2n2,k2n3,k2n4
107  INTEGER :: k3n1,k3n2,k3n3,k3n4
108 
109  REAL*8, DIMENSION(1:NumNP) :: temperature
110  REAL*8 :: temperaturegauss,temperature0
111  REAL*8 :: strssth11, strssth22, strssth33
112 
113 
114  DO i = nstart, nend
115  j = matcstet(i)
116 
117  n1 = lmcstet(1,i)
118  n2 = lmcstet(2,i)
119  n3 = lmcstet(3,i)
120  n4 = lmcstet(4,i)
121 
122  k3n1 = 3*n1
123  k3n2 = 3*n2
124  k3n3 = 3*n3
125  k3n4 = 3*n4
126 
127  k2n1 = k3n1 - 1
128  k2n2 = k3n2 - 1
129  k2n3 = k3n3 - 1
130  k2n4 = k3n4 - 1
131 
132  k1n1 = k3n1 - 2
133  k1n2 = k3n2 - 2
134  k1n3 = k3n3 - 2
135  k1n4 = k3n4 - 2
136 
137  x1 = coor(1,n1) ! Node 1, x-coor
138  x2 = coor(1,n2) ! Node 2, x-coor
139  x3 = coor(1,n3) ! Node 3, x-coor
140  x4 = coor(1,n4) ! Node 4, x-coor
141  y1 = coor(2,n1) ! Node 1, y-coor
142  y2 = coor(2,n2) ! Node 2, y-coor
143  y3 = coor(2,n3) ! Node 3, y-coor
144  y4 = coor(2,n4) ! Node 4, y-coor
145  z1 = coor(3,n1) ! Node 1, z-coor
146  z2 = coor(3,n2) ! Node 2, z-coor
147  z3 = coor(3,n3) ! Node 3, z-coor
148  z4 = coor(3,n4) ! Node 4, z-coor
149 
150  x12 = x1 - x2 ! not used in vol. calc
151  x13 = x1 - x3 ! not used in vol. calc
152  x14 = x1 - x4
153  x24 = x2 - x4
154  x34 = x3 - x4
155  y12 = y1 - y2 ! not used in vol. calc
156  y13 = y1 - y3 ! not used in vol. calc
157  y14 = y1 - y4
158  y24 = y2 - y4
159  y34 = y3 - y4
160  z12 = z1 - z2 ! not used in vol. calc
161  z13 = z1 - z3 ! not used in vol. calc
162  z14 = z1 - z4
163  z24 = z2 - z4
164  z34 = z3 - z4
165 
166  c11 = y24*z34 - z24*y34
167  c21 = -( x24*z34 - z24*x34 )
168  c31 = x24*y34 - y24*x34
169 
170  vx6 = -( x14*c11 + y14*c21 + z14*c31 )
171 
172  vx6inv = 1.d0 / vx6
173 
174 ! See the maple worksheet 'V3D4.mws' for the derivation of [B]
175 ! NOTE: Factored for a more equivalent/compact form then maple's
176 
177  b1 = (y34*z24 - y24*z34) * vx6inv
178  b2 = (z34*x24 - z24*x34) * vx6inv
179  b3 = (x34*y24 - x24*y34) * vx6inv
180  b4 = (y13*z14 - y14*z13) * vx6inv
181  b5 = (z13*x14 - z14*x13) * vx6inv
182  b6 = (x13*y14 - x14*y13) * vx6inv
183  b7 = (y14*z12 - y12*z14) * vx6inv
184  b8 = (z14*x12 - z12*x14) * vx6inv
185  b9 = (x14*y12 - x12*y14) * vx6inv
186  b10 = (y12*z13 - y13*z12) * vx6inv
187  b11 = (z12*x13 - z13*x12) * vx6inv
188  b12 = (x12*y13 - x13*y12) * vx6inv
189 
190  temperaturegauss = ( temperature(n1) + &
191  temperature(n2) + &
192  temperature(n3) + &
193  temperature(n4) )*0.25d0
194 
195  strssth11 = -ci(1,j)*coeffexp(j)*( temperaturegauss - temperature0 ) !* Vx6inv
196  strssth22 = -ci(3,j)*coeffexp(j)*( temperaturegauss - temperature0 ) !* Vx6inv
197  strssth33 = -ci(6,j)*coeffexp(j)*( temperaturegauss - temperature0 ) !* Vx6inv
198 
199  print*,-ci(1,j)*coeffexp(j),ci(1,j),coeffexp(j),temperaturegauss
200 
201  s11(i) = s11(i) + strssth11
202  s22(i) = s22(i) + strssth22
203  s33(i) = s33(i) + strssth33
204 
205 ! calculate the volume
206 
207  vol = vx6 / 6.d0
208 
209 ! ASSEMBLE THE INTERNAL FORCE VECTOR
210 
211 ! local node 1
212  r_in(k1n1) = r_in(k1n1) - strssth11*b1*vol
213  r_in(k2n1) = r_in(k2n1) - strssth22*b2*vol
214  r_in(k3n1) = r_in(k3n1) - strssth33*b3*vol
215 ! local node 2
216  r_in(k1n2) = r_in(k1n2) - strssth11*b4*vol
217  r_in(k2n2) = r_in(k2n2) - strssth22*b5*vol
218  r_in(k3n2) = r_in(k3n2) - strssth33*b6*vol
219 ! local node 3
220  r_in(k1n3) = r_in(k1n3) - strssth11*b7*vol
221  r_in(k2n3) = r_in(k2n3) - strssth22*b8*vol
222  r_in(k3n3) = r_in(k3n3) - strssth33*b9*vol
223 ! local node 4
224  r_in(k1n4) = r_in(k1n4) - strssth11*b10*vol
225  r_in(k2n4) = r_in(k2n4) - strssth22*b11*vol
226  r_in(k3n4) = r_in(k3n4) - strssth33*b12*vol
227 
228 
229  ENDDO
230  RETURN
231 END SUBROUTINE v3d4_thermalexp
232 
subroutine v3d4_thermalexp(coor, matcstet, lmcstet, R_in, ci, S11, S22, S33, numnp, nstart, nend, numcstet, numat_vol, CoeffExp, Temperature, Temperature0)
blockLoc i
Definition: read.cpp:79
virtual std::ostream & print(std::ostream &os) const
j indices j
Definition: Indexing.h:6