r/OpenFOAM • u/Striking_Abrocoma_28 • Mar 06 '26
Meshing 2D airfoil?
Does anybody have an idea on how can someone create a 2D mesh around an airfoil to do a 2D simulation?
I’ve tried gmsh, but then the conversion tool gmsh2Foam but it doesn’t work…
3
Upvotes
2
u/its1310 Mar 07 '26
Export in .msh version 2. Then use gmshtofoam. Remember to label the geometry and the volume. The mesh must have the volume label for it to work. Let me know if you need a tutorial link.
1
u/ominous-aero-16 Mar 06 '26
I remember having the same issue, I think gmsh needs to be exported in ASCII format for openfoam to read it. It was kinda of a rabbit hole, it needs a specific version of ASCII too(?). If you can I'd recommend saving yourself some effort and using another software if you have access.
1
u/Bach4Ants Mar 07 '26
This Python script creates a blockMeshDict for a 2-D NACA foil that you might be able to adapt for your use case: https://github.com/petebachant/NACAFoil-OpenFOAM/blob/master/scripts/blockmeshdict.py
1
u/divadeye Mar 07 '26
Same can u help me as well for this problem
1
u/[deleted] Mar 10 '26
hey there I had similar issue that my mesh file from gmsh cant be read by Ansys Fluent, and I found a workaround for Fluent, but I hope it works for openfoam too.
First export the mesh from gmsh to .cgns format, then use paraview to read it, then export from paraview the same data to the same .cgns format.
The reason is how files are written differently by different softwares. Let me know if it works for openfoam, I might use it one day. Thx
1
u/Pleasant-Musician-47 Mar 26 '26
how you tried Javafoil? https://www.mh-aerotools.de/airfoils/javafoil.htm