CliMA / Oceananigans.jl

🌊 Julia software for fast, friendly, flexible, ocean-flavored fluid dynamics on CPUs and GPUs
https://clima.github.io/OceananigansDocumentation/stable
MIT License
999 stars 196 forks source link

`minimum_xspacing` does not account for the immersed boundary #3954

Open simone-silvestri opened 1 week ago

simone-silvestri commented 1 week ago

I think it's because of these definitions

https://github.com/CliMA/Oceananigans.jl/blob/504ab5da6c1cac49f0b5c364e58c117563bde0e6/src/ImmersedBoundaries/immersed_boundary_nodes.jl#L67-L69

This causes the CFL to be limited by possibly immersed nodes. It is quite relevant on the TripolarGrid where nodes near the north poles are immersed with the spacings tending to zero.

I can open a PR to fix this.

glwagner commented 1 week ago

Nice find. Also we should note that the immersed boundary grid can change the spacings (in addition to the fact that we must omit immersed spacings). For example with partial cells the zspacings are different than on the underlying grid.

glwagner commented 6 days ago

cc @ali-ramadhan I'm not sure if this was bundled with other changes you made but a good thing to be aware of