Exporting mesh from Ansys Workbench to OpenFOAM

If you use Ansys® Workbench® to build your mesh, you probably noticed that the .msh file exported is binary, and cannot be converted properly by the OpenFOAM® converter fluentMeshToFoam. However there is a workaround. Simply set the variable


before launching workbench, or add it to your ~/.bashrc file. This will automatically force the mesher to save .msh files in ASCII format, which can be then imported as usual in OpenFOAM.

Source: Simon Pereira @ CFD Online

This offering is not approved or endorsed by OpenCFD Limited, the producer of the OpenFOAM software and owner of the OPENFOAM®  and OpenCFD®  trade marks.

One Comment

  • philipp

    Hi Simon,

    could you help me with a problem concerning the mesh-import form workbench to openFoam? For my bachelor´s thesis I have to build a mesh using the Ansys Workbench, but the simulation should be computed using openFoam. Now I tried to export the Workbech-mesh using the .msh file-format and tried to import it using the command fluentMeshToFoam. Unfortunately openFoam could not read the .msh-file probarely. What do I have to do to get the mesh from Workbench to openFoam?

    With Regards