CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Pre-Processing (https://www.cfd-online.com/Forums/openfoam-pre-processing/)
-   -   Gmsh 4 compatibility with gmshToFoam (https://www.cfd-online.com/Forums/openfoam-pre-processing/213917-gmsh-4-compatibility-gmshtofoam.html)

gridley2 January 13, 2019 14:04

Gmsh 4 compatibility with gmshToFoam
 
Hello all,


Gmsh 4 has some nice new capabilities like meshing around STL and constructive solid geometry capability. I'm attempting to test importing this to an OpenFOAM mesh, but it seems some incompatibility exists between the gmsh file and gmshToFoam.


In particular, gmshToFoam returns:


Quote:

Create time

Starting to read mesh format at line 2
Read format version 4 ascii 0

Starting to read physical names at line 5
Physical names:5
Surface 1 walls
Surface 2 inlet
Surface 3 outlet
Surface 4 dingding
Volume 5 inside

Skipping tag $Entities at line 13
Starting to read points at line 45
Vertices to be read:28
Vertices read:19


--> FOAM FATAL IO ERROR:
Wrong token type - expected word, found on line 0: label 20

file: input at line 0.

From function Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::word&)
in file primitives/strings/word/wordIO.C at line 75.

FOAM exiting

This looks to me like Gmsh 4 has a slightly different ASCII .msh format from what gmshToFoam is used to. If it helps, my gmsh input which runs fine is:


Code:

SetFactory("OpenCASCADE");
Box(1) = {-10,-20,-10, 49,100,60};
Delete { Volume{1}; }

SetFactory("Built-in");
Merge "dingding.stl";
Surface Loop(1) = {1,2,3,4,5,6};
Surface Loop(2) = {7};
Volume(9) = {2};
Volume(10) = {2,1};
Physical Surface("walls") = {6, 1, 2, 5};
Physical Surface("inlet") = {3};
Physical Surface("outlet") = {4};
Physical Surface("dingding") = {7};
Physical Volume("inside") = {10};
Mesh.CharacteristicLengthMax = 1;


Maybe this has to do with the fact that the gmsh mesh is created from meshing an STL surface. Regardless, it's not like the .msh file references the .stl or anything like that.


Has anyone seen a message like this before? Otherwise I'll report it as a bug, I suppose.

gridley2 January 14, 2019 13:06

For anyone encountering this:


NVM, seems this is already reported on the openfoam-plus repository issue tracker.


https://develop.openfoam.com/Develop...us/issues/1155


All times are GMT -4. The time now is 11:20.