trixi-framework / Trixi.jl

Trixi.jl: Adaptive high-order numerical simulations of conservation laws in Julia
https://trixi-framework.github.io/Trixi.jl
MIT License
538 stars 109 forks source link

Is Trixi.jl suitable for simulation of acoustic wave through inhomogeneous media ? #1744

Open LaurentPlagne opened 12 months ago

LaurentPlagne commented 12 months ago

Sorry for this probably dumb question, but I wonder if Trixi.jl is suitable for simulation of acoustic wave through (3D) inhomogeneous media (in time domain) ? I have seen the keywork acoustic on a slide in a video presentation of Trixi.jl, but I was not able to find example for it.

DanielDoehring commented 12 months ago

What are the governing equations? Acoustic perturbation, (non)linear Euler, how does inhomogeneous media translate into physical modeling?

LaurentPlagne commented 12 months ago

I would like to solve this kind of equation

$\frac{1}{\rho c^2} \frac{\partial^2}{\partial t^2}u-\nabla \cdot (\frac{1}{\rho}\nabla u) =s $

like in https://arxiv.org/pdf/2003.09812.pdf

DanielDoehring commented 12 months ago

That should be possible - however, you need to implement this equation yourself which involves rewriting this as a two-dimensional system with only first order temporal derivatives.

sloede commented 12 months ago

That should be possible - however, you need to implement this equation yourself which involves rewriting this as a two-dimensional system with only first order temporal derivatives.

Exactly! Once rewritten, you should be able to discretize the equations with Trixi.jl. Furthermore: 1) If $\rho$ and $c$ are to vary in space, you need to implement them as additional state variables, and set the physical flux (flux) and the numerical fluxes for them to zero. We did something similar for, e.g., the acoustic perturbation equations. 2) If $\rho$ and $c$ are to vary in time, you need to provide a custom rhs! function as described in this tutorial that updates the values appropriately in each Runge-Kutta stage.

Feel free to ping us in case of further questions.