This tutorial follows the tutorial about DOE and mesh morphing on the airfoil shape optimization case. If you are interested in this tutorial but not in the previous one … Yeah, fair enough! Here is a quick reminder of the work done so far: Thanks to a 3-points shape parametrization of the airfoil, we managed to set up a full Design of Experiment leveraging OpenFOAM mesh morphing capabilities. We are starting this tutorial with a set of 9 simulated pressure field.

*OpenFOAM simulation of pressure field around DOE elements*

Based on that DOE, we will generate a surrogate model thanks to the Proper Orthogonal Decomposition Scilab tool. If you want more details about this tool check this tutorial.

Still here? Shall we start, then?

## POD basis generation

Let’s be honest, the mesh and field data import and post-processing would be by far the hardest tasks of all the process. Mainly because you will need 2D nodes data when the simulations results are cell-centered values all over a 3D mesh. So … good luck with that.

But there is a good point. Thanks to the mesh morphing process, the cells composition remains the same. So you will have 9 different **points** files (different points coordinates) for only one **faces** file (each face keeps the same nodes). This is a very important point regarding the POD process. Actually, POD is about computing a correlation matrix, field correlation for each nodes through the snapshots. Your mesh topology has to remain the same, as depicted in the image below.

Doing so, you can set a classical POD process using only one mesh object. Just make sure that you are using the Euclidean inner product within the POD tool in order to be mesh-independent. Here are the 9 modes for the pressure field you got.

*POD modes for pressure field. NACA 0012 airfoil for visualization.*

## Interpolation methods

This case is really interesting because it makes you really understand what the POD is all about:

- Finding coherent structures (modes) that appear when parameters vary (correlation through snapshots). Here we can see that shape bumps are responsible for pressure bubbles (mode 2, 3 and 4).
- Combining those structures in order to predict a new system dynamic based on coefficients interpolation. If there wan only one bump near the leading edge, we can easily imagine that the coefficients associated to modes n°2 will be the dominant one, negative though.

The script above allows you to predict your pressure field based on your DOE, your reduced basis, your learning simulations and a given set of design parameters. You can try different interpolation methods within the * RBF_interpolation* function. As you can see on image below, the classical Gaussian kernel seems to be the most relevant method for pressure field prediction. The error have been computed thanks to the

*function.*

**compute_rel_error***Root mean square error of pressure field all over the mesh (POD vs OpenFOAM)*

## Surrogate model limits

The model generated is a good model within the DOE bounds. But, as you can imagine, the system behavior change when the bumps size increases. Take the example of the airfoil defined by the set of parameters : x = [0.07 0.04 0.05], outside the DOE bounds.

*Simulated velocity field (left) and pressure coefficients: POD vs OpenFOAM*

We can see for example that re-attached flow (responsible for a decreasing pressure on the upper side) and recirculation zone (responsible for a non-increasing pressure on the lower side) have not been considered in our surrogate model.

*Iso-pressure for POD prediction (left) and OpenFOAM simulation (right)*

As we can see there are a few differences in the pressure field between POD prediction and OpenFOAM simulation. If lift prediction remains good, pressure drag prediction becomes too far from reality though. For this study to be relevant we will keep on looking the optimum shape within the DOE bounds. But if you would like to generate a “better” surrogate model, you have to set a smarter Design of Experiment that will consider all the possible non-linear changes in the pressure dynamic around the airfoil.

## Conclusion

We saw in this tutorial how to create a surrogate model with the POD tool. The last tutorial will be about setting the optimization process leveraging the surrogate model in order to compute the pressure drag and lift coefficients for each airfoil considered in each optimization cycle.