Aerial Photo Alignment

I’ve been working with River Simulation results recently. The simulation results look good colored by the various variables, but they look 10x better when you use aerial photos overlaid on the simulation. This gives a great perspective and context to the simulation, as well as providing the viewer with a lot more spatial information. It is a great combination of simulation and real map. The crux of this problem is the accurate alignment of the photo with the simulation results. Lucky, most high end/bespoke aerial photos have some type of Global Positioning, or World File information with them. This provides some spatial reference information which can be combined with the simulation space to align the two pieces of information.

texture map alignment

Exact Alignment of Texture map image with geometry using World File information.

In the models and images I looked at this week, the images had “World Files” associated with them. These world files provide the scaling, rotation, and transformation information to map the pixels of the image into 2D space. So, I wrote a small little python tool as an example of being able to accurately align the image with the simulation results using these “World Files”. The python file opens up the image file to figure out its pixel dimensions, and then opens the World File to extract out the scaling & transformation information (I’ve left rotation out of the mix for the moment). With this information, I can then correctly specify the S and T projection vectors as well as the Offset information in the texture map dialog to automatically project the image onto the geometry in the correct 2D space. I also included an option for relative vs. absolute coordinates of the simulation model, so that you can easily account for that difference in the World File.

The Python tool and window are as follows:


This provides a nice enhancement to the texture map capability in EnSight, to exactly align the image with the geometry when this information is known (via World File).

If users utilize other conventions for alignment of the Aerial Photo with the geometry, please feel free to contact us, as the power of python programming should allow alternative methods.

To install this python, copy the link below, and place into your ~/.ensight92/extensions/user_defined/Tools/ directory (or subdirectory), and re-launch EnSight.

EnSight UserDefinedTool for Image Alignment

Analytical Ray Casting

I had an interesting request come through last week regarding analyzing the maximum value along a particular direction. The user desired this information as a form of comparison against experimental information gathered. In this instance, the user really wanted to define a plane as a start point, then move along a direction from this plane, and register what the maximum value was… and plot that back on the surface as some type of filled contour. The user also wanted to limit the length of this survey, so that they could determine the maximum within X units from the originating plane.

EnSight’s built in “Radiograph_mesh” and “Radiograph_grid” were first looked at, as they return an integral along a ray cast from a surface. This was useful, however they needed the maximum value (rather than integral), and wanted to control the length of the ray (rather than infinite), as they needed to compare to experimental data.

So, we already had a “Streamline Analysis” tool which analyzed streamlines, and returned various analytical information about the streamlines (scalar max being one of them). This tool analyzes each streamline in turn, and creates new scalar fields like distance traveled, time traveled, normalized scalar, maximum scalar. If you then combine this tool with a “Fixed” vector field, rather than a spatial varying velocity vector field, you can in effect cast “rays” along a particular direction and then analyze the values along each streamline.

Here is an example of that output, using a simplified exhaust manifold model.

Example of Ray Casting and Analysis of Max value along ray.

Example of Ray Casting and Analysis of Max value along ray.


The image on the left indicates the maximum value of temperature experienced a direction specified (this case normal to the clip), for a distance of 0.2 units.
You can find more information by watching a short video/audio tutorial here :



Pipe centerline routine

As many of you know I’ve been working on the pipe centerline routine in the past. Today it’s running well on most geometries so it’s time to share it.

If you already know older versions, you will see that some changes have been made. One thing is that the the routine can be used as a User Defined tool now. If you want to use it that way, please delete the expression run(0), currently in line 693. Copy the routine and the thumbnail to ~/.ensight92/extensions/user_defined/Tools and restart EnSight. Now you should see the thumbnail and the tool description in the UDT dialog. Starting the routine will launch the GUI where you can make your settings.


















The GUI changes dynamically, depending on the selectid parts and the settings. For running the script, please select the wall part (this should be the pipe with the desired center spline), an inlet and an outlet. The order of inlet and outlet part is not important. If the pie has no parallel sections you can allow EnSight to generate infinite clips. If there are parallel sections do not allow that. EnSight will then generate a finite pipe clip with the plane tool. The diameter of the plane tool is the twice of the inlet part diameter by default. Modify this setting if the pipe diameter varies.
































The step delta controls the moving steps of the plane tool. This value is calculated automatically, depending on the selected wall part. This value should fit for most situations. Only modify it if the spline result is not satisfying. The script should generate a coaxial spline for the pipe geometry. If you are not satisfied with the result please play with the settings or contact me.









The script can be downloaded here:


The thumbnail:







Converting Crank Angle to Time

EnSight’s transient capability, in particular the Pathline capability for time integrated streamlines relies on a consistent set of units. The time specified in the EnSight Case Format must match the units of time in the velocity field (distance/time). In older versions of ConvergeCFD, the velocity was written out as m/s, while the time was written out in crank angle. In this situation, the Pathline calculation routine will not correctly, as the units are not consistent. I’ve written a short quick little tool that converts the Crank Angle information to Time.

This little tool has the following attributes:
a. It sits in your UserDefinedTools area (so you don’t loose it), and you have a little single click icon to execute it.
b. It asks you for your Engine Speed in RPM, and the Case file containing Crank Angle
c. It moves the Crank Angle data over into its own separate file, so that user still has access to it through EnSight.
d. It modifies the .case file to include the above new crank angle file, and correctly writes time in the time values section.
e. It then asks you if you’d like to automatically load in this new .case file…

You now have time correctly in there.
You also have Crank Angle as another Constant that you create a label with, dial, gauge, or calculate with automatically.

So, there is a video tutorial (~ 4 minutes) on setup and using this routine :

And the little routine can be downloaded from here:
(updated 25-Sept-2012 to no longer require that the Case file be EnSight Gold (will work on non-Gold files too)

Let me know if you have any questions or problems.