-
Notifications
You must be signed in to change notification settings - Fork 1
/
ViscoElastic_2D_FDTD_SG_CPML.m
86 lines (76 loc) · 2.81 KB
/
ViscoElastic_2D_FDTD_SG_CPML.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
clc,clear
% 2D Elastic wave simulation using finite difference.
% with staggered-grid; with Convolutional Perfectly Matched Layer;
% By zhaoqingwei
% Chengdu University of Technology (CDUT), 2021-2025
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%txx(tzz)--Vx--txx(tzz)
% | | |
% Vz------txz---vz
% | | |
%txx(tzz)--Vx--txx(tzz)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FM=20;
DT=0.001;dt=DT;
T=4;
nx=600;
nz=600;
DH=10;dx=DH;dz=DH;
s=wavelet(FM,DT,T)*1e5;
vp=ones(nz,nx)*4000;vs=vp/2;rou=ones(600,600)*2;
lamda=rou.*(vp.*vp-vs.*vs*2);mu=rou.*vs.*vs;
c11=rou.*vp.*vp;c13=rou.*(vp.*vp-vs.*vs*2);c33=c11;c55=rou.*vs.*vs;%¸÷ÏòͬÐÔ
% Epsilon=0.25*ones(600,600);Delta=0.1*ones(600,600);
% c33=vp.*vp.*rou;c55=vs.*vs.*rou;c11=2*c33.*Epsilon+c33;c13=rou.*sqrt(((1+2*Delta).*vp.*vp-vs.*vs).*(vp.*vp-vs.*vs))-rou.*vs.*vs;%VTI
QP=100;QS=100;
c11i=c11/(QP*FM);c33i=c11i;c55i=c55/(QS*FM);c13i=c11i-2*c55i;
vx0=zeros(nz,nx);vx1=vx0;
vz0=vx0;vz1=vx0;
taoxx0=vx0;taoxx1=vx0;
taozz0=vx0;taozz1=vx0;
taoxz0=vx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filter(vz1,ddz1)+c11.*TX.*imfilter(vx1,ddx1)+c13.*HZZ1*dt+c11.*HXX1*dt+c13i.*vzzt+c11i.*vxxt;
taozz1=taozz0+c33.*TZ.*imfilter(vz1,ddz1)+c13.*TX.*imfilter(vx1,ddx1)+c33.*HZZ1*dt+c13.*HXX1*dt+c33i.*vzzt+c13i.*vxxt;
taoxz1=taoxz0+c55.*TZ.*imfilter(vx1,ddz0)+c55.*TX.*imfilter(vz1,ddx0)+c55.*HXZ1*dt+c55.*HZX1*dt+c55i.*vxzt+c55i.*vzxt;
% taoxx1(z0,x0)=taoxx1(z0,x0)+s(k);
% taozz1(z0,x0)=taozz1(z0,x0)+s(k);
EXX0=EXX1;EXZ0=EXZ1;EZX0=EZX1;EZZ0=EZZ1;
HXX0=HXX1;HXZ0=HXZ1;HZX0=HZX1;HZZ0=HZZ1;
taoxx0=taoxx1;taozz0=taozz1;taoxz0=taoxz1;
vz0=vz1;vx0=vx1;
if mod(t,0.5)==0
figure();
imagesc(vz1);
end
end