ar4 / deepwave

Wave propagation modules for PyTorch.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

how to simulate a source that is not point source, but has an arbitrarily spatial distribution?

aaelmeli opened this issue · comments

commented

Hi

I am trying to simulate a case where a source is not a single point in space, but it has some arbitrary distribution. One thought is to model this source as a group of point sub-sources that capture that distribution. Any pointers on this?

Thanks in advance.

commented

image
Hi,

I was trying to simulate the case when there is a force distributed in space similar to the picture on the left. The force profile in time is a rectangular pulse that rise to 1 for a half of millisecond and then becomes zero. The expectations is that, after relatively long time, the waves propagate with almost zero tail. However, as you see in the right figure, the tail of the waves does not seem to be zero or close to zero. One reason that I was thinking of is the numerical dispersion being summed up for different sources (I have many here~1000 ) and causing this issue. The reason why I thought this way, I tried to use only few sources (~10), with the exact same time profile (rectangular pulse), and I could get something that close to the expected wave profile, as shown below. I am setting accuracy=8 in all simulations. So, I wanted to get your insight on this, if I am missing something here.

Thank you so much!
image

Hi,

I tried to approximately implement what I think you are describing, but I think the result looks like it is probably plausible. Here is my code:

import torch
import matplotlib.pyplot as plt
import deepwave
from deepwave import scalar

ny = 1000
nx = 1000
dx = 4.0
v = torch.ones(ny, nx) * 1500

freq = 25
nt = 600
dt = 0.001
peak_time = 1.5 / freq

# source_locations
source_locations = torch.zeros(1, 1000, 2,
                               dtype=torch.long)
source_locations[..., 0] = (torch.arange(10) + (ny//2) - 5).reshape(-1,1).repeat(1,100).reshape(1,-1)
source_locations[..., 1] = (torch.arange(100) + (nx//2) - 50).reshape(1,-1).repeat(1,10)

# source_amplitudes
# source_amplitudes = (
#     deepwave.wavelets.ricker(freq, nt, dt, peak_time)
#     .repeat(1, 1000, 1)
# )
source_amplitudes = torch.zeros(nt)
source_amplitudes[10:15] = 1
source_amplitudes = source_amplitudes.reshape(1,1,-1).repeat(1,1000,1)

# Propagate
out = scalar(v, dx, dt, source_amplitudes=source_amplitudes,
             source_locations=source_locations,
             accuracy=8,
             pml_freq=freq)

# Plot
plt.imshow(out[0][0,20:-20,20:-20])

The result:
image

Since the source you described is non-oscillatory, and since this is 2D propagation, the waves will decay as they spread away from the source, but they will never go to zero. If you instead use an oscillatory source (change the source amplitudes in my code above to instead use the commented-out Ricker wavelet) then the amplitudes do return to zero.

One potential issue to be aware of with what you are trying to accomplish is that the specified PML frequency will probably be wrong. It needs to be set correctly in order for the PML to effectively absorb waves reaching the edges of the model. I used 25 Hz for it in my code above, even though that is likely to be incorrect for the rectangular pulse, but it still seems to perform reasonably well. If you have a large areal source, however, the low frequency component of the wave will likely increase and so this may affect the PML effectiveness.

I hope this answers your question. Please let me know if you still have problems.

commented

Thank you very much for the insight and spending time trying this. I think you are right with respect to the force profile in time. What I have from the experimentalist, the force profile in time is a rectangular pulse. However, when I tried to model it exactly as they reported, the wavefield does not looks correct at all. But, when I changes the force to the Ricker pulse, I got very similar pattern to the actual measured wavefield. I suspect that, even though the force is setup for a rectangular pulse, the actual force transmitted to the phantom material is not!

Thanks again.

commented

Hi Alan,

One more question, in the scalar (), what is the out[-1], is it the velocity or displacements? or just the potential?, if not the velocities, is there a way to get this from deepwave, or I have to implement some function for this?