Grid Visualization and Inspection with EnSight

By Kevin Colburn
Senior Applications Engineer, Computational Engineering International, Inc.

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:

Color each element by a color representing the type of element

When this tool is executed on this sample recombined T-Rex grid, we can quickly inspect the topology of various grids used.

recombined t-rex mesh
Figure 1: A recombined T-Rex mesh in EnSight demonstrating the ability to color a grid by element type.

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:

Shows a gray part with multi-colored mesh overlay for all visible parts

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:

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

After downloading and installing (see instructions below), you will have an entry in your User Defined Tools area like:

Calculates Element Metrics and Histogram

Double clicking on this utility will launch a GUI (Figure 3) with some basic user controls:

  1. The first option allows the user to calculate the metrics for all parts in the model or to operate only on the current selected parts.
  2. The histogram options control the number of bins for the histogram function, as well as where to write this information (text file and/or EnSight query registers).
  3. The typical output to the text file provides an overview of the variables computed and quantification of the variable distribution in the domain.
GUI for the EleMetric_Histogram script
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:

grid image with elements colored by type
Figure 5: Sample visualization of the scaled Distortion distribution for a multi-block structured mesh from Pointwise.

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.

Try Pointwise Yourself

If you would like to generate your meshes using Pointwise request a free evaluation today.

Free Trial

Search Articles

Share This