|
[Sponsors] |
Tool to convert OpenFoam mesh to SU2 mesh (2D and 3D) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
August 11, 2017, 14:33 |
|
#21 |
New Member
Prakriteesh Sarma
Join Date: Oct 2016
Posts: 6
Rep Power: 10 |
Hi Laurent,
Thanks for the quick response. This seems to have fixed the throwing of the error. But now I have another problem from the same line. During the format conversion process, it gets stuck while doing one particular cell, (cell no. 18003 out of 1738006).. When I tried to debug, it appears that this 'if' conditional is never true, so the outer 'while' loop never gets terminated.. (for the previous cells, the process didnt enter this 'while' loop, so the problem appeared only for this cell) : Code:
if (len(CommonPoints(listFaces[listCells[i][j]], listFaces[listCells[i][listLateralFacesOrdered[p]]])) == 2): Can you please help fix this. Thanks Prakriteesh Last edited by fluxCatcher; August 11, 2017 at 14:35. Reason: text layout gone wrong |
|
August 11, 2017, 17:24 |
|
#22 |
Member
Join Date: Sep 2013
Posts: 43
Rep Power: 13 |
It's a long time I have not used this tool and I have never tried to convert meshes with pyramids. Nevertheless, I have looked at the part of the code for the pyramids and found that there is a mistake. I have done a small correction and I hope it will help you. The new code is in attachement.
If you find other bugs, don't hesitate to correct them and share your new code with the community of SU2 users. Regards, Laurent |
|
August 12, 2017, 10:12 |
|
#23 |
New Member
Prakriteesh Sarma
Join Date: Oct 2016
Posts: 6
Rep Power: 10 |
Hi ,
Thanks for the new code. The bug isn't gone yet for pyramid cells, but I will try fixing it if I can. Kind regards Prakriteesh |
|
October 25, 2017, 07:17 |
Very Useful
|
#24 |
New Member
Alessandro Mogavero
Join Date: Nov 2012
Location: Glasgow
Posts: 15
Rep Power: 14 |
Hi Combas,
thank you for posting this script, it is very useful. May I suggest that you put it on the SU2 project, it would be a very nice contribution. However I am now facing a problem during the writing of the su2 mesh: Code:
******************************************************* Program to convert OpenFoam meshes to SU2 mesh format This program has been written by Laurent Berdoulat laurent.berdoulat@wolfconseil.com date: 11/12/2013 ******************************************************* Enter the name of the input file:TemplateOpenFoamToSU2_2D.txt Reading of the input file TemplateOpenFoamToSU2_2D.txt pathOpenFoamMesh = HB2-24/constant/polyMesh pathSU2Mesh = ./ nameSU2MeshFile = hb2-OF.su2 kindMesh (2D/3D) = 2D axisProjection = Z Input file read correctly Reading of the 'points' file nb points = 277191 'points' file read correctly Reading of the 'faces' file nb faces = 551610 'faces' file read correctly Reading of the 'owner' file nb cells = 137700 nb internal faces = 274420 'owner' file read correctly Reading of the 'neighbour' file 'neighbour' file read correctly Reading of the 'boundary' file nb boundaries = 7 Boundaries = {'frontAndBack': [275400, 0, 'empty'], 'wall': [275400, 810, 'wall'], 'inlet': [274420, 810, 'patch'], 'frontAndBack_pos': [276210, 137700, 'wedge'], 'outlet': [275230, 170, 'patch'], 'frontAndBack_neg': [413910, 137700, 'wedge'], 'axis': [275400, 0, 'symmetryPlane']} 'boundary' file read correctly Beginning of the format conversion process Conversion progress: 10 % done Conversion progress: 20 % done Conversion progress: 30 % done Conversion progress: 40 % done Conversion progress: 50 % done Conversion progress: 60 % done Conversion progress: 70 % done Conversion progress: 80 % done Conversion progress: 90 % done Conversion progress: 100% done Conversion to 2D mesh listCorrespondance done listFaces updated listCellsPoints updated Final listPoints created Final listCellsPoints created listBoundaries updated Format conversion process ended with success! Beginning of the .su2 mesh file writting pathAndFileName = ./hb2-OF.su2 File opened Problem during the .su2 mesh file writting |
|
October 26, 2017, 05:46 |
|
#25 |
Member
Join Date: Sep 2013
Posts: 43
Rep Power: 13 |
Hi,
I am sorry but I have no idea... You should check first that you don't have a problem of hard disc full on your computer. Then, you can open the output file and check if it is empty or not. If it is not empty, you can find which part of the writing process fails. Finally, you can add some "print" commands in the script, or use a Python debugger to find what is wrong. Regards, Laurent |
|
October 26, 2017, 05:59 |
|
#26 |
New Member
Alessandro Mogavero
Join Date: Nov 2012
Location: Glasgow
Posts: 15
Rep Power: 14 |
Thank you, I have found what was wrong. The Open Foam mesh was not generated by extrusion, but using an app to transform it into a wedge.
Using your app before the transformation into a wedge, solved the issue. |
|
November 10, 2017, 11:57 |
|
#27 | |
Member
Join Date: Nov 2015
Posts: 30
Rep Power: 11 |
Quote:
Many thanks for this. I was actually looking for a *.cgns to *.su2 converter but since ICEM can also export *.msh this might work as well. |
||
November 13, 2017, 05:22 |
|
#28 |
Super Moderator
Tim Albring
Join Date: Sep 2015
Posts: 195
Rep Power: 11 |
Hi,
thanks for this nice and useful tool! Can someone quickly summarize the capabilities of the current version? If the main creator agrees, we would like to add it to the mesh tools repo (https://github.com/su2code/MeshTools). Thanks guys! Tim
__________________
Developer Director @ SU2 Foundation Get involved:
|
|
June 30, 2018, 07:05 |
OpenFOAM mesh to .SU2
|
#29 |
Senior Member
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13 |
Hello friends ,
I got following message while converting OpenFOAM mesh to .SU2 format Problem during the input file reading (InputOpenFoam2SU2.dat) |
|
June 30, 2018, 09:51 |
|
#30 | |
Senior Member
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13 |
Quote:
************************************************** ***** Program to convert OpenFoam meshes to SU2 mesh format This program has been written by Laurent Berdoulat laurent.berdoulat@wolfconseil.com date: 11/12/2013 ************************************************** ***** Enter the name of the input file:input.txt Reading of the input file input.txt pathOpenFoamMesh = /home/harsha/OpenFOAM/harsha-2.4.0/steam_jet_ejector_cfMesh/constant/polyMesh pathSU2Mesh = /home/harsha/OpenFOAM/harsha-2.4.0/steam_jet_ejector_cfMesh nameSU2MeshFile = ejector.su2 kindMesh (2D/3D) = 3D Input file read correctly Reading of the 'points' file nb points = 190671 'points' file read correctly Reading of the 'faces' file nb faces = 513776 'faces' file read correctly Reading of the 'owner' file Problem during the 'owner' file reading I got this error while converting Mesh |
||
September 2, 2018, 07:19 |
|
#31 |
Senior Member
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13 |
It does not work. Problem during the 'owner' file reading
|
|
September 20, 2018, 07:52 |
|
#32 |
Senior Member
harshawardhank
Join Date: Mar 2014
Posts: 209
Rep Power: 13 |
Mesh created using snappyHexmesh or cfmesh is not getting converted into .su2 format
|
|
January 14, 2022, 15:00 |
Openfoam7
|
#33 |
New Member
jose daniel
Join Date: Apr 2020
Posts: 26
Rep Power: 6 |
Thank you!
|
|
January 14, 2022, 15:28 |
To msh file
|
#34 |
New Member
jose daniel
Join Date: Apr 2020
Posts: 26
Rep Power: 6 |
Hello. Thanks for your help.
I already created the su2 2D file from foam mesh. Now I'm trying to conver the su2 file to .msh (or any format that fluent can read). Any sugestion? Thanks |
|
January 14, 2022, 16:21 |
|
#35 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 676
Rep Power: 21 |
You can convert directly from foam to fluent with FoamMeshToFluent. You can also use pypi meshio to convert meshes in python.
|
|
January 14, 2022, 18:10 |
2D OpenFOAM to 2D fluent
|
#36 |
New Member
jose daniel
Join Date: Apr 2020
Posts: 26
Rep Power: 6 |
Hello. The problem is that using foam convert, a 3D mesh is obtain in fluent (from 2D openFOAM case). Thats why I converted first to SU2 2D. Meshio doesnt works neither.
|
|
January 15, 2022, 04:36 |
|
#37 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 676
Rep Power: 21 |
What is the problem with meshio? It might be that you lose the boundary conditions, but you can add them in Fluent again.
The best option is maybe (if you have the original CAD file) to export the CAD in a format that you can import in the Fluent Mesher, like cgns, and then mesh in Fluent. |
|
January 15, 2022, 15:46 |
|
#38 |
New Member
jose daniel
Join Date: Apr 2020
Posts: 26
Rep Power: 6 |
Hello. I attach the capture of the error of meshio from su2 to msh.
Moreover, the url for the su2 mesh if you can take a look: https://drive.google.com/file/d/1uat...ew?usp=sharing Thanks for helping. |
|
January 17, 2022, 06:38 |
|
#39 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 676
Rep Power: 21 |
OK, try creating a mesh with only one cell type (either triangles or quadrilaterals), because it is complaining that you need to supply more information if you have a mixed mesh.
Can you not convert convert to a cgns? You can then read the same mesh with fluent and su2. |
|
January 17, 2022, 12:49 |
|
#40 |
New Member
jose daniel
Join Date: Apr 2020
Posts: 26
Rep Power: 6 |
It is suppose it has only quads. Moreover I tried with cgns but the only way to read that mesh in ansys is via ICEM, but it says that the cgns file was written in a recent version of cgns. I did not found information about how to upgrade the library cgns of ansys (I have the 2020 R2 ansys)
|
|
|
|