-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Feature request] Exporting to OpenFOAM format #19
Comments
Hey, this is definitely something I would like to implement in the near future. In order to use the current state of the code, you could try exporting the meshes as VTU files and then convert them to the OpenFOAM format using auxiliary tools, such as for example meshio. Do you think this could work? Greetings |
Hi, Unfortunately, accoding to my experience with meshio (using it for some time), it is unreliable at best. In particular the VTK/VTU et al. formats are very buggy, and in most cases it is not possible to get them to convert to OpenFOAM format properly. Supporting OpenFOAM in TQMesh, in my opinion, is the right way to achieve this. Best regards. |
Hey, I guess you're right! Is there any way to test such a grid file if it fits the OpenFOAM format without installing OpenFOAM? This would make things a lot easier... ;-) Regards, |
Hi, thank you for your reply. The easiest way I can think of is to use Paraview to open OpenFOAM meshes. You can download Paraview from the official website: https://www.paraview.org/download/ To open the Mesh, you need the following minimal setup (it doesn't require the 0 and system folders that are typically used by all OpenFOAM simulations):
You need a folder named To open the mesh in Paraview, you need to create an empty file with the extension |
Hey, thanks - this helped me a lot! So I added a small python script which converts a TQMesh text file into the mentioned openFOAM directory structure including the different mesh files. You can find it here in the "develop" branch. However, I am not sure if I got the face-orientation and the resulting direction between owner- and neighbor-elements correctly. Thank you very much for your help! Regards, |
Many thanks for your work. Here is a link to the documenation about OpenFOAM meshes: https://www.openfoam.com/documentation/user-guide/4-mesh-generation-and-conversion/4.1-mesh-description Meanwhile, could you please provide some meshes to play with? I am right now on Windows and I don't have TQMesh installed. Regards |
Hey there, here is a sample file, that stems from example 1 (a simple triangular mesh): The python script to convert this file as an OpenFOAM mesh should also work on a Windows machine. In case that it is not possible for you to run the script, here are the respective output-files of that script in a zip-file: Thank you very much for your help! Regards, |
I just figured that the Greetings |
Hi.
The command
|
Hey, thanks a lot! I guess the faces are not yet oriented correctly. Maybe you could try if Otherwise, I will probably need to install openFOAM to debug this... ;-) Anyway, thank you very much for helping! Greetings |
Thanks for the update. Unfortunately, the number of errors now increased to 5 as you can see below:
|
Thanks! I had to do some minor changes but finally got it working - does checkMesh also proceed for you? It seems to work with most of the meshes from the examples. However, for some examples checkMesh still has some problems. But this could also be related to the meshes... Anyway, I hope for now the script should work. Thanks for sharing your idea and for your help! :-) Cheers |
Thank you for the update!
|
Thanks! Greetings |
Hello,
This is a very nice project.
I wonder if there are plans to support OpenFOAM mesh format? That would be very useful for the OpenFOAM community.
Best regards
The text was updated successfully, but these errors were encountered: