ar4 / deepwave

Wave propagation modules for PyTorch.
MIT License
216 stars 47 forks source link

question #83

Open yulongovo opened 2 weeks ago

yulongovo commented 2 weeks ago

I would like to ask where CFL of the P/SV simulation can be seen?

ar4 commented 2 weeks ago

The CFL condition is the same for both scalar and elastic propagators. It is defined in the function cfl_condition in common.py, which is called during the propagator setup. If the maximum velocity is not specific by the user, the maximum value in the velocity models (in the elastic case, vp and vs are calculated from the input lambda, mu, buoyancy) is used.

I hope that this answers your question, but please let me know if anything is still unclear.

yulongovo commented 2 weeks ago

Is there an inequality that represents this CFL condition?

---Original--- From: "Alan @.> Date: Wed, Nov 13, 2024 01:12 AM To: @.>; Cc: @.**@.>; Subject: Re: [ar4/deepwave] question (Issue #83)

The CFL condition is the same for both scalar and elastic propagators. It is defined in the function cfl_condition in common.py, which is called during the propagator setup. If the maximum velocity is not specific by the user, the maximum value in the velocity models (in the elastic case, vp and vs are calculated from the input lambda, mu, buoyancy) is used.

I hope that this answers your question, but please let me know if anything is still unclear.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

ar4 commented 2 weeks ago

I think the inequality expressed by the function that I linked to is v*dt*sqrt(1/dy^2+1/dx^2) <= 0.6. This does not seem to exactly match the definition on Wikipedia. It seems to me like it would be safer to instead use v*dt*1/min(dy, dx) <= 0.6, so thank you for drawing my attention to this. Have you encountered a problem that you suspect might be related to the CFL condition, and that is why you are asking about it?

yulongovo commented 2 weeks ago

Yes, the model parameters I set do not seem to satisfy the CFL

ar4 commented 2 weeks ago

I am sorry to hear that. Can you tell me more about the model parameters you are using and why you think they do not seem to satisfy the CFL?