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 = […]

» Read More


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 = […]

» Read More


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 […]

» Read More


Use Raw Strings to Load Multiple Files Using Multiple Lines

In 2018 R2 we’ve added the capability for raw strings to be used in Macros. This added the capability to space the files out on multiple lines for readability. Before raw strings, all of the files had to be placed on one line which made for terrible readability when loading more than a couple of data files. Here is the syntax for loading multiple files: $!ReadDataSet R”INPUTFILES(“/this/is/a/somewhat/long/file/name/File1.dat”                                                                 “/this/is/a/somewhat/long/file/name/File2.dat”                                                                 […]

» Read More


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 […]

» Read More


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 […]

» Read More


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 […]

» Read More


Load Multiple Files at Once with a Macro

Problem: I have many files that need to be loaded into Tecplot but loading them all is tedious. I want to load multiple files at once without having to select each individual file. Solution: For files that only differ by a constant, PyTecplot or macro scripts can be configured to load your datasets quickly and accurately. For example, if you have a directory containing many files: file001.plt file002.plt etc. You […]

» Read More