Sheng Wang

一阶声波方程有线差分模拟

本文介绍了一阶声波方程有限差分模拟,并利用一维模型例子加以说明。

控制方程

一维空间下,一阶声波方程可以写成以下形式:$ $

在无外力作用无信号输入情况下,声波方程及其差分形式为:

交错网格

参考Virieux(1984, 1986),构建交错网格如下:

在二阶差分精度下,对于B点可以推导:

同样的,可以推导A点:

故而,波场递推关系为:

实现

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
% Matlab
clear;close all; clc
nx = 1000; dx = 10; x = (0:nx-1) * dx;
nt = 2500; dt = 1.0e-2;
v = 1000.0; rho = 1500;

f_wave = 0.5*2.0 * pi ;
n_stop = floor( 2.0 * pi / f_wave / dt );
src= [ sin( (0:n_stop)*dt*f_wave) zeros(1,nt) ]; %source

p = zeros(2,nx); q = zeros(2,nx-1); %initial conditions
new = 1; old = 2;
c_q = -1.0*dt/rho/dx; c_p = -1.0*rho*v*v*dt/dx;
figure
for it = 1:nt
% 1 2 3 4 5 ...
%--q---q---q---q---q--...
%p---p---p---p---p---p...
%1 2 3 4 5 6...
p(old,501) = src(it)+p(old,501);
for ix = 1:nx-1
q(new,ix) = q(old,ix) + c_q * ( p(old,ix+1) - p(old,ix) );
end
for ix = 2:nx-1
p(new,ix) = p(old,ix) + c_p * ( q(new,ix) - q(new,ix-1) );
end

p(new,nx) = p(new,nx-1); % free boundary
p(new,1) = p(new,2);
%p(new,nx) = 0.0; % rigid boundary
%p(new,1) = 0.0;
plot(x,p(old,:));
axis( [0 nx*dx -1.5 1.5] );
pause(0.001);
tmp = old; old = new; new = tmp;
end

参考文献

Virieux J. SH-wave propagation in heterogeneous media: Velocity-stress finite-difference method[J]. Geophysics, 1984, 49(11): 1933-1942.
Virieux J. P-SV wave propagation in heterogeneous media: Velocity-stress finite-difference method[J]. Geophysics, 1986, 51(4): 889-901.