CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Open Source Meshers: Gmsh, Netgen, CGNS, ... (http://www.cfd-online.com/Forums/openfoam-meshing-open/)
-   -   Conversion Error (http://www.cfd-online.com/Forums/openfoam-meshing-open/72884-conversion-error.html)

nuovodna February 20, 2010 13:17

Conversion Error
 
1 Attachment(s)
Hi, i have a problem in conversion process of attached msh file made by gmsh 2.4.2

Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.6                                  |
|  \\  /    A nd          | Web:      www.OpenFOAM.org                      |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
Build  : 1.6-53b7f692aa41
Exec  : gmshToFoam parziale.msh
Date  : Feb 20 2010
Time  : 18:13:36
Host  : ububox
PID    : 12595
Case  : /home/simulation/OpenFOAM/simulation-1.6/tutorials/incompressible/simpleFoam/airFoil3D
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Found $MeshFormat tag; assuming version 2 file format.
Starting to read physical names at line 5
Physical names:3


wrong token type - expected string found on line 0 the label 1

file: IStringStream.sourceFile at line 0.

    From function operator>>(Istream&, string&)
    in file primitives/strings/string/stringIO.C at line 57.

FOAM exiting


I tried to launch gmshToFoam and filename without extension .msh and it gave this error

Code:

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time


#0  Foam::error::printStack(Foam::Ostream&) in "/home/simulation/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libOpenFOAM.so"
#1  Foam::sigSegv::sigSegvHandler(int) in "/home/simulation/OpenFOAM/OpenFOAM-1.6/lib/linuxGccDPOpt/libOpenFOAM.so"
#2  Uninterpreted:
#3  main in "/home/simulation/OpenFOAM/OpenFOAM-1.6/applications/bin/linuxGccDPOpt/gmshToFoam"
#4  __libc_start_main in "/lib/tls/i686/cmov/libc.so.6"
#5  _start at /usr/src/packages/BUILD/glibc-2.9/csu/../sysdeps/i386/elf/start.S:122
Segmentation fault

Partially solved: removing gmsh label it gives me other errors

Code:

Found $MeshFormat tag; assuming version 2 file format.
Starting to read points at line 5
Vertices to be read:794
Vertices read:794

Starting to read cells at line 802
Cells to be read:1544

Mapping region 41 to Foam patch 0
Mapping region 35 to Foam patch 1
Mapping region 38 to Foam patch 2
Mapping region 36 to Foam patch 3
Mapping region 37 to Foam patch 4
Mapping region 39 to Foam patch 5
Mapping region 40 to Foam patch 6
Cells:
    total:0
    hex  :0
    prism:0
    pyr  :0
    tet  :0



No cells read from file "parziale.msh"
Does your file specify any 3D elements (hex=5, prism=6, pyramid=7, tet=4)?
Perhaps you have not exported the 3D elements?

    From function readCells(..)
    in file gmshToFoam.C at line 662.

FOAM exiting

Opening the .msh file with gmsh there aren't any 3d cell. How can i export the whole 3d cell to .msh file?

nuovodna February 20, 2010 21:09

I add Physical Volume and now it gives me other errors :

Code:

Found $MeshFormat tag; assuming version 2 file format.
Starting to read points at line 5
Vertices to be read:5236
Vertices read:5236

Starting to read cells at line 5244
Cells to be read:19212

Mapping region 56 to Foam patch 0
Mapping region 55 to Foam cellZone 0
Cells:
    total:14409
    hex  :0
    prism:0
    pyr  :0
    tet  :14409

CellZones:
Zone        Size
    0        14409

Skipping tag  at line 24459
Patch 0 gets name patch0

--> FOAM Warning :
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 577
    Found 10472 undefined faces in mesh; adding to default patch.
Finding faces of patch 0

FaceZones:
Zone        Size

Writing zone 0 to cellZone cellZone_0 and cellSet
End


madad2005 April 21, 2010 10:59

Issues with mesh tolerances after using gmshToFoam
 
Deleted. Should have been a new thread.

Does gmshToFoam still produce a mesh at the end? Have you tried running checkMesh to see what errors it picks up?

nuovodna June 7, 2010 09:40

No importing of physical surfaces and run doesn't start
 
I change my case. I m trying to simulate a dam break case. I have this .geo file

Code:

cl1 = 0.1;
Point(1) = {0, 0, 0, cl1};
Point(2) = {3.2196, 0, 0, cl1};
Point(3) = {3.2196, 1.8, 0, cl1};
Point(4) = {3.2196, 1.8, 0.1, cl1};
Point(5) = {3.2196, 0, 0.1, cl1};
Point(6) = {0, 0, 0.1, cl1};
Point(7) = {0, 1.8, 0.1, cl1};
Point(8) = {0, 1.8, 0, cl1};
Point(9) = {1.2, 0, 0, cl1};
Point(10) = {1.2, 0, 0.1, cl1};
Point(11) = {1.2, 0.6, 0.1, cl1};
Point(12) = {1.2, 0.6, 0, cl1};
Point(13) = {0, 0.6, 0, cl1};
Point(14) = {0, 0.6, 0.1, cl1};
Line(1) = {7, 14};
Line(2) = {14, 6};
Line(3) = {6, 1};
Line(4) = {1, 13};
Line(5) = {13, 8};
Line(6) = {8, 7};
Line(7) = {14, 13};
Line(8) = {7, 4};
Line(9) = {3, 8};
Line(10) = {3, 4};
Line(11) = {5, 4};
Line(12) = {3, 2};
Line(13) = {2, 5};
Line(14) = {10, 5};
Line(15) = {2, 9};
Line(16) = {9, 12};
Line(17) = {12, 11};
Line(18) = {10, 9};
Line(19) = {11, 14};
Line(20) = {13, 12};
Line(21) = {11, 10};
Line(22) = {10, 6};
Line(23) = {1, 9};
Line Loop(25) = {8, -10, 9, 6};
Plane Surface(25) = {25};
Line Loop(27) = {1, 7, 5, 6};
Plane Surface(27) = {27};
Line Loop(31) = {2, 3, 4, -7};
Plane Surface(31) = {31};
Line Loop(33) = {13, 11, -10, 12};
Plane Surface(33) = {33};
Line Loop(40) = {20, 17, 19, 7};
Plane Surface(40) = {40};
Line Loop(42) = {16, 17, 21, 18};
Plane Surface(42) = {42};
Line Loop(44) = {23, -18, 22, 3};
Plane Surface(44) = {44};
Line Loop(46) = {15, -18, 14, -13};
Plane Surface(46) = {46};
Line Loop(48) = {16, -20, -4, 23};
Plane Surface(48) = {48};
Line Loop(50) = {22, -2, -19, 21};
Plane Surface(50) = {50};
Line Loop(54) = {5, -9, 12, 15, 16, -20};
Plane Surface(54) = {54};
Line Loop(56) = {8, -11, -14, -21, 19, -1};
Plane Surface(56) = {56};
Surface Loop(52) = {48, 42, 40, 50, 31, 44};
Volume(52) = {52};
Surface Loop(58) = {56, 25, 33, 46, 54, 27, 40, 42};
Volume(58) = {58};
Physical Surface(60) = {25};
Physical Surface(61) = {27,31};
Physical Surface(62) = {44, 46};
Physical Surface(63) = {33};
Physical Volume(59) = {52, 58};

When i try to import .msh file in OpenFOAM i got this warning

Code:

Found $MeshFormat tag; assuming version 2 file format.
Starting to read points at line 5
Vertices to be read:1586
Vertices read:1586

Starting to read cells at line 1594
Cells to be read:5390

Mapping region 0 to Foam patch 0
Mapping region 0 to Foam cellZone 0
Cells:
    total:5006
    hex  :0
    prism:0
    pyr  :0
    tet  :5006

CellZones:
Zone    Size
    0    5006

Skipping tag  at line 6987
Patch 0 gets name patch0

--> FOAM Warning :
    From function polyMesh::polyMesh(... construct from shapes...)
    in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 577
    Found 2946 undefined faces in mesh; adding to default patch.
Finding faces of patch 0

FaceZones:
Zone    Size

Writing zone 0 to cellZone cellZone_0 and cellSet
End

and the physical surfaces are not imported as i defined them in .geo file

checkMesh output :

Code:

Mesh stats
    points:          1586
    faces:            11485
    internal faces:  8539
    cells:            5006
    boundary patches: 2
    point zones:      0
    face zones:      0
    cell zones:      1

Overall number of cells of each type:
    hexahedra:    0
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    5006
    polyhedra:    0

Checking topology...
    Boundary definition OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces ...
    Patch              Faces    Points  Surface topology                 
    patch0              384      332      ok (non-closed singly connected) 
    defaultFaces        2562    1423    ok (non-closed singly connected) 

Checking geometry...
    Overall domain bounding box (0 0 0) (3.2196 1.8 0.1)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (-1.58397e-18 -9.84818e-18 -5.54391e-17) OK.
    Max cell openness = 4.99737e-16 OK.
    Max aspect ratio = 518.051 OK.
    Minumum face area = 7.19968e-05. Maximum face area = 0.00992881.  Face area magnitudes OK.
    Min volume = 1.43759e-07. Max volume = 0.000323876.  Total volume = 0.579528.  Cell volumes OK.
    Mesh non-orthogonality Max: 88.7287 average: 25.4321
  *Number of severely non-orthogonal faces: 49.
    Non-orthogonality check OK.
  <<Writing 49 non-orthogonal faces to set nonOrthoFaces
    Face pyramids OK.
    Max skewness = 1.22583 OK.

Mesh OK.

When i start the interFoam run i have this error:

Code:

--> FOAM FATAL IO ERROR:

    patch type 'patch' not constraint type 'empty'
    for patch defaultFaces of field p in file "/home/emanuelet/Case_GMSH/0/p"

Changing the boundary file and switching defaultFaces from patch to empty i got this new error:

Code:

--> FOAM FATAL ERROR:
This mesh contains patches of type empty but is not 1D or 2D
    by virtue of the fact that the number of faces of this
    empty patch is not divisible by the number of cells.

    From function emptyFvPatchField<Type>::updateCoeffs()
    in file fields/fvPatchFields/constraint/empty/emptyFvPatchField.C at line 151.

FOAM exiting

How can i fix it??
Thanks in advance

Emanuele


EDIT: Using gmsh 2.5.0 from svn it doesn't export patch. Solved using gmsh 2.2.3. Error on empty patch still appear...

nuovodna June 7, 2010 10:52

Problems solved
 
Solved using extrude gmsh function instead of defining two different surface. It's my new workin .geo file:


Code:

Point (1) = {0, 0, 0, 0.1};
Point (2) = {3.2196, 0, 0, 0.1};
Point (3) = {3.2196, 1.8, 0, 0.1};
Point (8) = {0, 1.8, 0, 0.1};
Point (9) = {1.2, 0, 0, 0.1};
Point (12) = {1.2, 0.6, 0, 0.1};
Point (13) = {0, 0.6, 0, 0.1};
Point (14) = {0, 1.8, 0.1, 0.1};
Point (15) = {3.2196, 1.8, 0.1, 0.1};
Point (19) = {3.2196, 0, 0.1, 0.1};
Point (23) = {1.2, 0, 0.1, 0.1};
Point (27) = {1.2, 0.6, 0.1, 0.1};
Point (31) = {0, 0.6, 0.1, 0.1};
Point (37) = {0, 0, 0.1, 0.1};
Line (1) = {8, 3};
Line (2) = {3, 2};
Line (3) = {2, 9};
Line (4) = {9, 12};
Line (5) = {12, 13};
Line (6) = {13, 1};
Line (7) = {1, 9};
Line (8) = {13, 8};
Line (14) = {14, 15};
Line (15) = {15, 19};
Line (16) = {19, 23};
Line (17) = {23, 27};
Line (18) = {27, 31};
Line (19) = {31, 14};
Line (21) = {8, 14};
Line (22) = {3, 15};
Line (26) = {2, 19};
Line (30) = {9, 23};
Line (34) = {12, 27};
Line (38) = {13, 31};
Line (47) = {31, 37};
Line (48) = {37, 23};
Line (56) = {1, 37};
Line Loop (10) = {1, 2, 3, 4, 5, 8};
Plane Surface (10) = {10};
Line Loop (12) = {5, 6, 7, 4};
Plane Surface (12) = {12};
Line Loop (23) = {1, 22, -14, -21};
Ruled Surface (23) = {23};
Line Loop (27) = {2, 26, -15, -22};
Ruled Surface (27) = {27};
Line Loop (31) = {3, 30, -16, -26};
Ruled Surface (31) = {31};
Line Loop (35) = {4, 34, -17, -30};
Ruled Surface (35) = {35};
Line Loop (39) = {5, 38, -18, -34};
Ruled Surface (39) = {39};
Line Loop (43) = {8, 21, -19, -38};
Ruled Surface (43) = {43};
Line Loop (44) = {14, 15, 16, 17, 18, 19};
Plane Surface (44) = {44};
Line Loop (57) = {6, 56, -47, -38};
Ruled Surface (57) = {57};
Line Loop (61) = {7, 30, -48, -56};
Ruled Surface (61) = {61};
Line Loop (66) = {18, 47, 48, 17};
Plane Surface (66) = {66};
Surface Loop (1) = {10, 44, 23, 27, 31, 35, 39, 43};
Volume (1) = {1};
Surface Loop (2) = {12, 66, 39, 57, 61, 35};
Volume (2) = {2};
Physical Surface (67) = {23};
Physical Surface (68) = {43, 57};
Physical Surface (69) = {31, 61};
Physical Surface (70) = {27};
Physical Volume (71) = {2};
Physical Volume (72) = {1};

Take a look here :
http://www.cfd-online.com/Forums/openfoam-meshing-gmsh/61888-problem-gmsh.html

nuovodna June 7, 2010 11:42

If i go with lc under 0.1 (eg 0.04) and changing Z coordinates to a value equal to lc, the problem of 2D/3D re-appear. Suggestions?

phsieh2005 June 14, 2010 19:09

Hi,

I am also getting the same FOAM Warning and gmshToFoam put all Physical Surfaces into 1 patch. Has anyone has the fix?

Thanks!

Pei
----------------------
hsieh@rutgers:~/OpenFOAM/hsieh-dev/run> gmshToFoam -case magnets2DB 2magnets900ul_200ul_OF.msh
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : dev-84cab37e7f6d
Exec : gmshToFoam -case magnets2DB 2magnets900ul_200ul_OF.msh
Date : Jun 14 2010
Time : 19:05:27
Host : rutgers
PID : 6583
Case : ./magnets2DB
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Found $MeshFormat tag; assuming version 2 file format.
Starting to read physical names at line 5
Physical names:3
Surface 1 infinity
Surface 2 front
Surface 3 back

Starting to read points at line 11
Vertices to be read:159640
Vertices read:159640

Starting to read cells at line 159654
Cells to be read:448150

Mapping region 0 to Foam patch 0
Mapping region 0 to Foam cellZone 0
Cells:
total:149206
hex :9900
prism:139306
pyr :0
tet :0

CellZones:
Zone Size
0 149206

Skipping tag at line 607807
Patch 0 gets name patch0

--> FOAM Warning :
From function polyMesh::polyMesh(... construct from shapes...)
in file meshes/polyMesh/polyMeshFromShapeMesh.C at line 613
Found 298944 undefined faces in mesh; adding to default patch.
Finding faces of patch 0

FaceZones:
Zone Size

Writing zone 0 to cellZone cellZone_0 and cellSet
End

hsieh@rutgers:~/OpenFOAM/hsieh-dev/run>

nuovodna June 15, 2010 05:00

I had this problem using gmsh-2.5 from svn. With stable version 2.4.2, it should work

phsieh2005 June 15, 2010 09:43

Quote:

Originally Posted by nuovodna (Post 263034)
I had this problem using gmsh-2.5 from svn. With stable version 2.4.2, it should work

Thanks nuovodna!

gmshToFoam worked when I switched back to gmsh 2.4.2 stable.

Pei

louisgag July 8, 2010 16:45

Maybe not the issue here, but sometimes it is necessary to manually edit the boundary file generated by gmshToFoam and remove the defaultFaces block and reduce the number of patches by 1... This can help if you're having a problem with undefined faces.

DVSoares July 21, 2010 17:06

Hi all,

I use gmsh a lot with OF. In fact, louisgag has given the clue. I usually don't delete the patches.

When making a 2D simulation on OF using gmsh generated mesh it is necessary to edit the 'boundary' file under 'constant/polymesh' and set the 'type' for 'frontAndBack' and 'defaultFaces' to 'empty'. An example:

gmshToFoam generates this:
Code:

frontAndBack
{
    type          patch;
    nFaces        9072;
    startFace    8882;
}

just change to:
Code:

frontAndBack
{
    type          empty;
    nFaces        9072;
    startFace    8882;
}

Cheers,

louisgag July 30, 2010 22:08

Hi Daniel,

it is interesting to see that you have a different approach and set the 'defaultFaces' to 'empty'. I wonder if it would work for my 3D simulations as well..!

Cheers,

-Louis

DVSoares July 30, 2010 22:23

Hi Louis,

In my cases, in which I define a physical group for everything, the defaultFaces patch is actually empty (it ends at the same point it starts).
If you can test the approach I mentioned, to see if anything changes in your simulations, please post your observations, but don't forget to check the size of the default patches! (I believe it must be zero)

Cheers,

Daniel

louisgag September 10, 2010 15:30

Hi Daniel,

I finally got around to trying your trick (leaving the defaultFaces patch in the boundary file (it is actually empty).

For me it worked well in both 2D and 3D!

Thanks for the advice,

-Louis

hardykalyan October 1, 2010 11:07

:)
 
Thank you Daniel, you saved my day. Deleting the default face worked pretty good for me.


All times are GMT -4. The time now is 02:06.