## 3 Workflow Description
### Geometry Processing  
T-WorkFlow uses the _blockMesh_ and _snappyHexMesh_ tools part of the OpenFOAM suite for the generation of the computational mesh, as detailed in Section 3.3. _snappyHexMesh_ is a fully parallel mesh generator that takes as input an existing (background) mesh, usually generated by _blockMesh_, and automatically and recursively splits its hexahedra to capture  
Figure 6: Summary of T-WorkFlow main operations and user interaction. the surface of the CAD model accurately. Before creating the mesh, some pre-processing operations need to be performed on the.stl files provided as input. It is essential to scale these files properly to ensure that their dimensions are expressed in meters, as OpenFOAM assumes this unit of measurement for.stl files. Depending on the CAD export settings, these data may, in fact, be in different units, usually millimeters. To perform this scaling for the inlet, outlet, and wall surfaces, T-WorkFlow uses the OpenFOAM command _surfaceMeshConvert_. Our empirical evidence indicates that the position and orientation of the CAD model in the frame of reference of the initial (background) Cartesian grid created by _blockMesh_ have a significant impact on the quality of the mesh produced by _snapyHexMesh_, as well as the time it takes to generate the grid. In fact, the sides of the background grid generated by _blockMesh_ are aligned by design with the Cartesian directions. Therefore, the.stl geometry files, which are typically provided in the vehicle reference system, cf. Figure 4, need to be properly rotated to fit the domain. We achieved the best results by applying two consecutive transformations: (i) align the ducts axis with a Cartesian direction and (ii) align the vector connecting the barycenter of the outermost channels with a second Cartesian direction. This process is schematically represented in Figure 7. These transformations are performed using the OpenFOAM _surfaceTransformPoints_ command, which automatically defines the axis and angle of rotation based on the directions of a vector before and after the transformation. Hence, to execute transformation (ii), it is necessary to know the coordinates of the points extracted by using the FreeCAD macro, cf. Section 3.1, after the first rotation (i). To this end, before applying any rotation, T-WorkFlow generates the triangulation_not_rotated.stl file, containing the surface defined by the points extracted by the FreeCAD macro, as represented in Figure 8. Rotation (i) is then applied to both the.stl files related to the radiator surface and to triangulation_not_rotated.stl using the OpenFOAM command _surfaceTransformPoints_. This leads to the creation of the triangulation_1.stl file containing the coordinates of the points originally extracted using the FreeCAD macro after the first rotation. By reading this file, it is therefore possible to define the vector connecting the centroids of the two outermost channels, which is then used to apply rotation (ii) to both the.stl files related to the radiator surface and to triangulation_1.stl. In this way, in addition to obtaining what is schematically represented in Figure 7, the file triangulation.stl is generated, from which the coordinates of points 1, 2, and 3, represented in Figure 8, are obtained as a result of the applied rotations. T-WorkFlow then applies the same transformations to the gravitational acceleration vector through appropriately defined rotation matrices. The impact of these operations on the generation of the computational grid is shown in Figure 9 for a detail of the cross-section of a channel. The last pre-processing operation performed by T-WorkFlow involves splitting the.stl file of the wall surface, see Figure 1, into two additional files: (i) channels.stl, which represents only the surfaces of the radiating channels; (ii) walls.stl, which includes the surfaces of the tanks as well as the inlet and outlet channels. This subdivision may already be present in the original.stl file provided as input, depending on how it was exported by the designer.