SPEED
MAKE_STRESS_TENSOR_DAMPED.f90
Go to the documentation of this file.
1! Copyright (C) 2012 The SPEED FOUNDATION
2! Author: Ilario Mazzieri
3!
4! This file is part of SPEED.
5!
6! SPEED is free software; you can redistribute it and/or modify it
7! under the terms of the GNU Affero General Public License as
8! published by the Free Software Foundation, either version 3 of the
9! License, or (at your option) any later version.
10!
11! SPEED is distributed in the hope that it will be useful, but
12! WITHOUT ANY WARRANTY; without even the implied warranty of
13! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14! Affero General Public License for more details.
15!
16! You should have received a copy of the GNU Affero General Public License
17! along with SPEED. If not, see <http://www.gnu.org/licenses/>.
18
50
51
52 subroutine make_stress_tensor_damped(nn,lambda,mu,&
53 duxdx,duydx,duzdx,&
54 duxdy,duydy,duzdy,&
55 duxdz,duydz,duzdz,&
56 strain_visc_xx, strain_visc_xy, strain_visc_xz, &
57 strain_visc_yy, strain_visc_yz, strain_visc_zz, &
58 Ylambda,Ymu, N_SLS, &
59 sxx,syy,szz,&
60 syz,szx,sxy,ie)
61
62
63 implicit none
64
65 integer*4 :: nn,N_SLS
66 integer*4 :: p,q,r,ie
67
68 real*8, dimension(N_SLS) :: ylambda, ymu, temp
69 real*8, dimension(nn,nn,nn) :: lambda,mu
70 real*8, dimension(nn,nn,nn) :: sxx,syy,szz,syz,szx,sxy
71 real*8, dimension(nn,nn,nn) :: duxdx,duxdy,duxdz,duydx,duydy,duydz,duzdx,duzdy,duzdz
72 real*8, dimension(nn,nn,nn,N_SLS) :: strain_visc_xx, strain_visc_xy, strain_visc_xz, &
73 strain_visc_yy, strain_visc_yz, strain_visc_zz
74
75
76 do r = 1,nn
77 do q = 1,nn
78 do p = 1,nn
79
80
81 temp = strain_visc_xx(p,q,r,:) + strain_visc_yy(p,q,r,:) + strain_visc_zz(p,q,r,:)
82
83 sxx(p,q,r) = lambda(p,q,r) * (duxdx(p,q,r) +duydy(p,q,r) +duzdz(p,q,r) &
84 - dot_product(ylambda,temp)) &
85 +2.0d0*mu(p,q,r) * (duxdx(p,q,r) - dot_product(ymu,strain_visc_xx(p,q,r,:)))
86
87 syy(p,q,r) = lambda(p,q,r) * (duxdx(p,q,r) +duydy(p,q,r) +duzdz(p,q,r) &
88 - dot_product(ylambda,temp)) &
89 +2.0d0*mu(p,q,r) * (duydy(p,q,r) - dot_product(ymu,strain_visc_yy(p,q,r,:)))
90
91 szz(p,q,r) = lambda(p,q,r) * (duxdx(p,q,r) +duydy(p,q,r) +duzdz(p,q,r) &
92 - dot_product(ylambda,temp)) &
93 +2.0d0*mu(p,q,r) * (duzdz(p,q,r) - dot_product(ymu,strain_visc_zz(p,q,r,:)))
94
95 syz(p,q,r) = mu(p,q,r) * (duydz(p,q,r) + duzdy(p,q,r) - dot_product(ymu,strain_visc_yz(p,q,r,:)))
96 szx(p,q,r) = mu(p,q,r) * (duzdx(p,q,r) + duxdz(p,q,r) - dot_product(ymu,strain_visc_xz(p,q,r,:)))
97 sxy(p,q,r) = mu(p,q,r) * (duxdy(p,q,r) + duydx(p,q,r) - dot_product(ymu,strain_visc_xy(p,q,r,:)))
98
99 ! write(*,*) p,q,r
100 ! write(*,*) temp
101 ! write(*,*) DOT_PRODUCT(Ylambda,temp)
102 ! write(*,*) DOT_PRODUCT(Ymu,strain_visc_xx(p,q,r,:))
103 ! write(*,*) DOT_PRODUCT(Ymu,strain_visc_yy(p,q,r,:))
104 ! write(*,*) DOT_PRODUCT(Ymu,strain_visc_zz(p,q,r,:))
105 ! write(*,*) DOT_PRODUCT(Ymu,strain_visc_yz(p,q,r,:))
106 ! write(*,*) DOT_PRODUCT(Ymu,strain_visc_xz(p,q,r,:))
107 ! write(*,*) DOT_PRODUCT(Ymu,strain_visc_xy(p,q,r,:))
108 ! write(*,*) '--------------------------------------'
109 enddo
110 enddo
111 enddo
112
113 return
114
115 end subroutine make_stress_tensor_damped
116
subroutine make_stress_tensor_damped(nn, lambda, mu, duxdx, duydx, duzdx, duxdy, duydy, duzdy, duxdz, duydz, duzdz, strain_visc_xx, strain_visc_xy, strain_vi
Computes the stress tensor.