# OneraM6 by Michael Alletto

**contributor**: Michael Alletto**affiliation**: WRD MS**contact**: click here for email address**OpenFOAM versions**: v2312**Published under**: CC BY-NC-ND license (creative commons licenses)

Go back to Collection by authors.

## Contents

# Transonic flow around the 3D Onera M6 wing at an angle of attack of 3.06°

You can download the case file [1] here.

## Introduction

The scope of this tutorials is to test the capability of the solver rhoSimpleFoam in combination with the OpenFOAM native mesher snappyHexMesh to simulate 3D transonic flows over wings. For this purpose we take as test case the Onera M6 wing listed in the NASA turbulence model resource home page https://turbmodels.larc.nasa.gov/index.html. The home page provides a list of test cases to validate turbulence models for compressible and incompressible flows. The flow around the Onera M6 wing is taken as one of the standard test cases to validate compressible flow solvers (see, e.g. [1],[2],[4]).

## Set up

The next figure shows a sketch of the setup. The Onera m6 wing consists in a swept wing with a span b of 1.196 m. The domain consists in a rectangular box where the edges are located 18 m from the wing root which is approximately 17 times the span width. This domain size should reduce the influence of the artificial boundary conditions on the results to a minimum. On the side of the box which is located at the wing root a symmetry boundary conditions is applied. For all other sides a inflow-outflow boundary conditions is used for all quantities but the pressure. For this boundary conditions a fixed value is used if the flow points inside the domain and a zero gradient is used if the flow points outward the domain. For the pressure a outflow-inflow boundary condition is used. Here the zero gradient boundary condition is used for incoming flow and a fixed value for outgoing flow. The free stream mach number is set to Ma = 0.84 and the angle of attach is set to α = 3.06°. The Reynolds number was approximately Re = 10^{7}. The numerical schemes are taken from the tutorials shown in https://wiki.openfoam.com/NACA0012_numerical_schemes_variation_by_Michael_Alletto. In this tutorial a detailed motivation is found we to choose a linear scheme for the convective schemes. The Spalart-Almaras turbulence model was chosen since in the tutorial https://wiki.openfoam.com/NACA0012_turbulence_model_variation_by_Michael_Alletto it showed the best agreement between simulation and experiment regarding shock position and strength.

### Mesh generation

Note that the available step file which defines the wing surface at the NASA turbulence model resource home page, can be converted with available online tools to a stl file which is required by snappyHexMesh. Just type convert step to stl in google and you will get a few in the first result which are doing the job well.
The next figures shows the meshing strategy adopted. Five refinements regions are chosen to gradually increase the resolution from the coarsest level to the finest level around the wing. The initial grid had hexagonal cells of 1.2m side length. Note that it is very important to start with cells which are cubes to get a high wall layer coverage near the surface if wall layers are used. The fifth refinement level has a cell side length of 0.0375 m. The surface around the wing is additionally refined to capture the fine curvature at the wing nose and the tail. For the surface a refinement level 8 and 9 was used. For coarser levels the nose of the wing was too coarsely resolved. This strategy results in a mesh of approximately 10^{6} cells. Five layers are used to increase the wall normal resolution to capture the sharp velocity gradients near the wall. The layer coverage is roughly 94%.

### Simulation setup

The following listing shows the fvSolution dictionary. It has to be said that for all variables the GAMG solver is used since it provided a good convergence rate. The transonic and the consistent switch is set to true.

The transonic switch switches a divergence term in the pressure equation on. It transforms the pressure equation from an elliptical equation in case of a incompressible fluid to a hyperbolic equation in case of a compressible fluid. For details how the pressure equation is derived for compressible flows see the book of [3].

The consistent switch specifies that a SIMPLEC algorithm is used. A description of the algorithm SIMPLEC can be found in [3] or also https://openfoamwiki.net/index.php/SimpleFoam for the incompressible case. The implementation for the compressible case is very similar (see https://openfoamwiki.net/index.php/RhoSimpleFoam). It can be seen from the dictionary that for the SIMPLEC algorithm much higher underrelaxation factors can be used compared to the SIMPLE algorithm.

`solvers
{
`

p { solver GAMG; tolerance 1e-08; relTol 0.1; smoother GaussSeidel; nCellsInCoarsestLevel 20; } "(U|e|k|epsilon|nuTilda)" { solver GAMG; tolerance 1e-08; relTol 0.1; smoother GaussSeidel; nCellsInCoarsestLevel 20; }

} SIMPLE {

nNonOrthogonalCorrectors 0; pMinFactor 0.1; pMaxFactor 2; transonic yes; consistent yes;

residualControl { p 1e-5; U 1e-6; e 1e-5; "(k|epsilon|nuTilda)" 1e-5; }

} relaxationFactors {

fields { p 1; } equations { p 1; U 0.9; e 0.8; k 0.9; epsilon 0.9; nuTilda 0.8; }

`}`

Regarding the fvSchemes dictionary has to be said that it is important to use a linear scheme for all convective terms to accurately capture the shock on the wing surface. A detailed discussion can be found in https://wiki.openfoam.com/NACA0012_numerical_schemes_variation_by_Michael_Alletto.

The following listing shows the thermophysicalProperties which defines the thermodynamic package used. Note that a small description of the entries of the thermophysicalProperties dictionary can be found in https://www.openfoam.com/documentation/user-guide/thermophysical.php or https://cfd.direct/openfoam/user-guide/v6-thermophysical/. What is important for the tutorial is that we used a pure mixture, the transport properties are constant (the viscosity μ) and not a function of temperature, the specific heat capacity cp (not to be confused with the pressure coefficient) is constant, a ideal or perfect gas is used as equation of state and that the internal energy is solved in the energy transport equation. Note that using a constant heat capacity and constant transport properties is a fairly good approximation for small temperature differences within the domain.

`thermoType
{
`

type hePsiThermo; mixture pureMixture; transport const; thermo hConst; equationOfState perfectGas; specie specie; energy sensibleInternalEnergy;

}

mixture // air at room temperature (293 K) {

specie { molWeight 28.9; } thermodynamics { Cp 1005; Hf 0; } transport { mu 1.82e-05; Pr 0.71; }

`}`

## Results

The next figure shows the comparison between the measured Cp values and the simulated one. The simulation results are generated as follows: First the pressure is extracted at the wing surface. After that the results are binned with a bin width of 0.005 times the span b around the measurement position in order to generate the plots. The python script is of course also provided in the tutorial. Excellent agreement can be found between the simulation and the experiment. From this plots (see also next figure) we can see that after the position y/b = 0.8 the two shocks present merge to one shock.

The next figure shows the pressure distribution on the wing surface. We can see that a lambda-shock is formed which is typical for the Onera M6 wing: Before approximately 80% of the span two shock can be seen at the surface which then merge to one forming a so called lambda-shock.

## References

[1] J Mayeur, A Dumont, D Destarac, and V Gleize. Reynolds-averaged navier–stokes simulations on naca0012 and onera-m6 wing with the onera elsa solver. AIAA Journal, 54(9):2671–2687, 2016.

[2] Davide Modesti and Sergio Pirozzoli. A low-dissipative solver for turbu- lent compressible flows on unstructured meshes, with openfoam imple- mentation. Computers & Fluids, 152:14–23, 2017.

[3] Fadl Moukalled, L Mangani, Marwan Darwish, et al. The finite volume method in computational fluid dynamics, volume 113. Springer, 2016.

[4] L Remaki, O Hassan, and K Morgan. Aerodynamic computations using a finite volume method with an hllc numerical flux function. Mathematical Modelling of Natural Phenomena, 6(3):189–212, 2011.