Export/import issues format Salome/gmsh/OpenFOAM [solved]

I am trying to import my meshes generated in salome to OpenFOAM.
the meshes have different type of cells (including pyramids, so I can not use the UNV format), therefore I try to export the mesh generated in salome to gmsh, and from gmsh export it to OpenFOAM. Nevertheless, I have not successfully got a ‘working’ mesh.
I have tried different possible exporting formats from salome to then import them into gmsh:
med 4.1, 4.0, 3.3, 3.2
CGNS (wich gave an error in gmsh 4.11.1)
GMF ASCII, binary (binary gave an error in gmsh 4.11.1)
when I import it to gmsh I don’t get any error message (with exception of the CGNS and GMF binary. then I export from there into .msh version 4.1 and then import it into OpenFOAM using gmshToFoam. this “works” but when I look at the mesh in paraview it is wrongly connected. It might be a stretch but depending in the format I exported in salome, I get different results in the end that’s why I am publishing here among the gmsh bug issues (not sure if the issue comes from the writing or reading this formats)
any insight in this issue or how to solve it would be appreciated

the correct workflow for importing a med file to Openfoam (in case that anyone finds with similar issue) would be: In Salome

  1. Create the 2D groups for patches and at least one 3D group that contains all the cells, also it is important to delete all 1D groups (not sure if the 0D also) of the mesh, so only have surface and volumetric groups.
  2. Export it in med file format, from my tests whatever version is ok
  3. Import the mesh in gmsh by open/select the med file
  4. Go to file export
  5. Export it using following parameters ASCII 2.1 format, and all options set to off
  6. Use gmshToFoam without any flag. This will allow to conturnate the issue of not being able to export directly meshes with pyramids from Salome in a format that is importable to openfoam