j-fu / VoronoiFVM.jl

Solution of nonlinear multiphysics partial differential equation systems using the Voronoi finite volume method
MIT License
183 stars 33 forks source link

hypoellictic operator #45

Open rveltz opened 1 year ago

rveltz commented 1 year ago

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

j-fu commented 1 year ago

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

rveltz commented 1 year ago

Hi, what is the intended geometry ?

Rectangle

Can you use a grid aligned with the coordinate directions ?

Yes I can

j-fu commented 1 year ago

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]

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.