tomchor / Oceanostics.jl

Diagnostics for Oceananigans
https://tomchor.github.io/Oceanostics.jl/
MIT License
24 stars 8 forks source link

Add stretched coordinates back to tilted BBL example #177

Closed tomchor closed 1 week ago

tomchor commented 1 week ago

Stretched coordinates removed from the tilted bottom boundary layer example in https://github.com/tomchor/Oceanostics.jl/pull/157 because something about it was causing the docs to get stuck. This PR stretches the vertical coordinate on that grid again.

Closes https://github.com/tomchor/Oceanostics.jl/issues/159

glwagner commented 1 week ago

Nice.

Happy to merge this but curious whether this matters much. Stretching often seems like a complication that feels more sophisticated, but doesn't really give much benefit (at least for wall-modeled boundary layer turbulence problems where usually at least half the domain is fully turbulent and we don't need super fine resolution near the boundary).

tomchor commented 1 week ago

I agree that it's not very important. The main purpose of the example is to show the ProgressMessenger and diagnostics capabilities and it does that with a regular just fine.

That said, I do think stretching makes the symmetric/centrifugal instabilities way more resolved at the bottom, with our small amount of points. Compare the level of noise in the PV or Ro number in the videos generated by current docs versus the old docs with stretched coords. So I do think it's a positive change, although not a priority. So if I can't make it happen relatively easily with this PR I'll probably drop the idea.

tomchor commented 1 week ago

Also an issue I've just noticed. It seems that something changed in the way the diagnostics are calculated and now the PV has an artifact at the west wall even though the domain is periodic in x:

image

This seems to have started with version 0.14.1 and olders versions don't have that.

Looking at the changelog between 0.14.0 and 0.14.1, I don't anything there that could have caused this: https://github.com/tomchor/Oceanostics.jl/compare/v0.14.0...v0.14.1

It was during that version that we switched to Julia 1.10 and Oceananigans jumped to version 0.91, so maybe something in Oceananigans changed?

glwagner commented 1 week ago

You're missing a fill halo regions somewhere perhaps?

glwagner commented 1 week ago

You may want to manually set the number of halos. You need 2 halo points? Or 3?

Probably you want to break down the PV term by term to see which term exhibits issues and then diagnose that.