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

[Gmsh] Problem in mesh saving

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 24, 2017, 10:32
Default Problem in mesh saving
  #1
Member
 
Jibran
Join Date: Oct 2012
Location: UK
Posts: 61
Blog Entries: 1
Rep Power: 15
Jibran is on a distinguished road
Hello everyone,

I am facing a minor problem while saving the mesh created from a Gmsh script file. I can see the complete mesh when I run the script (snapshot is attached named 'mesh_complete') however only part of the mesh is saved in the 'mesh.msh' file (snapshot named 'mesh_quarter').

The script I am using can be found below.

Code:
cc = 6;
cd = 4;
cz = 8;

cr=0.05;
zmax=0.5;
cx=Sqrt(cr*cr/2.0);

sl=1/3.0;
sx=sl/2.0;

nc = cc + 1;
nd = cd + 1;


// Section 1
Point(1) = {0, 0, 0};
Point(2) = {cx, cx, 0};
Point(3) = {sx, sx, 0};
Point(4) = {-sx, sx, 0};
Point(5) = {-cx, cx, 0};

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

Transfinite Line{1,3} = nd;
Transfinite Line{2,4} = nc;
Transfinite Surface{1} = {2,3,4,5};
Recombine Surface{1};


Rotate {{0, 0, 1}, {0, 0, 0}, Pi} {
  Duplicata { Surface{1}; }
}
Transfinite Line{8,6} = nd;
Transfinite Line{9,7} = nc;
Transfinite Surface{5} = {6,7,11,15};
Recombine Surface{5};


Rotate {{0, 0, 1}, {0, 0, 0}, -Pi/2} {
  Duplicata { Surface{1}; }
}
Transfinite Line{14,12} = nc;
Transfinite Surface{10} = {2,3,11,15};
Recombine Surface{10};


Rotate {{0, 0, 1}, {0, 0, 0}, Pi/2} {
  Duplicata { Surface{1}; }
}
Transfinite Line{19,17} = nc;
Transfinite Surface{15} = {4,5,6,7};
Recombine Surface{15};


// Extrusion in the third dimension
Extrude{0,0,zmax}{
Surface{1,5,10,15};
Layers{cz};Recombine;
}

Physical Surface("fixed") = {1};
Physical Volume("volume") = {1,5,10,15};

Mesh 3;
Coherence Mesh;
Save "mesh.msh";
I would be very grateful if someone spots the problem in my script or has any suggestion. Please note that I have already to save the mesh through GUI but I obtain the same result.

Many thanks
Attached Images
File Type: png mesh_complete.PNG (113.6 KB, 7 views)
File Type: png mesh_quarter.PNG (50.2 KB, 5 views)
__________________
Jibran Haider
Jibran is offline   Reply With Quote

Old   May 24, 2017, 12:17
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,938
Rep Power: 39
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

You messed up physical surface and physical volume definitions. And since the only valid number in volume definition is 1, you got quarter of the mesh.
alexeym is offline   Reply With Quote

Old   May 24, 2017, 12:32
Default
  #3
Member
 
Jibran
Join Date: Oct 2012
Location: UK
Posts: 61
Blog Entries: 1
Rep Power: 15
Jibran is on a distinguished road
Quote:
Originally Posted by alexeym View Post
Hi,

You messed up physical surface and physical volume definitions. And since the only valid number in volume definition is 1, you got quarter of the mesh.

Hi Alexey,

Many thanks for the prompt response.
The volume definition was wrong. It should have been
Code:
Physical Volume("volume") = {1,2,3,4};
Works perfectly now. Thanks again
__________________
Jibran Haider
Jibran is offline   Reply With Quote

Reply

Tags
gmsh, mesh 3d


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
decomposePar problem: Cell 0contains face labels out of range vaina74 OpenFOAM Pre-Processing 37 July 20, 2020 06:38
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 18:16
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 19:57
[ICEM] ICEM Structured Mesh Problem OMJT ANSYS Meshing & Geometry 3 March 22, 2013 11:06
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11


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