tomchor / Oceanostics.jl

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

Adds conservative form of the KE dissipation rate #110

Closed tomchor closed 1 year ago

tomchor commented 1 year ago

So far in the current form the new version actually produces results that are very close to a non-conservative form and very close to the expected values based on the decrease of KE:

image

One thing to note is that the level of error between ΔKE and the integrated dissipation rate is about 3%, which seem high compared to what we got for the tracer variance dissipation rate (irrc it's less than 0.5% there).

This might mean there's something wrong with my formulation or that KE dissipation is simply more challenging to calculate numerically in conservative form.

tomchor commented 1 year ago

Leaving this for reference for future self: running this for longer still produces results that are kinda far from the correct ones, indicating that the formulation still isn't correct:

image

Furthermore, this is a diffusivity-dominated regime. It would be nice to test this in an advection-dominated one.

tomchor commented 1 year ago

I improved the time-integration and results are now better. The in figure below, top panel, I'm comparing the KE, the new (supposedly conservative) formulation, the old (non-conservative formulation) of the time-integrated KE dissipation rate, and the whole diffusive term directly from Oceananigans.Models.NonhydrostaticModel. The bottom panel shows time-derivatives of the same quantities:

image

The dissipation rate estimates all match up really well with each other. Given that one of those rates comes from straight from Oceananigans.Models.NonhydrostaticModel I take them to be correct (at least for this example). It's a bit surprising that they match that well with the measured KE. Is that the limit of predictability due to the interpolations?

tomchor commented 1 year ago

KineticEnergyDissipationRate is now also implemented in conservative form. Tested with NonhydrostaticModel up to eps() :tada:

I also renamed ViscousDissipationRate to KineticEnergyDissipationRate, which is more informative.