## Calculate Swirl Strength

Problem: How do I calculate the Swirling Strength criterion (Lambda-Ci)? Solution: Use a Tecplot Macro to automate the calculation. Make sure Tecplot is aware of the variables representing your velocity field (Analyze->Field Variables menu).   The commands are as follow: Calculate the tensor of velocity gradients. This command can be obtained by recording the Analyze->Calculate Variables…->Velocity Gradient (tensor) action in Tecplot’s user interface (UI). \$!EXTENDEDCOMMAND COMMANDPROCESSORID = ‘CFDAnalyzer4’ COMMAND = […]

## Calling a Macro from Another Macro

Problem: I have a few macros that I use often and want to call them from within another macro. Solution: Tecplot 360 allows for macros and macro functions to be called from other macro files via the \$!INCLUDEMACRO command. For example, if you have a macro function to post an equation in a file called add_text.mcr: #!MC 1410 \$!MACROFUNCTION NAME = “Equation” \$!AttachText   AnchorPos     {     X = […]

## Calculate Delta Criterion

Problem: How do I calculate Delta Criterion? Solution: The easiest way to do this is to use a Tecplot Macro to automate the calculation. Calculations are derived from https://www.ctr.maths.lu.se/media/thesis/2013/FMA820.pdf First, make sure Tecplot has established the velocity variables via the Field Variables dialog (Analyze -> Field Variables). Then, play the macro via the Scripting menu. The macro commands are as follows: Calculate the Velocity Gradient tensor. (Can also be calculated […]

## Calculate Lambda-2 Criterion

Problem: How do I calculate the Lambda-2 criterion? Solution: Use a Tecplot Macro to automate the calculation. Make sure Tecplot is aware of the variables representing your velocity field (Analyze->Field Variables menu).   The commands are as follow: Calculate the tensor of velocity gradients. This command can be obtained by recording the Analyze->Calculate Variables…->Velocity Gradient (tensor) action in Tecplot’s graphical user interface (GUI). \$!EXTENDEDCOMMAND COMMANDPROCESSORID = ‘CFDAnalyzer4’ COMMAND = ‘Calculate […]

## Precise Probe to Create Time Series Plot

Problem: How do I Probe to Create Time Series Plot at a given set of coordinates? Solution: Use Tecplot’s macro language to precisely define the point to probe. The commands are as follow: Prompt for the (X, Y, Z) coordinates of the point to probe: \$!PROMPTFORTEXTSTRING |xPosition| INSTRUCTIONS = “Enter X position of the probe.” Or define them directly in the macro: \$!VARSET |xPosition|= 0.1 Pass these coordinates to the […]

## Extract Vortex Cores over time

Problem: How do I extract vortex cores over time? Solution: Use a Tecplot Macro to loop over time and extract the vortex cores at each time step. Make sure Tecplot is aware of the variables representing your velocity field (Analyze->Field Variables menu).   The commands are as follow: Retrieve the number of time steps \$!EXTENDEDCOMMAND COMMANDPROCESSORID=’extend time mcr’ COMMAND=’QUERY.NUMTIMESTEPS NUMTIMESTEPS’ Loop over time \$!LOOP |NUMTIMESTEPS| \$!EXTENDEDCOMMAND COMMANDPROCESSORID=’extend time mcr’ COMMAND=’SET.CURTIMESTEP […]