CliMA / LESbrary.jl

šŸ“šGenerating Oceananigans large eddy simulation (LES) data for calibrating parameterizations
MIT License
28 stars 10 forks source link

Clarification on the calculation of Shear Production terms and interpolations #80

Closed tomchor closed 3 years ago

tomchor commented 3 years ago

I'm not 100% familiar with all the interpolation functions that exist, so forgive me if I'm missing something obvious. I'm trying to base myself off of the Shear Production term written here

https://github.com/CliMA/LESbrary.jl/blob/fcf704446c62dbc17fe89f52b641c90f40fbdce3/src/TurbulenceStatistics/shear_production.jl#L51-L59

If we consider, for example this call specifically:

https://github.com/CliMA/LESbrary.jl/blob/fcf704446c62dbc17fe89f52b641c90f40fbdce3/src/TurbulenceStatistics/shear_production.jl#L57

Part of what this line is doing is differentiating U wrt z (thus transforming it from a quantity that lies on (F, C, C) to (F, C, F)) and then multiplying by w (which lies on (C, C, F)). Is my assessment correct?

Isn't this calculation wrong since they're at different positions? The only way I can see that this can be correct is if you assume that that U is a horizontal average and has no x collocation. Is that the case?

Thanks!

PS: I'm using C and F as abbreviations for Cell and Face.

glwagner commented 3 years ago

U is a horizontal average, so it does not have a horizontal position -- its a 1D profile and only has a z-location. However, the 3D u does have a horizontal position, so we do have to interpolate u.

tomchor commented 3 years ago

Thanks! I just wanna make I understand what the interpolations are doing since I'm starting to write my own (more general) kernels in a separate repo.