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

[Gmsh] element connectivity in gmsh file

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By aljazari

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 13, 2016, 13:24
Unhappy element connectivity in gmsh file
  #1
New Member
 
Mayank Patni
Join Date: Apr 2016
Posts: 2
Rep Power: 0
mayankpatni is on a distinguished road
Dear All,

I am new to OpenFOAM Gmsh. I am using below commands to generate a 2D mesh with 2nd order:

// Gmsh project created on Wed Apr 13 13:55:50 2016

lc = 1e-5;


Point(1) = {-10,0,-10,lc};
Point(2) = {10,0,-10,lc} ;
Point(3) = {10,0,10,lc} ;
Point(4) = {-10,0,10,lc} ;

Line(1) = {1,2} ;
Line(2) = {2,3} ;
Line(3) = {3,4} ;
Line(4) = {4,1} ;

Line Loop(5) = {4,1,2,3} ;

Plane Surface(6) = {5};

Transfinite Line{1,2,3,4} = 3;
Transfinite Surface{6};
Recombine Surface{6};


When I save the msh file and read to check the element connectivity, it gives as below :

$Elements
16
1 15 2 0 1 1
2 15 2 0 2 2
3 15 2 0 3 3
4 15 2 0 4 4
5 8 2 0 1 1 5 6
6 8 2 0 1 5 2 7
7 8 2 0 2 2 8 9
8 8 2 0 2 8 3 10
9 8 2 0 3 3 11 12
10 8 2 0 3 11 4 13
11 8 2 0 4 4 14 15
12 8 2 0 4 14 1 16
13 10 2 0 6 4 14 17 11 15 18 19 13 20
14 10 2 0 6 11 17 8 3 19 21 10 12 22
15 10 2 0 6 14 1 5 17 16 6 23 18 24
16 10 2 0 6 17 5 2 8 23 7 9 21 25
$EndElements


Ideally it should be only 4 elements (4 9-noded elements). How to remove the elements from 1-12 ?

Any suggestions would be helpful.

Thanks !
mayankpatni is offline   Reply With Quote

Old   April 15, 2016, 11:09
Default
  #2
New Member
 
Abdulhaq
Join Date: Oct 2012
Posts: 27
Rep Power: 14
aljazari is on a distinguished road
Quote:
c = 1e-5;


Point(1) = {-10,0,-10,lc};
Point(2) = {10,0,-10,lc} ;
Point(3) = {10,0,10,lc} ;
Point(4) = {-10,0,10,lc} ;

Line(1) = {1,2} ;
Line(2) = {2,3} ;
Line(3) = {3,4} ;
Line(4) = {4,1} ;

Line Loop(5) = {4,1,2,3} ;

Plane Surface(6) = {5};

Transfinite Line{1,2,3,4} = 3;
Transfinite Surface{6};
Recombine Surface{6};

Physical Surface(1) = {6};
You need to add a physical surface. This should leave you with four elements.
mayankpatni likes this.
aljazari is offline   Reply With Quote

Old   April 15, 2016, 11:17
Default
  #3
New Member
 
Mayank Patni
Join Date: Apr 2016
Posts: 2
Rep Power: 0
mayankpatni is on a distinguished road
Hello Abdulhaq,

Thank you so much for your reply. This is what I was looking.

I have one more question. When I read the mesh file, its like
************************************************** ***

$MeshFormat
2.2 0 8
$EndMeshFormat
$Nodes
9
1 -10 0 -10
2 10 0 -10
3 10 0 10
4 -10 0 10
5 -1.232614010859834e-11 0 -10
6 10 0 -1.232614010859834e-11
7 1.232614010859834e-11 0 10
8 -10 0 1.232614010859834e-11
9 0 0 1.519298140712631e-23
$EndNodes
$Elements
4
1 3 2 1 6 4 8 9 7
2 3 2 1 6 7 9 6 3
3 3 2 1 6 8 1 5 9
4 3 2 1 6 9 5 2 6
$EndElements

************************************************** ***
How to get the coordinates as 0 instead of very small numbers for nodes 5-9 ?

5 -1.232614010859834e-11 0 -10
6 10 0 -1.232614010859834e-11
7 1.232614010859834e-11 0 10
8 -10 0 1.232614010859834e-11
9 0 0 1.519298140712631e-23

Regards
Mayank
mayankpatni is offline   Reply With Quote

Old   April 15, 2016, 12:27
Default
  #4
New Member
 
Abdulhaq
Join Date: Oct 2012
Posts: 27
Rep Power: 14
aljazari is on a distinguished road
You are welcome.

There is no apparent way to control the precision.

Smoothing the mesh replaced the node which contained "e-23" with 0 but nothing else.

You can smooth the mesh either from the command line:

Quote:
gmsh -2 input.geo -smooth 20
or by adding the following in the geometry file:

Quote:
Mesh.Smoothing = 20;
aljazari is offline   Reply With Quote

Reply

Tags
element connectivity, gmsh, mesh 2d, msh file


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
[Gmsh] 3D Mesh conversion from gmsh-2.5.0 to OpenFOAM Ancioi OpenFOAM Meshing & Mesh Conversion 17 January 9, 2019 00:50
[foam-extend.org] problem when installing foam-extend-1.6 Thomas pan OpenFOAM Installation 7 September 9, 2015 22:53
Trouble compiling utilities using source-built OpenFOAM Artur OpenFOAM Programming & Development 14 October 29, 2013 11:59
[OpenFOAM] Annoying issue of automatic "Rescale to Data Range " with paraFoam/paraview 3.12 keepfit ParaView 60 September 18, 2013 04:23
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 12:44


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