Zach Davis

Sr. Engineer

Pointwise, Inc.

Improvements in computational capability, access to High Performance Computing (HPC) resources, and open-source tools have recently contributed to the prevalence of computational fluid dynamics (CFD) and its widespread adoption across several diverse industries. CFD simulations that leverage sophisticated physical models are regularly used throughout product development to help shape and refine the overall final product’s design.

Ensuring computed solutions are sufficiently accurate with respect to the physical system being modeled is often left to the computational analyst to determine. Even for relatively standard simulations, questions often arise as to the robustness with which CFD methods can accurately compute engineering metrics of interest. Numerical errors can often be directly traced to the configuration of the underlying mesh and orientation of individual and neighboring cells used in calculating a solution. A priori mesh quality assessments can be useful in identifying poor quality cells, but ascertaining whether a given mesh is good is far more challenging, particularly when complex geometry and flow physics are involved. To make matters worse, one mesh configuration may be more suitable for accurately representing a given engineering metric like pressure drag, while another configuration is used to reliably predict a different metric such as shock propagation as depicted in Figure 1.

One approach that helps aid in reducing numerical errors is by changing the mesh in response to the developing flow solution. This technique is typically referred to as adaptive mesh refinement, or simply mesh adaptation. While not new, application of mesh adaptation tends to be somewhat limited to only a few specialists throughout academia and industry who regularly employ it successfully. However, they continue to demonstrate time and again that error estimation and adaptive methods are critical components for improving the reliability of computational simulations efficiently and reliably. Given these advantages, why is mesh adaptation not used more regularly within the CFD community? To answer this question, and get a better idea of what is involved when incorporating mesh adaptation into the typical CFD simulation setup, we took a closer look.

Metric-based mesh adaptation typically involves two steps. The first step is to construct a metric that describes the desired size and anisotropy of the adapted grid elements. The second step is to produce an adapted grid that is based on this metric. There are several methods in the literature for how this metric is formulated, but they typically fall within one of two categories: local error based or output based. Local error based adaptation constructs the metric based on properties of the flow solution; whereas, output based mesh adaptation constructs the metric from both flow and adjoint solutions to reduce estimated errors in a specific engineering metric. The differences between these two approaches are illustrated in Figure 2.

The grid can be adapted in various ways as well. Many mesh refinement schemes simply add isotropic cells (hexahedra or tetrahedra) to resolve some gradient detected within the flow solver (i.e. local error based adaptation). Other schemes are capable of much more including parallel insertion and movement of nodes, collapsing and swapping cells, anisotropic stretching, support for time-accurate simulations, and more in order to iteratively drive mesh refinement and satisfy some anisotropic metric.

To better understand some of the nuances involved when using mesh adaptation, a small case study was devised to incorporate output based mesh adaptation to solve the flow around an ONERA M6 wing. Designed in 1972 by the ONERA Aerodynamics Department as an experimental geometry for studying three-dimensional, high Reynolds number flows, the ONERA M6 is a widely known wing geometry that serves as a reference model for validating new numerical methods and CFD codes due to the availability of empirical data and intriguing flow features. A description of the wing geometry and single flow condition used in this exercise are shown in Figure 3 and Table 1, respectively.

Pointwise is used to create an unstructured surface mesh using anisotropic triangles along the leading and trailing edges of the wing to resolve the wing's curvature with an efficient number of cells. A spherical farfield boundary is created a distance 20 mean aerodynamic chord lengths away from the center of the root chord. The volume grid is initialized using Pointwise’s T-Rex (anisotropic tetrahedral extrusion) advancing layer extrusion technique. T-Rex marches layers of anisotropic tetrahedra from the surface grid at a constant growth rate until the tetrahedra reach isotropy, and then the interior volume is filled with isotropic tetrahedra. This provides a smooth transition from these high-quality, right-angled tetrahedra used for boundary layer refinement into isotropic tetrahedra in the volume’s interior.

For the ONERA M6 Wing, an initial normal wall spacing of 6.5e-05 inches (y^{+} = 1) is enforced, and a constant cell growth rate of 1.2 applied. T-Rex marched 38 full layers of tetrahedra normal to the surface mesh. Figure 4 shows the near-wall mesh created in Pointwise.

For output-based mesh adaptation, NASA Langley's FUN3D software is used. FUN3D consists of both a node-based finite-volume flow solver, adjoint solver, and libraries for metric-based grid adaptation. In this case study, FUN3D's built-in refine library for metric-based grid adaptation is used. The metric tensor, *M*, for mapping the physical grid space into a computational space where everything is isotropic is reconstructed using a Hessian based on Mach number as shown in Equation 1.

Here ^{1}/*h ^{1/2}* are the eigenvalues of the symmetric positive definite matrix which denote sizing requests in each of the three principal directions along with corresponding eigen-vectors,

FUN3D's mesh adaptation mechanics only support adaptation of simplex cells; and therefore, other cell types are ignored. FUN3D’s developers recommend freezing anisotropic cells near solid wall boundaries for best results based on earlier experience. From this advice, cells that are an equivalent distance of y^{+} = 100 (i.e. ∆*s* = 0.00582 inches) from solid wall boundaries were fixed in place and not modified by FUN3D's mesh adaptation library. While FUN3D’s flow solver provides support for wall functions, the adjoint solver does not. Accordingly, both were run using a Spalart-Allmaras turbulence model with an initial y^{+} = 1 spacing specified normal to solid wall boundaries. FUN3D also supports several engineering metrics to be used as objective functions in error estimation. If none of the built-in metrics are suitable, then the ability to formulate your own exists. For this example, the lift-to-drag ratio, * ^{L}/D* was chosen.

The simulation was run for ten adaptation cycles. A plot of the residual history from FUN3D's flow solver for all 10 cycles is shown in Figure 5a. Each uptick in the residuals corresponds to the beginning of one mesh adaptation cycle. In Figure 5b, *N* is the number of grid points in the mesh for the given adaptation cycle. As mesh adaptation continues, the number of points that FUN3D is permitted to insert into the mesh is restricted. This helps to avoid exceeding available computational resources by limiting the total number of points in the resulting adapted mesh at each step. It also helps reduce execution time on initial grids by keeping them smaller. As the number of points in the mesh is gradually increased (i.e. moving from right to left along the abscissa in Figure 5b), the solver converges to an asymptotic value for the objective function as one might expect when performing a grid refinement study.

The final adapted mesh at a constant y-plane is shown in Figure 6. The mesh shows some additional clustering and stretching of cells coincident with a shock on the upper wing’s surface. Cell clustering is also apparent at both leading and trailing edges.

Figure 7 shows a comparison of surface pressures plotted at several spanwise locations along the wing for the adapted tetrahedral mesh and empirical data gathered from NASA’s ONERA M6 Wing Validation Archive. Overall the numerical solution matches fairly closely to the available empirical data, and the solution tracks the shock on the upper wing’s surface at each constant spanwise cut pretty closely.

Mesh adaptation seems like an invaluable addition to every CFD practitioner’s set of tools, and could perhaps save users time over traditional grid refinement studies while delivering improved accuracy for a valued engineering metric. Mature implementations provide plenty of options to help control the overall mesh size and stretching of cells, while expanding access to, and increasing capabilities of, HPC resources should make adopting mesh adaptation techniques more reasonable than ever. If you are not already using mesh adaptation in your CFD process, then perhaps it is worth revisiting. Share your experiences with mesh adaptation, and send us your thoughts to letstalk@pointwise.com.

- M. A. Park. Feature- and adjoint- based error estimation and mesh adaptation.
*2015 FUN3D Workshop*, page 4, June 2015. - M. A. Park and D. L. Darmofal. Parallel anisotropic adaptation for metric and direct error control.
*Computers and Fluids*, June 2009.

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

3rd Quarter of 2017

2nd Quarter of 2017

May 2017, Special Edition

1st Quarter of 2017

December 2016, Special Edition

4th Quarter of 2016

September 2016, Special Edition

3rd Quarter of 2016

2nd Quarter of 2016

1st Quarter of 2016

February 2016, Special Edition

November / December 2015

September 2015, Special Edition

September / October 2015

July / August 2015

June 2015, Special Edition

May 2015, Special Edition

May / June 2015

March / April 2015

February 2015, Special Edition

January / February 2015

November / December 2014

September / October 2014

August 2014, Special Edition

July / August 2014

May / June 2014

April 2014, Special Edition

March / April 2014

January / February 2014

November / December 2013

September 2013, Special Edition

September / October 2013

July / August 2013

June 2013, Special Edition

May / June 2013

March / April 2013

February 2013, Special Edition

January / February 2013

December 2012, Special Edition

November / December 2012

September / October 2012

August 2012, Special Edition

July / August 2012

May / June 2012

March / April 2012

March 2012, Special Edition

January / February 2012

November / December 2011

September / October 2011

July / August 2011

May / June 2011

March / April 2011

January / February 2011