Q criterion

24 views
Skip to first unread message

Giorgio Moscato

unread,
Jul 29, 2025, 1:56:38 PMJul 29
to PIVlab
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 mechanics285, 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



thielickeoptolution

unread,
Jul 30, 2025, 6:25:05 AMJul 30
to PIVlab
Dear  Giorgio,
thanks for your input. Have you compared the outputs and the difference it gives?
I validated the code in PIVlab against the output from Paraview. I got identical plots when computing the Q-criterion in PIVlab and in Paraview. Do you have the possibility to validate the code with some known results?

Giorgio Moscato

unread,
Aug 4, 2025, 3:09:27 PMAug 4
to PIVlab
Dear William,
I apologize for the delay in getting back to you, but I wanted to run a few tests before responding. I’ve tested some of my data using the Q-criterion scripts from PIVlab, ParaView, and a custom script I developed. While the results are quite similar in some cases, in others, my script and ParaView agree closely, whereas PIVlab shows some differences.

If you don’t mind, I’d like to share an example with you by email, including the velocity field and my script.

Please let me know if you’d be interested in taking a look at it.

Best regards

Giorgio  

thielickeoptolution

unread,
Aug 6, 2025, 7:22:18 AMAug 6
to PIVlab
Dear  Giorgio, yes please send me more information via email (https://optolution.com/de/unternehmen/team/)
Reply all
Reply to author
Forward
0 new messages