CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[Gmsh] Gmsh to foam

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By BM_CFD

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 4, 2018, 11:32
Default Gmsh to foam
  #1
New Member
 
Carmelo Jesús Mentado Santana
Join Date: Aug 2018
Posts: 4
Rep Power: 7
Carmelo55 is on a distinguished road
Hello

I am trying to make a cube in GMSH, mesh it and then using gmshToFoam convert the code. But i dont know what is wrong. I am starting with gmsh and OpenFoam if someone could help me please.

GMSH.
// Gmsh project created on Thu Oct 04 16:20:25 2018
SetFactory("OpenCASCADE");
lc = 0.1;

//Puntos

Point (1) = {0,0,0,lc};
Point (2) = {1,0,0,lc};
Point (3) = {1,1,0,lc};
Point (4) = {0,1,0,lc};
Point (5) = {0,0,0.1,lc};
Point (6) = {1,0,0.1,lc};
Point (7) = {1,1,0.1,lc};
Point (8) = {0,1,0.1,lc};

//Lineas

//Block
Line (1) = {1,2};
Line (2) = {2,3};
Line (3) = {3,4};
Line (4) = {4,1};
Line (5) = {5,6};
Line (6) = {6,7};
Line (7) = {7,8};
Line (8) = {8,5};

//laterales

Line (9) = {5,1};
Line (10) = {6,2};
Line (11) = {7,3};
Line (12) = {8,4};

//Superficies


Curve Loop(14) = {4, 1, 2, 3};
Plane Surface(14) = {14};

Curve Loop(15) = {6, 7, 8, 5};
Plane Surface(15) = {15};

Curve Loop(16) = {4, -9, -8, 12};
Plane Surface(16) = {16};

Curve Loop(17) = {7, 12, -3, -11};
Plane Surface(17) = {17};

Curve Loop(18) = {6, 11, -2, -10};
Plane Surface(18) = {18};
//+
Curve Loop(19) = {10, -1, -9, 5};
Plane Surface(19) = {19};

Surface Loop(1) = {14, 16, 19, 18, 15, 17};
Volume(1) = {1};

Physical Surface("bottom") = {14};
Physical Surface("top") = {15};
Physical Surface("left") = {16};
Physical Surface("right") = {17};
Physical Surface("front") = {18};
Physical Surface("back") = {19};




//+
Physical Volume("internal") = {1};

////////////////////////////////////////////////////////////////////////

OpenFoam:

/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
|*---------------------------------------------------------------------------*|
|* OpenFOAM for Windows 18.06 (v1) *|
|* Built by CFD Support, www.cfdsupport.com (based on Symscape). *|
\*---------------------------------------------------------------------------*/
Build : dev-59be3e7
Exec : C:\OpenFOAM\18.06\cygwin64\opt\OpenFOAM\OpenFOAM-dev\platforms\cygwin64mingw-w64DPInt32Opt\bin\gmshToFoam.exe Cubomshtofoam.msh
Date : Oct 04 2018
Time : 16:26:35
Host : "DESKTOP-PLD6LT5"
PID : 9340
I/O : uncollated
Case : C:/OpenFOAM/18.06/Carmelo-dev/run/cavity
nProcs : 1
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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:7
Surface 1 bottom
Surface 2 top
Surface 3 left
Surface 4 right
Surface 5 front
Surface 6 back
Volume 7 internal

Skipping tag $Entities at line 15
Starting to read points at line 45
Vertices to be read:27
Vertices read:18


--> FOAM FATAL IO ERROR:
wrong token type - expected word, found on line 0 the label 381

file: IStringStream.sourceFile at line 0.

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

FOAM exiting


Thanks and Best Regards.
Carmelo55 is offline   Reply With Quote

Old   November 6, 2018, 03:25
Default
  #2
New Member
 
Batu
Join Date: Dec 2016
Location: Turkey
Posts: 5
Rep Power: 9
BM_CFD is on a distinguished road
The problem is I think due to how new version of gmsh is creating the mesh. Version 4.0 of gmsh creates the .msh file in ASCII v4 however gmshToFoam is created for ASCII v2. You can find the solution to this issue in the following discussion:

https://www.cfd-online.com/Forums/op...-openfoam.html

Regards
Adam_K likes this.
BM_CFD is offline   Reply With Quote

Reply

Tags
gmsh to openfoam


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
error with reactingFoam BakedAlmonds OpenFOAM Running, Solving & CFD 4 June 22, 2016 02:21
[blockMesh] BlockMesh FOAM warning gaottino OpenFOAM Meshing & Mesh Conversion 7 July 19, 2010 14:11
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 10:56
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 14:00
[Gmsh] Import gmsh msh to Foam adorean OpenFOAM Meshing & Mesh Conversion 24 April 27, 2005 08:19


All times are GMT -4. The time now is 09:44.