## 2 Methods
### Field Inversion
#### 2.2.1 Goal Function Selection  
The goal function that drives the optimization procedure in field inversion is crucial for finding physically consistent corrections. This function must meet some important criteria:  
* It should be easy to measure with sufficient accuracy. * It should be closely related to the performance of the system. * It should be sensible to the correction introduced by field inversion. The basic idea is that the goal function should represent the RANS error on a variable that can be easily measured or evaluated through scale-resolving simulations (such as force coefficients or pressure and skin friction distribution). This information is then used to find corrections for other variables (for example, the modified turbulent eddy viscosity), which cannot be directly measured in an experiment. It is important to note that experimental results can also contain uncertainties, which may affect the optimization process. In a previous study [48], a sensitivity analysis was performed by perturbing the experimental data to identify the regions within the domain where these uncertainties have the greatest impact on the correction provided by field inversion. This approach can be used to define accuracy requirements that the reference experimental data should satisfy to be suitable for the field inversion procedure. The goal function is augmented with a penalization term, often referred to as Tikhonov regularization. This term helps prevent extreme values in the correction field during optimization, ensuring that the correction field is active only in regions where it can significantly contribute to the reduction in the error. An example of a goal function based on the pressure distribution, including the penalization term, is shown below:  
\[G=\int_{\partial\Omega}(Cp-Cp_{exp})^{2}dl+\lambda\int_{\Omega}(\beta-\beta_{0 })^{2}d\Omega \tag{30}\]  
The first term is a line integral performed along the airfoil's wall, which evaluates the norm-2 error in the wall pressure distribution. The second term is a surface integral over the computational domain \(\Omega\) where \(\lambda\) is the penalization term. This second term penalizes the goal function when the correction field deviates significantly from its initial value \(\beta_{0}\). One of the key strengths of the field inversion approach is its flexibility in optimizing the correction field by defining a goal function that can be tailored to various objectives. This flexibility allows for the optimization of different aspects of the flow, whether it is a global performance metric or specific local characteristics. In our work, we utilized both local and global coefficients to define the goal function. Specifically, we focused on skin friction distribution, pressure distribution, lift and drag coefficients. By choosing an appropriate norm, we aggregated these coefficients into a single value that effectively guides the optimization process. A discussion on the use of global (force coefficients) or local (pressure or skin friction distributions) goal functions is presented in Section 3.2.1. Global goal functions, based on integral quantities, can be more easily measured, but pressure and skin friction distributions can provide more physical insight. We analyze two test cases: the NACA0021 and the SD7003 airfoil. All results for the turbulent viscosity and velocity fields are non-dimensionalized using the reference kinematic viscosity \(\
u_{ref}=\frac{\
u_{ref}}{\rho_{ref}}\) and the reference velocity \(V_{ref}=\sqrt{RT_{ref}}\), where \(\mu_{ref}\) and \(\rho_{ref}\) are the reference dynamic viscosity and reference density, respectively, evaluated in the far-field. Here, \(R\) is the gas constant for air and \(T_{ref}\) is the reference static temperature in the far-field. For the SD7003 airfoil, we have both local and global coefficients, allowing us to test the effects of defining the goal function using either global or local coefficients.