valib
Vortex Analysis LIBrary
User functions

User-level VALIB functions. More...

Functions

VA_DEVICE_FUN void valib_contrarotation (VA_DEVICE_ADDR VA_REAL *A, VA_DEVICE_ADDR VA_REAL *S_RAVG)
 Average contrarotation (a.k.a. \( S_{RAVG} \)) [20]. More...
 
VA_DEVICE_FUN void valib_corotation (VA_DEVICE_ADDR VA_REAL *A, VA_DEVICE_ADDR VA_REAL *omega_RAVG)
 Average corotation (a.k.a. \(\boldsymbol{\omega}_{RAVG}\)) [13]. More...
 
VA_DEVICE_FUN void valib_delta (VA_REAL *A, VA_REAL *delta)
 \( \Delta \)-criterion [3] [4] [18] More...
 
VA_DEVICE_FUN void valib_lambda2 (VA_REAL *A, VA_REAL *lambda_2)
 \( \lambda _2 \)-criterion [9] More...
 
VA_DEVICE_FUN void valib_qcriterion (VA_REAL *A, VA_REAL *qcriterion)
 \(Q\)-criterion [8] More...
 
VA_DEVICE_FUN void valib_qdcriterion (VA_REAL *A, VA_REAL *qd_criterion)
 \(Q_D\)-criterion [15] More...
 
VA_DEVICE_FUN void valib_qmcriterion (VA_REAL *A, VA_REAL *qm_criterion)
 \(Q_M\)-criterion [11] More...
 
VA_DEVICE_FUN void valib_qwcriterion (VA_REAL *A, VA_REAL *qw_criterion)
 \(Q_W\)-criterion [12] More...
 
VA_DEVICE_FUN void valib_rortex (VA_REAL *A, VA_REAL *rortex)
 The Rortex vector \( \boldsymbol R \) (a.k.a. the Vortex vector or the Liutex vector) [6] [16]. More...
 
VA_DEVICE_FUN void valib_swirling_strength (VA_REAL *A, VA_REAL *lambda_ci, VA_REAL *lambda_cr)
 Swirling strength criterion (a.k.a. \(\lambda_{ci}\)-criterion) [19] [2]. More...
 
VA_DEVICE_FUN void valib_triple_decomposition (VA_DEVICE_ADDR VA_REAL *A, int *num_intervals, VA_DEVICE_ADDR VA_REAL *residual_vorticity, VA_DEVICE_ADDR VA_REAL *residual_strain, VA_DEVICE_ADDR VA_REAL *shear)
 Triple Decomposition Method (TDM, a.k.a. residual vorticity and residual strain rate) [14], [10]. More...
 
VA_DEVICE_FUN void valib_triple_decomposition_4norms (VA_DEVICE_ADDR VA_REAL *A, int *num_intervals, VA_DEVICE_ADDR VA_REAL *residual_vorticity, VA_DEVICE_ADDR VA_REAL *residual_strain, VA_DEVICE_ADDR VA_REAL *shear_vorticity, VA_DEVICE_ADDR VA_REAL *shear_strain)
 Triple Decomposition Method (TDM, a.k.a. residual vorticity and residual strain rate) [14], [10]. More...
 

Detailed Description

User-level VALIB functions.


Function Documentation

◆ valib_contrarotation()

VA_DEVICE_FUN void valib_contrarotation ( VA_DEVICE_ADDR VA_REAL *  A,
VA_DEVICE_ADDR VA_REAL *  S_RAVG 
)

Average contrarotation (a.k.a. \( S_{RAVG} \)) [20].

The symmetric tensor of average contrarotation at a point \(x_0\) is defined as a spherical average over a unit sphere \(\sigma(0,1)\) as

\[ S_{RAVG}(x_0) = \beta\ \frac{\iint\limits_{\sigma(0,1)} S_{3,RES}(x_0, n)\ d\sigma} {\iint\limits_{\sigma(0,1)}\ d\sigma} = \frac{\beta}{4\pi}\iint\limits_{\sigma(0,1)} S_{3,RES}(x_0, n)\ d\sigma, \]

where \(\beta\) is a scaling factor. The natural choice \(\beta=5/2\) is derived in [20], and this value is used also here. The tensor \( S_{3,RES}(x_0, n) \) is obtained by 2-D analysis of the residual strain rate in a cutting plane given by a normal \(n\), and it corresponds to the contrarotation of line segments near a point. Details can be found in [20] . It should not be confused with the \( S_{RES} \) tensor of the 3-D residual strain rate from the Triple Decomposition Method [14].

The average-contrarotation tensor can be seen as the strain-rate tensor corrected by the effect of shear. As shown in [20], the norm of the tensor \(\| S_{RAVG} \|_F\) can be effectively used for vizualising high strain-rate zones.

Average contrarotation is determined from deviatoric quantities, thus it can be applied to compressible flows for which

\[ \mbox{trace}(\nabla u) \neq 0. \]

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[out]S_RAVG3x3 matrix with the tensor of averaged contrarotation, stored column-wise

Definition at line 55 of file contrarotation.h.

◆ valib_corotation()

VA_DEVICE_FUN void valib_corotation ( VA_DEVICE_ADDR VA_REAL *  A,
VA_DEVICE_ADDR VA_REAL *  omega_RAVG 
)

Average corotation (a.k.a. \(\boldsymbol{\omega}_{RAVG}\)) [13].

The vector of average corotation at a point \(x_0\) is defined as a spherical average over a unit sphere \(\sigma(0,1)\) as

\[ \boldsymbol{\omega}_{RAVG}(x_0) = 3\ \frac{\iint\limits_{\sigma(0,1)} \boldsymbol{\omega}_{RES}(x_0, n)\ d\sigma} {\iint\limits_{\sigma(0,1)}\ d\sigma} = \frac{3}{4 \pi}\iint\limits_{\sigma(0,1)} \boldsymbol{\omega}_{RES}(x_0, n)\ d\sigma \]

The vector

\[ {\boldsymbol \omega}_{RES}(x_0, n) = 2\omega_{RES}\ n \]

corresponds to the corotation of line-segments near a point in a cutting plane given by a normal \(n\).

The length of the vector \( \omega_{RES} \) corresponds to the residual vorticity (see [14]) in the given 2-D plane determined as

\[ \omega_{RES} = \left\{ \begin{array}{ll} \omega - \omega_{SH} = (\mbox{sgn}\ \omega)( |\omega| - |s_D|) & \mbox{for}\ |\omega|\ge|s_D|, \\ 0 & \mbox{for}\ |\omega|\le|s_D|, \end{array} \right. \]

where \( \omega_{SH} \) stands for the vorticity due to shear, \( |s_D| \) is the planar deviatoric principal strain-rate magnitude

\[ |s_D| = \left( \sqrt{(u_x - v_y)^2 + (u_y + v_x)^2}\right)/2, \]

and \(\omega\) is the planar vorticity

\[ \omega = (v_x - u_y)/2. \]

These quantities are derived from a velocity gradient tensor in the 2-D plane

\[\left( \begin{array}{cc} u_{x} & u_{y} \\ v_{x} & v_{y} \end{array} \right) \]

The average-corotation vector can be seen as a vector of vorticity corrected by the effect of shear. Therefore, as shown in [13], the magnitude of the vector \(|\boldsymbol{\omega}_{RAVG}|\) can be effectively used for vizualising vortices, unlike the magnitude of the (uncorrected) vorticity vector \(|\boldsymbol{\omega}|\), \(\boldsymbol{\omega} = \nabla \times u\), which cannot be effectively used for vizualizing vortices in the presence of strong ‘outer’ shear, such as in boundary layers.

Average corotation is determined from deviatoric quantities, thus it can be applied to compressible flows for which

\[ \mbox{trace}(\nabla u) \neq 0. \]

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[out]omega_RAVGaverage-corotation vector of length 3

Definition at line 89 of file corotation.h.

◆ valib_delta()

VA_DEVICE_FUN void valib_delta ( VA_REAL *  A,
VA_REAL *  delta 
)

\( \Delta \)-criterion [3] [4] [18]

Vortices are defined as the regions in which the velocity gradient \( \nabla u \) has a conjugate pair of complex eigenvalues. This corresponds to

\[ \Delta = \left(\frac{Q}{3} \right)^3 + \left(\frac{R}{2}\right)^2 > 0, \]

where \( Q \) is the second invariant of \( \nabla u \), and \( R \) is the third invariant (the determinant) of \( \nabla u \). Incompressibility is assumed in the derivation of this criterion, i.e.

\[ \mbox{trace}(\nabla u) = 0. \]

The criterion is derived from the discriminant of the characteristic polynomial

\[ \lambda ^3 + Q\lambda - R = 0, \]

with \( \Delta = 0 \) corresponding to the transition from three real eigenvalues to the case of one real eigenvalue and a conjugate pair of complex eigenvalues.

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[out]deltavalue of \( \Delta \)

Definition at line 49 of file delta.h.

◆ valib_lambda2()

VA_DEVICE_FUN void valib_lambda2 ( VA_REAL *  A,
VA_REAL *  lambda_2 
)

\( \lambda _2 \)-criterion [9]

Vortex is defined as a connected fluid region with two negative eigenvalues of the symmetric tensor

\[ S^2 + \Omega^2, \]

where \( \Omega = \frac{1}{2} ( \nabla u - ( \nabla u )^T ) \) is the antisymmetric part and \( S = \frac{1}{2} ( \nabla u + (\nabla u )^T )\) is the symmetric part of the velocity gradient \( \nabla u \).

In the underlying search for a local pressure minimum across a vortex, the quantity \(S^2 + \Omega^2\) is employed as an approximation of the pressure Hessian after removing the unsteady irrotational straining and viscous effects from the strain-rate transport equation for incompressible fluids. The eigenvalues of \(S^2 + \Omega^2\) are real and if they are ordered,

\[ \lambda_1 \geq \lambda_2 \geq \lambda_3, \]

the condition on two negative eigenvalues is equivalent to

\[ \lambda_2 < 0, \]

hence the name of the criterion.

Incompressibility is assumed in the derivation of this criterion, i.e.

\[ \mbox{trace}(\nabla u) = 0, \]

and the criterion should not be applied to flows with significant effects of compressibility.

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[out]lambda_2the second eigenvalue of \(S^2 + \Omega^2\)

Definition at line 59 of file lambda2.h.

◆ valib_qcriterion()

VA_DEVICE_FUN void valib_qcriterion ( VA_REAL *  A,
VA_REAL *  qcriterion 
)

\(Q\)-criterion [8]

Vortices are identified as connected fluid regions with a positive second invariant of the velocity-gradient tensor \( \nabla u \), which for an incompressible flow simplifies to

\[ Q = \frac{1}{2} \left( \| \Omega \|_F^2 - \| S \|_F^2 \right) > 0, \]

where \( \Omega = \frac{1}{2} ( \nabla u - ( \nabla u )^T ) \) is the antisymmetric part and \( S = \frac{1}{2} ( \nabla u + ( \nabla u )^T ) \) is the symmetric part of the velocity gradient \( \nabla u \). The criterion is fulfilled in the regions where the vorticity magnitude prevails over the strain-rate magnitude.

Incompressibility is assumed in the derivation of this criterion, i.e.

\[ \mbox{trace}(\nabla u) = 0. \]

For compressible flows, variants taking compressibility into account, i.e. \(Q_D\), \(Q_M\), or \(Q_W\), should be used.

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[out]qcriterionvalue of \( Q \)

Definition at line 46 of file qcriterion.h.

◆ valib_qdcriterion()

VA_DEVICE_FUN void valib_qdcriterion ( VA_REAL *  A,
VA_REAL *  qd_criterion 
)

\(Q_D\)-criterion [15]

Vortices are identified as connected fluid regions with a positive quantity

\[ Q_D = \frac{1}{2} \left( \| \Omega \|_F^2 - \| S_D \|_F^2 \right) > 0, \]

where \( \Omega = \frac{1}{2} ( \nabla u - ( \nabla u )^T ) \), and \( S_D = \frac{1}{2} ( (\nabla u)_D + (\nabla u )_D^T )\) is the symmetric part of the deviatoric part of the velocity gradient \( \nabla u \),

\[ (\nabla u)_D = \nabla u - \frac{1}{3} \mbox{trace}(\nabla u)\ I. \]

The criterion is a modification of the \(Q\)-criterion, which corrects the effect of combressibility. It is applicable also to compressible flows where

\[ \mbox{trace}(\nabla u) \neq 0. \]

An alternative might be using the \(Q_M\) or \(Q_W\) criterions, which better suppress the effect of shear. This is important in regions with strong ‘outer’ shear, such as in boundary layers.

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[out]qd_criterionvalue of \( Q_D \)

Definition at line 45 of file qdcriterion.h.

◆ valib_qmcriterion()

VA_DEVICE_FUN void valib_qmcriterion ( VA_REAL *  A,
VA_REAL *  qm_criterion 
)

\(Q_M\)-criterion [11]

Acording to the ‘modified \(Q\)-criterion’, vortices are identified as connected fluid regions with a positive quantity

\[ Q_M = \frac{1}{2} \left( \| \Omega \|_F^2 - \frac{3}{2} \| S_D \|_F^2 \right) > 0, \]

where \( \Omega = \frac{1}{2} ( \nabla u - ( \nabla u )^T ) \), and \( S_D = \frac{1}{2} ( (\nabla u)_D + (\nabla u )_D^T )\) is the symmetric part of the deviatoric part of the velocity gradient \( \nabla u \),

\[ (\nabla u)_D = \nabla u - \frac{1}{3} \mbox{trace}(\nabla u)\ I. \]

The criterion is a modification of the \(Q\)-criterion, and it is based on corotation of line segments in principal planes of the strain-rate tensor. \(Q_M\) corrects the effect of compressibility and eliminates the effect of shear. Since it is derived from the deviatoric part of the velocity gradient \(\nabla u\), it is applicable also to compressible flows where

\[ \mbox{trace}(\nabla u) \neq 0. \]

The criterial quantities \(Q_M\), \(Q_D\) and \(Q\) can be related as

\[ Q_M = Q + \frac{II_S}{2} = Q_D + \frac{II_{DS}}{2}, \]

where \( II_S \) and \( II_{DS} \) are the second invariants of \( S \) and \( S_D \), respectively. An alternative might be using the \(Q_W\) criterion, which is less strict than \(Q_M\).

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[out]qm_criterionvalue of \( Q_M \)

Definition at line 54 of file qmcriterion.h.

◆ valib_qwcriterion()

VA_DEVICE_FUN void valib_qwcriterion ( VA_REAL *  A,
VA_REAL *  qw_criterion 
)

\(Q_W\)-criterion [12]

Vortices are identified as connected fluid regions with a positive quantity

\[ Q_W = \frac{1}{2} \left( \| \Omega \|_F^2 - \frac{6}{5} \| S_D \|_F^2 \right) > 0, \]

where \( \Omega = \frac{1}{2} ( \nabla u - ( \nabla u )^T ) \), and \( S_D = \frac{1}{2} ( (\nabla u)_D + (\nabla u )_D^T )\) is the symmetric part of the deviatoric part of the velocity gradient \( \nabla u \),

\[ (\nabla u)_D = \nabla u - \frac{1}{3} \mbox{trace}(\nabla u)\ I. \]

The criterion is a modification of the \(Q\)-criterion, and it is based on spherical averaging of the (planar) Okubo-Weiss criterion. \(Q_W\) corrects the effect of compressibility and eliminates the effect of shear. Since it is derived from the deviatoric part of the velocity gradient \(\nabla u\), it is applicable also to compressible flows where

\[ \mbox{trace}(\nabla u) \neq 0. \]

An alternative might be using the \(Q_M\) criterion, which is stricter than \(Q_W\).

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[out]qw_criterionvalue of \( Q_W \)

Definition at line 48 of file qwcriterion.h.

◆ valib_rortex()

VA_DEVICE_FUN void valib_rortex ( VA_REAL *  A,
VA_REAL *  rortex 
)

The Rortex vector \( \boldsymbol R \) (a.k.a. the Vortex vector or the Liutex vector) [6] [16].

Vortex is defined as a region for which \( \nabla u \) has a pair of complex (conjugate) eigenvalues,

\[ \lambda_{cr} \pm \lambda_{ci} i, \]

where \( \lambda_{cr} \) and \( \lambda_{ci} \) are the real and the imaginary parts of the complex eigenvalue of \( \nabla u \), respectively.

The result is a vector with the direction of \( \boldsymbol r \), which is the eigenvector corresponding to the real eigenvalue \( \lambda_{r} \).

The orientation of the eigenvector is selected so that

\[ \boldsymbol \omega \cdot \boldsymbol r > 0, \]

where \( \boldsymbol \omega \) is the vorticity vector.

Then the Rortex vector is defined in [6], equation (13), as

\[ \boldsymbol R = R \boldsymbol r = \left\{ \boldsymbol \omega \cdot \boldsymbol r - \sqrt{(\boldsymbol \omega \cdot \boldsymbol r)^2 - 4\lambda_{ci}^2} \right\} \boldsymbol r. \]

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[out]rortexRortex vector of length 3

Definition at line 53 of file rortex.h.

◆ valib_swirling_strength()

VA_DEVICE_FUN void valib_swirling_strength ( VA_REAL *  A,
VA_REAL *  lambda_ci,
VA_REAL *  lambda_cr 
)

Swirling strength criterion (a.k.a. \(\lambda_{ci}\)-criterion) [19] [2].

Vortex is defined as a region for which \( \nabla u \) has a pair of complex (conjugate) eigenvalues,

\[ \lambda_{cr} \pm \lambda_{ci} i, \]

where \( \lambda_{cr} \) and \( \lambda_{ci} \) are the real and the imaginary parts of the complex eigenvalue of \( \nabla u \), respectively.

Absolute value of the imaginary part of these eigenvalues is used to determine a vortex region in [19], i.e.

\[ \lambda_{ci} \ge \varepsilon. \]

In addition, according to [2], a vortex region needs to satisfy

\[ -\kappa \le \lambda_{cr}/\lambda_{ci} \le \delta, \]

It can be seen as a generalization of the \(\Delta\)-criterion, and these two criteria are equivalent for zero thresholds, i.e.

\[ \Delta = 0 \Leftrightarrow \lambda_{ci} = 0. \]

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[out]lambda_ciabsolute value of the imaginary part of the complex eigenvalue of \( \nabla u \), \( \lambda_{ci} \)
[out]lambda_crthe real part of the complex eigenvalue of \( \nabla u \), \( \lambda_{cr} \)

Definition at line 56 of file swirling_strength.h.

◆ valib_triple_decomposition()

VA_DEVICE_FUN void valib_triple_decomposition ( VA_DEVICE_ADDR VA_REAL *  A,
int *  num_intervals,
VA_DEVICE_ADDR VA_REAL *  residual_vorticity,
VA_DEVICE_ADDR VA_REAL *  residual_strain,
VA_DEVICE_ADDR VA_REAL *  shear 
)

Triple Decomposition Method (TDM, a.k.a. residual vorticity and residual strain rate) [14], [10].

Evaluates the norms of the quantities appearing in the triple decomposition of the velocity gradient following [14],

\[ \nabla u = S_{RES} + \Omega_{RES} + (\nabla u)_{SH} \]

where the symmetric tensor \( S_{RES} \) corresponds to the irrotational straining motion (residual strain rate), \( \Omega_{RES} \) is the antisymmetric tensor of rigid-body rotation (residual vorticity), and \( (\nabla u)_{SH} \) contains the effective pure shearing motion. In the Basic Reference Frame (BRF), the last tensor has a strictly asymmetric form, i.e.

\[ u_{i,j} = 0\ \mbox{or}\ u_{j,i} = 0\ \mbox{for all}\ i,j. \]

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[in]num_intervalsnumber of steps, i.e. division of the interval \( [0,\pi] \)
[out]residual_vorticityFrobenius norm of the tensor of rigid rotation \( \|\Omega_{RES}\|_F \)
[out]residual_strainFrobenius norm of the tensor of irrotational straining \( \|S_{RES}\|_F \)
[out]shearFrobenius norm of the tensor related to the shear contribution \( \|(\nabla u)_{SH}\|_F \)

Definition at line 193 of file triple_decomposition.h.

◆ valib_triple_decomposition_4norms()

VA_DEVICE_FUN void valib_triple_decomposition_4norms ( VA_DEVICE_ADDR VA_REAL *  A,
int *  num_intervals,
VA_DEVICE_ADDR VA_REAL *  residual_vorticity,
VA_DEVICE_ADDR VA_REAL *  residual_strain,
VA_DEVICE_ADDR VA_REAL *  shear_vorticity,
VA_DEVICE_ADDR VA_REAL *  shear_strain 
)

Triple Decomposition Method (TDM, a.k.a. residual vorticity and residual strain rate) [14], [10].

Evaluates the norms of the quantities appearing in the triple decomposition of the velocity gradient following [14],

\[ \nabla u = S_{RES} + \Omega_{RES} + (\nabla u)_{SH} \]

where the symmetric tensor \( S_{RES} \) corresponds to an irrotational straining motion (residual strain rate), \( \Omega_{RES} \) is an antisymmetric tensor of rigid-body rotation (residual vorticity), and \( (\nabla u)_{SH} \) contains the effective pure shearing motion. In the Basic Reference Frame (BRF), the last tensor has a strictly asymmetric form, i.e.

\[ u_{i,j} = 0\ \mbox{or}\ u_{j,i} = 0\ \mbox{for all}\ i,j. \]

The difference from the valib_triple_decomposition function is that the tensor of shear is transformed from BRF to the original coordinate system and there further decomposed into the symmetric and antisymmetric parts,

\[ (\nabla u)_{SH} = S_{SH} + \Omega_{SH}. \]

Norms of these parts are returned by this function individually.

Parameters
[in]A3x3 matrix of velocity gradient stored column-wise
[in]num_intervalsnumber of steps, i.e. division of the interval \( [0,\pi] \)
[out]residual_vorticityFrobenius norm of the tensor of rigid rotation \( \|\Omega_{RES}\|_F \)
[out]residual_strainFrobenius norm of the tensor of irrotational straining \( \|S_{RES}\|_F \)
[out]shear_vorticityFrobenius norm of the tensor related to the shear contribution to vorticity \( \|\Omega_{SH}\|_F \)
[out]shear_strainFrobenius norm of the tensor related to the shear contribution to strain-rate \( \|S_{SH}\|_F \)

Definition at line 340 of file triple_decomposition.h.