# An Automated Framework for Streamlined CFD-Based Design and Optimization of Fixed-Wing UAV Wings
## 3 Framework Breakdown
### Geometry Module  
The geometry module is critical for generating CFD-ready wing geometries, ensuring compatibility with the following meshing and simulation processes. According to [41], a \"good\" geometric model tailored to the requirements of CFD not only enhances workflow efficiency but also ensures reliable and reproducible results--an essential objective of  
Figure 4: Framework pipeline. More than 35 custom functions have been developed to facilitate the framework.  
this framework, where robustness is paramount. Using an object-oriented programming approach, the module features a dedicated _Wing_ class, as shown in Figure 5.  
The _Wing_ class methods can be distinguished into three categories:  
* Geometry Modeling: involves defining design parameters and producing the core geometry, automating blending between sections, calculating the Mean Aerodynamic Chord (MAC), and determining the center of gravity.
* Operating Conditions: definition of flight conditions and computation of key metrics.
* Case Management: exports geometry in STEP format and records attributes in an XML file for case tracking.  
Trailing edge (TE) treatment, section blending, and Mean Aerodynamic Chord (MAC) calculation are integral to ensure that the generated wing geometries are appropriate for CFD meshing. The trailing edge cut is applied to improve mesh quality and numerical stability, as sharp TEs often lead to a high aspect ratio or skewed cells, affecting solver convergence [42]. To maintain consistency, the TE thickness is set to 1% of the chord length, a commonly recommended guideline for subsonic applications [41]. Blending between wing sections is fully automated to eliminate abrupt transitions, ensuring geometric continuity across all generated designs. The framework prioritizes the second section as the primary  
Figure 5: Wing class developed for the geometry module along with its sub-methods.  
lifting surface, with the first section adjusted to enforce tangency at the leading and trailing edges, preventing discontinuities at the symmetry plane.  
Additionally, the MAC is computed using a weighted averaging approach, serving as the reference chord length for moment coefficient (Cm) calculations, which define the pitching moment characteristics of the wing about its aerodynamic center [7]. Moreover, MAC serves as the characteristic length for the calculation of the Reynolds number. These treatments eliminate human intervention and are executed in the background, minimizing the workload needed for geometry preparation. Further details on TE treatment methodology, blending algorithms, and MAC computation are provided in Appendix A.1.  
The right-hand side of Figure 5 highlights additional capabilities of the geometry module. While these functions, such as the calculation of Reynolds and Mach numbers, do not directly contribute to geometry generation, they provide essential metrics for flow characterization and categorization. Finally, through case management methods, the generated wing geometry can be exported in STEP file format, while the design parameters of the wing along with the calculated metrics can be recorded in an XML file for case tracking.