Tutorial 07: Acoustic Wave Propagation

Tutorial 07: Acoustic Wave Propagation#

Note

This tutorial is available as a Python script examples/07_acoustic_forward.py and an interactive Jupyter notebook examples/notebooks/07_acoustic_forward.ipynb.

Run 2D acoustic wave simulations on the Marmousi2 model using the finite-difference time-domain (FDTD) solver with PML absorbing boundaries.

What You Will Learn#

  • Set up GridConfig and BoundaryConfig

  • Build AcousticModel with velocity and density

  • Configure Source, Receiver, and Survey

  • Run AcousticPropagator with gradient checkpointing

  • Visualize shot gathers and wavefield snapshots

Code#

from geobrain.physics.wave import (
    GridConfig, BoundaryConfig, AcousticModel,
    Source, Receiver, Survey, AcousticPropagator,
    RickerWavelet,
)

grid = GridConfig(nx=200, nz=88, dx=40.0, dz=40.0)
boundary = BoundaryConfig(type='pml', n_layers=30, free_surface=True)
model = AcousticModel(grid=grid, boundary=boundary, vp=vp, rho=rho)

# Survey setup
source = Source(nt=NT, dt=DT, f0=5.0)
source.add_source(x=100, z=1, wavelet=wavelet_np)
receiver = Receiver(nt=NT, dt=DT)
receiver.add_receivers(x=rcv_x, z=rcv_z, receiver_type='pr')
survey = Survey(source, receiver)

# Forward modeling
propagator = AcousticPropagator(model, survey, device='cuda')
result = propagator.forward(checkpoint_segments=4)

Results#

../_images/07_velocity_density.png

Fig. 49 Marmousi2 velocity and density model.#

../_images/07_survey_geometry.png

Fig. 50 Survey geometry: sources and receivers.#

../_images/07_wavefield_snapshots.png

Fig. 51 Acoustic wavefield snapshots at different time steps.#

../_images/07_shot_gather_0.png

Fig. 52 Shot gather at the center of the model.#

Full Example#

See examples/07_acoustic_forward.py.