Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
vol_elem_mat_matous.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 vol_elem_mat_matous(glb)
54 !
55 ! Forms the material compliance matix, [C] for an isotropic material
56 ! -1
57 ! Note: [E] = [C] and {epsilon} = [C]{sigma}
58 !
59 
60  USE rocstar_rocfrac
61 
62  IMPLICIT NONE
63  TYPE(rocfrac_global) :: glb
64 
65  REAL*8 :: e_l, nu_l
66 
67  INTEGER :: i,j ! loop counter
68 
69 !-----Create material constant matrices
70 
71 
72 
73  ALLOCATE(glb%L_tensor(1:6,1:6,1:glb%NumMatVol_Part))
74  ALLOCATE(glb%M_tensor(1:6,1:6,1:glb%NumMatVol_Part))
75 
76  glb%L_tensor = 0.d0
77  glb%M_tensor = 0.d0
78 
79  DO i = 1, glb%NumMatVol_Part
80 
81 
82 ! -- [E]
83 !!$ ci(1,i) = e(i)*(1.d0 - xnu(i))/ &
84 !!$ ( (1.d0+xnu(i))*(1.d0-2.d0*xnu(i)) )
85 !!$ ci(2,i) = e(i)*xnu(i)/( (1.d0+xnu(i))*(1.d0-2.d0*xnu(i)) )
86 !!$ ci(3,i) = ci(1,i)
87 !!$ ci(4,i) = ci(2,i)
88 !!$ ci(5,i) = ci(2,i)
89 !!$ ci(6,i) = ci(1,i)
90 !!$ ci(7,i) = e(i)/( 2.d0 * (1.d0 + xnu(i)) )
91 !!$ ci(8,i) = ci(7,i)
92 !!$ ci(9,i) = ci(7,i)
93 
94 ! -- [C]
95  glb%M_tensor(1,1,i) = 1.d0 / glb%E1(i)
96  glb%M_tensor(1,2,i) = - glb%nu12(i) / glb%E2(i)
97  glb%M_tensor(1,3,i) = - glb%nu13(i) / glb%E3(i)
98  glb%M_tensor(2,1,i) = glb%M_tensor(1,2,i)
99  glb%M_tensor(2,2,i) = 1.d0 / glb%E2(i)
100  glb%M_tensor(2,3,i) = - glb%nu23(i) / glb%E3(i)
101  glb%M_tensor(3,1,i) = glb%M_tensor(1,3,i)
102  glb%M_tensor(3,2,i) = glb%M_tensor(2,3,i)
103  glb%M_tensor(3,3,i) = 1.d0 / glb%E3(i)
104  glb%M_tensor(4,4,i) = 1.d0/glb%G12(i)
105  glb%M_tensor(5,5,i) = 1.d0/glb%G13(i)
106  glb%M_tensor(6,6,i) = 1.d0/glb%G23(i)
107 
108 ! --
109 
110  CALL invert2(glb%M_tensor(:,:,i), glb%L_tensor(:,:,i), 6)
111 
112 
113  print*,' Stiffness Matrix of Material',i
114  DO j= 1, 6
115  print*,glb%L_tensor(j,:,i)
116  ENDDO
117 
118  print*,' Compliance Matrix of Material',i
119  DO j= 1, 6
120  print*,glb%M_tensor(j,:,i)
121  ENDDO
122 
123 
124 
125 !!$ PRINT*, 'E = 1/M(1,1) = ', E_l
126 !!$ PRINT*, 'G = 1/M(4,4) = ', 1.d0/glb%M_tensor(4,4,i)
127 !!$ PRINT*, 'nu = -M(1,2)*E = ', nu_l
128 
129  ! not true for othotropic material: fix
130 
131  glb%ShrMod(i) = 1.d0/glb%M_tensor(4,4,i)
132  glb%PoisRat(i) = -glb%M_tensor(1,2,i)*1.d0/glb%M_tensor(1,1,i)
133  glb%BulkMod(i) = glb%E1(i)/(3.*(1.-2.*glb%PoisRat(i)))
134 
135  ENDDO
136 
137 ! PRINT*,'HOMOGENEOUS MEDIUM : matrix[2], fiber[1] | cm =', cm, ': cf =', cb, ' : cd =', cd
138  print*,'Comparison medium Lo = a1*Lm + a2*L2 : a1 =',glb%alpha1, ' | a2 =', glb%alpha2
139 
140 
141  CALL compositestiffnes(glb%L_tensor(:,:,1), glb%L_tensor(:,:,2), glb%M_tensor(:,:,1), glb%M_tensor(:,:,2), glb%cm, glb%c2, &
142  glb%alpha1, glb%alpha2, glb%L_bar, glb%M_bar, glb%Lo)
143 
144  print*,'Stiffness Matrix of Homogeneous Medium'
145 
146  DO j= 1, 6
147  print*,glb%L_bar(j,:)
148  ENDDO
149 
150  print*,'Compliance Matrix of Homogeneous Medium'
151 
152  DO j= 1, 6
153  print*,glb%M_bar(j,:)
154  ENDDO
155 
156  print*,''
157 
158  print*,'E = 1/M(1,1) = ', 1.d0/glb%M_bar(1,1), 'G = 1/M[4][4] = ', &
159  1.d0/glb%M_bar(4,4), 'nu = -M(1,2)*E =,', -glb%M_bar(1,2)*1./glb%M_bar(1,1)
160 
161  e_l = 1.d0/glb%M_bar(1,1)
162  nu_l = -glb%M_bar(1,2)*1.d0/glb%M_bar(1,1)
163 
164  print*,e_l*(1.d0-nu_l),glb%rho(1),(1.d0+nu_l)/(1.d0-2.d0*nu_l)
165  glb%cd_fastest = sqrt( e_l*(1.d0-nu_l)/glb%rho(1)/(1.d0+nu_l)/(1.d0-2.d0*nu_l) )
166 
167 ! ALLOCATE( glb%cd(1:4,1:glb%NumElVol) )
168 
169  print*,'done'
170 
171  RETURN
172 END SUBROUTINE vol_elem_mat_matous
173 
subroutine vol_elem_mat_matous(glb)
double sqrt(double d)
Definition: double.h:73
blockLoc i
Definition: read.cpp:79
subroutine compositestiffnes(Lm, L2, Mm, M2, cm, c2, alpha1, alpha2, L_bar, M_bar, Lo)
virtual std::ostream & print(std::ostream &os) const
subroutine invert2(Inv_in, a, nrow)
j indices j
Definition: Indexing.h:6