tomchor / Oceanostics.jl

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

Adds `KineticEnergyForcingTerm` #136

Closed tomchor closed 1 year ago

tomchor commented 1 year ago

This PR adds KineticEnergyForcingTerm, which calculates the contribution of the momentum forcing terms on the kinetic energy evolution. It's especially useful when calculating the dissipation rate due to sponge layers and such.

glwagner commented 1 year ago

Maybe ForcingProduction? (Are we adding the word "Term" to the end of all the names?)

tomchor commented 1 year ago

Maybe ForcingProduction? (Are we adding the word "Term" to the end of all the names?)

I haven't been very good about following any patterns, which basically means I add the ending Term when I notice that people generally tend to refer to that term as a term.

For example people usually say "I'll calculate the KE dissipation rate", not "I'll calculate the KE dissipation rate term", so that term is called only KineticEnergyDissipationRate, as opposed to KineticEnergyDissipationRateTerm.

For the diffusive term, I feel like people usually do refer to that as the "diffusive term", so its name is KineticEnergyDiffusiveTerm. I think the same goes for the forcing production term, which is why Term is there.

If you have a general naming pattern suggestion, I'd be interested in hearing it! If we agree then we can make it official and start following it.

With that said, I've been going for clarity at the expense of being verbose, so I'd prefer naming it KineticEnergyForcingProduction (or that + Term) than just ForcingProduction.

glwagner commented 1 year ago

Maybe ForcingProduction? (Are we adding the word "Term" to the end of all the names?)

I haven't been very good about following any patterns, which basically means I add the ending Term when I notice that people generally tend to refer to that term as a term.

Aren't all of these objects "terms"? "Term" means that the object appears among other similar ones in an equation (eg an equation consists of "terms").

glwagner commented 1 year ago

I think we use "term" when its in the context of an equation. Ie, the TKE budget has three terms: production, buoyancy flux, dissipation rate. We might then say, "the production term does X...", or "the dissipation rate term does Y..."

Outside the context of a budget or an equation we would not use the word "term". Personally I think we should remove the word term. "KineticEnergyDiffusiveTerm" -- is that "KineticEnergyTransport"?

tomchor commented 1 year ago

I think we use "term" when its in the context of an equation. Ie, the TKE budget has three terms: production, buoyancy flux, dissipation rate. We might then say, "the production term does X...", or "the dissipation rate term does Y..."

Good point.

Outside the context of a budget or an equation we would not use the word "term". Personally I think we should remove the word term. "KineticEnergyDiffusiveTerm" -- is that "KineticEnergyTransport"?

The diffusive term includes both KE dissipation and transport, so I don't think calling it KineticEnergyTransport would be correct.

tomchor commented 1 year ago

@glwagner I like this discussion. I'm tempted to merge this as is and maybe we can discuss this on an issue? I think several diagnostics need to be changed once we agree on a naming pattern, so it's good to debate that on a separate issue and implement it on a separate PR.