Grid Visualization and Inspection with EnSight
By Kevin Colburn
Appropriate grid generation is a key aspect to obtaining a high quality CFD solution in an efficient manner. Inspection of grids to assess element quality, grid density, and grid placement is critical to the setup of computational models. The visual and computational capability of EnSight allows users to inspect, visualize, and quantify the quality of the grid used in a simulation. Engineers at CEI have developed these tools to help users understand the grid they have generated and will be using with their CFD solver. EnSight can visualize, quantify, and illustrate grid metrics for any type of grid exported from Pointwise, but it is particularly useful when inspecting recombined T-Rex grids, which are generated on export from Pointwise. In this article, we will highlight three common tools you can utilize in EnSight: coloring grid by element type, mesh display attributes, and element metrics inspection.
Coloring Grid by Element Type
EnSight 10 includes a new calculator function that can be used to determine the element type within a domain, and create a new color attribute for elements based on this element type. EnSight's Python scripting language was used to create a tool that invokes this calculator function, colors the elements, and creates a legend with the element types. The tool can be placed in either EnSight's UserDefinedTools area or within the main icon bar of EnSight (See the note at the end of this article on where/how to install these tools). Once installed, you will see the tool as shown below:
When this tool is executed on this sample recombined T-Rex grid, we can quickly inspect the topology of various grids used.
Multi-Colored Overlay Mesh Display
We also developed a new tool/macro to provide further options for grid overlay display in EnSight. The effect is similar to a “hidden line” display in EnSight, but allows for more coloring options and edge display. To achieve this easily, we have developed a tool/macro for this operation as well. Once downloaded and installed (see note at end of article), you should see a new tool available:
In addition to turning on the “grid overlay display” in EnSight, you can either color the grid by a constant color (gray, black, white, etc.) or you can have different parts of the grid displayed in different colors as shown in Figure 2.
Figure 2: Using the Colored Mesh tool the user can overlay a multi-colored Pointwise mesh on top of the impeller part. Here, the model edges are illustrated with black edge lines, while the grid display mimics a hidden overlaid grid mesh.
Element Metrics Quantification
EnSight can not only visualize but also analyze and quantify the grid and solution. We have extended this capability to the grid quality by developing a tool that computes the Element Metrics based on the Sandia Verdict Library. There are approximately 30 different element metrics that this routine will calculate, depending upon the grid type used. We implemented this as a general purpose calculator function wrapped with a Python-based macro to add further ease of use and end-user functionality. This macro is called “EleMetric_Histogram”, and it performs the following on the selected parts in EnSight:
After downloading and installing (see instructions below), you will have an entry in your User Defined Tools area like:
Double clicking on this utility will launch a GUI (Figure 3) with some basic user controls:
Figure 3: The GUI for the EleMetric_Histogram script
The “EleMetric_Histogram.txt” file lists all the variables computed. If the minimum and maximum are the same, we simply report that. Otherwise, the distribution is given as well:
Figure 4: The text file containing histograms for all of the element metrics computed.
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 it by the grid metric of interest:
Limitations and Future Work
The current Sandia Verdict Library operates on triangle (3 node) and quadrilateral (4 node) 2D elements; tetrahedral (4 node) and hexahedral (8 node) 3D elements. It does not, however, contain metrics for pyramid (5 node) or prism (6 node) elements. We are discussing with Pointwise on how to enhance the routine to work on a broader range of element types.
Downloading and Installing User Defined Tools
To download and install any of the routines, follow the guidelines below:
Once these are installed, you can right-click on the Icon bar in EnSight 10, and choose “Customize”. You can then move these tools to the main icon bar, making these tools available at the top level Icon bar:
Should you have any questions or would like to request further enhancements or capabilities, please do not hesitate to contact your local EnSight Sales Office or our main headquarters at email@example.com.
For specific details on individual metrics in the “EleMetric” calculator function, please see the following reference: C. J. Stimpson, C. D. Ernst, P. Knupp, P. P. Pebay, & D. Thompson, The Verdict Library Reference Manual, May 8, 2007.