vortex_criterions module

IMTreatment.vortex_criterions.vortex_criterions.get_NL_residual_vorticity(vectorfield, radius=None, ind=False, mask=None, raw=False)[source]

Return the residual vorticity computed with non-local gradients.

Parameters:
  • vectorfield (VectorField object) –

    .

  • radius (number, optionnal) – The radius used to choose the zone where to compute gamma for each point. If not mentionned, a value is choosen in ordre to have about 8 points in the circle. It allow to get good result, without big computation cost.
  • ind (boolean) – If ‘True’, radius is expressed on number of vectors. If ‘False’ (default), radius is expressed on axis unit.
  • mask (array of boolean, optionnal) – Has to be an array of the same size of the vector field object, gamma will be compute only where mask is ‘False’.
  • raw (boolean, optional) – If ‘False’ (default), a ScalarField is returned, if ‘True’, an array is returned.
IMTreatment.vortex_criterions.vortex_criterions.get_Nk_criterion(vectorfield, mask=None, raw=False)[source]

Return the scalar field of the 2D Nk criterion . Define as “||Omega||/||S||” , with “||Omega||” the rotation rate tensor norm and ||S|| the shear rate tensor norm.

Parameters:
  • vectorfield (VectorField object) –
  • mask (array of boolean, optional) – Has to be an array of the same size of the vector field object, Nk criterion will be compute only where zone is ‘False’.
  • raw (boolean, optional) – If ‘False’ (default), a ScalarField is returned, if ‘True’, an array is returned.

Notes

See J. Jeong and F. Hussain, “On the identification of a vortex,” Journal of Fluid Mechanics, vol. 285, pp. 69–94, 1995.

IMTreatment.vortex_criterions.vortex_criterions.get_angle_deviation(vectorfield, radius=None, ind=False, mask=None, raw=False, local_treatment='none', order=1)[source]

Return the angle deviation field.

Parameters:
  • vectorfield (VectorField object) –

    .

  • radius (number, optionnal) – The radius used to choose the zone where to compute for each field oint. If not mentionned, a value is choosen in ordre to have about 8 points in the circle. It allow to get good result, without big computation cost.
  • ind (boolean) – If ‘True’, radius is expressed on number of vectors. If ‘False’ (default), radius is expressed on axis unit.
  • mask (array of boolean, optionnal) – Has to be an array of the same size of the vector field object, gamma will be compute only where mask is ‘False’.
  • raw (boolean, optional) – If ‘False’ (default), a ScalarField is returned, if ‘True’, an array is returned.
  • local_treatment (string, optional) – If ‘None’ (default), angles are taken directly from the velocity field If ‘galilean_inv’, angles are taken from localy averaged velocity field if ‘local’, angles are taken from velocity fields where the velocity of the central point is localy substracted.
  • order (number, optional) – Order used to compute the deviation (default 1 for sum of differences, 2 for standart deviation (std) or more)
IMTreatment.vortex_criterions.vortex_criterions.get_delta_criterion(vectorfield, mask=None, raw=False)[source]

Return the scalar field of the 2D Delta criterion . Define as “(Q/3)**3 + (R/2)**2” , with “Q” the Q criterion, and “R” the determinant of the jacobian matrice of the velocity.

Parameters:
  • vectorfield (VectorField object) –
  • mask (array of boolean, optional) – Has to be an array of the same size of the vector field object, iota2 will be compute only where zone is ‘False’.
  • raw (boolean, optional) – If ‘False’ (default), a ScalarField is returned, if ‘True’, an array is returned.

Note

Negative values of Delta mean that the local streamline pattern is closed or spiraled.

IMTreatment.vortex_criterions.vortex_criterions.get_divergence(vf, raw=False)[source]

Return a scalar field with the 2D divergence.

Parameters:
  • vf (VectorField or TemporalVectorfields) – Field(s) on which compute shear stress
  • raw (boolean, optional) – If ‘True’, return an arrays, if ‘False’ (default), return a ScalarField object.
Returns:

div – Divergence field(s)

Return type:

ScalarField or TemporalScalarFields

IMTreatment.vortex_criterions.vortex_criterions.get_enstrophy(vectorfield, radius=None, ind=False, mask=None, raw=False)[source]

Return the enstriphy field.

Parameters:
  • vectorfield (VectorField object) –

    .

  • radius (number, optionnal) – The radius used to choose the zone where to integrate enstrophy for each point. If not mentionned, a value is choosen in ordre to have about 8 points in the circle.
  • ind (boolean) – If ‘True’, radius is expressed on number of vectors. If ‘False’ (default), radius is expressed on axis unit.
  • mask (array of boolean, optionnal) – Has to be an array of the same size of the vector field object, gamma will be compute only where mask is ‘False’.
  • raw (boolean, optional) – If ‘False’ (default), a ScalarField is returned, if ‘True’, an array is returned.
IMTreatment.vortex_criterions.vortex_criterions.get_gamma(vectorfield, radius=None, ind=False, kind='gamma1', mask=None, raw=False, dev_pass=False)[source]

Return the gamma scalar field. Gamma criterion is used in vortex analysis. The fonction recognize if the field is ortogonal, and use an apropriate algorithm.

Parameters:
  • vectorfield (VectorField or TemporalVectorFields object) –

    .

  • radius (number, optionnal) – The radius used to choose the zone where to compute gamma for each point. If not mentionned, a value is choosen in ordre to have about 8 points in the circle. It allow to get good result, without big computation cost.
  • ind (boolean) – If ‘True’, radius is expressed on number of vectors. If ‘False’ (default), radius is expressed on axis unit.
  • kind (string) – If ‘gamma1’ (default), compute gamma1 criterion. If ‘gamma1b’, compute gamma1 criterion with velocity corrector. (multiply with the mean velocity) If ‘gamma2’, compute gamma2 criterion (with relative velocities) If ‘gamma2b’, compute gamma2 criterion with a velocity corrector. (hide uniform velocity zone)
  • mask (array of boolean, optionnal) – Has to be an array of the same size of the vector field object, gamma will be compute only where mask is ‘False’.
  • raw (boolean, optional) – If ‘False’ (default), a ScalarField is returned, if ‘True’, an array is returned.
  • dev_pass (boolean, optional) – If ‘True’, the algorithm compute gamma criterion only where the velocity angles deviation is strong (faster if there is few points). Work only with ‘gamma1’
IMTreatment.vortex_criterions.vortex_criterions.get_improved_swirling_strength(vf, raw=False)[source]

Return a scalar field with the improved swirling strength

Parameters:
  • vf (VectorField or Velocityfield) – Field on which compute shear stress
  • raw (boolean, optional) – If ‘True’, return an arrays, if ‘False’ (default), return a ScalarField object.

Notes

Chakraborty, Pinaki, S. Balachandar, et Ronald J. Adrian. « On the Relationships between Local Vortex Identification Schemes ». Journal of Fluid Mechanics 535 (5 juillet 2005): 189‑214.

IMTreatment.vortex_criterions.vortex_criterions.get_iota(vectorfield, mask=None, radius=None, ind=False, raw=False)[source]

Return the iota scalar field. iota criterion is used in vortex analysis. The fonction is only usable on orthogonal fields. Warning : This function is minimum at the saddle point center, and maximum around this point.

Parameters:
  • vectorfield (VectorField object) –
  • mask (array of boolean, optionnal) – Has to be an array of the same size of the vector field object, iota2 will be compute only where zone is ‘False’.
  • radius (number, optionam) – If specified, the velocity field is smoothed with gaussian filter of the given radius before computing the vectors angles.
  • ind (boolean, optional) – If ‘True’, radius is an indice number, if ‘False’, radius if in the field units (default).
  • raw (boolean, optional) – If ‘False’ (default), a ScalarField is returned, if ‘True’, an array is returned.
IMTreatment.vortex_criterions.vortex_criterions.get_kappa(vectorfield, radius=None, ind=False, kind='kappa1', mask=None, raw=False, dev_pass=False)[source]

Return the kappa scalar field. Kappa criterion is used in vortex analysis. The fonction recognize if the field is ortogonal, and use an apropriate algorithm.

Parameters:
  • vectorfield (VectorField object) –
  • radius (number, optionnal) – The radius used to choose the zone where to compute kappa for each point. If not mentionned, a value is choosen in ordre to have about 8 points in the circle. It allow to get good result, without big computation cost.
  • ind (boolean) – If ‘True’, radius is expressed on number of vectors. If ‘False’ (default), radius is expressed on axis unit.
  • kind (string) – If ‘kappa1’ (default), compute kappa1 criterion. If ‘kappa2’, compute kappa2 criterion (with relative velocities).
  • mask (array of boolean, optionnal) – Has to be an array of the same size of the vector field object, kappa will be compute only where mask is ‘False’.
  • raw (boolean, optional) – If ‘False’ (default), a ScalarField is returned, if ‘True’, an array is returned.
  • dev_pass (boolean, optional) – If ‘True’, the algorithm compute gamma criterion only where the velocity angles deviation is strong (faster if there is few points)
IMTreatment.vortex_criterions.vortex_criterions.get_lambda2(vectorfield, mask=None, raw=False)[source]

Return the lambda2 scalar field. According to … vortex are defined by zone of negative values of lambda2. The fonction is only usable on orthogonal fields.

Parameters:
  • vectorfield (VectorField object) –
  • mask (array of boolean, optionnal) – Has to be an array of the same size of the vector field object, iota2 will be compute only where zone is ‘False’.
  • raw (boolean, optional) – If ‘False’ (default), a ScalarField is returned, if ‘True’, an array is returned.
IMTreatment.vortex_criterions.vortex_criterions.get_q_criterion(vectorfield, mask=None, raw=False)[source]

Return the scalar field of the 2D Q criterion . Define as “1/2*(R**2 - S**2)” , with “R” the deformation tensor, norm and “S” the rate of rotation tensor norm.

Parameters:
  • vectorfield (VectorField object) –
  • mask (array of boolean, optional) – Has to be an array of the same size of the vector field object, Q criterion will be compute only where zone is ‘False’.
  • raw (boolean, optional) – If ‘False’ (default), a ScalarField is returned, if ‘True’, an array is returned.
IMTreatment.vortex_criterions.vortex_criterions.get_residual_vorticity(vf, raw=False)[source]

Return a scalar field with the residual of the vorticity. (see Kolar (2007)).

Parameters:
  • vf (VectorField or Velocityfield) – Field on which compute shear stress
  • raw (boolean, optional) – If ‘True’, return an arrays, if ‘False’ (default), return a ScalarField object.
IMTreatment.vortex_criterions.vortex_criterions.get_shear_vorticity(vf, raw=False)[source]

Return a scalar field with the shear vorticity. (see Kolar (2007)).

Parameters:
  • vf (VectorField or VectorFields) – Field on which compute shear stress
  • raw (boolean, optional) – If ‘True’, return an arrays, if ‘False’ (default), return a ScalarField object.
IMTreatment.vortex_criterions.vortex_criterions.get_stokes_vorticity(vf, window_size=2, raw=False)[source]

Return a scalar field with the z component of the vorticity using Stokes’ theorem.

Parameters:
  • vf (VectorField or Velocityfield) – Field on which compute shear stress
  • window_size (integer, optional) – Window size for stokes approximation of the vorticity.
  • raw (boolean, optional) – If ‘True’, return an arrays, if ‘False’ (default), return a ScalarField object.

Notes

Seal et al., “Quantitative characteristics of a laminar, unsteady necklace vortex system at a rectangular block-flat plate juncture,” Journal of Fluid Mechanics, vol. 286, pp. 117–135, 1995.

IMTreatment.vortex_criterions.vortex_criterions.get_swirling_strength(vf, raw=False)[source]

Return a scalar field with the swirling strength (imaginary part of the eigenvalue of the velocity Jacobian)

Parameters:
  • vf (VectorField or Velocityfield) – Field on which compute shear stress
  • raw (boolean, optional) – If ‘True’, return an arrays, if ‘False’ (default), return a ScalarField object.

Notes

Zhou, J., R. J. Adrian, S. Balachandar, et T. M. Kendall. « Mechanisms for generating coherent packets of hairpin vortices in channel flow ». Journal of Fluid Mechanics 387 (mai 1999): 353‑96.

IMTreatment.vortex_criterions.vortex_criterions.get_vorticity(vf, raw=False)[source]

Return a scalar field with the z component of the vorticity.

Parameters:
  • vf (VectorField or TemporalVectorfields) – Field(s) on which compute shear stress
  • raw (boolean, optional) – If ‘True’, return an arrays, if ‘False’ (default), return a ScalarField object.
Returns:

vort – Vorticity field(s)

Return type:

ScalarField or TemporalScalarFields