Follow

# How to compute weak vortex core hulls using the Lambda2 user-defined math function (UDMF).

The Lamda2 scalar has been used to detect vortex core hulls in regions of weak vortices.

Procedure
Computing the Lambda2 user-defined math function (UDMF) is done in three steps (with accompanying command language scripts below for examples).

1. Extract the velocity components as scalar variables, and then pre-compute the gradient vectors of each of these components (which gives you the velocity gradient tensor defined by three vectors).

Note: the below scripts are general examples.  The field part(s) need to be selected in place of the "part: select_all" in order to compute these functions.

variables: activate velocity
part: select_all
variables: evaluate Vx = velocity[X]
variables: evaluate Vy = velocity[Y]
variables: evaluate Vz = velocity[Z]

2. Specify these three gradient vectors in the lambda2 user-defined math function to compute the lambda2 scalar variable.

part: select_all
variables: evaluate Lambda2 = Lambda2(plist,gVx,gVy,gVz)

3. Finally compute an iso-surface on this lambda2 scalar variable at the value of zero.  This will give you the vortex hulls associated with the lambda2 eigenvalue = 0.

part: select_all
isos: begin
isos: variable Lambda2
isos: value 0.00000e+000
isos: type isosurface
isos: end
isos: create

Documentation
The equation and code for computing the lambda2 function are documented in the libudmf-lambda2.c file located under the CEI installation directory; i.e. ../CEI/ensight100/src/math_functions/lambad2/libudmf-lambda2.c

Please refer to EnSight's online documentation under
Help > Interface Manual > 4 User Defined Math Functions
for a more detailed discussion on the implementation and use of user-defined math functions.