## 3 Workflow Description
### Mesh Generation
#### 3.3.2 Automated Configuration of the _snappyHexMeshDict_  
_snappyHexMesh_ is one of the grid generators available in the OpenFOAM suite. Starting from the.stl files of the fluid domain and the base grid created using _blockMesh_, it is capable of systematically discretizing even complex geometries. The generation of the snappyHexMeshDict is automated by T-WorkFlow, and this file is made by five parts, which are briefly described below: (i) geometry; (ii) castellatedMeshControls; (iii) snapControls; (iv) addLayersControls; (v) meshQualityControls. In the geometry section, the entities that define the fluid domain are specified. This includes identifying the names of the corresponding.stl files, which must be located in the constant/triSurface  
Figure 9: Comparison between mesh given by the same snappyHexMeshDict in a cross-section of the channels. folder. Once these entities have been defined, the progressive refinement phase of the underlying grid defined by _blockMesh_ begins. This is carried out according to the information provided in castellatedMeshControls and follows an octree-refinement-based algorithm. The refinement levels selected for the different surfaces are fixed and have been chosen to balance the quality of the resulting grid, the time required for its generation, and the total number of cells, according to the specifications of Tatuus Racing S.p.a. In this phase, particular attention is given to certain regions of the radiator that require a larger mesh density to be properly represented. To this end, through the OpenFOAM command _surfaceFeatures_, it is possible to extract from the.stl files indicated in the corresponding dictionary some features of the surface where a higher mesh refinement is required. Particularly, this command generates the.eMesh files in constant/triSurface folder, which can then be referenced in the feature section of castellatedMeshControls, along with the corresponding refinement level. The maximum level of refinement is imposed on the contour of the radiator channels to properly capture their very pronounced curvature (see Figure 9a). Another region to be refined is the edge of the tanks to accurately discretize the junction between the radiator channels and the tanks themselves, as shown in Figure 10. To achieve this, the region of the radiator channels alone was included in a dedicated.stl file during the pre-processing phase, cf. Section 3.2. In this way, through the OpenFOAM command _surfaceFeatures_, it's possible to generate the channel.eMesh file to which the highest level of refinement is effectively applied. Once the surface refinement phase is completed, _snappyHexMesh_ removes the cells not contained in the fluid domain, i.e., all but those cells included in the internal region of the input.stl files. The internal region is identified by means of the coordinates of the point provided through the locationMesh keyword in castellatedMeshControls, and the software automates the writing of these coordinates. This operation is based on the coordinates of Point 3, represented in Figure 8, which corresponds to the barycenter of the \"Base Surface\", shown in Figure 5. These coordinates are known due to the information obtained through the FreeCAD macro, cf. Section 3.1. Specifically, Point 3 of Figure 8 is translated in the direction opposite to the normal of the surface on which it resides by a small fraction of the length of the vector connecting it to one of the barycenter of the outermost channels. Following this approach the coordinates of a point within one of the radiator tanks, which are subsequently assigned to the locationInMesh keyword within castellatedMeshControls, are obtained. Upon completion of the refinement, the snapping phase begins. This process involves a series of operations aimed at conforming the generated mesh to the reference geometry, thereby enhancing its alignment with the computational domain boundaries defined by the input.stl files.