Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hypoellictic operator #45

Open
rveltz opened this issue Oct 14, 2022 · 3 comments
Open

hypoellictic operator #45

rveltz opened this issue Oct 14, 2022 · 3 comments

Comments

@rveltz
Copy link

rveltz commented Oct 14, 2022

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
Copy link
Owner

j-fu commented Oct 15, 2022

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

@rveltz
Copy link
Author

rveltz commented Oct 15, 2022

Hi, what is the intended geometry ?

Rectangle

Can you use a grid aligned with the coordinate directions ?

Yes I can

@j-fu
Copy link
Owner

j-fu commented Oct 16, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants