Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How Perfect Match Layer can be more effective? #86

Open
Lujiang-ECUST opened this issue Dec 10, 2024 · 2 comments
Open

How Perfect Match Layer can be more effective? #86

Lujiang-ECUST opened this issue Dec 10, 2024 · 2 comments

Comments

@Lujiang-ECUST
Copy link

Hi, I find that the absorption of the perfectly matched layer is poor when I set 'pml_freq' to the same value as the excitation frequency, even though I set 50 cells all around!What should I do to better absorb the reflected waves at the boundary?
Figure_1
The figure shows two distinct boundary reflection waves after propagating for some time

@Lujiang-ECUST
Copy link
Author

Lujiang-ECUST commented Dec 10, 2024

I'll attach my part of the code, the loading part of the speed model is omitted

ny = 200
nx = 200
# dx = 0.5e-4
dx = 0.2e-3
vmin=5800
vmax=6300
Model = md.ModelGenerator('emnist')
model = Model()
vp_background = torch.ones(nx,ny, device=device) *5800.0
vs_background = torch.ones(nx,ny, device=device)*3348.6315918
rho_background = torch.ones(nx,ny, device=device)*2.70532036*1000

vp_true = torch.tensor(model['vp'], device=device,dtype=torch.float32)
vs_true = torch.tensor(model['vs'], device=device,dtype=torch.float32)
rho_true = torch.tensor(model['rho']*1000, device=device,dtype=torch.float32)

n_shots = 64

n_sources_per_shot = 1
d_source = 3
first_source = 4
source_depth = 0

n_receivers_per_shot1 = 64
d_receiver = 3
first_receiver = 4
receiver_depth1 = 0
receiver_depth2 = 99
freq = 2.25e6
nt =1400
# dt = 0.4e-8
dt = 1e-8
peak_time = 1.5 / freq

# source_locations
source_locations = torch.zeros(n_shots, n_sources_per_shot, 2,device=device)
source_locations[..., 0] = source_depth
source_locations[:, 0, 1] = (torch.arange(n_shots) * d_source +
                             first_source)

# receiver_locations
receiver_locations = torch.zeros(n_shots, n_receivers_per_shot1, 2, device=device)
receiver_locations[:,:, 0] = receiver_depth1

receiver_locations[:, :, 1] = (
    (torch.arange(n_receivers_per_shot1) * d_receiver +
     first_receiver)
    .repeat(n_shots, 1)
)

# source_amplitudes
source_amplitudes = (
    (deepwave.wavelets.ricker(freq, nt, dt, peak_time))
    .repeat(n_shots, n_sources_per_shot, 1).to(device)
)
observed_data = deepwave.scalar(
                vp_true, dx, dt,
                source_amplitudes=source_amplitudes,
                source_locations=source_locations,
                receiver_locations=receiver_locations,
                max_vel=vp_true.max().max(),
                pml_freq=freq,
                pml_width=[50,50,50,50])
plt.imshow(observed_data[0][0].detach().cpu().numpy())
plt.show()

@ar4
Copy link
Owner

ar4 commented Dec 10, 2024

Hello and thank you for your question.

I ran your code, using the background vp model for the velocity, and I obtained approximately the same image as you did for the final wavefield. However, looking at the amplitudes of the waves, I see that they are extremely small (~1e-12), and so it seems that the PML worked effectively.

Do you see any reflections from the boundaries in your recorded data?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants