CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Mesh Generation & Pre-Processing (https://www.cfd-online.com/Forums/mesh-generation/)
-   -   Salome meshing to OpenFOAM (https://www.cfd-online.com/Forums/mesh-generation/220996-salome-meshing-openfoam.html)

FM_Stiral September 30, 2019 09:51

Salome meshing to OpenFOAM
 
Hi Salome and openFOAM users.


I am facing a problem with mesh conversion from Salome to OpenFOAM.


Context :



1 / My geometry is made of 3 parts : a pipe, a rectangular pipe and a junction (for mesh transition). The geometry is constructed with Solidworks and exported as STEP file


2 / I use Salome for mesh generation (I import the step file, explode the assembly in 3 solids). I mesh each solid independently (3D extrusion for pipe and rectangular pipe, and NetGen 3D for junction) BUT with a continuity at interface faces (using import 1D-2D Elements from Another Mesh algorithm as sub mesh). Of course, I create groups of faces for boundaries (inlet, outlet and wall).

Then I make a compound with the 3 different meshes.


At this step, everything seems ok. Problems start at the following steps.


3 / For OpenFOAM mesh use, I need a compatible mesh format.

1 : My 1st option is to export my mesh in .UNV file (however, this format do not recognize pyramids and this is a big problem for me).
2 : My second option is to use python scripts (SalomeToOpenFOAM). This script is very interesting (thank to nicolasedh and others for their contributions). However, using this script, I have internal faces at the interface between the pipe and the junction that are recognized as external faces and made in defaultPatches face group.

3 : Other solution ?




I would like to keep Solidworks for CAD generation, Salome for mesh generation because I find it easy to use (when you have spend time playing with it) but if you know a free software easy to use with a good documentation I could change, and of course OpenFOAM.


For information, when I realize a face control (faces with bare border) in Salome, it seems faces that cause my problem are highlighted. However, I don't know how to fix my problem.




In attachment, I share my Step file (I would like to share my salome file but it is too big, even with cleared mesh data).



Thank you for you help and time spent to my demand, and do not hesitate if my demand is not very clear.
I hope you can help me.

Flowkersma October 1, 2019 08:03

Hi,

I think that the mesh that you are exporting from Salome contains 3 different regions which are not stitched together and that's why you get the internal faces. Are the meshes conforming at the interfaces? You could try to fix this either in Salome or in OpenFOAM by using stitchMesh utility.

Best, Mikko

virengos October 2, 2019 05:51

Hello Frédéric,
as already pointed out by Mikko, it seems you have really 3 regions/meshes.
To avoid such problems, I myself use the OpenFOAM "extrudeMesh" function to easily create the extensions.
You can check my script on GitLab for this purpose:
https://gitlab.com/virengos/openfoam...01_extrudeMesh
best,
Damian

FM_Stiral October 3, 2019 09:58

Quote:

Originally Posted by Flowkersma (Post 745952)
Hi,

I think that the mesh that you are exporting from Salome contains 3 different regions which are not stitched together and that's why you get the internal faces. Are the meshes conforming at the interfaces? You could try to fix this either in Salome or in OpenFOAM by using stitchMesh utility.

Best, Mikko


Thank you Mikko for your answer.


My geometry is made of 3 parts exported (Assembly in Solidworks). Therefore I understand why it could be seen as three different regions. But the meshes are made to have continuity at interfaces (but I'm not sure if it is really conform even if using "Import 1D-2D Elements from Another Mesh" algorithm should make a conform mesh at the interfaces.


But I don't understand how to fix this in Salome. And depending on what part I mesh 1st, the SalomeToOpenFOAM.py script can fail and give the following error "IndexError : list assignment index out of range" I think this is due to the bad interface faces but not sure.


I would like to share my Salome study (.hdf) in order to have an easier way to discuss about my problem but it size is big. Do you know a mean to do this ?


Thank you again.


Fred

FM_Stiral October 3, 2019 10:01

Quote:

Originally Posted by virengos (Post 746022)
Hello Frédéric,
as already pointed out by Mikko, it seems you have really 3 regions/meshes.
To avoid such problems, I myself use the OpenFOAM "extrudeMesh" function to easily create the extensions.
You can check my script on GitLab for this purpose:
https://gitlab.com/virengos/openfoam...01_extrudeMesh
best,
Damian




Thank you Damian for your time.


If I well understand, your script is used to create the mesh ? Or you first create your mesh in Salome and after "repair" when it is in OpenFOAM mesh format (using SalomeToOpenFOAM.py script ?).


Fred

Flowkersma October 3, 2019 11:28

Hi Fred,

Unfortunately, I don't have much experience with Salome so I'm not sure if I can help you. You can upload the file to some cloud service provider and give us a link.

Best, Mikko

FM_Stiral October 4, 2019 09:05

Quote:

Originally Posted by Flowkersma (Post 746142)
Hi Fred,

Unfortunately, I don't have much experience with Salome so I'm not sure if I can help you. You can upload the file to some cloud service provider and give us a link.

Best, Mikko


Each answer is always an help even when it doesn't solve the problem directly :)
I have uploaded my CAD + mesh files (available here https://wetransfer.com/downloads/18d...4130314/378bb0). I think it can help to understand how I have created my geometry and mesh (I'm not sure if it's the best way).


Thank you for your contribution.

Fred

FM_Stiral October 4, 2019 11:36

2 Attachment(s)
I see where my problem is located.
In the following images, the CAD imported in Salome (we can see non continued edges between the pipe and the junction, I think mesh generation is based on the CAD edges and it involve a gap between the two meshes. But I don't know how to reorient the edges.


Thank you for your time.


Fred.

FM_Stiral October 15, 2019 08:59

Finally I solved my problem : I had to create a single part in solidworks and split it in Salome.


All times are GMT -4. The time now is 00:00.