Dear William,
First of all, I really want to thank you for the great work you’ve done with PIVlab. I truly appreciate the time and effort you’ve invested in it.
While reviewing the way PIVlab calculates the Q‑criterion, I noticed something that might be worth double‑checking. It seems that the current implementation directly uses curlz.^2 (the vorticity squared) inside the formula for Q, while I believe it should use half of this value (or the quantity called "cav" in Matlab "curl" function). Indeed, the second invariant is computed as
Q= 0.5* (||Ω||^2 −||S||^2), where S and Ω are the symmetric and antisymmetric components of the velocity gradient. Therefore, Ω should be
0.5.*vorticity (see equation 2 in "Jeong, J., & Hussain, F. (1995). On the identification of a vortex. Journal of fluid mechanics, 285, 69-94." or equation 2.1b in "Hunt, J. C., Wray, A. A., & Moin, P. (1988). Eddies, streams, and convergence zones in turbulent flows. Studying turbulence using numerical simulation databases, 2. Proceedings of the 1988 summer program.").
At the moment the code uses:
Q = 0.5 * (curlz.^2 - S2).
Moreover, speaking about Matlab "gradient" function, in Matlab help I found:
"Numerical gradients, returned as arrays of the same size as F. The first output FX is always the gradient along the 2nd dimension of F, going across columns. The second output FY is always the gradient along the 1st dimension of F, going across rows."
Therefore, I am wondering if these two lines in the code:
"[dudy, dudx] = gradient(u, -dy, dx);
[dvdy, dvdx] = gradient(v, -dy, dx);"
should be replaced by
"[dudx, dudy] = gradient(u, dx, -dy);
[dvdx, dvdy] = gradient(v, dx,-dy);"
Please let me know if I’m missing something and again, thank you for making this great software available to everyone!
Best regards,
Giorgio Moscato