Required field
Required field
Required field

# Tutorial: Compressible Flow Simulation Around a Wing

This article provides a step-by-step tutorial for a wing simulation, or more specifically, evaluating compressible flow simulation around a wing.

## Overview

This wing simulation tutorial teaches how to:

• Set up and run a compressible simulation.
• Assign topological entity sets in SimScale.
• Assign boundary conditions, material, and other properties to the simulation.
• Mesh with the SimScale standard meshing algorithm.
• Visually assess the mesh quality.

We are following the typical SimScale workflow:

1. Preparing the CAD model for the simulation.
2. Setting up the simulation.
3. Creating the mesh.
4. Run the simulation and analyze the results.

## 1. Prepare the CAD Model and Select the Analysis Type

First of all click, the button below. It will copy the wing simulation tutorial project containing the geometry into your workbench.

The following picture demonstrates what should be visible after importing the tutorial project.

### 1.1 Creating the Flow Region

To run a wing simulation where you can visualize the airflow, the first step is to create a flow region. This page gives you an overview of SimScale’s flow volume extraction operations.

For external aerodynamics, an enclosure operation is necessary. To create an enclosure, follow the steps presented in the picture:

1. Right-click on the geometry named wing;
2. Select an ‘enclosure’ operation.

Give dimensions to the enclosure, as in the picture below, and start the operation.

Did you know?

The boundaries of the domain should be far away from the wing. This is necessary to ensure that the flow near the wing won’t be affected by the conditions at the boundaries.

In a wing, chord length is the distance between leading and trailing edges.

In general, the bigger the enclosure, the better. However keep in mind that a big enclosure will increase the mesh cell count. The boundaries of the domain should be far away from the wing. This is necessary to ensure that the flow near the wing won’t be affected by the conditions at the boundaries.
Find below the minimum recommended size for the enclosure, in terms of chord lengths (L):

### 1.2 Create the Simulation

Make sure the enclosure is selected for this simulation project:

Hitting the ‘Create Simulation’ button leads to the following options:

Choose ‘compressible’ for analysis type and ‘create the simulation’.

Now the global simulation setups pop up:

Set the turbulence model to k-omega SST.

## 2. Assigning the Material and Boundary Conditions

To have an overview, the following picture shows the boundary conditions applied for this simulation:

### 2.1 Define a Material

This simulation will use air as fluid material. Therefore click on the ‘+ button’ next to materials. Doing this opens the SimScale fluid material library as shown in the figure below:

Select air and click ‘Apply’. Afterward, a tab with properties opens up. You can leave the default values and assign them to the entire flow region.

### 2.2 Assign the Boundary Conditions

Using Figure 7 as a reference, the boundary conditions will be assigned.

#### a. Walls – Slip

Follow the instructions presented in the picture below to add a new boundary condition:

1. After hitting the ‘+ button’ next to boundary conditions, a drop-down menu will appear, where one can choose between different boundary conditions.
2. Select the ‘Wall’ boundary condition.

Change (U) Velocity to slip and (T) Temperature to zero gradient. Assign the side, top, and bottom enclosure boundaries to it.

#### b. Symmetry

Create a new boundary condition, but this time choose symmetry. Assign it to the enclosure face adjacent to the wing.

#### c. Pressure Outlet

Create yet another boundary condition. Select pressure outlet and assign the following enclosure face to it:

#### d. Velocity Inlet

Due to the high velocities involved, compressible simulations require extra care during the setup phase. Aiming to improve stability in early iterations, the velocity will be ramped, starting from a magnitude of 11.6 m/s at iteration 0, to the final magnitude of 116 m/s at iteration 600.

Furthermore, an angle of attack of 3 degrees for the wing will be taken into account. Therefore, the velocity will have components in the Y and Z directions.

Create a velocity inlet boundary condition and follow the steps demonstrated in the picture:

1. Select ‘Fixed value’;
2. Assign a Temperature of ‘0 °C’;
3. Assign the inlet surface to the boundary condition;
4. Click on the highlighted icon to access the velocity table and define it as pictured below:
1. Click ‘Table’ to access the table input.
2. Define the ramp according to the table below.
3. Confirm by hitting ‘Apply’.

\begin{array} {|r|r|} \hline t & U<x> & U<y> & U<z> \\ \hline 0 & 0 & 0.6071 & -11.5841 \\ \hline 600 & 0 & 6.071 & -115.841 \\ \hline \end{array}

#### e. Walls-No-slip

All solid walls should receive a no-slip condition, because they are physical walls.

Topological entity sets help to assign a group of faces all at once. As we need all the faces of the wing to be modeled as physical walls, let’s group them as a topological entity set.

To create a topological entity set for the wing walls, follow these steps:

1. Enable the select face mode in the viewer;
2. Select all 6 boundary faces of the enclosure;
3. Right-click in the viewer and ‘invert’ the selection.

Now, all the walls of the wing are selected. Follow the instructions in the figure below to create the set:

• 4: Click on the ‘+ button’ next to topological entity sets;
• 5: Name your newly created set appropriately. For example, as Walls.

Now, create a wall boundary condition and assign it to the newly created set. Make sure to set ‘zero gradient‘ for temperature.

Note

Check out this page, if you are interested in other boundary conditions available in SimScale.

### 2.3 Initial Conditions

The values for the initial velocity and temperature will require changes from the default. Doing this stabilizes the calculation.

The velocity field will receive the same initialization as the velocity inlet.

Did you know?

Initializing the velocity means that the air around the wing in our virtual wind tunnel is already moving.
If we would not predefine it, there would not be air movement at the beginning of the calculation and the solver would have to calculate it based on the specified inlet velocity.

And, for temperature, please initialize the entire domain with 0 Celsius.

### 2.4 Numerics

In the numerics tab, again seeking to improve stability, add 2 non-orthogonal correctors:

### 2.5 Simulation Control

Please set up the wing simulation control as shown below:

• Under simulation control, prescribe 1500 iterations to end time and write interval.
• Also, raise the maximum runtime to 30000 seconds.

### 2.6 Result Control

By setting result controls, you can observe the convergence behavior of several parameters of interest. Hence it is an important indicator to evaluate the quality and trustability of the results.

The first result control to set is a forces and moments control. Writing the forces data every 10 iterations is enough to assess convergence. Assign it to the walls topological entity set:

Now, click on the ‘+ button’ next to surface data to create area averages. A total of two controls will be created, one for the inlet and one for the outlet.

Similarly, for the outlet:

## 3. Mesh

To create the mesh, we recommend using the standard algorithm, which is a good choice in general as it is quite automated and delivers good results for most of the geometries.

From the main settings, disable automatic boundary layers. Boundary layer refinements will be added later.

### 3.1 Local Element Size Refinement

Click on the ‘+ button’ next to refinements. A local element size will be assigned to the walls entity set. Limit the element size to 0.07 meters:

### 3.2 Inflate Boundary Layer Refinement

The boundary layer refinement is important to capture the near-wall profiles appropriately. Create an inflate boundary layer refinement and set it up as shown:

### 3.3 Region Refinement

As fluid flows around a body, a turbulent region is developed downstream. This region is called ‘wake’. Since gradients in the wake are often high, we will create region refinements for it.

First, create a new region refinement. Specify 0.8 meters as maximum edge length and click on the ‘+ button’ to create a geometry primitive:

Select a cartesian box primitive and give it the following coordinates:

After saving the first cartesian box, head back to the region refinement. Assign the cartesian box to it.

Following the same steps, create another region refinement. This time, set maximum edge length to 0.5 meters. Click on the ‘+ button’ next to geometry primitives and create another cartesian box with the following dimensions:

After saving the box, assign it to the second region refinement.

### 3.4 Generating the Mesh

At last, head back to the main mesh settings and hit Generate.

The resulting mesh takes about 8 minutes to complete. This is how the 2.6M cells mesh looks like:

### 3.5 Mesh Quality Inspection

Within SimScale, it’s possible to visually inspect mesh quality parameters. Amongst the available quality parameters, we have non-orthogonality, aspect ratio, and volume ratio.

To access this feature, click on mesh quality, which is located under mesh. The post-processing environment then opens up.

Under results you can find a list of available quality parameters:

A particularly helpful filter is isovolumes. By playing with the minimum and maximum isovalues, it’s easy to identify bad cells. For example, these are the worst cells in the mesh, when it comes to aspect ratio.

A visual representation of mesh quality is extremely helpful when trying to improve the mesh.

For our mesh, the maximum observed value for aspect ratio is 57, which is acceptable. Therefore, we can proceed to run the simulation.

## 4. Start the Simulation

Click on the ‘+ button’ next to ‘simulation runs‘ and ‘start‘ the process.

While it’s running, you can access the intermediate results by clicking on solution fields. They’re updated as the iterations go by!

The entire simulation takes between 2 to 3 hours to finish, depending on the number of processors. In the reference project, which is linked below, we calculated a few more iterations, to assure complete convergence.

## 5. Post-Processing

### 5.1 Result Controls

Once the run is finished, open the area average at the inlet result control. By inspecting Uz and Uy, the velocity ramp is very clear:

For any wing simulation, force plots are commonly used to assess convergence. By inspecting the force plot from this simulation, we can see that all parameters converge nicely:

For compressible external aerodynamics simulations, other parameters useful to assess convergence are:

• Inlet: pressure;
• Outlet: temperature, velocities, and density.

### 5.2 Post-Processing Pictures

Analyze your results with the SimScale post-processor. Have a look at our post-processing guide to learn how to use the post-processor.

Congratulations! You finished the tutorial!

Note

If you have questions or suggestions, please reach out either via the forum or contact us directly.