# Gradient-Based Aerodynamic Optimization of an Airfoil with Morphing Leading and Trailing Edges
## 2 Methodologies
### Mesh Deformation  
A hybrid mesh deformation strategy, which consists of the deformation of the surface mesh by a radial basis function (RBF) tool and the deformation of the surrounding volume mesh by linear elasticity formulation, is adopted in this work. The first stage is surface mesh deformation. However, the mesh mapping from the baseline CST airfoil to the morphed CST airfoil is not straightforward, since the mesh grid points and the CST airfoil may not always coincide with each other. An auxiliary function is required for surface mesh mapping, and the idea is to construct an RBF interpolation of the displacement on a set of boundary nodes. Assume we have the undeformed baseline CST airfoil \(\Omega_{\text{u}}\), and the corresponding the morphed CST airfoil \(\Omega_{\text{m}}\). There are points with coordinates \(\left\{\mathbf{x}_{k}^{u}\right\}_{k\in\mathcal{W}}\) on the corresponding undeformed surface mesh, where \(\mathcal{W}\) is the set of surface mesh nodes indexes on the surface \(\mathcal{S}\) to be designed. Meanwhile, the corresponding mesh point coordinates on the deformed surface \(\mathcal{S}^{m}\) are \(\left\{\mathbf{x}_{k}^{m}\right\}_{k\in\mathcal{W}}\). The surface mesh mapping problem is, given the baseline CST airfoil \(\Omega_{\text{u}}\) and the corresponding morphed CST airfoil \(\Omega_{\text{m}}\), computing a mapping function \(\mathcal{G}\) such that the surface mesh nodes on the morphed surface \(\mathbf{x}_{k}^{m}\) can be found through a linear mapping \(\mathbf{x}_{k}^{u}\xrightarrow{\mathcal{G}}\mathbf{x}_{k}^{m}\). The mapping function is constructed from the pair of points from baseline CST airfoil \(\Omega_{\text{u}}\) to morphed CST airfoil \(\Omega_{\text{m}}\). There are two sets of points: \(\left\{\mathbf{x}_{t}^{u}\right\}_{t\in\mathcal{V}}\) on the \(\Omega_{\text{u}}\), and \(\left\{\mathbf{x}_{t}^{m}\right\}_{t\in\mathcal{V}}\) on \(\Omega_{\text{m}}\), where \(\mathcal{V}\) is the space such that \(\forall t_{i}\in\mathcal{V}\) point \(\mathbf{x}_{t_{i}}^{u}\) and \(\mathbf{x}_{t_{i}}^{m}\) share the same arc length measured from the origin (i.e., leading edge point). For convenience, two displacement fields from baseline CST airfoil \(\Omega_{\text{u}}\) and surface mesh nodes on \(\mathcal{S}\) to morphed CST airfoil \(\Omega_{\text{m}}\) and surface mesh nodes \(\mathcal{S}^{\text{m}}\) are introduced:  
\[\mathbf{v}_{t} =\mathbf{x}_{t}^{m}-\mathbf{x}_{t}^{u} t\in\mathcal{V}(\Omega) \tag{12}\] \[\mathbf{w}_{t} =\mathbf{x}_{k}^{m}-\mathbf{x}_{k}^{u} k\in\mathcal{W}(\mathcal{S})\]  
Figure 4: RAE 2822 with morphing leading and trailing edges. The displacement interpolation space can be generated from the generic RBF with first-order polynomial correction [28]:  
\[s(\mathbf{x})=\sum_{i=1}^{N}\gamma_{i}\phi(\left\|\mathbf{x}-\mathbf{x}_{i}\right\|)+h(\mathbf{x}) \tag{13}\]  
where, \(s\) is a scalar value, \(\phi\) weighed by coefficient \(\gamma_{i}\) is the non-negative radial interaction function defined on the positive real axis, \(\mathbf{x}\) is evaluation point, and \(\mathbf{x}_{i}\) are source points that also be called centers with a total number of source points of \(N\). Here, in the displacement interpolation problem, the source points are \(\mathbf{x}_{t}^{u}\). A first-order polynomial \(h\) is usually added for resolving the ill condition of the interpolation matrix. In a two-dimensional \(x-z\) space, the linear polynomial has the form of \(h(\mathbf{x})=\beta_{0}+\beta_{1}x+\beta_{2}z\), where \(\mathbf{x}=(x,\ z)^{\intercal}\ \|\cdot\|\) denotes the Euclidean distance, which is the standard metric to represent the straight-line distance.