Merging multiple time periods of a CFx simulation into one

During the calculation of a CFx simulation, the solver can stop and restart. When this happens, the user can only export one dataset in Case Gold format for each one of the restarts, making it impossible to load the solution in EnSight as a single transient dataset. In this scenario, some operations such as the calculation of the temporal average, or the creation of plots vs. time over all the timeline, will not be possible.

If this is the problem you are facing, then you can use this User Defined Tool presented in this article to concatenate the datasets from the restarts into a single transient Case Gold dataset. The Tool will take care of distinguishing between changing or static connectivity, and will check the sequence of timesteps to create a unique timeset with increasing timesteps.

Shown below is the structure of the directories with the data that you need to have to run this UDT. Note that there is no constraint on the directory names – only on their structure

Transient data





In this example, Data1 will contain the dataset for the first restart, Data2 will contain the dataset for the second restart, and so on.

Download the attached file, un-zip it and place the files into your local UDT directory (which by default is in $CEI_HOME/ensight101/site_preferences/extensions/user_defined/Tools). Open EnSight a first time with the “-no_prefs” option to initially load this tool, and then restart EnSight  normally. Now, you will find the tool among the User Defined Tools.

Double-click on the tool lo launch it. It will pop-up a window asking for the first .case file. Select it and give “Ok”.

The script creates an additional ZData directory under the Transient_Data directory. In this new ZData you will find the new concatenated dataset. Note that the script makes a copy of the original files, doesn’t move/delete them. This means that you can end up using a lot of disk space, if your initial dataset is large.

Please feel free to contact us if you have any question or problem in using this Tool



Creating curved clips from splines

These are two related tools which create 2D curved “clips” from user-created splines. The tools do not create actual EnSight clip parts. Instead the final result is either an offset part (a type of elevated surface) or a second case with a single part and no variables. The “clip” geometry and mesh depend only on the splines, not on any parts.

Tool 1 – Curved clip from a single spline


This will create a clip which is the shape of a spine extruded in a single direction.


  1. Makes one or more splines
  2. Run the tool (if there is more than one spline the tool will ask you to select one)
  3. Set the extrusion distance and direction

The tool should run and a new part should be visible.

Options to set in the file before starting EnSight

grid_size – The clip mesh will be quad4 elements that are approximately square. The grid_size variable sets the desired length of one side of each element.
min_spline_points – In cases where the grid_size is too large relative to the length of the spline the number of elements could be very small. If the number of points along the spline is below the minimum specified here then the grid_size will be reduced to meet the minimum requirement.

Tool 2 – Curved clip from two splines


This will create a clip which is the shape of a spine extruded along the direction of a second spline.


  1. Make two or more splines
  2. Run the tool
  3. Select the two splines to use (the order of the splines matters) and other options in the window

The tool should run and a new part should be visible. If there are critical errors a window should pop up with an error message. If the direction of the extrusion is in the wrong direction, invert the second spline and run the tool again.

Options to set in the file before starting EnSight

There are two methods the tool can use for creating clips.
1. The default is to write a new case file, load it in as a second case, and use CaseMap to color it by a variable. This method is much faster and more robust but it does require loading a second case. For that reason a second method is included.
2. Create a point part with triangle mesh, then use the point part to create an offset part. There are two sub-methods for how to create the point part. See below.

temp_file_type – chooses which method above to use.
‘case’ is for writing a new case file.
‘point’ is for creating a point part by writing a point part file.
‘none’ will create a point part without using a file.
grid_size – The grid_size variable sets the desired distance between neighboring nodes.
max_rectangles – (for ‘case’ only) If the given grid_size and spline lengths would result in more than max_rectangles then the grid_size will be increased.
max_triangles – (for ‘point’ and ‘none’ only) The tool can become prohibitively slow if there are too many triangles. The number depends on your hardware and OS but 10k triangles should take a few seconds, 100k triangles a few minutes. The time increase is faster than linear (i.e. n^2) so be careful how high you go. If the given grid_size and spline lengths would result in more than max_triangles then the grid_size will be increased.


Creating point parts should be faster in 10.1.4a and later. Some text output is sent to the python tab. (updated 2015-4-23)

Element Metrics and Histogram Tool

elemetric_histogramAs part of the core capability of EnSight to not only visualize, but analyze the domain and solution results, we have implemented the Element Metrics routines from Sandia Verdict Library ( There are approximately 30 different element metrics that this routine will calculate for you, depending upon the grid types used. Again, we have implemented this function as a general purpose calculator function, as well wrap this fundamental capability with a Python-based macro to add further ease of use and end-user functionality. This macro is called “EleMetric_Histogram”, and performs the following on the selected parts in EnSight:

1. Determines the element types selected, and only calculates EleMetric quantities which apply.
2. Creates separate scalar variables for each Metric computed. Users can color by any of these variables, or further query where maximum or minimum values occur.
3. Determines a Histogram Distribution through the domain, and reports this to a text file (EleMetric_Histogram.txt) in the directory where your case is. This file is simple ascii, and can be inspected with any text editor.
4. An EnSight Query is generated for each Metric Histogram, so that you can visually graph the distribution of that Metric for the domain.

elemetrics_guiDouble clicking on this utility will launch the following short GUI for some basic user controls:
The first option allows the user to utilize the current selected parts only, or to calculate the variables for ALL parts in the model.
The histogram options provide the ability to control the number of bins for the histogram function, as well as where to write this information (text file and/or EnSight query registers).
The typical output to the text file should provide a nice overview of the variables computed, as well as quantification of the variable distribution in the domain.

The “EleMetric_Histogram.txt” file list all of the variables computed. If the minimum and maximum are the same, we simply report that. Else, the distribution is given as well:


In EnSight, the user now has access to the variable information computed, and can clip the domain (perhaps a crinkly clip would be best), and color the domain by the metric of interest:



The following link can be used to download the user defined tool for “EleMetric_Histogram”

Download here for elemetric_histogram

Current version is 4.0, dated 23-Oct-2014, updated by Marina Galvagni.

Kevin Colburn, CEI


STAR-CCM+ Particle Track File Conversion into EnSight 10

** Updated 01-May-2014: Users of EnSight 10.1 will have version2.3 of this tool automatically installed in the UserDefinedTools — > File Import/Export section. **

Users of STAR-CCM+ who are also using the lagrangian or discrete element modeling capability, there is a new translation utility from CEI to convert the STAR-CCM+ based particle track file into EnSight’s Measured Data format, to visualize and analyze within EnSight.

This translation routine takes an existing EnSight Case Format files (the continuous domain) exported from STAR-CCM+, along with the STAR-CCM+ based Particle Track files (.trk). The routine converts the .trk file contents onto a single timeline, creates the appropriate EnSight Measured Data files (in a “trk_mea_files” directory), and modifies the EnSight Case file to include the appropriate references for the Measured Data Files. Once loaded, the user can visualize, analyze, and communicate the information contained within both the lagrangian/discrete phase along with the continuous phase.

To utilize this new translation routine, please follow the instructions below:

1. Download the .zip file containing the new translator. Unzip. To make this available to all users on your installation, place the “ccm_trk_ensext” directory into your installation Tools sub directory as follows:


(Please ensure that you have proper write privileges to place this directory here).

Now start up EnSight as follows (example assumes you are running EnSight 10.0)

ensight100 -no_prefs


for personal use, install into your local Tools directory as described in the How To Manual (in HOW TO PRODUCE CUSTOMIZED ACCESS TO TOOLS & FEATURES)

Local directory – python files for your own personal use

Linux: ~/.ensight100/extensions/user_defined/Tools

Mac: ~/Library/Application Support/EnSight100/extensions/user_defined/Tools Windows

Vista, Windows 7: C:\Users\username\.ensight100\extensions\user_defined\Tools

Windows XP: %HOMEDRIVE%%HOMEPATH%\(username)\.ensight100\extensions\user_defined\Tools

To find out your %HOMEDRIVE%%HOMEPATH% do Help>Online Support, click the System Into tab, and look at the Prefs Dir. This is where EnSight looks for user defined tools.

If you don’t see your tool, try

ensight100 -no_prefs

Download version 2.3 of STAR-CCM+ Track File Conversion Tool Here

2. Start EnSight 10. You should notice a new tool under the “UserDefinedTools — > File Import/Export” denoting STAR-CCM+ .trk file translation:

3. Ensure that you have exported the continuous domain from STAR-CCM+ into EnSight format.

4. Double click the “STAR-CCM+ .trk import” tool from the UserDefinedTools area.

4a. Specify the EnSight Case format “.case” file. (Exported from STAR-CCM+)

4b. Specify the STAR-CCM+ Particle/Discrete Element file (.trk)

4c. Specify the number of timesteps to re-sample the particle track information into.

4d. Specify Time option for conversion of the Particles. The Default of “Max Trace” will resample all of the particles based on the min and max time of all the particles.  If you choose “User Specified”, then please specify the minimum and maximum times in section 4e (below). Use this option if you have rogue particles which may “hang around” for long periods of time, or you want to specifically control the time period over which the particles are converted.

4e. If you choose the “User Specified” Time option, then provide the minimum and maximum time.

4f. Toggle to keep particles at their last known location if the time is greater than defined for that particle. Particularly useful to “stick” particle where they exit the domain.

5. Click on the “Convert” button to convert the STAR-CCM+ based Track File into EnSight Measured data.

You will see a progress bar indicating the progress through the process of reading, re-sampling, and writing out the new EnSight Measured data. Two new items are written in the same directory : “trk_mea_files” directory containing the EnSight format Measured Data, and a modified .case file “<original_name>”

Once complete, you will get a “Done” Dialog, after which the new case file will be automatically loaded in. You can now change the visible aspects of the Measured Data via the “Node Display” icon :

Since the Translation routine writes new Measured Data files, subsequent loading of this case with Measured data, the user can simply specify to load the “” file directly, without the need to re-translate the Particle Track information each time.

Should you have any questions, please do not hesitate to contact CEI ( with questions, comments, praise.

Example Dataset:

An example STAR-CCM+ based dataset containing Particle track information can be downloaded here.


Video Tutorial:

To further assist your use of STAR-CCM+ Particles in EnSight, please consult this video tutorial here:



Users of STAR-CD v3.x and v4.x:

Note: This routine mentioned here is meant to work for the specific “STAR-CCM+” based track file format, which is different to that of STAR-CD (v3.x and v4.x) particle track routines. If you are trying to convert “STAR-CD” based particle track files, please see our existing “f33toparticle” conversion routine.

Revision History

** Version 2.3:  Updated 01-May-2014 for mint & maxt calculation, as well as sorting trks based on time prior to re-sampling/interpolation. **

Create Triangle Mesh

If you are faced with the problem that you have a hole in a surface EnSight has no powerful tool to fill it. Think about the radiator grille of a car. If one has the request to create a clip plane within the grille geometry to calculate the flow for example, the plane tool wont help in most cases as it’s rectangular and radiator grills are often not rectangular.

This tool can create a triangle meshes within a closed spline. If you campare the result with the meshing of a point part it has two big advantages:

1. The mesh elements are connected

2. Point parts along splines are meshed with one row of triangles. Here we have multiple rows. This enables calculation and coloring on the new mesh.

The spline geometry should be circular or elliptic and as flat as possible. Convex or concave geometries might cause problems. If the geometry is elliptic the first spline point should be at a pointed area (Think about the two ends of an egg). The scipt can use an existing spline or you can create a new one. If you select the option new spline, the GUI becomes interactive. Just click along the surface with the left mouse button and check how the spline points get created. There’s a control field of the current number of splines in the script GUI. If you want to get rid of one or more spline points, just use the delete button within the GUI. The spline can be open. The code will create a final spline point to close it. This will be done on existing splines and on new splines. Furthermore you can map an existing fluid variable to the new surface.

When the create button was pressed EnSight will create a new case and geometry file in the current working directory. These files are loaded as an additional case








The attached script is a stand alone tool. You can run it via File > Command > Play. Just contact me if you want to add it to your user tools.


In-Cylinder Tools

In-Cylinder Engine (ICE) simulations often contain specialized requirements for analysis. EnSight’s Python tool capability allows users to develop their own custom operations to fulfill the requirements of the analysis. I have written an initial set of tools here called “In-Cylinder Tools”, which can be installed as UserDefinedTools in EnSight 10

In this set of tools, we have the following:

1. Calculate Swirl. This routine takes the currently selected parent part(s) (typically the fluid domain of the cylinder), and calculates Swirl Velocity based about the Z axis. Using the parent part, it also calculates an Constant Variable which is the Spatial Mean of Swirl, so that you could easily create a plot vs. time for the average swirl.




2. Calculate Tumble. This routine takes the currently selected parent part(s) (typically the fluid domain of the cylinder), and calculates a tumble velocity, using the current average height of the parent part. The routine automatically works through time to determine this tumble velocity using the new center reference point at each timestep, and creates a graph of tumble vs time.




3. Crank Angle Conversion tool. This converts an EnSight .case file which has been setup with Analysis_Time specified as degrees crank angle, and converts this to Analysis_Time in seconds (user provides RPM). This allows EnSight to compute Pathlines correctly, as all of the constituent variables have consistent units.

4. Spray.out reader. For users of Converge, this tool will read in the Spray.out file information into a series of queries that you can then automatically plot. This reader will also read other Converge .out files which confirm to the save format.






5. Particle Distribution Function. This routine operates on the Measured Data within EnSight, to determine a mass-based distribution of any measured data variable (like radius or temperature) within the time domain. Please refer to this previous Python Exchange article for further information on the intended uses and application of this routine. Previous article.




Please download these tools from the link below. Unzip the file, and place the directory into your .ensight100/extensions/user_defined/Tools/ directory, and restart EnSight. You should then see a new tool folder in your UserDefinedTools area with the above tools.

Should you require any assistance with the tools or modification of them to suit your particular needs, please do not hesitate to contact CEI.

Click here to download In_Cylinder_Tools


Importing Converge .out files

The Converge Solver exports out additional quantitative information into various “*.out” files. The information contained within these .out files can be very useful in visualizing along with the fluid domain in EnSight, to quantify against other extracted values in EnSight, qualitative comparison, or just to easily visualize versus time in EnSight.

This very small/short routine was developed to work on the spray.out file which contains information regarding the spray computed by the solver (injection pressure, injected mass, spray penetration, etc). The routine reads the .out file, along with the user specified engine RPM (to calculate time in seconds), and places all of the values from the .out file into EnSight Queries.

The User Defined Tool should appear as :

The user simply needs to specify the Converge .out file, along with the Engine RPM, so that the routine can correctly tie the query with time.

Once executed, you should see a number of additional queries within EnSight. The name of the Query is taken from the .out file, along with the units. Each query is associated with “Time” in seconds, and should therefore play correctly and appropriately within EnSight, as well as synchronizing with the timesteps of the main dataset.

The resulting Queries can easily be plotted with the Right Mouse Button, or drag/drop onto current plotters. Query-on-query operations can also be performed to further inspect rate of change, comparisons (differences between queries).

You can download the current User Defined Tool here. Once downloaded, unzip the file, and place the contents into your .ensight100/extensions/user_defined/Tools/ directory, and restart EnSight.

Click here to download Converge .out file reader

Particle Distribution Analysis

As a follow on to the Probability Density/Distribution Function for the continuous phase domain (link here), I have created a close cousin of this routine which works on Discrete Particles to determine a Particle Distribution of the Discrete Phase.

This routine was written with the intended use for Spray Distribution in an In-Cylinder model, and built according to the typical variables and techniques used for this modeling scheme. It is common to determine and understand what the distribution of the particular spray is within the domain over time (mass distribution vs. radius).  This routine asks the user for a variable to base the Distribution on (in this case droplet radius). The routine breaks this value down into N number of “bins” (in this case 20). For each bin, the routine calculates the total mass of the spray in that bin, and reports back out a distribution. The routine then walks the transient domain to collect this information over time, and generate extracted information vs. time.

In order to base the total in each bin on Mass, the user must prescribe three items : a) the droplet radius, b) the droplet density, and c) the number of droplet per parcel. In this instance, the actual Discrete/Particle data in EnSight represents one parcel of spray (all with the same physical properties).  Therefore, the mass is represented as (number_drop_parcel)*(particle_density)*(4/3*pi*r^3).

The GUI input for this routine is similar to the previous PDF macro for the continuous phase, with the addition of variable prescription needed for the mass calculation.

Based on this range, it then divides the volume into N number of IsoVolumes (number of bins) based on this variable range. The routine then determines the mass of the spray which is contained within each of these variable constrained ranges. The result is placed into a query register and automatically plotted on the screen.

The Tool presents the user with the simple Window to select the variable, and number of bins (or bars) for the distribution function, along with the three items needed to calculate the mass of the spray (radius, density, parcel count)


After executing, you will then get a graph of distribution of the variable within the parent part(s) selected.

The values on the graph should always sum to the total mass of spray in the domain.

Note: As users increase the number of bars( or bins) for the graph, the shape of the curve will increase in resolution, although values on the Y-axis of the graph will adjust.

This Tool can be downloaded from the link below. Please unzip the file and place both the Python Script and Icon PNG file into your UserDefinedTools area and restart EnSight. You should see a “PDF Particle Graph” icon available in your UDT area, and you can double click to execute.


 Video Tutorial:

Please view this video tutorial for a detailed walk through of using this tool for Spray Analysis.

Screencast Tutorial

Please use the following link to download the UserDefinedTool:

Click here to download Particle Distribution Tool


Transient STL File Conversion

Do you have a series of STL files which represent moving geometry? If this geometric motion is simple (constant rotation, or translation), you can utilize the “Rigid Body Motion” capability already in EnSight. However, what if the motion is complex, or if the STL surfaces change from timestep to timestep? The native STL file reader in EnSight expects steady state STL file information (either a single STL file, or multiple STL files via .xct; but still only for a single timestep).

A short Python routine can be used here to actually help out. This python routine takes a series of STL files, and assumes that they are part of a transient sequence, with one STL file per timestep. The Python routine converts the STL information into EnSight Case Gold format files, with multiple .geo files, allowing you to view your STL information in a transient nature. This routine can be further modified and customized to suit your needs, file conventions, or time information (since no time information is explicitly available within the .stl file).

Please feel free to contact CEI, or the author of the routine ( for further customization or questions.

To download this example Python utility, please click on the link below, and place into your User Defined Tools area.

Click here to download Multiple Transient STL Conversion Tool

Current Version : 1.0 (11-January-2013)

Current Limitations/Assumptions:

a. A series of ASCII stl files all with ‘.stl’ extension
b. Will convert and assume ALL “*.stl” files in the directory are to be converted.
c. All STL files have the same number of parts (but can change triangles from timestep to timestep)
d. Since there is no Time information with STL, will force Time 0 = 0.0 seconds, Time 1 = 1.0 seconds, etc
If user needs other time information, just change the time values in the .case file
e. STL files are all triangles (no quads)

Help Documentation can be found here :

Measure Distance & Size

EnSight has no really handy capability to measure the size of a selected part or the distance between two points although all necessary information is existig. I was asked several times for a simple click solution. Well, here it comes. Attached are two Python codes zipped to a complete directory. Both scripts include a dynamical GUI which enables a very handy usage.

The size measurement tool:

Start the routine and just select one ore more parts from the part list or directly from the graphical area – that’s all. The GUI of the code will update immediately so you will get the desired information without more steps.









The distance measurement tool:

Start the routine and choose the measurement mode. Now just click on the first surface point. The GUI will update at once and asks you to select the second surface point. Once again the GUI will update and tell you the distance betwee the two points. Both points are connected with the line tool now. You can continue picking surface points as long as the GUI is active. If you are finished, just quit the GUI and the line tool will disappear.









Both routines are included in a complete user defined tool directory. Download the file, unzip it and copy the whole directory to this path (If the path does not exist you’ll have to create it):



Please contact me at if you have any problems.