# An Automated Framework for Streamlined CFD-Based Design and Optimization of Fixed-Wing UAV Wings
## 4 Evaluation Metrics
### Solution Confidence
A critical factor contributing to the confidence in the results is the convergence behavior of each case. As described in Section 3, a substantial computational budget is allocated to the solution, and an automated algorithm continuously monitors the quantities of interest (forces generated on the wings) until they stabilize within a predefined tolerance level. Cases that fail to converge may indicate oscillatory or divergent behavior, or, in rare instances, a very slow rate of convergence, as observed in the authors' experience. For every CFD result, the convergence condition is reported alongside the residuals for each force, providing designers with valuable insights into the simulation setup. Inflation Layer Exploration  
This section and Figure 10, describes the approach adopted to generate a structured inflation layer mesh from unstructured CFD simulation data with the scope of accurately defining the grid elements inside the boundary layer (Figure 11). The development of a structured inflation layer mesh, while complex, enables the detailed post-processing of these regions. Figure 9: Qualitative metric of the grid resolution based on the \(y^{+}\) and the amount of prism layers inside the boundary layer. The initial step involves extracting the simulation data, including element positions, node positions, and element-node connectivity. This information is gathered via PyFluent and forms the foundation for mapping relationships between nodes and elements, which is necessary for reconstructing structured layers. The data structure allows for the efficient traversal and identification of edges shared between elements, enabling the formation of a coherent network around the airfoil. The airfoil boundary is located by identifying nodes  
Figure 11: Boundary layer recognition. Figure 10: Structured inflation layer flowchart. lying along its surface. These nodes are determined based on their spatial arrangement (their proximity to the plane of interest), their velocity magnitude (which should be zero according to the no-slip boundary condition imposed), and distinct geometric features, such as proximity to the airfoil shape and minimal deviation in the tangential direction. Once identified, the airfoil nodes are chained into a continuous sequence, representing the airfoil surface from the leading edge to the trailing edge. This chaining process preserved the geometric coherence of the airfoil outline. Subsequently, elements connected to the airfoil nodes are isolated, using the connection information from the solver, forming the first inflation layer directly adjacent to the airfoil. The elements are ranked based on their proximity and connectivity to ensure an unambiguous representation of the layer. Using the elements of the first layer as a foundation, additional inflation layers are constructed incrementally. For each layer, the following process is applied:  
1. **Element Connectivity Traversal**: The neighboring elements of the current layer are identified through their shared edges. 2. **Velocity and Y-Coordinate Filtering**: Candidate elements for the next layer are filtered based on predefined constraints on x-velocity component and vertical (z-axis) alignment, ensuring physical relevance. 3. **One-to-One Mapping**: A one-to-one mapping is enforced between elements of consecutive layers to maintain coherence. This ensured that each element in a new layer corresponded to exactly one element in the previous layer, preserving the structured arrangement. 4. **Continuity Validation**: Additional continuity checks ensured the spatial arrangement of elements remained consistent. A maximum allowable distance criterion was applied between consecutive elements to detect and resolve discontinuities. With the structured data array, including computed variables such as the fluid velocity and turbulent viscosity ratio, the boundary layer height can be determined at any position along the airfoil [48; 61].