Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ArtificialDamping.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 artificialdamping(numcstet, numnp, &
54  rho, cd_fastest, detfold, dt, f, fdot, vx6, strssvisco)
55 
56  implicit none
57 
58  integer :: numcstet
59  integer :: numnp
60 
61  REAL*8 :: rho
62  real*8 :: cd_fastest
63  real*8 :: detfold ! change to more general
64  real*8 :: dt
65  real*8 :: vx6
66 
67 
68  REAL*8,DIMENSION(1:3,1:3) :: id = reshape( &
69  (/1.0,0.0, 0.0, &
70  0.0,1.0, 0.0, &
71  0.0,0.0, 1.0 /),(/3,3/) )
72 
73 
74  REAL*8 :: f(3,3),detf,finv(3,3), fdot(3,3), t(3,3), symt(3,3), devt(3,3)
75  REAL*8 :: strsscauchy(3,3), strssvisco(3,3)
76 
77  REAL*8 :: eta, c1, cl, h, du
78 
79  c1 = 1.d0
80  cl = 0.1d0
81 
82  finv(:,:) = f(:,:)
83 
84 ! returns the -1
85 ! inverse of the deformation gradient, F
86 ! and determanate of F
87 
88  CALL invert3x3(finv,detf)
89 
90 ! . -1
91 ! F * F
92 !
93 
94  t = matmul(fdot,finv)
95 !
96 ! . -1 T
97 ! symm( F * F ) = symm(T) = 0.5*( T + T )
98 
99  symt = 0.5d0*( t + transpose(t))
100 
101 !
102 ! dev( symm(T) ) = symmT - 1/3 * ( tr(symm(T)) * I
103 !
104 
105  devt = symt - 1.d0/3.d0*(symt(1,1)+symt(2,2)+symt(3,3))*id
106 
107 !
108 ! h = ( J* d! * |Vol| ) ^ (1/d)
109 !
110 ! where
111 ! d is the dimension fo space
112 ! Vol is the volume of the element
113 ! J is the Jacobian
114 !
115 !
116 
117  h = ( detf * vx6 )**(1./3.)
118 
119 ! n+1 n
120 ! DelU = h * ( log(J - log J ) ) / Delt
121 !
122 
123  du = h * ( log(detf) - log(detfold) )/dt
124 
125 
126 
127 !
128 ! artifical viscosity, max(0, -3/4 * h * rho*(c1*DelU - cL*a)
129 
130 ! IF(Du.GE.0.d0)THEN
131 ! eta = 0.d0
132 ! ELSE
133 
134  eta = max(0.d0,-0.75d0*h*rho/detf*(c1*du - cl*cd_fastest))
135 
136 ! ENDIF
137 
138 ! Cauchy Stress
139 
140  strsscauchy = 2.0*eta*devt
141 
142 ! PK2 stress
143 
144  strssvisco = detf*finv*strsscauchy*transpose(finv)
145 
146 !
147 ! store Jacobian for next time step
148 
149  detfold = detf
150 
151 end subroutine artificialdamping
152 
subroutine artificialdamping(numcstet, numnp, rho, cd_fastest, DetFold, dt, F, Fdot, Vx6, StrssVisco)
Vector_n max(const Array_n_const &v1, const Array_n_const &v2)
Definition: Vector_n.h:354
subroutine invert3x3(a, det)
Definition: v3d8_me.f90:1454
unsigned long id(const Leda_like_handle &x)
Definition: Handle.h:107