Aerospace Design Lab Logo
Skip to end of metadata
Go to start of metadata

Introduction

Welcome to the Quick Start Tutorial for the SU2 software suite. This tutorial is intended to demonstrate some of the key features of the analysis and design tools in an easily accessible format. Completion of this tutorial only requires a few minutes. If you haven't done so already, please visit the Download and Installation pages to obtain the most recent stable release of the software and details for installation. This tutorial requires only the SU2_CFD tool from the SU2 suite.

Goals

Upon completing this simple tutorial, the user will be familiar with performing the flow and adjoint simulation of external, inviscid flow around a 2D geometry and be able to plot the sensitivities along that surface. The specific geometry chosen for the tutorial is the NACA 0012 airfoil. Consequently, the following capabilities of SU2 will be showcased in this tutorial:

  • Steady, 2D, Euler and Continuous Adjoint Euler equations
  • Multigrid

  • JST numerical scheme for spatial discretization
  • Euler implicit time integration
  • Euler Wall and Farfield boundary conditions

Resources

After obtaining a copy of the SU2_CFD flow solver and the TestCases directory, two other files are needed as input to the code: a configuration file describing the options for the particular problem, and the corresponding computational mesh file. (If you haven't already, you may wish to download the full set of meshes for the tutorials cases which may be downloaded upon registration from here. The configuration file is available in TestCases/euler/naca0012/ as obtained from the github distribution. The mesh file is available in TestCases/euler/naca0012/ but obtained from the zip from the registration page. Both of these files are also available below:

These sample results files from SU2 can be used to compare the results you obtain from the tutorial:

Tecplot Format:

Tutorial

The following tutorial will walk you through the steps required to compute the flow and adjoint solutions around the NACA 0012 airfoil using SU2. Again, we assume that you have already obtained and compiled the SU2_CFD code (either individually, or as part of the complete SU2 package) for a serial computation. If you have yet to complete this requirement, please see the Download and Installation pages.

Background

The NACA0012 airfoil is one of the four-digit wing sections developed by the National Advisory Committee for Aeronautics (NACA), and it is a widely used geometry for many CFD test cases. The numbering system is such that the first number indicates the maximum camber (in percent of chord), the second shows the location of the maximum camber (in tens of percent of chord) and the last two digits indicate the maximum thickness (in percent of chord). More information on these airfoil sections can be found here or in the book 'Theory of Wing Sections' by Abbott and von Doenhoff.

Problem Setup

This problem will solve the Euler equations on the NACA0012 airfoil at an angle of attack of 1.25 degrees, using air with the following freestream conditions:

  • Pressure = 101325 Nm-2
  • Temperature = 273.15 K
  • Mach number = 0.8

The aim is to find the flow solution and the adjoint solution with respect to an objective function defined as the drag of the airfoil.

Mesh Description

The unstructured mesh provided is in the .su2 format. It consists of 10,216 triangular cells, 5,233 points, and two boundaries named airfoil and farfield. The airfoil surface uses a flow-tangency Euler wall boundary condition, while the farfield uses a standard characteristic-based boundary condition. Figure (1) shows the computational mesh. Find more information on the supported mesh formats here.

 

Figure (1): Far-field and zoom view of the computational mesh.

Configuration File Options

Aside from the mesh, the only other file required to run the SU2_CFD solver details the configuration options. It defines the problem, including all options for the numerics, flow conditions, multigrid, etc., and also specifies the names of the input mesh and output files. In keeping simplicity for this tutorial, only two configuration options will be discussed. More configuration options will be discussed throughout the remaining tutorials.

Upon opening the inv_NACA0012.cfg file in a text editor, one of the early options is the MATH_PROBLEM:

SU2 is capable of running the direct and adjoint problems for several sets of equations. The direct analysis solves for the flow around the geometry, and quantities of interest such as the lift and drag coefficient on the body will be computed. Solving the adjoint problem leads to an efficient method for obtaining the change in a single objective function (e.g., the drag coefficient) relative to a large number of design variables (surface deformations). The direct and adjoint solutions often couple to provide the objective analysis and gradient information needed by an optimizer when performing aerodynamic shape design. In this tutorial, we will perform DIRECT and ADJOINT solutions for the NACA 0012 airfoil.

The user can also set the format for the solution files:

SU2 can output solution files in the .vtk (ParaView), .dat (Tecplot ASCII), and .plt (Tecplot binary) formats which can be opened in the ParaView and Tecplot visualization software packages, respectively. We have set the file type to TECPLOT in this tutorial by default, but users without access to Tecplot are encouraged to download and use the freely available ParaView package. To output solution files for ParaView, set the OUTPUT_FORMAT option to PARAVIEW. Some details on the supported visualization packages can be found on the installation page. 

Running SU2

Flow solution

The first step in this tutorial is to solve for the flow:

  1. Create a directory in which to run the tutorial. Copy the config file (inv_NACA0012.cfg) and the mesh file (mesh_NACA0012_inv.su2) to this directory. Navigate to this directory in a terminal.
  2. Run the executable by entering "SU2_CFD inv_NACA0012.cfg" at the command line.
  3. SU2 will print residual updates with each iteration of the flow solver, and the simulation will finish after reaching the specified convergence criteria.
  4. Files containing the flow results (with "flow" in the file name) will be written upon exiting SU2. The flow solution can be visualized in ParaView (.vtk) or Tecplot (.dat or .plt). More specifically, these files are:
    • flow.dat, flow.plt or flow.vtk - full volume flow solution.
    • surface_flow.plt or surface_flow.vtk - flow solution along the airfoil surface.
    • surface_flow.csv - comma separated values (.csv) file containing values along the airfoil surface.
    • restart_flow.dat - restart file in an internal format for restarting this simulation in SU2.
    • history.plt or history.csv - file containing the convergence history information.

Adjoint solution

Next we want to run the adjoint solution to get the sensitivity of the objective function (the drag over the airfoil) to conditions within the flow:

  1. Open the config file and change the parameter MATH_PROBLEM from DIRECT to ADJOINT, and save this file.
  2. Rename the restart file (restart_flow.dat) to "solution_flow.dat" so that the adjoint code has access to the direct flow solution.
  3. Run the executable again by entering "./SU2_CFD inv_NACA0012.cfg" at the command line.
  4. SU2 will print residual updates with each iteration of the flow solver, and the simulation will finish after reaching the specified convergence criteria.
  5. Files containing the adjoint results (with "adjoint" in the file name) will be written upon exiting SU2. The flow solution can be visualized in ParaView (.vtk) or Tecplot (.dat or .plt). More specifically, these files are:
    • adjoint.plt or adjoint.vtk - full volume adjoint solution.
    • surface_adjoint.plt or surface_adjoint.vtk - adjoint solution along the airfoil surface.
    • surface_adjoint.csv - comma separated values (.csv) file containing values along the airfoil surface.
    • restart_adj_cd.dat - restart file in an internal format for restarting this simulation in SU2. Note that the name of the objective appears in the file name.
    • history.plt or history.csv - file containing the convergence history information.

Results

The following figures were created in Tecplot using the SU2 results. These results are contained in the flow.dat, surface_flow.dat, adjoint.dat, and surface_adjoint.dat files.

Flow Solution

Figure (2): Pressure contours around the NACA 0012 airfoil.

Figure (3): Coefficient of pressure distribution along the airfoil surface. Notice the strong shock on the upper surface (top line) and a weaker shock along the lower surface (bottom line).

 

Adjoint Solution

Figure (4): Contours of the adjoint density variable.

Figure (5): Surface sensitivities. The surface sensitivity is the change in the objective function due to an infinitesimal deformation of the surface in the local normal direction. These values are calculated at each node on the airfoil surface from the flow and adjoint solutions at negligible computational cost.

 

Congratulations! You've successfully performed your first flow simulations with SU2. Move on to the tutorials to learn much more about using the code, and don't forget to read through the information in the user's guide. Having problems with the quick start or visualizing the results?  Visit the FAQs page, or see our forum at CFD-online.

  • No labels