Q Criterion Iso-Value Calculator for Fluid Flow
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
This calculator computes the Q-criterion iso-value, a scalar used in fluid dynamics to identify vortex cores in a flow field. You enter the strain-rate tensor components (du/dx, dv/dy, dw/dz) and the vorticity tensor components (dv/dx – du/dy, etc.), and the calculator returns the Q value, which is positive in regions dominated by rotation (vortices) and negative in regions dominated by strain (shear). The Q-criterion is defined as Q = 0.5 * (||Ω||² – ||S||²), where Ω is the vorticity tensor and S is the strain-rate tensor.
Formula
The Q-criterion is defined as:
Q = ½ (‖Ω‖² − ‖S‖²)
where:
- ‖Ω‖² is the Frobenius norm squared of the vorticity tensor (rotation rate), computed as ΩijΩij.
- ‖S‖² is the Frobenius norm squared of the strain-rate tensor (deformation rate), computed as SijSij.
In index notation, for an incompressible flow (where the trace of S is zero), the expanded form is:
Q = −½ (∂u/∂x)² − (∂v/∂y)² − (∂w/∂z)² − (∂u/∂y)(∂v/∂x) − (∂u/∂z)(∂w/∂x) − (∂v/∂z)(∂w/∂y) + ½ (∂u/∂y)² + (∂v/∂x)² + (∂u/∂z)² + (∂w/∂x)² + (∂v/∂z)² + (∂w/∂y)²
But the calculator uses the tensor norm form, which is equivalent and more compact. Each velocity gradient component has units of 1/s (reciprocal seconds), so Q has units of 1/s².
Worked Example
Using the default values from the calculator:
- du/dx = 2 s⁻¹
- dv/dy = 1 s⁻¹
- dw/dz = −1 s⁻¹
- du/dy = 0.5 s⁻¹
- dv/dx = 1.5 s⁻¹
- All other gradients = 0
First, compute the antisymmetric (vorticity) components:
Ωxy = ½(dv/dx − du/dy) = ½(1.5 − 0.5) = 0.5 s⁻¹
Ωxz = ½(du/dz − dw/dx) = 0
Ωyz = ½(dw/dy − dv/dz) = 0
Thus ‖Ω‖² = 2(0.5²) = 0.5 s⁻² (the factor 2 accounts for the symmetric pairs).
Now compute the symmetric (strain) components:
Sxx = du/dx = 2 s⁻¹
Syy = dv/dy = 1 s⁻¹
Szz = dw/dz = −1 s⁻¹
Sxy = ½(du/dy + dv/dx) = ½(0.5 + 1.5) = 1.0 s⁻¹
Other strain components = 0.
‖S‖² = 2² + 1² + (−1)² + 2(1.0²) = 4 + 1 + 1 + 2 = 8 s⁻²
Then Q = ½(0.5 − 8) = −3.75 s⁻²
The calculator gives Q = −3.75, matching the manual calculation.
When to Use the Q-Criterion
The Q-criterion is a vortex identification method used in computational fluid dynamics (CFD) post-processing. It is most useful when you want to visualize or quantify coherent vortical structures in turbulent flows, such as wingtip vortices, trailing vortices behind vehicles, or turbulent boundary layers. A positive Q value indicates that the local rotation rate exceeds the strain rate, meaning the region is vortex-dominated. A negative Q indicates strain-dominated flow, typical of shear layers or boundary layers.
This calculator is handy when you have velocity gradient data from a CFD simulation (e.g., from a probe point or a cell center) and want to quickly compute Q without writing a script. It is also educational for understanding how the velocity gradient tensor decomposes into rotation and deformation.
How to Choose the Right Velocity Gradients
To use the calculator correctly, you need the nine components of the velocity gradient tensor ∇u, which in 3D is a 3×3 matrix:
- Row 1: ∂u/∂x, ∂u/∂y, ∂u/∂z
- Row 2: ∂v/∂x, ∂v/∂y, ∂v/∂z
- Row 3: ∂w/∂x, ∂w/∂y, ∂w/∂z
In CFD, these are typically available as cell-centered or node-centered data. Ensure the coordinate system is consistent (e.g., Cartesian x, y, z). If you are using a 2D simulation, set all gradients involving z to zero. For incompressible flow, the trace (du/dx + dv/dy + dw/dz) should be zero; if it isn’t, you may have a compressible flow or a numerical error.
Common Mistakes and Misconceptions
- Using the wrong sign convention: Some texts define Q as ‖Ω‖² − ‖S‖² without the ½ factor. This calculator uses the standard ½ factor, which is common in literature (e.g., Hunt et al., 1988). Always check which convention your reference uses.
- Mixing up the tensor components: The off-diagonal components of the strain tensor are ½(∂u/∂y + ∂v/∂x), not simply ∂u/∂y. The calculator correctly uses the sum of the two velocity gradients for the strain norm.
- Forgetting the factor of 2 for off-diagonal terms: When computing the Frobenius norm, the off-diagonal terms appear twice (e.g., Sxy² appears as SxySxy and SyxSyx), so you must multiply the squared off-diagonal component by 2. The calculator does this automatically.
- Units: Ensure all velocity gradients are in the same units (e.g., 1/s). If you have velocities in m/s and distances in mm, convert to consistent units first.
Limitations of the Q-Criterion
The Q-criterion is a local, instantaneous measure. It does not track vortices over time, and it can be sensitive to noise in the velocity field. In highly turbulent flows, the threshold for Q (the iso-value) is often chosen arbitrarily to visualize structures; there is no universal threshold. Also, Q is not Galilean invariant? Actually, it is Galilean invariant because it depends only on velocity gradients, not on the absolute velocity. However, it is not rotationally invariant? It is invariant under rotation of the coordinate system, but the decomposition into strain and vorticity depends on the frame of reference in a rotating frame. For most engineering applications, this is not an issue.
Another limitation: Q only considers the instantaneous velocity gradient. In flows with strong unsteady effects, the vortex cores may be better identified by other criteria like λ₂ or the swirling strength. Always compare with other methods if you are uncertain.
Frequently Asked Questions
What does a positive Q value mean?
A positive Q means that the local rotation rate (vorticity) dominates over the strain rate. This indicates a vortex core. The larger the positive value, the stronger the rotation relative to deformation. In visualization, you typically plot iso-surfaces of Q at a positive threshold to show vortex tubes.
Can I use this for 2D flows?
Yes. For 2D flows, set all gradients involving the z-component (du/dz, dw/dx, dv/dz, dw/dy, dw/dz) to zero. The calculator will still compute Q correctly, though in 2D the Q-criterion reduces to a simpler form. Note that in 2D, Q is often defined differently in some texts, but the tensor norm formula remains valid.
What if my velocity gradients are not in units of 1/s?
You must convert them to reciprocal seconds before entering them. For example, if you have velocities in m/s and distances in mm, divide the velocity by the distance in meters to get 1/s. The calculator assumes all inputs are in the same units; it does not perform unit conversion.
Why is my Q value negative for a simple shear flow?
In simple shear flow (e.g., u = y, v = 0), the strain rate is equal to the vorticity magnitude, so Q = 0. If you have a shear flow with additional strain (e.g., a boundary layer), Q can be negative because strain dominates. Negative Q is normal in shear layers; it does not mean the calculation is wrong.
How do I choose the iso-value for visualization?
There is no universal threshold. A common practice is to start with a small positive value (e.g., 1% of the maximum Q in the domain) and adjust until the vortex structures are clearly visible. Some studies use a value that captures a certain percentage of the total enstrophy. Experiment with different thresholds to find what best reveals the structures of interest.
Does the Q-criterion work for compressible flows?
Yes, but you must account for the non-zero divergence. The standard Q formula still applies, but the interpretation may change because the strain tensor includes dilatation. Some researchers use a modified Q that subtracts the dilatation term. For most low-Mach flows, the original Q is fine.
Related
Formula used
in dudx | du/dx | 1/s | 2 | 0 in dvdy | dv/dy | 1/s | 1 | 0 in dwdz | dw/dz | 1/s | -1 | 0 in dudy | du/dy | 1/s | 0.5 | 0 in dvdx | dv/dx | 1/s | 1.5 | 0 in dudz | du/dz | 1/s | 0 | 0 in dwdx | dw/dx | 1/s | 0 | 0 in dvdz | dv/dz | 1/s | 0 | 0 in dwdy | dw/dy | 1/s | 0 | 0 out q | Q-criterion | 1/s^2 | 0.5*( ( (dvdx-dudy)^2 + (dudz-dwdx)^2 + (dwdy-dvdz)^2 ) - ( (2*dudx)^2 + (2*dvdy)^2 + (2*dwdz)^2 + (dudy+dvdx)^2 + (dudz+dwdx)^2 + (dvdz+dwdy)^2 ) ) | 2 out enstrophy | Enstrophy (Ω²) | 1/s^2 | (dvdx-dudy)^2 + (dudz-dwdx)^2 + (dwdy-dvdz)^2 | 2 out strain | Strain rate (S²) | 1/s^2 | (2*dudx)^2 + (2*dvdy)^2 + (2*dwdz)^2 + (dudy+dvdx)^2 + (dudz+dwdx)^2 + (dvdz+dwdy)^2 | 2
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.