Fast and Easy Way to Create Full Hex Elements Meshes for Curved Pipes with Salome
Full hex elements mesh for curved pipe in Salome

Fast and Easy Way to Create Full Hex Elements Meshes for Curved Pipes with Salome

In this post, I want to show you one possible and uncomplicated way, how CFD meshes for curved pipes can be generated with the Salome Software. For this demonstration, the Salome version 9.3.0 on my Linux Fedora machine was used. Unfortunately, at this time I was not aware the new Shaper module exists. Therefore, all the 3D design work has been done by using the older GEO module.

The featured mesh and the simulated CFD data will later serve as a basis for my next tutorial about visualization with the ParaView tool. Generally, it would be desirable to have a fully automated and robust meshing work-flow. However, currently, we are still a few steps away from that. In conclusion, I’m going to explain what’s the reason for that at the end of this article.

Instead of a detailed step by step instruction, I will only focus on some essential steps here. So, let me know if you have any questions or need some support when creating the 3D model or the mesh. If desired, we can also schedule an online meeting to clarify all issues. Moreover, feel free to visit our Salome CAE Group on Facebook and discuss the topic there as well.

And if you can’t wait and would like to investigate the 3D model and the mesh immediately, so visit my Google Drive Page and download the complete project files from there. Apart from this, the data is also available in STL format and can be opened with a simple Viewer: Check my overview with available OpenSource Tools if you’re looking for an appropriate tool!

3D modeling and meshing strategy for simple pipes

As an example, I decided to choose a curved pipe with a continuous notch, which might indicate a weld seam. The official Salome documentation gives already some hints, that for the creation of Hex elements, the geometry must be divided into appropriate blocks.
Which consists of:

  • 8 vertices
  • 12 edges
  • 6 quadrangular faces

Salome offers a good build-in O-grid generator. One can generate straight, curved and scaled sections, or even extrude an O-grid disk along a curve. Unfortunately, I was not able to merge all my sub-section to one object without issues. Because of that, I decided to move on with my activities and to create some partitions elements for the pipe with FreeCAD and import it into Salome, which at the end, works like a charm. I’m planning to do the same with the SHAPER module, which should be principally possible as well.

How to Generate suitable geometry partitions

The first step was to create some partitions on the pipe by using the imported Shells / Segments and the Salome Partition Tool (Operations | Partition).

Due to the attached, lateral groove to the pipe geometry, the standard hexagon O-grid structure must be modified accordingly. All the subareas must consist of four edges and there should not be any sharp angles. In addition to the already created partitions, two more are required on the tangential pipe transitions, to avoid any distorted cells in these sections. Simply create two lines and extrude them to surfaces, that it’s.
The consistency of the created 3D object can be checked by using several functions from the (Inspection) menu.
Before moving on with any meshing operations, I strongly recommend performing the (Check Compound of Block) check!

Generate groups for meshing and the subsequent CFD simulation

For the subsequent CFD simulation, all individual areas must be grouped to be able to define the boundary conditions for the solver. In this case, these are the inlet, outlet and the wall groups. As visible in the Pipeline Browser, and to control the cell ratio along the pipe, one more group has been created for all the flow path edges. Finally, The groups can be created by using the (New Entity | Group | Create Group) command.

Meshing Procedure using the SMESH module

The meshing process has been split into two stages. Primarily, all the 3D-2D-1D parameters were assigned to the entire pipe geometry, as shown in the pictures below. Next, some sub-meshes were defined, based on the basic mesh and the flow-path-edges-group to control the cell ratio along the pipe. One can also use the growth function for this purpose.
Despite the fact, the Salome SMESH Module is running only on a single core, it took just a few moments to create the entire mesh with appr. 243K cells!

Mesh Check and Export

Finally, the mesh has been checked visually and qualitative. Salome offers numerous features for this purpose in the (Controls) menu. To verify the mesh from inside with few clips, one can use the  comfortable (Clipping) operation, which is placed in the (RMB Context Menu). Once the check operations are completed, all the required groups for the CFD-simulation must be created based on the 3D geometry with the
(Mesh | Create Groups from Geometry) function. In the end, I dumped the file into the UNV format (File | Export | UNV File), which can be easily converted into the OpenFOAM format by using their terminal commands.
The entire project can be exported to a Python file, which can be used for automatization. A good overview of the possibilities offers the official Salome documentation.

What is the mesh good for? | CONCLUSION

To get a fully developed pipe flow during the simulation, the inlet area of the mesh needs to be extended. For this purpose, I use my self-developed bash script with integrated OpenFOAM commands.

The created mesh will be used for my simple CFD benchmark, which will run on my scaleable Digital Ocean Droplet. Both with OpenFOAM and Code Saturne. If you want to check Digital Ocean’s services, you can follow my referral link to get a $50 credit for your new account.

My next Salome meshing project will be about robust boundary layer creation on this pipe model. Also, some more tests on my T-junction pipe for Hexa meshing will be performed with the new parametric SHAPER module.

Comments and discussions about this post are welcome in our Salome CAE group on Facebook!

update on 2019-10-29

During the CFD-Simulation some slight irregularities have been detected caused by the mesh topology. I redesigned the mesh to reduce the cell ratios and aspect ratios. My script to create the inlet and outlet extensions works like a charm and can be downloaded from my GitLab account, any contribution is appreciated.
The boundary layer creation was performed with a simple OpenFOAM command and some default values for the wall mesh size. I used the following settings in the CLI to get 4 layers:

$ refineWallLayer -overwrite '(obj_wall)' 0.7
$ refineWallLayer -overwrite '(obj_wall)' 0.7 
$ refineWallLayer -overwrite '(obj_wall)' 0.5

System configuration for this project:

  • Fedora Linux 29
  • OpenGL 3.1 Mesa 18.3.6 / LLVM 7.0.1
  • Salome 9.3
  • openFOAM v7
  • ParaView 5.6