Fdelmodcmanual PDF
Fdelmodcmanual PDF
Jan Thorbecke
March 17, 2016
Contents
0 Getting Started 2
0.1 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
0.2 Compilation and Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
0.3 Running examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1 Introduction to Finite-Difference 3
1.1 Finite-difference algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Stability and Dispersion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2 Acoustic 8
2.1 Staggered scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
3 Visco-Acoustic 11
4 Elastic 13
5 Visco-Elastic 15
1
A Source and directory structure 48
C Makewave 52
0 Getting Started
0.1 Installation
The software, downloaded as a gzipped tar archive, can be extracted in a directory of your choice, e.g., by typing
bin
lib
doc
include
fdelmodc
utils
FFTlib
The README file in that directory contains some of the quick-start information given here in condensed format. The
FFTlib directory does not contain a main program and contains source code to build a library (libgenfft.a)
with Fourier transformation functions. The fdelmodc and utils directories include all files needed to compile and
link the executables build in that directory. This means that some of the source files in the fdelmodc and utils
directory are the same. This has been done to make the compilation procedure less complicated. Section A of this
manual contains a brief (one-sentence) explanation of the meaning of all the files in the source tree of this package.
The source code is in continuous development to add new features and solve bugs. The latest version of the source
code and manual can always be found at:
http://www.xs4all.nl/ janth/Software/Software.html.
The code is used by many different people and when somebody requests a new option for the code (for example
place receivers in a circle) then I will try to implement and test the new functionality and put the updated source
(and manual) on the website as soon as it is ready and tested.
2. Check the compiler and CFLAGS options in the file Make include and adapt to the system you are using.
The default options are set for a the GNU C compiler on a Linux system. A Fortran or g++ compiler is not
needed to compile the code. The compilation of the source code has been tested with several versions of
GNU and Intel compilers.
3. If the compiler options are set in the Make include file you can type
2
> make
and the Makefile will compile and link the source code in the directories:
FFT library
fdelmodc
utils
The compiled FFT library will be placed in the lib/ directory, the executables in the bin/ directory and the
include file of the FFT library in the include/ directory.
To use the executables dont forget to include the pathname in your PATH:
bash:
export PATH=path_to_this_directory/bin:$PATH:
csh:
setenv PATH path_to_this_directory/bin:$PATH:
On Linux systems using the bash shell you can put the export PATH=path to this directory/bin:$PATH:
setting in $HOME/.bashrc, to set it every time you login.
Other useful make commands are:
make clean: removes all object files, but leaves libraries and executables
make realclean: removes also object files, libraries and executables.
> ./fdelmodc_plane.scr
in the directory fdelmodc/demo/. The results of this script are discussed in section 7.1. The fdelmodc/demo/
directory contains scripts to demonstrate the different possibilities of the modeling program. Most of the scripts in
the demo directory can re-produce the figures used in this manual. The examples section 7 contains also detailed
explanations of the other demo scripts.
To reproduce the Figures shown in the GEOPHYICS manuscript Finite-difference modeling experiments for
seismic interferometry (Thorbecke and Draganov, 2011) the scripts in fdelmodc/FiguresPaper/ directory
can be used. Please read the README in the FiguresPaper directory for more instructions and guidelines.
To clean-up all the produced output files in the fdelmodc/demo/ and fdelmodc/FiguresPaper/ direc-
tory you can run the clean script in those directories.
1 Introduction to Finite-Difference
The program fdelmodc can be used to model waves conforming the 2D wave equation in different media. This
manual does not give a detailed overview about finite-difference modelling and only briefly explains the four
different Finite-Difference (FD) schemes implemented in the program fdelmodc. More important are the (im)-
possibilities of the program, and a detailed explanation is given how to use the parameters together with certain
specific implementation issues a user must be aware of. There are already many programs available to model the
2D wave equation, and one might ask why write another one? The program fdelmodc is open source, makes use
of the Seismic Unix (SU) parameter interface and output files, and specially aims at the modelling of measurements
used for Seismic Interferometry. This means that noisy source signals at random source positions can be modeled
for very long recording times using only one program.
3
The first four sections after the introduction describe the four implemented schemes; acoustic, visco acoustic,
elastic, and visco elastic. In section 6 the program parameters are described and in section 7 examples are given how
the program can be applied and demonstrates the possibilities of the program. The remainder of this introduction
explains the finite-difference approximations for the derivatives used in the first-order systems governing the wave
equation, and how the discretization must be chosen for stable and dispersion-free modelling results.
The program fdelmodc computes a solution of the 2D wave equation by approximating the derivatives in the
wave equation by finite-differences. The wave equation is defined through the first-order linearized systems of
Newtons and Hookes law. For an acoustic medium the equations are given by;
Vx 1 P
= ,
t x
Vz 1 P
= , (1)
t z
P 1 Vx Vz
= { + },
t x z
where Vx , Vz are the particle velocity components in the x and z-direction, respectively, P the acoustic pressure,
is the density of the medium and the compressibility.
The first-order derivatives in the spatial coordinates (lateral position x and depth position z) are approximated by
a so-called centralized 4th order Crank-Nicolson approximation,
P P ((i + 32 )x) + 27P ((i + 12 )x) 27P ((i 12 )x) + P ((i 32 )x)
(2)
x 24x
the first order derivative in time is approximated by a 2th order scheme:
x P x2 2 P x3 3 P
P (x + x) P (x) + + + + Ox4 (4)
1! x 2! x2 3! x3
For example, a 4th order approximation of a first-order derivative, used in the implemented staggered grid, can be
derived from four Taylor expansions on 4 points centered around x = 0:
x x P x2 2 P x3 3 P x4 4 P
P (x + ) P (x) + + + + + Ox5
2 2 x 8 x2 24 x3 96 x4
x x P x2 2 P x3 3 P x4 4 P
P (x ) P (x) + 2
3
+ + Ox5
2 2 x 8 x 24 x 96 x4
3x 3x P 9x2 2 P 27x3 3 P 81x4 4 P
P (x + ) P (x) + + + + + Ox5
2 2 x 8 x2 24 x3 96 x4
3x 3x P 9x2 2 P 27x3 3 P 81x4 4 P
P (x ) P (x) + 2
3
+ + Ox5
2 2 x 8 x 24 x 96 x4
Subtracting the expansions of x x x
2 from x + 2 and subtracting x
3x
2 from x + 3x
2 already eliminates the
second and fourth order terms (or more general all even-power terms) :
x x P 2x3 3 P
D1 = P (x + ) P (x ) x + + Ox5
2 2 x 24 x3
3x 3x P 54x3 3 P
D2 = P (x + ) P (x ) 3x + + Ox5
2 2 x 24 x3
Using a linear combination of D1 and D2 , to eliminate the third order term, gives the 4th order approximation:
x x 3x 3x
27D1 D2 P 27(P (x + 2 ) P (x 2 ))
P (x + 2 ) + P (x 2 )
+ Ox4 + Ox4 . (5)
24x x 24x
4
The implemented Finite-Difference codes make use of a staggered grid and is following the grid layout as de-
scribed in Virieux (1986). In the sections for the specific solutions the staggered grid is explained in detail. The
implementation of equation 1 is also called a stencil, since it forms a pattern of four grid point needed to compute
the partial derivative at one grid point. To compute the spatial derivative on all grid points the stencil is shifted
through the grid.
The medium parameters used in the FD program are
1
( + 2) = c2p = (6)
= c2s (7)
where is the density of the medium, cp the P-wave velocity, cs the S-wave velocity, and the Lame parameters
and the compressibility. The program reads the P (and S-wave for elastic modelling) velocity and medium
density as gridded input model files. From these files the program calculates the Lame parameters used in the first
order equations 1 to calculate the wavefield at next time steps.
5
FD kernel acoustic
get parameters
update Vx and Vz
allocate arrays
apply source to Vx, Vz
source signatures
boundary conditions
shot loop
update P
time loop
apply source to P
FD kernel
no
taper edges
no
write receivers
arrays Disk
no
free memory
Figure 1: Flow chart of the finite-difference (FD) algorithm. The FD kernel of the acoustic scheme is explained in
the onset in more detail. The two decision loops are for the number of shot positions and the number of time steps
to be modeled. In the chart, t represents time, Vx and Vz the horizontal and vertical particle-velocity, respectively,
and P the acoustic pressure.
The update of the stress fields (P ) is done after the updates of the particle-velocity fields, hence the P field is
calculated also staggered with time (+ 21 t) compared to the particle-velocity fields. Numerical particle velocity
(Vx , Vz ) are computed at time (k + 12 )t, and numerical stress (zz = P, xz , xx ) at time (k +1)t are computed
explicitly from stress at time kt and from velocity at time (k 12 )t (Virieux, 1986).
The kernel operators (stencils) are shown in Figure 2. They are the implementation of the finite-difference approx-
imation of a first order derivative as represented in equation 1. A staggered grid implementation has been used.
This means that the grids of the Vx and Vz wavefields are positioned in between the P grid.
6
P P
Vx Vx
Vz Vz
Figure 2: The compute kernels showing the grid points needed to update the Vx and Vz (a) and P (b) wavefields.
The wavefields all have a unique grid position. A staggered grid implementation has been used. This means that
the grids of the Vx and Vz wavefields are positioned in between the P grid.
0.606h
t < (10)
cmax
with h = x = z being the discretization step in the spatial dimensions. If equation 10 is not satisfied unstable
results will be calculated if, within a time step t, the wavefront has travelled a distance larger than 0.606x. This
will typically occur at high velocities when tcmax is large. The unstable solution will propagate though the whole
model and can end up with large numbers and the out-of-range representation NaN (Not a Number).
Besides unstable solutions wavefield dispersion can also occur. Unfortunately, finite-difference schemes are intrin-
sically dispersive and there is no fixed grid points per wavelength rule that can be given to avoid dispersion. The
widespread rule of thumb 5 points per wavelength for a (2,4) scheme (Alford et al., 1974) has to be understood
in the sense 5 points per wavelength for an average geophysical medium, and for the propagation of a 100 wave-
lengths through the medium(Sei, 1995). Dispersion for the 2D wave-equation will occur more strongly and clearly
visible if the following relation is not obeyed,
cmin
h < , (11)
5fmax
min
h <
5
and will occur at small wavelengths (min , low velocities and/or high frequencies). In the case of dispersion,
the program will keep on running but will give dispersive waves. Do not confuse numerical dispersion with the
physical dispersion of visco-elastic waves discussed later.
7
x [m] x [m]
0 500 1000 1500 2000 0 500 1000 1500 2000
0 0
500 500
1000 1000
z [m]
z [m]
1500 1500
2000 2000
1500
500
1600
1000
z [m]
z [m]
1700
1800
1500
1900
2000
2000
Figure 3 shows different snapshots with no dispersion (a), dispersion (b and c) and the results for an unstable
scheme (d). Note that before starting the calculating the program checks if the stability and dispersion equations
10 and 11 are satisfied. If they are not satisfied the programs stops with an error message and suggestion how
to change the discretization interval or maximum frequency, to get a stable scheme.The dispersion check can be
overruled by using the fmax= parameter smaller than the actual maximum frequency found in the source wavelet.
For a more detailed discussion about stability in finite-difference schemes see Sei (1995), Sei and Symes (1995)
Bauer et al. (2008).
Unfortunately, the stability and dispersion criteria shown in equation 10 is not valid for visco-elastic media. See
the end of section 5 for some guidelines.
2 Acoustic
The linearized equation of motion (Newtons second law) and equation of deformation (Hooks law) are given by:
Vx 1 P
= , (12)
t x
Vz 1 P
= , (13)
t z
P 1 Vx Vz
= { + }, (14)
t x z
where Vx , Vz are the particle velocity components in the x and z-direction, respectively, and P the acoustic pres-
sure. In the staggered-grid implementation, x and Vx , z and Vz , and c2p = 1 and P are put on the same
calculation grid. The computational grid (represented by and cp ) is placed at an offset (one or two grid-points,
8
Vz Vz Vz
(0, 0)
Vx P Vx Vx
(0, 0)
(0, 0) P P
Vz Vz Vz
Vx x
Vx Vx Vx Vx
P P P P Vz z
P
Vz Vz Vz
Vx Vx Vx
P P P
Vz
Figure 4: Acoustic staggered calculation grid for a fourth-order scheme in space. Vz , Vx represent the particle
velocity of the wavefield in the z and x direction, respectively, and P represent the acoustic pressure. The blue
fields are auxiliary points used to calculate the black field values. Those blue points are not updated and initialized
to zero. On all sides of the model a virtual Vx or Vz layer has been added for proper handling of the edges of the
model.
depending of the field component) in the computational grid for efficient handling of the boundaries. Note that
compared to equations 1 we have removed the minus sign in the right hand side of 12. This is how the equations
are actually implemented in the code. The minus sign is added again in the implementation of the source (so,
S(t) is used). In the other schemes, presented below, the same notation without the minus sign is used.
The pressure/stress wavefields are computed on different time steps than the particle-velocity fields. In the algo-
rithm the first time-step (it = 0) computed for the particle-velocity fields uses pressure/stress fields at it = 0
resulting in particle-velocity fields at time steps (it + 12 )t. The pressure/stress fields are computed at time steps
itt using the particle-velocity fields at time steps (it + 12 )t.
For the staggered-grid implementation, shown in Figure 4, every field quantity has a different origin. The origins
of the field are chosen in such a way that interpolation of one field grid to another field grid can be done in a
straightforward way (see also section 6.6.3). The derivative operators need two points on each sides of their centre
to calculate the derivative at the centre. By offsetting the grid, the extra points needed to calculate the derivative
at the boundaries of the model are added. These extra layers, needed at the edges of the model, are also taken into
account in the choice of the origin. The origins of the medium parameters (and the different fields) are defined
according to the following mapping:
[z, x]
x [1, 2] 0.5 ([0, 0] + [0, 1])
z [2, 1] 0.5 ([0, 0] + [1, 0])
[1, 1] c2p [0, 0][0, 0].
(15)
Note that the choice for the origin is just a choice for convenience and nothing else.
In the code section below the io** variables define the origin-offsets used in the calculations.
9
/* Vx: rox */
ioXx=2;
ioXz=ioXx-1;
/* Vz: roz */
ioZz=2;
ioZx=ioZz-1;
/* P, Txx, Tzz: lam, l2m */
ioPx=1;
ioPz=ioPx;
/* Txz: muu */
ioTx=2;
ioTz=ioTx;
/* calculate p/tzz for all grid points except on the virtual boundary */
for (ix=ioPx; ix<nx+1; ix++) {
for (iz=ioPz; iz<nz+1; iz++) {
p[ix*n1+iz] -= l2m[ix*n1+iz]*(
c1*(vx[(ix+1)*n1+iz] - vx[ix*n1+iz]) +
c2*(vx[(ix+2)*n1+iz] - vx[(ix-1)*n1+iz]) +
c1*(vz[ix*n1+iz+1] - vz[ix*n1+iz]) +
c2*(vz[ix*n1+iz+2] - vz[ix*n1+iz-1]));
}
}
10
3 Visco-Acoustic
For a visco-acoustic medium the linearized equation of motion (Newtons second law) and equation of deformation
(Hooks law) are :
Vx 1 P
= (16)
t x
Vz 1 P
= (17)
t z
P 1 p Vx Vz
= { + } + rp (18)
t x z
rp 1 p 1 Vx Vz
= rp + ( 1)( ){ + } (19)
t x z
For the attenuation implementation a leap-frog scheme in time is used and shown in the implementation below.
The so-called memory variable rp (Robertsson et al., 1994) are introduced for the relaxation mechanism.
/* calculate p/tzz for all grid points except on the virtual boundary */
for (ix=ioPx; ix<nx+1; ix++) {
for (iz=ioPz; iz<nz+1; iz++) {
dxvx[iz] = c1*(vx[(ix+1)*n1+iz] - vx[ix*n1+iz]) +
c2*(vx[(ix+2)*n1+iz] - vx[(ix-1)*n1+iz]);
}
for (iz=ioPz; iz<nz+1; iz++) {
dzvz[iz] = c1*(vz[ix*n1+iz+1] - vz[ix*n1+iz]) +
c2*(vz[ix*n1+iz+2] - vz[ix*n1+iz-1]);
}
The relaxation parameters p , are defined in the program indirectly by defining the Quality factor (Q). This Q-
factor can be defined in the program by setting the parameter Qp= for a constant-Q medium,or by using a gridded
file file qp=, which defines a different Q-factor for every grid point. The Q-factors are transformed inside the
11
xz V xz Vz xz Vz xz Vz
(0, 0) z
(0, 0)
Vx p Vx p Vx p Vx p
(0, 0)
(0, 0)
xz Vz xz Vz xz Vz xz Vz
Vx x
Vx p Vx p Vx p Vx p Vz z
p + 2,
xz Vz xz Vz xz Vz xz xz
Vx p Vx p Vx p
xz Vz xz Vz xz
Vx p Vx p
Figure 5: Elastic staggered calculation grid for a fourth-order scheme in space. Vz , Vx represent the particle
velocity of the wavefield in the z and x direction, respectively, and p (xx or zz ), xz represent the stress fields.
The blue fields are auxiliary points used to calculate the black field values. Those blue points are not updated and
initialized to zero. On all sides of the model a virtual Vx , xz or Vz , xz layer has been added for proper handling
of the edges of the model.
program to the relaxation parameters (used in the numerical scheme) by using (Robertsson et al., 1994):
t s 1 + w 2 ts te
Q= (20)
(te ts ) wt s
1.0 + 1.0
Q2p Qp
1.0
= (21)
fw
1.0
p = 2 (22)
fw
1.0 + fw Qs
s = (23)
fw Qs fw2
where fw is the central frequency (of the used wavelet) given by parameter fw=.
The relaxation parameters are defined by the following damping model:
L
1 + jte,l
M () = k0 1L (24)
1 + jts,l
l=1
{M ()}
Q= (25)
{M ()}
TODO: explain the physical mechanism of the used damping model (mass-spring configuration).
12
4 Elastic
Linearized equation of motion (Newtons second law) and equation of deformation (Hooks law) are used:
Vx 1 xx xz
= { + } (26)
t x z
Vz 1 xz zz
= { + } (27)
t x z
xx 1 Vx Vz
= { + } (28)
t x z
zz 1 Vz Vx
= { + } (29)
t z x
xz Vx Vz
= { + } (30)
t z x
where ij denotes the ijth component of the symmetric stress tensor Virieux (1986).
The derivative operators need two points on each side of their centre to calculate the derivative at the centre. By
offsetting the grid, the extra points needed to calculate the derivative at the boundaries of the model are added.
These extra layers needed at the edges of the model are also taken into account in the choice of the origin. The
origins are defined according to the following mapping:
[z, x]
x [1, 2] 0.5 ([0, 0] + [0, 1])
z [2, 1] 0.5 ([0, 0] + [1, 0])
[1, 1] c2p [0, 0][0, 0]
[2, 2] c2s [0, 0][0, 0]
[1, 1] c2p [0, 0][0, 0] 2c2p [0, 0][0, 0].
/* Vx: rox */
ioXx=mod.iorder/2;
ioXz=ioXx-1;
/* Vz: roz */
ioZz=mod.iorder/2;
ioZx=ioZz-1;
/* P, Txx, Tzz: lam, l2m */
ioPx=mod.iorder/2-1;
ioPz=ioPx;
/* Txz: muu */
ioTx=mod.iorder/2;
ioTz=ioTx;
13
vz[ix*n1+iz] -= roz[ix*n1+iz]*(
c1*(tzz[ix*n1+iz] - tzz[ix*n1+iz-1] +
txz[(ix+1)*n1+iz] - txz[ix*n1+iz]) +
c2*(tzz[ix*n1+iz+1] - tzz[ix*n1+iz-2] +
txz[(ix+2)*n1+iz] - txz[(ix-1)*n1+iz]) );
}
}
/* calculate Txx/tzz for all grid points except on the virtual boundary */
for (ix=ioPx; ix<nx+1; ix++) {
for (iz=ioPz; iz<nz+1; iz++) {
dvvx[iz] = c1*(vx[(ix+1)*n1+iz] - vx[ix*n1+iz]) +
c2*(vx[(ix+2)*n1+iz] - vx[(ix-1)*n1+iz]);
}
for (iz=ioPz; iz<nz+1; iz++) {
dvvz[iz] = c1*(vz[ix*n1+iz+1] - vz[ix*n1+iz]) +
c2*(vz[ix*n1+iz+2] - vz[ix*n1+iz-1]);
}
for (iz=ioPz; iz<nz+1; iz++) {
txx[ix*n1+iz] -= l2m[ix*n1+iz]*dvvx[iz] + lam[ix*n1+iz]*dvvz[iz];
tzz[ix*n1+iz] -= l2m[ix*n1+iz]*dvvz[iz] + lam[ix*n1+iz]*dvvx[iz];
}
}
/* calculate Txz for all grid points except on the virtual boundary */
for (ix=ioTx; ix<nx+1; ix++) {
for (iz=ioTz; iz<nz+1; iz++) {
txz[ix*n1+iz] -= mul[ix*n1+iz]*(
c1*(vx[ix*n1+iz] - vx[ix*n1+iz-1] +
vz[ix*n1+iz] - vz[(ix-1)*n1+iz]) +
c2*(vx[ix*n1+iz+1] - vx[ix*n1+iz-2] +
vz[(ix+1)*n1+iz] - vz[(ix-2)*n1+iz]) );
}
}
To handle a solid fluid interface an extra layer is introduced between the interfaces. This technique is described by
van Vossen et al. (2002).
14
5 Visco-Elastic
Linearized equation of motion (Newtons second law) and equation of deformation (Hooks law) used are:
Vx 1 xx xz
= { + } (31)
t x z
Vz 1 xz zz
= { + } (32)
t x z
xx 1 p Vx Vz s Vz
= { + } 2 + rxx (33)
t x z z
zz 1 p Vx Vz s Vx
= { + } 2 + rzz (34)
t x z x
xz s Vx Vz
= { + } + rxz (35)
t z x
rxx 1 p 1 Vx Vz s Vz
= rxx + ( 1)( ){ + } ( 1)2 (36)
t x z z
rzz 1 p 1 Vx Vz s Vx
= rzz + ( 1)( ){ + } ( 1)2 (37)
t x z x
rxz 1 s Vx Vx
= rxz + ( 1){ + } (38)
t z z
More details about visco-elastic FD modelling can be found in Robertsson et al. (1994), Saenger and Bohlen
(2004), and Bohlen (2002).
The relaxation parameters p , s , are defined in the program indirectly by defining the Quality factor (Q). This
Q-factor can be defined in the program by setting the parameter Qp= Qs= for a constant-Q medium, or by using
a gridded file file qp= file qs= which defines a different Q-factor for every grid point. The Q-factors are in
the program transformed into the relaxation parameters (used in the numerical scheme) by using Robertsson et al.
(1994):
t s 1 + w 2 ts te
Q= (39)
(te ts ) wt s
1.0 + 1.0
Q2p Qp
1.0
= (40)
fw
1.0
p = 2 (41)
fw
1.0 + fw Qs
s = (42)
fw Qs fw2
where fw is the central frequency (of the used wavelet) given by parameter fw=.
The relaxation parameters are defined by the following damping model:
L
1 + jte,l
M () = k0 1L (43)
1 + jts,l
l=1
{M ()}
Q= (44)
{M ()}
Unfortunately, the stability calculations within the program are not always valid for visco-elastic media. There is
no general rule of thumb for visco-elastic media to calculate a stability criterion. If in a modeling experiment, with
a chosen Qp and Qs, the program is not stable, the advise is to increase the smallest Q-factor (for example from 20
to 30), or use ischeme=3, and see if that gives a stable modeling result. If you get a stable result by increasing
Q (or ischeme=3) and you want to use the lower Q, value you have to make the dx (and possibly dt) smaller to
get stable answers for that Q value as well.
15
6 Parameters in program fdelmodc
The self-doc of the program is shown by typing fdelmodc on the command line without any arguments. You
will then see the following exhaustive list of parameters:
IO PARAMETERS:
file_cp= .......... P (cp) velocity file
file_cs= .......... S (cs) velocity file
file_den= ......... density (ro) file
file_src= ......... file with source signature
file_rcv=recv.su .. base name for receiver files
file_snap=snap.su . base name for snapshot files
file_beam=beam.su . base name for beam fields
dx= ............... read from model file: if dx==0 then dx= can be used to set it
dz= ............... read from model file: if dz==0 then dz= can be used to set it
dt= ............... read from file_src: if dt==0 then dt= can be used to set it
OPTIONAL PARAMETERS:
ischeme=3 ......... 1=acoustic, 2=visco-acoustic 3=elastic, 4=visco-elastic
tmod=(nt-1)*dt .... total registration time (nt from file_src)
ntaper=0 .......... length of taper in points at edges of model
npml=35 ........... length of PML layer in points at edges of model
R=1e-4 ............ the theoretical reflection coefficient at PML boundary
m=2.0 ............. scaling order of the PML sigma function
tapfact=0.30 ...... taper strength: larger value gets stronger taper
For the 4 boundaries the options are: 1=free 2=pml 3=rigid 4=taper
top=1 ............. type of boundary on top edge of model
left=4 ............ type of boundary on left edge of model
right=4 ........... type of boundary on right edge of model
bottom=4 .......... type of boundary on bottom edge of model
grid_dir=0 ........ direction of time modeling (1=reverse time)
Qp=15 ............. global Q-value for P-waves in visco-elastic (ischeme=2,4)
file_qp= .......... model file Qp values as function of depth
Qs=Qp ............. global Q-value for S-waves in visco-elastic (ischeme=4)
file_qs= .......... model file Qs values as function of depth
fw=0.5*fmax ....... central frequency for which the Qs are used
sinkdepth=0 ....... receiver grid points below topography (defined bij cp=0.0)
sinkdepth_src=0 ... source grid points below topography (defined bij cp=0.0)
sinkvel=0 ......... use velocity of first receiver to sink through to next layer
beam=0 ............ calculate energy beam of wavefield in model
disable_check=0 ... disable stabilty and dispersion check and continue modeling
verbose=0 ......... silent mode; =1: display info
16
zsrca= ............ defines source array z-positions
wav_random=1 ...... 1 generates (band limited by fmax) noise signatures
fmax=from_src ..... maximum frequency in wavelet
src_multiwav=0 .... use traces in file_src as areal source
src_at_rcv=1 ...... inject wavefield at receiver coordinates (1), inject at source (0)
src_injectionrate=0 set to 1 to use injection rate source
RECEIVER SELECTION:
xrcv1=xmin ........ first x-position of linear receiver array(s)
17
xrcv2=xmax ........ last x-position of linear receiver array(s)
dxrcv=dx .......... x-position increment of receivers in linear array(s)
zrcv1=zmin ........ first z-position of linear receiver array(s)
zrcv2=zrcv1 ....... last z-position of linear receiver array(s)
dzrcv=0.0 ......... z-position increment of receivers in linear array(s)
dtrcv=.004 ........ desired sampling in receiver data (seconds)
xrcva= ............ defines receiver array x-positions
zrcva= ............ defines receiver array z-positions
rrcv= ............. radius for receivers on a circle
arcv= ............. vertical arc-lenght for receivers on a ellipse (rrcv=horizontal)
oxrcv=0.0 ......... x-center position of circle
ozrcv=0.0 ......... z-center position of circle
dphi=2 ............ angle between receivers on circle
rcv_txt=........... text file with receiver coordinates. Col 1: x, Col. 2: z
rec_ntsam=nt ...... maximum number of time samples in file_rcv files
rec_delay=0 ....... time in seconds to start recording: recorded time = tmod - rec_del
rec_type_p=1 ...... p registration _rp
rec_type_vz=1 ..... Vz registration _rvz
rec_type_vx=0 ..... Vx registration _rvx
rec_type_txx=0 .... Txx registration _rtxx
rec_type_tzz=0 .... Tzz registration _rtzz
rec_type_txz=0 .... Txz registration _rtxz
rec_type_pp=0 ..... P (divergence) registration _rP
rec_type_ss=0 ..... S (curl) registration _rS
rec_type_ud=0 ..... decomposition in up and downgoing waves _ru, _rd
kangle= ........... maximum wavenumber angle for decomposition
rec_int_vx=0 ..... interpolation of Vx receivers
- 0=Vx->Vx (no interpolation)
- 1=Vx->Vz
- 2=Vx->Txx/Tzz(P)
- 3=Vx->receiver position
rec_int_vz=0 ...... interpolation of Vz receivers
- 0=Vz->Vz (no interpolation)
- 1=Vz->Vx
- 2=Vz->Txx/Tzz(P)
- 3=Vz->receiver position
rec_int_p=0 ...... interpolation of P/Tzz receivers
- 0=P->P (no interpolation)
- 1=P->Vz
- 2=P->Vx
- 3=P->receiver position
NOTES: For viscoelastic media dispersion and stability are not always
guaranteed by the calculated criteria, especially for Q values smaller than 13
18
file_src=wavelet.su
In the next subsections all the parameters will be described in more detail and guidelines will be given how to use
them.
For visco-acoustic (elastic) media extra options are: Qp= (and Qs=) for selecting an overall Q factor for all layers.
This Q value is defined for a frequency at fw=, other frequencies will have slightly different Q values. It is also
possible to define a Q value for every grid point in the medium. These arrays must be stored in files, have the
same dimensions as the files of the medium parameters, and can be used by the program using the parameters
file qp= (and file qs= for elastic media).
6.3 Boundaries
There are four boundary types used in the FD schemes. The boundary type is selected with the parameters left=
right= top= bottom= and are identified with a number . The default values of these parameters are; free
surface for the top (1) and tapered (4) for the other three boundaries. The different boundary types are:
19
condition is implemented: a taper on the Vx and Vz fields. It is difficult to give guidelines how many
grid points the taper length should be to suppress the side reflections. The wave field is gradually tapered
over a specified range of grid points (window length ntaper). The default setting for the taper length is:
4 ((cpm ax/f max)/dx), 4 wavelengths. Depending on the size of the grid a window length of 40,80 grid
points might be sufficient. You may alter these, if you like, in order to increase or decrease the amount of
tapering. The larger the window length, the better the absorption, but the longer the modeling will take.
200 200
400 400
depth [m]
depth [m]
600 600
800 800
1000 1000
lateral position [m] lateral position [m]
500 1000 500 1000
0 0
0.2 0.2
0.4 0.4
time [s]
time [s]
0.6 0.6
0.8 0.8
1.0 1.0
a) no taper b) 200 points taper
Figure 6: Snapshots and receiver recording in homogeneous medium with and without taper. The receivers are
placed at 300 m depth and the source is positioned in the middle of the model at (500,500). The grid distance is 1
meter. The script fdelmodc taper.scr in the demo directory reproduces the pictures.
Using the parameters and ntaper=n enables the tapered boundaries with a taper length of n points. Besides
those parameters specific boundaries must be put on for tapering by using left=4 right=4 top=4
bottom=4 . All enabled boundaries are using the same taper length and it is not possible to use different
taper lengths for different boundaries. The number of taper points should be chosen such 1-2 times the main
wavelength in the modeled data. The program calculates the number of taper points to be five times the
max(c )
wavelength 5tap = 5 fmaxp ;
ix
taper[ix] = exp (0.30 )2 , (45)
ntaper
where ix is an integer ranging from 0 to ntaper 1 and 0.30 is the taper factor. This taper factor can be
changed with the parameter tapfact=. A larger taper factor will make the taper go steeper to 0.0. In
Figure 7 different tapfact= choices are shown. Note that if the taper is chosen too steep (larger than 0.5)
the wavelet will already start reflecting from the beginning of the tapered boundary.
Figure 6 shows the effects of the taper in a homogenous medium. It effectively suppresses the reflections
from the sides of the model. The chosen taper length in this example is 200 points long. This is a large
number of ;pints and used for illustration purposes. Using a taper is not a very efficient way of suppressing
20
1.0
amplitude
0.5
0
10 20 30 40 50
grid points
Figure 7: The boundary taper as function of the tapfact= parameter is shown. The red line with the highest
amplitude has tapfact=0.1, each line with a lower amplitude has a tap fact 0.1 larger (e.g. the green line has
0.2, the yellow line 0.3).
side reflections and there are plans to implement a better absorbing boundary method such as the Perfectly
Matched Layer (PML) approach.
Free surface (1)
The free surface implementation for the acoustic scheme is straightforward and just sets the pressure field
to zero on the free surface. For the elastic scheme the implementation is more involved and the free surface
conditions (for the upper boundary) are :
1. zz = 0 is set
2. xz = 0 is implemented by defining an odd symmetry xz [iz] = xz [iz + 1].
3. xx : removed term with V z Vx
z , and add extra term with x , corresponding to free-surface condition for
xx . Other boundaries (left, right and bottom) are treated in a similar way.
The linearized equation of motion (Newtons second law) and equation of deformation (Hooks law) for the
free surface become:
1 Vz Vx
zz = 0 = + (46)
z x
Vx Vz
xz = 0 = { + } (47)
z x
In the FD code zz is set to 0 at the free surface position z = 0. xz is constructed in such a way that the
difference around the free surface ends up to be zero:
xz (0 12 z) = xz (0 + 12 z)
xz (0 1 21 z) = xz (0 + 1 21 z)
Note that the location in the equations above are with respect to the grid for zz . The trick for xz is only
needed for staggered grids to make the free surface of xz on the same level as zz .
For an expression of xx on the free surface:
1 Vx Vz
xx = + (48)
x z
we substitute equation (46) Vz
z = Vx
x into and gives:
1 Vx Vx
xx = 2 (49)
x x
Using the parameters left=1 right=1 top=1 bottom=1 enables a free surface boundary for all 4
sides.
21
if (bnd.top==1) { /* free surface at top */
izp = bnd.surface[ixo];
for (ix=ixo; ix<ixe; ix++) {
iz = bnd.surface[ix-1];
if ( izp==iz ) {
/* clear normal pressure */
tzz[ix*n1+iz] = 0.0;
}
izp=iz;
}
izp = bnd.surface[ixo];
for (ix=ixo+1; ix<ixe+1; ix++) {
iz = bnd.surface[ix-1];
if ( izp==iz ) {
/* assure that txz=0 on boundary by filling virtual boundary */
txz[ix*n1+iz] = -txz[ix*n1+iz+1];
/* extra line of txz has to be copied */
txz[ix*n1+iz-1] = -txz[ix*n1+iz+2];
}
izp=iz;
}
Placing a pressure source exactly on the free surface will not eject any energy into the medium and the
resulting wavefield will contain only zeros. To overcome that you can use a Fz source (src type=7) or
place the pressure source one grid-point below the free-surface.
Note that you will always get a reflection from the free-surface. To summarise the effects:
a P-source on a free surface can not put energy into the medium, and gives gathers with all zeros
a Fz source (src type=7) on the free-surface can put energy into the medium and is a good alterna-
tive for a P-source
placing a P-source one-grid point below the surface, will simulate a dipole source. The part of the
dipole coming from the reflection from the free surface.
placing receivers, just one grid-point below the free surface, also gives a dipole receiver response.
Vz receivers on a free suface measure an wavefield, P-receivers will not measure anything on a free
surface.
To correct for the ghost of the source it is possible to de-ghost the measured response. This can be done with
the program basop option=ghost. There is also a lot of literature about source de-ghosting (google
search). The basop implementation is the most simple one.
22
Rigid surface (3)
The rigid boundary condition sets the velocities on the boundaries to zero. For the top surface these condi-
tions are met by setting:
Vx [iz] = 0.0
Vz [iz] = Vz [iz + 1]
Setting the boundary parameters left= right= top= bottom= to 3 enables a rigid surface boundary
for the selected boundary.
PML (2)
Only implemented for acoustic.
Topography
On the top of the model an irregular topography can be used. The density and velocity model must have
zero-values above the defined topography. To place a source or receiver on the topography it is sufficient to
place it at the correct lateral position above the topography. In the code the depth is searched for the first non-
zero medium parameter and at that depth the source or receiver is placed. The parameter sinkdepth=n
places the receiver position n grid-points below the found depth point on the topography. For the source
position the parameter sinkdepth src=n places the source position n grid-points below the found depth
point on the topography. When the parameter sinkvel=1 is used the receiver (not the source position) can
also sink through a layer with a non-zero velocity. The velocity of the first receiver is used as the velocity to
sink through to the next layer.
For the elastic scheme the topography is implemented as described in Robertsson (1996) and Perez-Ruiz et al.
(2005). In those schemes the points at the topography layer are treated differently (depending on which side
of the topography the free-surface is), such that the free surface is taken into account in the best possible
way.
Vx 1 P
= , (50)
t x
Vz 1 P
= , (51)
t z
P 1 Vx Vz
= { + }. (52)
t x z
On PML introduces stretched-coordinate space (in the frequency domain) following Drossaert and Giannopoulos
(2007) and Chew and Liu (1996):
x
x = 1 + (53)
j
z
z = 1 + (54)
j
Vx 1 1 P
= , (55)
t x x
Vz 1 1 P
= , (56)
t z z
P 1 1 Vx 1 Vz
= { + }, (57)
t x x z z
The manner with which coordinate stretching causes losses in a medium can be easily understood as follows:
Given a plane wave propagating in a lossless medium described by exp(jkx), a coordinate stretching is a change
x = x (a + j). Then exp(jkx) becomes exp(jkax kx ) = exp(jkax ) exp(kx ). In other words, a wave
becomes attenuative in the stretched x coordinate if the stretching variable is complex (Chew and Liu, 1996).
23
Introducing auxiliary variables
1 P Vx 1
Sx = = Sx , (58)
x x t
1 P Vz 1
Sz = = Sz , (59)
z z t
1 Vx 1 Vz P 1
Ex = Ez = = {Ex + Ez } (60)
x x z z t
Substituting the stretch variables x and z into these auxiliary variables gives:
x P
Sx + Sx = , (61)
j x
z P
Sz + Sz = , (62)
j z
x Vx
Ex + Ex = , (63)
j x
z Vz
Ez + Ez = (64)
j z
To compute Sx , the other components can be done completely analogous, the following steps are carried out. The
integration over time of Sx is approximated by using trapezoidal integration.
x P
Sx = Sx (65)
j x
t
P
x Sx dt = Sx (66)
0 x
n1
nt
1 0 1
x Sx dt tx Sx + t x Sxt + tx Sxn (67)
0 2 t=1
2
(68)
assuming Sx0 = 0 results at time step n
1
n1
P n
Sxn (1 + tx ) + t x Sxt = (69)
2 t=1
x
P n
Sxn = RA( tn1
x ) (70)
x
1
RA = (71)
1 + 12 tx
nx = n1
x + x Sxn (72)
The first few time steps in the PML regions are then computed as follows:
P 0
n = 0 : Sx0 = RA( ) (73)
x
0x = x Sx0 (74)
1
P
n = 1 : Sx1 = RA( t0x ) (75)
x
1x = 0x + x Sx1 (76)
2
P
n = 2 : Sx2 = RA( t1x ) (77)
x
2x = 1x + x Sx2 (78)
24
With these steps the auxiliary variables can now be computed and substituted into equations 58 for the PML
regions.
Following the same steps as before: Substituting these stretch variables x and z into the auxiliary variables 58
gives:
P
(x x + x j + x )Sx = (x + j) , (82)
x
P
(z z + z j + z )Sz = (z + j) , (83)
z
Vx
(x x + x j + x )Ex = (x + j) , (84)
x
Vz
(z z + z j + z )Ez = (z + j) (85)
z
To compute Sx , the other components can be done completely analogous, the following steps are carried out:
divide by j results in
P
(x x + x j + x )Sx = (x + j) , (86)
x
x x + x x P P
Sx + x Sx = + , (87)
j j x x
t
t
P P
(x x + x )Sx dt + x Sx = x dt + (88)
0 0 x x
(89)
P
The integration over time of Sx and x is approximated by using trapezoidal integration.
n1
nt
1 1
aSx dt taSx0 + t aSxt + taSxn (90)
0 2 t=1
2
P 0
assuming Sx0 = 0 and x = 0 results at time step n in
n1
1 P t
n1
1 P n P n
t (x x + x )Sxt + t(x x + x )Sxn + x Sxn = t x + tx + (91)
t=1
2 t=1
x 2 x x
n1
1 P t
n1
1 P n
t (x x + x )Sxt + ( t(x x + x ) + x )Sxn = t x + ( tx + 1) (92)
t=1
2 t=1
x 2 x
25
P n
Sxn = RA RBn1x (93)
x
1
( 2 tx + 1)
RA = 1 (94)
2 t(x x + x ) + x
t
RB = 1 (95)
2 t(x x + x ) + x
P n
nx = n1
x + (x x + x )Sxn x (96)
x
The first few time steps in the complex frequency shifted PML regions are then computed as follows:
P 0
n = 0 : Sx0 = RA (97)
x
P 0
0x = (x x + x )Sx0 x (98)
x
P 1
n = 1 : Sx1 = RA RB0x (99)
x
P 1
1x = 0x + (x x + x )Sx1 x (100)
x
P 2
n = 2 : Sx2 = RA RB1x (101)
x
P 2
2x = 1x + (x x + x )Sx2 x (102)
x
26
1 40
amplitude
amplitude
20
0
fmax
1 40
amplitude
amplitude
20
0
fmax
0
0 0.05 0.10 0.15 0.20 0 10 20 30 40 50 60 70 80 90 100
time frequency
b) Truncated Ricker wavelet (left) and its amplitude spectrum (right).
Figure 8: Wavelet and its amplitude spectrum. The maximum frequency in the wavelet is found by searching
from the maximum amplitude to the first frequency amplitude 0.0025 Amax (indicated with an arrow). Note
that due to the truncation at t = 0 in b) high frequencies are introduced and can cause dispersion. The script
fdelmodc rand.scr in the demo directory calculates the data and eps for manual.scr reproduces the
pictures.
peak back to t = 0. When rec delay= is set to a positive non-zero value the modelling time recorded in the
receiver array will be the total modeling time decreased by the time of the rec delay.
Noise signals are created (wav random=1) by setting random values to the amplitude and phase of the source
signal up to the given maximum frequency (fmax=). This signal is transformed back to the time domain and
truncated in time to the desired source duration. Figure 9 shows 20 random signals in the time domain with
varying source duration (average duration of 2.5 s tlength=2.5). Without any tapering this truncation in the
time domain will introduce high frequencies. To suppress these high frequencies, the beginning and the end of the
source signal are smoothly extrapolated (using cubic splines) to an amplitude value of 0.0. The bottom pictures in
Figure 10 show a noise signal and its amplitude spectrum. This signal was constructed with a maximum frequency
of 30 Hz. The start and beginning of the noise signal are smoothly starting and ending at amplitude zero. The
red circles and lines shows how this signal is constructed. Despite the smooth start and ending of the signal the
spectrum of the noise signal does continue after 30 Hz, but the amplitude after 30 Hz is so low that it does not
give rise to severe dispersion in the modelling. The calculated noise source signatures are written to an SU file
if the parameter verbose>3 (see also Table 1). Note that if file src is defined then wav random=0 is
default set off. However, if src random=1 is used wav random=1 is default set on. The length (duration) of
the random signal is chosen to be a random number (between 0.0 and 1.0 multiplied) by tlength. By setting
length random=0 all random signals will have the same length given by tlength.
27
source duration in seconds
3
0
0 1 2 3 4 5
start time in seconds
source number
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
0
2
time
Figure 9: Random source signatures with varying source duration (top picture). Note that the sources start at
random times in the interval tsrc1= : tsrc2=. The script fdelmodc rand.scr in the demo directory
calculates the data and eps for manual.scr reproduces the pictures.
amplitude
amplitude
0 0
0 0.01 0.02 0.03 0.04 0.05 3.65 3.66 3.67 3.68 3.69
time time
4000
amplitude
amplitude
0
2000
0 1 2 3 4 5 0 10 20 30 40 50 60 70 80 90 100
time frequency
Figure 10: Random source signature and its amplitude spectrum. The start and beginning of the source sig-
nature are smoothly (cubic spline) starting from and ending at amplitude 0. Despite this smooth transition the
frequency spectrum of the signature still contains some energy after the defined maximum frequency. The script
fdelmodc rand.scr in the demo directory calculates the data and eps for manual.scr reproduces the
pictures.
28
source number
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
-0.5
time
0.5
1.0
Figure 11: Auto-correlated random source signatures with varying source duration normalized to the maximum
amplitude per trace. The longest signals (source numbers 11 and 15) have the highest auto-correlation peak
and best S/N ratio. The script Figure17 19AppendixA.scr in the FiguresPaper directory reproduces the
pictures.
29
The autocorrelation of the source signal gives an indication of the contribution of the individual sources to a
Seismic Interferometry result. In Figure 11 the normalized auto-correlation of the signals in Figure 9 is shown.
The longest signals will give a contribution, and has the highest signal (peak at t = 0) to noise ratio. The longer
the source is active the more energy it will bring into the medium and the better the S/N ratio will be.
The cross-correlation of the source signals with each other gives how the different source signatures interfere
with each other. Ideally the signatures should not interfere. Figure 12 show 100 source signatures and the cross-
correlation. The diagonal is the auto correlation, and dominates the cross-correlation picture, indicating that the
source are not correlated to each other.
source number
20 40 60 80 100
0 source number
20 40 60 80 100
20
20 1.0
time in seconds
source number
0.8
40
0.6
0.4
40 60
0.2
0
80
60
100
Figure 12: The 100 source signatures on the left side have been cross-correlated with each other and the result is
shown on the right side. The script cross.scr in the FiguresPaper directory reproduces these pictures.
where S(t) represents the source signature injected at position x . Substituting Hookes Law in Newtons law gives
the second order wave equation. Adding an amplitude on a grid point (representing a delta pulse (x x , z z ))
in the first order equations, results in a source term of t (x x , z z ) in the right-hand side in the (second
order) wave equation
2 P (x, z, t) 2
2 P (x, z, t) 2 P (x, z, t) S(t)
2
) c p { 2
+ 2
} = (x x , z z ) . (106)
t x z t
To end up with a source injection in the wave equation, and not injection rates as in equation 106, the source
1
signature is adjusted (in the frequency domain by j : integrating over time) before it is applied to the grid. The
input parameter src injectionrate can be set to choose between injection rate (set to 1) or injection (set to
0, which is the default).
For example when src injectionrate=0 a measured P response of a P source will measure the same source
signature. The output file src nwav.su (this file is written when verbose=4) contains the wavelet as it is
being added to the grids in the FD code. Meaning that with src injectionrate=0 (default) it will be a time
integrated version of the wavelet given by file src=.
30
TODO. The general source function can be described as Wapenaar 1989 page 13:
(t) Fz
S(t) = (107)
t z
Monopole source ( (t)
t )has same wavelet shape as Force source (dipole
Fz
z )
8=P-potential for elastic scheme placed on Vx and Vz grid with amplitude s (experimental)
where s represents the amplitude of the source signal (from file src= or a generated random signature).
The source orientation can be changed from monopole to dipole, where the orientation of the dipole can also be
changed. The implementation of the source orientation options are shown in Figure 13. The source orientation is
only implemented for three types of sources: compressional (src type=1), Txz (src type=2), and pure shear
source (src type=5). For the other source types the src orient= parameter has no effects and a monopole
source is always used.
ix3 1 ix3 + ix5 ix5 + 1
iz 1
1 +
+
+
4
+
iz
3 5
2
iz + 1
Figure 13: Implementation of different source orientations on the grid. The different numbers (colors) show the
options of parameter src orient=. The + and symbol represent the sign of the source amplitude added to
the computational grid.
Note, to check source-receiver reciprocity the dipole/monopole character of the source and receiver has to be taken
into account as well. For example a dipole source with a Vz receiver (rvz) will be reciprocal with each other. The
same for a monopole source and P receiver (rp). For a monopole source and Vz receiver this is reciprocal with a
dipole source and and P receiver. For example run the code with: src orient=1 and select Vz receivers and
after changing source and receiver x,z positions, set src orient=2 and use P receivers. Those measurements
are source-receiver reciprocal with each other.
Pressure source
P (x, z, t) 1 Vx (x, z, t) Vz (x, z, t) 1
= { + } + (x x , z z )( S(t)), (108)
t x z
Vx (x, z, t) 1 P (x, z, t)
= , (109)
t x
Vz (x, z, t) 1 P (x, z, t)
= , (110)
t z
31
Force source
P (x, z, t) 1 Vx (x, z, t)
= , (111)
t x
Vx (x, z, t) 1 P (x, z, t) 1
= + (x x , z z )( S(t)), (112)
t x
Vz (x, z, t) 1 P (x, z, t)
= , (113)
t z
Potential S source (stype=5)
Vz (x, z, t) Vx (x, z, t)
Ss (x, z, t) = , (114)
x z
(115)
vx[ix*n1+iz] += src_ampl*sdx;
vx[ix*n1+iz-1] -= src_ampl*sdx;
vz[ix*n1+iz] -= src_ampl*sdx;
vz[(ix-1)*n1+iz] += src_ampl*sdx;
Potential P source (stype=8)
Vz (x, z, t) Vx (x, z, t)
Ps (x, z, t) = + , (116)
z x
(117)
vx[(ix+1)*n1+iz] += src_ampl*sdx;
vx[ix*n1+iz] -= src_ampl*sdx;
vz[ix*n1+iz+1] += src_ampl*sdx;
vz[ix*n1+iz] -= src_ampl*sdx;
To have correct amplitudes between the different source types and independence of the discretization in the finite
difference code (t, x) , scaling factors are applied to the input source wavelet amplitudes.
src-type amplitude
t 2
1,2,3,4 x2 2.0Cp
t 2.0
5,6,7,8 x2
Single or regular shot distribution The position of a single source is set by the parameters xsrc= zsrc=.
The parameters nshot= together with dxshot= and dzshot= determine how many shots are modeled and the
position for each shot. For every new shot of the nshots to model the xsrc and zsrc positions are adjusted with
dxshot and dzshot. The loop over the number of shots to model is
for (is=0; is<shot.n; is++) {
shot->x[is] = xsrc+is*dxshot;
shot->z[is] = zsrc+is*dzshot;
}
32
For example xrsc=50 zsrc=0 dxshot=15 dzshot=0 nshot=5 will successively model 5 shots at the
positions (50,0) (65,0) (80,0) (95,0) and (110, 0). In Figure 14a the black dots represent the source positions
which have been defined using a regular shot position. This means that for every black dot in Figure 14a a shot is
calculated.
depth [m]
depth [m]
4000 4000 4000
a) b) c)
Figure 14: Source (black dots) and receiver (white dots) positions for different choices of the positions parameters.
In
a) xrcv1=6000 xrcv2=6000 dxrcv=0 zrcv1=100 zrcv2=6000 dzrcv=100 xsrc=500
zsrc=100 nshot=50 dxshot=100 dzshot=0 has been used, for
b) xsrca=5900,5950,6000,6100,6200,6300,6350,6300,6200,6100,6000,5950,5900
zsrca=2000,2100,2200,2300,2400,2500,2650,2800,2900,3000,3100,3200,3300
xrcv1=4000 zrcv1=1000 xrcv2=4000 zrcv2=6000 dzrcv=100 dxrcv=0 and for
c) xrcv1=6000,500 xrcv2=6000,7500 dxrcv=0,500 zrcv1=100,500 zrcv2=6000,500
dzrcv=100,0 src random=1 nsrc=150 xsrc1=500 xsrc2=7500 zsrc1=6000 zsrc2=7500
. The script fdelmodc srcrec.scr in the demo directory reproduces the pictures.
Source arrays An array of sources (or an areal source) is defined with the parameters xsrca= zsrca=. The pa-
rameters define the position of the sources. For example xrsca=50,55,67,40,12 zsrca=0,10,7,8,10
defines an areal source consisting of 5 shot positions. The shots at these positions are all fired simultaneously. In
Figure 14b the black dots represent the source positions, which have been defined using a source array. This means
that all black dots in b) will be fired simultaneously an only one shot is calculated.
You can also use multiple sources simultaneously by placing multiple source wavelets (with different amplitude
and frequency) into the file src file and set the parameter src multiwav=1. The position of these sources
are read from the Seismic Unix header values; gx for the x-postion, and gelev for the z-position of the source.
Setting parameter src at rcv=0 will use the sx for the x-postion and selev for the z-position. Note that these
setting of the scalco (gx) and scalel (gelev) factor in the Seismic Unix file. To fire multiple sources (more than 2)
after each other, and construct one receiver gather that contains the wavefields generated by these sources, can be
achieved by adding a time delay to the traces of file src and set src multiwav=1. All traces will start at the
same time in the modeling program. In this case some trace will only have a non-zero amplitude in the beginning
and become active (non-zero) after a certain timing.
Plane wave A plane wave can be defined by using the parameters: plane wave= nsrc= src angle=
src velo= nsrc= src window=. The plane wave is implemented by placing a horizontal array of nsrc=
sources placed on every grid position symmetric around xsrc= at the horizontal depth given by zsrc=. The
angle (ray-parameter) of the plane wave is defined by src angle= src velo= and is implemented by adding
time delays to the shot positions on the horizontal array. Figure 17b shows the plane wave source positions as blue
dots in the model.
Source random positions src random= nsrc= xsrc1= xsrc2= zsrc1= zsrc2= tsrc1= tsrc2=
tactive= tlength= amplitude= distribution= seed=
33
When the parameter src random=1 is used, nsrc= random source positions will be created with positions
between xsrc1= : xsrc2= and zsrc1= : zsrc2=. During the model time tmod=, sources will start and
at random times in the interval tsrc1= : tsrc2= and contribute to the calculated wavefield. The maximum
signal length is defined by tlength= and the resulting average length = tlength/2. Note that if tlength= is
larger thantsrc2-tsrc1 then for some sources the time the source is being active (tlength) will be truncated
to MIN(tsrc1+tlength, tactive). The parameter tactive= gives the maximum modeling time the
sources are being active. After tactive= no sources are being active anymore. The source time settings allows
modeling of many random source positions being active by running just one modeling. The amplitude distribu-
tion of the sources is default set to 0, meaning that all sources have the same amplitude. Defining for example
amplitude=10 will introduce an amplitude distribution for the different source with a maximum amplitude of
10. This distribution can be made flat distribution=0 or Gaussian distribution=1. The seed= param-
eter can be used to generate different random sequences, if the same seed value is used modeling results can be
reproduced. In Figure 14c random source positions are used for the lower part in the model and visible as small
black dots in the Figure.
ud: up- and down-going decomposition with file extension ru, rd (only for receiver arrays)
In the acoustic scheme only rec type p= and rec type vz= can be used. In elastic media there is no pressure
component, so you can not record it. However, if you set-up an elastic model and put a water layer on top of that
elastic model you can place a receiver in that water layer and the Tzz component of the elastic modeling scheme
will contain the pressure field in the water. We have made a comparison between the Tzz component of the elastic
field in a water layer with the P field in an acoustic layer and they are identical.
The potential wavefields P and S for the elastic scheme are based on divergence and curl (rotation), respectively,
given by:
rec_pp[irec*rec.nt+isam] = (vx[ix2*n1+iz]-vx[ix*n1+iz] +
vz[ix*n1+iz2]-vz[ix*n1+iz])/mod.dx;
rec_ss[irec*rec.nt+isam] = (vx[ix2*n1+iz2]-vx[ix2*n1+iz] -
(vz[ix2*n1+iz2]-vz[ix*n1+iz2]))/mod.dx;
The up- and down-going wave fields make use of acoustic decompositions operators Wapenaar (1998). The P
and Vz fields needed to do this decomposition are automatically enabled when rec type ud=1 is chosen. In the
program all grid points in x, for the chosen receiver-depth level, are stored into memory for the P and Vz fields.
The decomposition is carried out, in the wavenumber-frequency domain, on these finely sampled fields. To avoid
artefacts from the edges of the model an angle filter is applied in the wavenumber-frequency domain. The cut-off
angle in this filter is estimated from the data at the receiver level. The maximum angle present in the receiver
34
data is estimated by summing along kx = ksin() lines in the wavenumber-frequency amplitude spectrum. The
maximum angle in the data is then selected as the angle at the average amplitude (this is just an simple method and
can be improved). Figure 15 shows the energy in the angles in the wavenumber domain for the P -field (based on
the decomposition.scr in the demo directory). In this example the average energy is 200 and leads to a maximum
angle of 67o . The calculated angle file is written to output file anglerp.su when the verbose option is set to
4 or larger. The use of the calculated angle can be overruled by setting the parameter kangle=.
lateral position [m] lateral position [m] lateral position [m] lateral position [m]
-2000 0 2000 -2000 0 2000 -2000 0 2000 -2000 0 2000
0 0 0 0
time [s]
time [s]
time [s]
1.5 1.5 1.5 1.5
200
0
10 20 30 40 50 60 70 80
angle in degrees
e) angle-energy plot.
Figure 15: The P (a) and Vz (b) fields and the decomposed up (c) and downgoing (d) fields from example demo/de-
compostion.scr. Selection of maximum angle (e) to filter the decomposition operator in kx domain.
The time samples and number of times samples are defined by dtrcv= and rec ntsam=. The recording can
start later than the modeling, for example to compensate for a time-delay in the source wavelet (see section 6.4)
by using rec delay=. The parameter max nrec= is used to allocate the number of receiver positions. If the
user defines more than 10000 receivers this parameter should be increased to the number of receivers defined by
the receiver parameters.
Seismic unix (and SEGY) uses an unsigned shot integer (16 bytes) in the header section of a trace to store the
number of samples in a trace. The maximum value of this short integer is 65536, so more samples can not be
stored in a single trace. In passive seismic modeling the recording times can be very long and one easily exceeds
the 65536 samples in a trace. For long recordings multiple files are created each with rec ntsam= samples
per trace in a file. The names of the output files are numbered starting with 001 and this number is placed in
the filename just before the name of the receiver type (for example shotA 001 rp.su, shotA 002 rp.su,
shotA 003 rp.su, ...).
35
Defining multiple lines, for example on multiple depth levels, is accomplished by using xrcv1=100,100
xrcv2=500,500 zrcv1=100,200, zrcv2=100,200 and dxrcv=10,10 defines two receiver lines from
100 to 500 m in the lateral direction; one on a depth level of 100 m and another one at 200 m depth. Note that in
defining multiple linear arrays the number of arguments in the parameters must be the same. The distance between
the receivers can also be different for the different lines by using dxrcv=10,5 or dzrcv. If only one value is
used for the distance parameters (one from dxrcv= dzrcv=) then all lines will use this distance. A receiver
line is defined by the end points: start (xrcv1,zrcv1) and end (xrcv2,zrcv2) and a distance between the
receivers. This distance can be given by dxrcv= or dzrcv, if both are given then dxrcv= is used and dzrcv is
calculated in the program. However, if dxrcv=0 and dzrcv is also given(and not zero) then the given dzrcv is
used. Multiple receiver arrays will be placed into the same receiver file in the same order you have defined them.
Another example to place a receiver array at the surface and two vertical arrays at x = 500 and x = 1500 you can
use the following parameters:
xrcv1=-2500,500,1500 xrcv2=2500,500,1500 zrcv1=0,0,0 zrcv2=0,1000,1000 dxrcv=20,0,0
dzrcv=0,10,10
Receiver array An array of receivers at specific points in the medium is defined with the parameters xrcva=
zrcva=. The parameters define the position of the receivers. For example xrcva=50,55,67,40,12 zrcva=0,10,7,8,10
defines a receiver array of 5 positions.
Receivers on circle or ellipse To put the receivers on a circle the following parameters can be used: rrcv= for
the radiation of the circle, oxrcv,ozrcv sets the origin (in meter, not grid points) of the circle and dphi the
distance between the receivers in angle. To make an ellipse use the additional parameter arcv=. This sets the size
of the vertical arc-length and rrcv= represents then the horizontal arc-length. The distance between the receivers
on the ellipse are (numerically) made equidistant (the dphi parameter is in the ellipse option only used to compute
the number of receivers (=360/dphi). Note that due to the grid of the wavefields the receivers are not placed on
exactly a circle/ellipse, but to the closest grid point. The option rec int p or rec int vz rec int vx set to
3 will interpolate (bi-linear) the fields to the exact position of the receivers on the circle. When rrcv is used the
parameters rec int p and rec int vx, rec int vz are automatically set to 3.
25 10
50 15
75 20
each line in this file contains a receiver location (x,z). Loading this file would place 3 receivers at (25,10), (50,15),
and (75,20).
A demo script to demonstrate the functionality is called RcvTextInput.scr.
36
for reading the wavefield at the receiver positions from the staggered grid positions.
rec int vz=1 interpolates Vz to the Vx position and makes use of the 4 surrounding Vz points (blue
colored items in Figure 16)
rec int vz=2 interpolates Vz to the p position and uses two 2 (top and down) Vz points (cyan colored
items in Figure 16)
interpolates xz to the p position and makes use of the 4 surrounding xz points (black colored items in
Figure 16)
rec int vx=1 interpolates Vx to the Vz position and makes use of the 4 surrounding Vx points (green
colored items in Figure 16)
rec int vx=2 interpolates Vx to the p position and uses two 2 (left and right) Vx points (magenta colored
items in Figure 16)
interpolates xz to the p position and makes use of the 4 surrounding xz points (black colored items in
Figure 16) Using rec int vz=2 and rec int vx=2 puts Vz , Vx and xz to the p position.
rec int vx=3 or rec int vz=3 interpolates all fields to the exact receiver positions given by the user
using bi-linear interpolation. In this case the receiver positions do not have to lie on a grid position (yellow
colored items in Figure 16). This option is turned on by default when receivers on a circle are defined.
xz xz Vz Vz Vz xz xz
Vx Vx Vx Vx
xz xz Vz Vz Vz xz xz
Vx Vx
Figure 16: Receiver interpolation options in the elastic staggered calculation grid. Vz , Vx represent the particle
velocity of the wavefield in the z and x direction respectively and p (xx or zz ), xz represent the stress fields.
Beams represent the energy of the wavefield during the complete model time. Beams are calculated as the square
root of the quadratic field quantities and can be used to investigate how energy propagates through a model. During
every time step the energy is calculated and added to the beam array. Beams are enabled by setting beam=1 and
37
the same parameters as for the snapshots are used to define grid distance dxsnap= and dzsnap=, area of interest,
and type of wavefield component. Note that the beam calculation is done for every time-step and is an expensive
computational operation, the total compute time can easily increase by 50% or more.
6.7 Verbose
The parameter verbose prints messages and produces additional files during the running of the program. Table
1 shows the kind of messages and the extra files printed using different values for verbose. Those messages and
files contain extra information for the user. The output files produced by different setting of the verbose parameter
are:
src nwav.su: file which contains the source signatures. For the noise sources each trace in this file
contains the noise signal used in the modeling. Note that this file can become large for long wavelengths
SrcRecPositions.su: SU file with the same size as the input model files. At every source position a
square (of 5x5 grid points) with value 1 is positioned and at every receiver position a square with value -1 is
placed. This file can be used to overlay (after scaling) the source and receiver positions on a velocity model.
For example the following command:
suop2 SrcRecPositions.su vel2 edge cp.su w1=6000 w2=1.0 op=sum | suximage
bclip=6000 wclip=0
adds source and receiver positions to the P-wave velocity file, where the weight factor w1 is set larger than
the maximum velocity in the P-wave velocity file.
srcTimeLengthN=ns.bin: 32 bits floating point binary file with ns samples where each sample value
gives the start time of the source.
SrcPositionsNSRC.txt: ASCII file which contains the source positions where NSRC is the number
of sources.
RcvPositionsNRCV.txt: ASCII file which contains the receiver positions where NRCV is the number
of receivers.
src ampl.su: when the amplitude parameter is used this file contains the amplitude distribution of the
sources.
Table 1: The files and messages produced by different values of the verbose parameter. The file src ampl.su
contains the amplitude variation of the (random) source signals when the parameter amplitude= is set to a
non-zero value. srcTimeLengthN=ns.bin is a binary file with ns samples which give the start time of the sources.
SrcRecPositions.su is a SU file with the same size as the input model files and at every source position a cross with
value 1 is positioned. The other positions in the file are set to zero. File src nwav.su contains the generated random
source signals. Note that this file can become large for long wavelengths (tlength=)
.
38
7 Examples to run the code
The demo directory contains scripts which demonstrate the different possibilities of the modeling program. In the
subsections below most demo script are explained and results are shown.
To reproduce the Figures shown in the GEOPHYICS manuscript Finite-difference modeling experiments for
seismic interferometry the scripts in FiguresPaper directory can be used. Please read the README in the Fig-
uresPaper directory for more instructions and guidelines.
../fdelmodc \
file_cp=$filecp file_cs=$filecs file_den=$filero \
ischeme=3 \
file_src=wavelet.su verbose=1 \
file_rcv=rec.su \
file_snap=snap.su \
xrcv1=0 xrcv2=2000 dxrcv=15 \
zrcv1=400 \
rec_type_vx=1 rec_type_pp=1 rec_type_ss=1 rec_int_vx=1 \
dtrcv=0.004 \
xsrc=1000 zsrc=1700 nshot=1 plane_wave=1 nsrc=301 \
src_type=1 tmod=3.0 src_velo=1800 src_angle=5 \
ntaper=120 \
left=4 right=4 bottom=4 top=4 \
tsnap1=0.1 tsnap2=3.0 dtsnap=0.1 \
sna_type_ss=1 sna_type_pp=1 verbose=4
The receivers are placed at z = 400 m. The measured particle velocity field Vz and the calculated P- and S-
wave potentials are shown in Figure 18a,b, and c respectively. Snapshots, where three modeling times are added
together, are shown in Figure 18d,e, and f. In the S-potential snapshot (Figure 18f) it is observed that the S-waves
are firstly occurring when the P-wave hits the curved reflector. Note also the better resolution of the S-potential.
In the run script the verbose option is set to 4, which means that auxiliary files are also written to disk. These files
contain information information about the used source and receiver positions and can be used to plot the source
and receiver positions in the model.
39
lateral position [m] lateral position [m]
0 500 1000 1500 2000 0 500 1000 1500 2000
0 0
500 500
depth [m]
depth [m]
1000 1000
1500 1500
2000 2000
time [s]
time [s]
depth [m]
depth [m]
40
7.2 Example for viscoelastic media: fdelmodc visco.scr
Visco-elastic modeling is enabled by choosing the parameter ischeme=4. In the demo script fdelmodc visco.scr
a model is created with makemod for the density and the P and S wave velocities. Besides the model which de-
scribes the medium parameters another gridded model is created with makemod for the Q-values (Qp and Qs ) of
the medium. The parameters of makemod are set-up to be used to create cp,cs and rho gridded model files. How-
ever, it can be (ab-)used for building any gridded file, where the values of cp, cs and rho just get another meaning.
To create the Q-values with makemod the cp velocity is used as Qp and the cs value is used as Qs , the density
value is not used. In this way the Q-model is created and used in fdelmodc. The results of running the demo
script is shown in Figure 19.
Another trick has been used to subtract the direct field of the measured recordings. This is done by running
fdelmodc a second time, and this time in a homogeneous medium with the velocity of the layer were the receivers
are placed. Then the recorded fields of the direct field is subtracted from the completed field resulting in only the
reflected field. Running the fdelmodc visco.scr takes about 10 minutes.
time [s]
time [s]
time [s]
0.8 0.8 0.8 0.8
41
lateral position (m) lateral position (m) lateral position (m)
-5000 -2500 0 2500 5000 -5000 -2500 0 2500 5000 -5000 -2500 0 2500 5000
0 0 0
1 1 1
time (s)
time (s)
time (s)
2 2 2
3 3 3
4 4 4
1 1 1
time (s)
time (s)
time (s)
2 2 2
3 3 3
4 4 4
42
lateral position [m] rotation in degrees
0 500 1000 1500 2000 0 100 200 300
0
-3000
0.5
-2000
1.0
-1000
time [s]
0 1.5
1000
2.0
2000
2.5
3000
3.0
Figure 21: The middle of the model contains a circular contrast and the receiver are placed on a circle around this
contrast. The left picture show the source (black dot) and receiver (white dots) positions. Right is the recorded
wavefield at the receiver positions.
z=-100,-200,-250,-200,-200,-120,-300,-600,-650,-500,-350,-200,-200,-150,-200 \
intt=rough var=200,3.2,1 poly=2 x=0,3000,8000,10000 \
z=400,250,300,500 cp=4500,4200,4800,4500 ro=1400 gradcp=5 grad=0 \
intt=def poly=2 x=0,2000,3000,5000,7000,8000,10000 \
z=1100,1100,1100,1600,1100,1100,1100 cp=4000 ro=2000 gradcp=8 grad=0 \
intt=def poly=0 x=0,10000 z=1750,2050 cp=4500,5100 ro=1500 gradcp=13 grad=0 \
intt=def poly=0 x=0,10000 z=1850,2150 cp=6000,4200 ro=1500 gradcp=14 grad=0 \
intt=def poly=0 x=0,10000 z=1950,2250 cp=4800,4800 ro=1500 gradcp=5 grad=0 \
intt=def poly=0 x=0,10000 z=2000,2300 cp=6100,5000 ro=1500 gradcp=13 grad=0 \
intt=def poly=0 x=0,10000 z=2100,2400 cp=3800,5000 ro=1500 gradcp=20 grad=0 \
intt=def poly=0 x=0,10000 z=2150,2450 cp=5000 ro=1500 gradcp=14 grad=0 \
intt=def poly=0 x=0,10000 z=2350,2650 cp=5800 ro=1500 gradcp=5 grad=0 \
intt=def poly=0 x=0,10000 z=2600,2600 cp=5500 ro=2200 gradcp=5 grad=0
fdelmodc \
file_cp=vel2_edge_cp.su ischeme=1 \
file_den=vel2_edge_ro.su \
file_rcv=shot_real2_x5000_topo.su \
file_src=G2.su \
dtrcv=0.004 \
verbose=4 \
tmod=3.004 \
dxrcv=20.0 \
zrcv1=-800 \
xrcv1=0 \
xrcv2=10000 \
sinkdepth=1 \
src_random=0 \
wav_random=0 \
xsrc1=5000 \
xsrc2=5000 \
zsrc1=-800 \
tsrc1=0.0 \
dipsrc=1 \
ntaper=$ntap \
left=4 right=4 bottom=4 top=1
43
lateral position [m] x10 4 lateral position (m)
-5000 -4000 -3000 -2000 -1000 0 1000 2000 3000 4000 5000
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0
500
0.5
1000
1.0
1500
depth [m]
time (s)
2000 1.5
2500
2.0
3000
2.5
3500
4000
3.0
Figure 22: The receivers are placed from -5000 m to 5000 m at every 20 m on the topography. The modeled
reflection response, for a source at 5000 m placed on the the topography, is shown in the right picture.
(x xs )(t) (118)
(x xs )
(t)
(x xs ) (119)
t
j(x xs )
The analytical Greens functions for volume injection sources are given by (Berkhout, 1987, page 141-146):
44
a) P field of monopole x10 -8
b) Vz field of monopole
0.08 4
x10 -2 x10 -8
3.96
7.96
3.94
7.94
Amplitude
Amplitude
7.92 3.92
0.04 7.90
2 3.90
Amplitude
Amplitude
7.88
3.88
7.86
3.86
0.256 0.256
time in seconds time in seconds
0 0
-0.04 -2
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
time in seconds time in seconds
1.91
Amplitude
Amplitude
3.84 1.2
0.002 3.82
1.89
Amplitude
Amplitude
1.87
0 0
-0.001
-0.6
-0.002
-1.2
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
time in seconds time in seconds
Figure 23: Comparison of Greens functions in an acoustic homogeneous medium for monopole (top) and dipole
sources (bottom) with pressure (P ) and particle velocity (Vz ), left and right, respectively, recorded wavefields. The
onsets show the differences for the positive peak of the wavelet, the lower line represents the finite-difference result.
The script FigureGreenAppendixA.scr in the FiguresPaper directory calculates the data and reproduces the
pictures.
where
(2)
H0 (kr) = J0 (kr) jY0 (kr), (124)
(2)
H1 (kr) = J1 (kr) jY1 (kr), (125)
r = (x2 + (zs zr )2 ), (126)
|zs zr |
cos() = , (127)
r
x represents the lateral distance and zs and zr are the depth positions of the source and receiver, respectively. J0
and J1 are the Bessel functions of the first kind of orders 0 and 1, respectively. Y0 and Y1 are the Bessel functions
of the second kind of orders 0 and 1, respectively. The wavenumber k = /c, where c is the velocity of the
medium. The analytical responses are generated by the program green, included in the source code distribution
in the utils directory. In the beginning of section 6.5 it is explained that an injection source is implemented (and
not injection rate). Sometimes in literature equations 120-123 have an extra factor j when injection rates are used.
Note that in 2D media the far field expression of the Hankel functions in equations (120)-(123) contain a 45 degree
phase-shift. This phase shift is of course also present in the computed FD results. For example if you have a Ricker
wavelet as input source (e.g. modelling in a homogeneous medium), then the recorded wave will have a 45 degree
phase shift compared to the input Ricker wavelet. Another way to see this is, is to realise that a point source in 2D
is represented by a line source in 3D. For a more detailed explanation see also (Berkhout, 1987, page 141-146).
In the staggered-grid implementation, the P - and Vz -fields are positioned at different spatial grids and the Vz
fields have been interpolated to the P -field grid position to be able to compare them with the analytical solution
positioned at the P -field position. The FD scheme is also staggered in time and the modeled P-field is shifted half
a time step compared to the Vz -field. For the implementation of a dipole source, two grid positions are used and
this gives an extra time delay of 0.5z
c , where c is the velocity at the source position and z the discretization step
in the z-direction. In the comparison with the analytical Greens functions these discretization effects have all been
taken into account.
The reference medium has a velocity of 2000 m/s and a density of 1000 kg/m3 . The source is positioned 500 m
below the receiver. For the finite-difference code a spatial grid of 2.5 m and a time step of 0.5 ms has been used to
45
a) P field of monopole b) Vz field of monopole
0.5 0.5
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
time in seconds time in seconds
0.5 0.5
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
time in seconds time in seconds
Figure 24: Difference between the analytical Greens function and the finite-difference result in an acoustic
medium for monopole and dipole sources for P and Vz recorded fields. The difference is shown as percentage
of the maximum peak in the analytical Greens function. A grid spacing of = 2.5 m is used. The script
FigureGreenDxAppendixA.scr in the FiguresPaper directory calculates the data and reproduces the pic-
tures.
46
a) Vz field of monopole = 1 b) Vz field of monopole = 5
0.5 0.5
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
time in seconds time in seconds
0.5 0.5
0 0
0 0.1 0.2 0.3 0.4 0.5 0 0.1 0.2 0.3 0.4 0.5
time in seconds time in seconds
Figure 25: Difference between the analytical Greens function and the finite-difference result in an acoustic
medium for monopole and dipole sources for Vz recorded fields using a grid spacing of 1 and 5 meter. The dif-
ference is shown as percentage of the maximum peak in the analytical Greens function. The larger errors for the
= 5 model results indicates that dispersion starts to develop. The script FigureGreenDxAppendixA.scr
in the FiguresPaper directory calculates the data and reproduces the pictures.
7.6.2 Elastic
This section is made together with Karel van Dalen, who has derived the Greens function in a homogenous elastic
medium.
To verify the accuracy and the correctness of the FD program we have compared the finite-difference calculation of
a Greens function in a homogenous elastic medium with the analytical Greens function. Four analytical Greens
functions have been used for verification :
force source in x-direction source and vertical particle-velocity (Vz ) receivers (Fx=1),
force source in z-direction source and vertical particle-velocity (Vz ) receivers (Fz=1),,
deformation source in x-direction source and vertical particle-velocity (Vz ) receivers (Tx=1),
deformation source in z-direction source and vertical particle-velocity (Vz ) receivers (Tz=1).
General Greens functions:
47
The corresponding analytical Greens functions are given by:
v,fx (x, xs ) = j {z x (G
G p (x, xs ) G
s (x, xs ))}, (135)
zx
(2) 2kp (2) (2) 2ks (2)
= {(kp2 H0 (kp r) H1 (kp r)) (ks2 H0 (ks r) H (ks r))} (136)
4r 2 r r 1
v,fz (x, xs ) = j G
G s (x, xs ) j {z z (G p (x, xs ) G
s (x, xs ))}, (137)
2
cs
(2)
= 2 H0 (ks r) (138)
4cs
kp (2) z2 x
2 (2)
2
{ z 2 kp H0 (kp r) + ( )H1 (kp r)} (139)
4r r
ks (2) z2 x2 (2)
+ 2
{ z 2 ks H0 (ks r) + ( )H1 (ks r)} (140)
4r r
(141)
v,xz (x, xs ) =
G (142)
(143)
v,zz (x, xs ) =
G (144)
(145)
where
(2)
H0 (kr) = J0 (kr) jY0 (kr), (146)
(2)
H1 (kr) = J1 (kr) jY1 (kr), (147)
= x xs ,
x (148)
z = z zs , (149)
r= (x xs )2 + (z zs )2 ), (150)
x2 + z2 ),
r = ( (151)
|z zs |
cos() = , (152)
r
x represents the lateral distance and zs and z are the depth positions of the source and receiver, respectively. J0 and
J1 are the Bessel functions of the first kind of orders 0 and 1, respectively. Y0 and Y1 are the Bessel functions of the
second kind of orders 0 and 1, respectively. The wavenumber k = /c, where c is the velocity of the medium. The
analytical responses are generated by the program green, included in the source code distribution in the utils
directory.
48
FiguresPaper ...........The bash-script to generate the Figures from in Geophysics manuscript
demo ................................Bash-script which demonstrate the possibilities of fdelmodc
doc ..................................................................where you can find this manual
include ........................................... Directory for the include file from the FFT library
lib ........................................................ Directory where the FFT library is placed
utils ................All source code for programs to generate models and wavelets can be found in here
/
bin/
basop ........................ Executable for basic operations (shift, envelope, ..) on seismic data
extendModel ......Executable to extends the edges of a file with first and last trace and/or sample
fconv ...........Executable for auto-, cross-correlation, deconvolution or convolution computation
fdelmodc ....................Executable for elastic acoustic finite-difference wavefield modeling
green ............... Executable for the calculation of 2D Greens function in homogeneous media
makemod ....................................Executable for building gridded subsurface models
makewave ....................................................Executable to generate wavelets
/include
genfft.h .....................................................Include file for the FFT library
/lib
libgenfft.a ...........................Library which contains the objects of the FFT routines
/
fdelmodc/
Makefile .........................controls the compilation and linking of the program fdelmodc
fdelmodc.h ................................ header file which defines structures used modeling
par.h ....................................header file from SU for reading in program parameters
SUsegy.h .............................. adjusted segy header file, which defines ns as an integer
segy.h .........................................................original segy header from SU
acoustic2.c ...............................Kernel of acoustic FD using 2nd order derivatives
acoustic4.c ................................Kernel of acoustic FD using 4th order derivatives
acoustic6.c ................................Kernel of acoustic FD using 6th order derivatives
applySource.c ..................Routine which adds source amplitude(s) to the wavefield grids
atopkge.c ...............................................converts ascii to arithmetic from SU
CMWC4096.c .......................................................random number generator
defineSource.c .............................computes, or read from file, the source signature
docpkge.c ..........................................function for self-documentation, from SU
elastic4.c ...................................Kernel of elastic FD using 4th order derivatives
fdelmodc.c .................................... main FD modeling program, contains self-doc
fileOpen.c ............................................file handling routines to open SU files
gaussGen.c ...............................generate a Gaussian distribution of random numbers
getBeamTimes.c .................... stores energy fields (beams) in arrays at certain time steps
getModelInfo.c .......... reads gridded model file to compute min/max and sampling intervals
getParameters.c .............................reads in all parameters to set up a FD modeling
getRecTimes.c ..................................stores the wavefield at the receiver positions
getWaveletInfo.c ...reads source wavelet file and computes maximum frequency and sampling
getpars.c ........................functions to get parameters from the command line, from SU
name ext.c .....................inserts a character string after the filename, before the extension
readModel.c . reads gridded model files and computes medium parameters used in the FD kernels
recvPar.c .......................calculates the receiver positions based on the input parameters
spline3.c .................................computes interpolation based on third order splines
taperEdges.c ............. tapers the wavefield to suppress unwanted reflections from the edges
verbosepkg.c .............. functions to print out verbose, error and warning messages to stderr
viscoacoustic4.c ...................Kernel of visco-acoustic FD using 4th order derivatives
viscoelastic4.c ......................Kernel of visco-elastic FD using 4th order derivatives
wallclock time.c ..................................function used to calculate wallclock time
writeRec.c ........................................writes the receiver array(s) to output file(s)
writeSnapTimes.c ............... writes gridded wavefield(s) at a desired time to output file(s)
writeSrcRecPos.c ..................writes the source and receiver positions into a gridded file
writesufile.c ...............................................writes an 2D array to a SU file
49
/
fdelmodc/
FiguresPaper/..................scripts to reproduce Figures in Thorbecke and Draganov (2011)
README ......................................... briefly describes the runtimes of the scripts
clean ...............................removes all *.su *.bin *.txt *.eps in the current directory
Figure2.scr ......................starts fdelmodc only to compute the source positions, 1 s.
Figure3.scr ..............calls Simple model base, and Simple model sides.scr, 122 hours!
Figure3 ref.scr ........................ direct modeled reference result Figure 3d, 500 s.
Figure4.scr ..............................5 different source signature lengths, 5x3.5 hours
Figure5.scr ................................simulates 8000 short (2.5 s) sources, 3.5 hours
Figure6.scr ............................5 different number of random sources, 5x3.5 hours
Figure6f.scr .....................make postscript file of middle trace after Figure6.scr, 1 s.
Figure6length.scr .alternative not used in paper, fixed source signature length, 5x3.5 hours
Figure7.scr ............................as Figure 6, but with 1000 deep sources, 3.5 hours
Figure7fmax.scr ....alternative not used in paper, varying maximum frequency, 5x3.5 hours
Figure7length.scr ...... alternative not used in paper, fixed length deep sources, 3.5 hours
Figure8-9.scr .. for random and ricker wavelet deep, volume and plane sources, 6x3.5 hours
Figure8-9Hom.scr .....for reviewer, same as Fig. 8-9 in homogeneous medium, 6x3.5 hours
Figure10.scr ......reference and 2 SI results for visco-acoustic media, 2x200 s. + 2x1 hours
Figure11.scr .........calls fdelmodc long.scr, can not be reproduced; software in test phase
Figure12.scr ....calls fdelmodc amplitude.scr, can not be reproduced; software in test phase
Figure13.scr .......................... amplitude variations on source strength, 3x1500 s.
Figure13Amp.scr ..................computes only the amplitude distributions pictures, 5 s.
Figure14-15.scr .........receivers and source placed on model with topography, 161 hours
FigureSourcesAppendixA.scr ... source construction shown in Figure A2-A3-A4, 150 s.
FigureGreenAppendixA.scr ..compares FD result with analytical result, used in Figure 23
FigureGreenDxAppendixA.scr ........difference with analytical result, used in Figure 24
SIrand.scr .......middle trace is correlated with all the output traces to compute the SI result
Simple model base.scr .......... models sequential 900 shots at level z = 3600, 70 hours
Simple model sides.scr models sequential 2x360 shots at the sides x=1000,9000, 50 hours
fdelmodc amplitude.scr ....models along recording on 3600 s. used in Fig 12, 100 hours
fdelmodc long.scr ...........models along recording on 3600 s. used in Fig 11, 100 hours
FigurePres.scr ...........snapshots for movie usage in presentation to explain SI, 2x800 s.
MakeGifMovie.scr ...attempt to make movie from FigurePres.scr snapshots, imageJ is better
cross.scr .calls FigureCCsources.scr and compute cross-correlation used in Figure 12, 1600 s.
FigureCCsources.scr .............. to compute source signature used in cross.scr, 1600 s.
/
fdelmodc/
demo/
clean ...............................removes all *.su *.bin *.txt *.eps in the current directory
eps for manual.scr .........the results of fdelmodc rand.scr in eps, used in Figure 8, 9, 10
fdelmodc rand.scr ..... generation of random source signatures placed at random positions
fdelmodc srcrec.scr ...........illustrates source and receiver positions, used in Figure 14
fdelmodc taper.scr ....... the effect of (absorbing) tapering of the edges, used in Figure 6
fdelmodc visco.scr ..........wave propagation in visco-elastic medium, used in Figure 19
fdelmodc circ.scr .........................receivers placed on a circle, used in Figure21
fdelmodc sourcepos.scr ................ different source distributions, used in Figure 20
fdelmodc plane.scr .plane wave at depth to receivers at the surface, including snapshots, 17
fdelmodc stab.scr ...... illustrates dispersion and instability in snapshots, used in Figure 3
fdelmodc topography.scr ..........source and receivers on topography, used in Figure22
fdelmodc obc.scr .same as fdelmodc topography, but receivers on topography of sea-bottom
model flank.scr ...................builds a steep flank model, used in fdelmodc srcrec.scr
/
utils/
Makefile ....................................................... to compile and link the code
par.h ....................................header file from SU for reading in program parameters
segy.h .........................................................original segy header from SU
50
allocs.c ....................................................allocate 2D arrays as pointer list
atopkge.c ...............................................converts ascii to arithmetic from SU
basop.c .....................................main program for basic operations on seismic data
diffraction.c ...............................insert diffractor in the model used, in makemod
docpkge.c ..........................................function for self-documentation, from SU
elipse.c .............................................elipse shaped contrast used in makemod
extendModel.c ..........................main program to extend the edges of a gridded model
fconv.c .....main program for auto-, cross-correlation, deconvolution or convolution computation
fractint.c ................................ compute fractal shaped interface used in makemod
freqwave.c .........................compute wavelets in frequency domain, used in makewave
getFileInfo.c ........................... gets sizes, sampling and min/max values of a SU fil
getModelInfo.c .......... reads gridded model file to compute min/max and sampling intervals
getpars.c ........................functions to get parameters from the command line, from SU
getrecpos.c ............................................read receiver positions used in green
green.c ............ main program for calculation of (exact) 2D Greens function in hom. medium
grid.c ..........................fills the gridded model below the interface zp used in makemod
gridabove.c ................... fills the gridded model above the interface zp used in makemod
interpolation.c .... interpolates the interface defined by the input parameters to all grid points
linearint.c .............................compute piecewise linear interface used in makemod
makemod.c ..................................main program of gridded subsurface model builder
makewave.c ......................................main program for the generation of wavelets
name ext.c .....................inserts a character string after the filename, before the extension
plotexample.c ................................ prints an example parameter file for makemod
polint.c ............................. compute polynominal shaped interface used in makemod
readData.c .....................................reads SU file and returns header and 2D array
roughint.c .................................compute rough shaped interface used in makemod
sinusint.c ................................. compute sinus shaped interface used in makemod
spline.c ................................... compute spline shaped interface used in makemod
verbosepkg.c .............. functions to print out verbose, error and warning messages to stderr
wallclock time.c ..................................function used to calculate wallclock time
writeData.c ................................................. writes an 2D array to a SU file
xwgreen.c ...... calculation of di/mono-pole response in 2D homogeneous medium used in green
xrcv= xrcva=
zrcv= zrcva=
51
C Makewave
The wavelets generated with makewave are
f f2
G1 (f ) = exp( 2 ) (154)
2fp 2fp
f2 f2
G2 (f ) = exp( ) (155)
fp2 fp2
References
Alford, R., Kelly, K., and Boore, D. (1974). Accuracy of nite-difference modeling of the acoustic wave equation.
Geophysics, 39(6):834842.
Bauer, A. L., Loub`ere, R., and Wendroff, B. (2008). On stability of staggered schemes. SIAM J. Numer. Anal.,
46(2):9961011.
Berkhout, A. J. (1987). Applied seismic wave theory. Elsevier, Amsterdam.
Bohlen, T. (2002). Parallel 3-d viscoelastic nite difference seismic modelling. Computer and Geosciences, 28:887
899.
Chew, W. C. and Liu, Q. H. (1996). Perfectly matched layers for elastodynamics: A new absorbing boundary
condition. Journal of Computational Acoustics, pages 341359.
Courant, R., Friedrichs, K., and Lewy, H. (1967). On the partial difference equations of mathematical physics.
IBM Journal, English translation of the 1928 German original, pages 215234. Available as download
http://www.stanford.edu/class/cme324/classics/courant-friedrichs-lewy.pdf.
Drossaert, F. H. and Giannopoulos, A. (2007). A nonsplit complex frequency-shifted pml based on recursive
integration for fdtd modeling of elastic waves. Geophysics, 72(2):T9T17.
Fornberg, B. (1988). Generation of finite difference formulas on arbitrarily spaced grids. Mathematics of Compu-
tation, 51(184):699706.
Perez-Ruiz, J. A., Luzon, F., and Garca-Jerez, A. (2005). Simulation of an irregular free surface with a displace-
ment finite-difference scheme. Bulletin of the Seismological Society of America, 95(6):22162231.
Robertsson, J. O. A. (1996). A numerical free-surface condition for elastic/viscoelastic finite-difference modeling
in the presence of topography. Geophysics, 61:19211934.
Robertsson, J. O. A., Blanch, J. O., and Symes, W. W. (1994). Viscoelastic finite-difference modeling. Geophysics,
59(09):14441456.
Saenger, E. H. and Bohlen, T. (2004). Finite-difference modeling of viscoelastic and anisotropic wave propagation
using the rotated staggered grid. Geophysics, 69(2):583591.
Sei, A. (1995). A family of numerical schemes for the computation of elastic waves. SIAM J. Sci. Comput.,
16(4):898916.
52
Sei, A. and Symes, W. (1995). Dispersion analysis of numerical wave propagation and its computational conse-
quences. Journal of Scientific Computing, 10(1):127.
Thorbecke, J. and Draganov, D. (2011). Finite-difference modeling experiments for seismic interferometry. Geo-
physics, 76(6):H1H18.
van Vossen, R., Robertsson, J. O. A., and Chapman, C. (2002). Finite-difference modeling of wave propagation in
a fluid-solid configuration. Geophysics, 67(2):618624.
Virieux, J. (1986). P-Sv wave propagation in heterogeneous media - Velocity-stress finite-difference method.
Geophysics, 51(04):889901.
53