VoronoiFVM.jl icon indicating copy to clipboard operation
VoronoiFVM.jl copied to clipboard

hypoellictic operator

Open rveltz opened this issue 2 years ago • 3 comments

Hi,

I would like to use your package to solve an equation of the form

d/dt P = d2/dx2 P + d/dx( F(x,y) P) + d/dy (G(x,y) P)

with Dirichlet BC. However, I am struggling writing the flux function mainly because the "Laplacian" only applies to the x variable. Can you give me a hint please?

Thank you

rveltz avatar Oct 14 '22 21:10 rveltz

Hi, what is the intended geometry ? Can you use a grid aligned with the coordinate directions ?

j-fu avatar Oct 15 '22 08:10 j-fu

Hi, what is the intended geometry ?

Rectangle

Can you use a grid aligned with the coordinate directions ?

Yes I can

rveltz avatar Oct 15 '22 08:10 rveltz

Ok, this is a good situation as otherwise the method as implemented now probably wouldn't converge. You have two cases: x parallel and y parallel. You can identify them as follows using the edge endpoint coordinates edge[:,1] and edge[:,2]

  • x parallel: edge[1,1]== edge[1,2]
  • y parallel:` edge[2,1]== edge[2,2]
  • Third case is the "diagonal" cas which you can safely ignore.

You can use exact comparison here as the coordinates come from the arrays at the input.

The you have convection-diffusion in the x direction which can be discretied by an upwind flux, and pure convection in y direction which can be discretized by a Godunov flux. I can give some more hints on these , just ask.

Note that these fluxes introduce artificial diffusion which in particular would smear sharp fronts, so you should carefully judge the accuracy of the results. Central difference variants on finer grids may provide a more accurate alternative.

If things don't work out properly with this package (which focuses on elliptic and parabolic problems), you may try Trixi.jl which is oriented at hyperbolic problems so it has more methods for the situation of vanishing diffusion.

j-fu avatar Oct 16 '22 20:10 j-fu