tomchor / Oceanostics.jl

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

Adds Q (from Q-criterion) calculation #125

Closed tomchor closed 1 year ago

tomchor commented 1 year ago

This PR adds the calculation of the "Q" velocity gradient tensor invariant. This is useful for the identification and visualization of vortices in fluid dynamics (a comparative study of similar methods can be found here.)

The definition and nomenclature comes from the equation for the eigenvalues of the velocity gradient tensor $\nabla \vec u$:

\lambda^3+P \lambda^2+Q \lambda+T=0

$Q$ is then defined as

Q=\frac{1}{2}\left(\|\bf\Omega\|^2-\|\bf S\|^2\right)

where $\bf S$ is the strain rate tensor and $\bf \Omega$ is the vorticity tensor (i.e. the symmetric and antisymmetric parts of the velocity gradient tensor, respectively).

This PR adds KernelFunctionOperations for StrainRateTensorModulus ($|| \bf S ||$), VorticityTensorModulus ($|| \bf \Omega ||$), and Q.

PS: I don't love this nomenclature since it gives basically zero information on what it's called, but I haven't ever seen it being called something else. If anyone knows of a better name for this, lmk.