CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Special Topics > Mesh Generation & Pre-Processing

Salome meshing to OpenFOAM

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 30, 2019, 10:51
Default Salome meshing to OpenFOAM
  #1
New Member
 
Frédéric MR
Join Date: Jun 2019
Posts: 18
Rep Power: 5
FM_Stiral is on a distinguished road
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.
FM_Stiral is offline   Reply With Quote

Old   October 1, 2019, 09:03
Default
  #2
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 11
Flowkersma is on a distinguished road
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
Flowkersma is offline   Reply With Quote

Old   October 2, 2019, 06:51
Default
  #3
Member
 
Damian Berghof
Join Date: May 2019
Posts: 41
Rep Power: 9
virengos will become famous soon enough
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
__________________
Get more support about Meshing with Salome and Visualization with ParaView in my growing groups
https://bit.ly/2lFfDkQ
https://bit.ly/2k2u8Pj
virengos is offline   Reply With Quote

Old   October 3, 2019, 10:58
Default
  #4
New Member
 
Frédéric MR
Join Date: Jun 2019
Posts: 18
Rep Power: 5
FM_Stiral is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
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 is offline   Reply With Quote

Old   October 3, 2019, 11:01
Default
  #5
New Member
 
Frédéric MR
Join Date: Jun 2019
Posts: 18
Rep Power: 5
FM_Stiral is on a distinguished road
Quote:
Originally Posted by virengos View Post
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
FM_Stiral is offline   Reply With Quote

Old   October 3, 2019, 12:28
Default
  #6
Senior Member
 
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 11
Flowkersma is on a distinguished road
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
Flowkersma is offline   Reply With Quote

Old   October 4, 2019, 10:05
Default
  #7
New Member
 
Frédéric MR
Join Date: Jun 2019
Posts: 18
Rep Power: 5
FM_Stiral is on a distinguished road
Quote:
Originally Posted by Flowkersma View Post
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 is offline   Reply With Quote

Old   October 4, 2019, 12:36
Default
  #8
New Member
 
Frédéric MR
Join Date: Jun 2019
Posts: 18
Rep Power: 5
FM_Stiral is on a distinguished road
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 is offline   Reply With Quote

Old   October 15, 2019, 09:59
Default
  #9
New Member
 
Frédéric MR
Join Date: Jun 2019
Posts: 18
Rep Power: 5
FM_Stiral is on a distinguished road
Finally I solved my problem : I had to create a single part in solidworks and split it in Salome.
FM_Stiral is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Map of the OpenFOAM Forum - Understanding where to post your questions! wyldckat OpenFOAM 10 September 2, 2021 06:29
OpenFOAM v3.0.1 Training, London, Houston, Berlin, Jan-Mar 2016 cfd.direct OpenFOAM Announcements from Other Sources 0 January 5, 2016 04:18
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 cfd.direct OpenFOAM Announcements from Other Sources 2 August 31, 2015 14:36
2D - Von Karman - Salomé - OpenFoam aaaallleex OpenFOAM Running, Solving & CFD 2 April 14, 2015 17:16
New OpenFOAM Forum Structure jola OpenFOAM 2 October 19, 2011 07:55


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