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

transient scalar transport equation (diffusion and advection) #2124

Closed sezerh24 closed 3 weeks ago

sezerh24 commented 3 weeks ago

I have seen some examples(elixirs) of the advection and diffusion. ( this example: examples/tree_2d_dgsem/elixir_advection_diffusion_nonperiodic.jl). so what if the diffusion coefficient is a function fo the species concentration in the case of mass transfer? how we can implement a non-constant diffusion coeffient?

Thank you

jlchan commented 3 weeks ago

Hi @sezerh24. This should be possible by creating a new type for your diffusivity and specializing the viscous flux function for your type. For example, for LaplaceDiffusion2D, the flux function is https://github.com/trixi-framework/Trixi.jl/blob/7d92aaf3a6397beece80eb2f1d42e2d8b75fc2cb/src/equations/laplace_diffusion_2d.jl#L21-L28

If you specialize this to your new type, you can modify the flux function to make the diffusion coefficient non-constant and a function of your solution u.

DanielDoehring commented 3 weeks ago

We have something similar for Navier-Stokes as we support temperature-dependent viscosity e.g. via Sutherlands law, see here, here, and here.

sezerh24 commented 3 weeks ago

Thank you very much.