Sig Numerical Optimization / Tips & Tricks
1 Basic procedure of mesh generation with cfMesh
For geometry creation to mesh with cfMesh the easiest way is to use .stl file type because it is supported in most CAD software. Key is to export each patch as separated .stl file (in ASCII type. NOT BINARY!!!) and then combine those files in one .stl file with added names of patches. The procedure is thoroughly explained in thread: Salome and cfMesh parametrization.
For boundary layer generation, it is important to have connected patch surfaces. This means your patch needs to be made of connected surfaces in open or closed way, as cfMesh captures feature edges at the border between the two patches or where it finds a feature edge defined by the user. For example:
- in the turbine example, surfaces of each blade should form patch for it self.
- in case with multiple seperated inlets, each inlet surface needs to be patch for it self.
To get good meshes it is recommended to follow these extra guidelines for the following specific mesh generators.
Cartesian2DMesh proves to be a very good mesh generator to be included in the optimization routine, because of its easy to understand input file and fast speed in generating the required mesh. In addition, it is able to generate boundary layers with ease, compared to other open-source mesh generators.
While working with this tool, the following guidelines have to be followed in order to avoid mistakes and unproper meshing:
- in 2D, the geometry should be drawn in the x-y plane (the default plane in the 2D draw of Salome). A geometry placed in the x-z or y-z plane will cause errors.
- the geometry should only be made of external patches. These patches can be easily selected and named using Salome (New entity -> Group -> Create group -> Surfaces (3rd bottom on the top-right). Front and back patches should not be included, as cartesian2DMesh will generate these patches itself (naming it topEmptyFaces and bottomEmptyFaces).
- Input files .fms or .ftr are also recommended in cartesian2DMesh. It is possible to convert an .stl to .ftr using the command surfaceConvert geometry.stl geometry.ftr
With .ftr geometries, it is possible to specify patch types which are transferred onto the resulting mesh in the meshing process. This is an advantage which simplifies the process of setting up a simulation.
For cartesianMesh it is enough to follow basic cfMesh procedure described above.