Fast and easy way to create full Hex Elements Meshes for curved Pipes with 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, I used the Salome Version 9.3.0 on my Linux Fedora machine.

The mesh and the simulated CFD data will be later used as a basis for my next tutorial about Visualization with ParaView. It would be desirable to have a fully automated and robust meshing work-flow, but at the moment we are still a few steps away from that. 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. Let me know if you have any questions or need some support when creating the 3D model or the mesh. If desired, we can schedule an online meeting to clarify all issues. 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. 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 uncomplicated way to open it!

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. I know already from experience, that for the creation of Hexa 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 wall groups. To control the cell ratio along the pipe, one more group was created for all the flow path edges, as visible in the Pipeline Browser.
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
Please follow and like us:
error
Close Menu