I want to solve a CFD problem with a mesh generated by my own code in OpenFOAM. The question is: in what format is better to export the mesh for OpenFOAM?
The easiest way is to pick one of the tutorial examples and edit the file called "blockMeshDict". When you run "blockMesh" in OpenFoam, it will read in blockMeshDict and generate the 5 required files (points, faces, owner, neighbor, and boundary).
If you want to write your own mesh with FORTRAN, then just write out the 5 files with the correct format. The problem is OpenFoam is written in C++. You need to understand the source code blockMesh.C located in ../src/mesh/blockMesh
Thank you Bruce, the problem I have is that writing the point file is not difficult, quite intuitive actually, but the others, since they require the knowledge of the relationship between an element and the other, are a bit difficult. Anyway, thanks a lot!
You may choose to export to any of these formats and then convert to OF. 'blockMeshDict' describes the geometry, not the mesh; 'blockMesh' creates the mesh from this geometry. Also, you may write the required OF mesh files directly:
BTW, do you really want to export the mesh, not geometry? It might be easier to export the geometry and then use some existing meshing software that can then export the mesh into the desired format.
I actually did that some time ago. I wrote the fortran output (mesh point data,structured grid) in plot3d format, and then used plot3dtoFoam converter to get it into OpenFOAM.
Thank You Very Much guys, Sorry If I didn't reply soon. Thanks Robert, but no, I need to do generate the mesh. This is because I have to perform post-processing operation over the domain which are difficult to do with an unstructured mesh. Thank you very much Arvind, I tried the plot3D way, it's just that I had problems in finding the right header of the file, I have found the Tecplot format but not the plot3D.