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

[Gmsh] Gmsh Layers Command

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2015, 00:03
Default Gmsh Layers Command
  #1
dsn
Member
 
Aditya
Join Date: Nov 2014
Posts: 35
Rep Power: 11
dsn is on a distinguished road
Hi everyone,

I have started learning gmsh and kinda got stuck at one command.

I try to create multiple layers on a particular surface using the command

Code:
Layers { { expression-list }, { expression-list } }
Can someone tell me how exactly should the expression list in the sceond bracket be specified. What does it mean exactly?

The code below is taken from a tutorial case, if someone can please explain what those 0.5 and 1 mean and how to define them, it would be great

Code:
Extrude {0,0,h} {
  Surface{6}; Layers{ {8,2}, {0.5,1} };
}
Thanks once again as always!!!!
dsn is offline   Reply With Quote

Old   April 10, 2015, 02:46
Default
  #2
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

Did you check documentation?

http://www.geuz.org/gmsh/doc/texinfo...ructured-grids

Quote:
In the first Layers form, expression gives the number of elements to be created in the (single) layer. In the second form, the first expression-list defines how many elements should be created in each extruded layer, and the second expression-list gives the normalized height of each layer (the list should contain a sequence of n numbers 0 < h1 < h2 < … < hn <= 1).
Your question is answered in the second sentence of the quote.
alexeym is offline   Reply With Quote

Old   April 10, 2015, 13:06
Default
  #3
dsn
Member
 
Aditya
Join Date: Nov 2014
Posts: 35
Rep Power: 11
dsn is on a distinguished road
Hi,

I did read the manual but I couldnt understand what they exactly mean by the height of the layer because when I used it in my code shown below to mesh a simple box geometry it gives me an error. I have attached the geometry, error generated and the code.

Can you Please take a look and let me know what is going wrong.

Code:
Point(1) = {0.6, -0.2, 0.1, 1.0};
Extrude {1, 0, 0} {
  Point{1}; Layers{20};
}
Extrude {0, 1, 0} {
  Point{2};Layers{20};
}
Extrude {-1, 0, 0} {
  Point{3};Layers{20};
}
Extrude {0, -1, 0} {
  Point{4};Layers{20};
}
Line Loop(5) = {4, 1, 2, 3};
Plane Surface(6) = {5};

Extrude {0, 0, 2} {
  Surface{6}; Layers{{10,5}, {0.5,0.5}};
}
Thanks a ton!!
Attached Images
File Type: png gmsh-log.png (16.5 KB, 39 views)
File Type: png gmsh-mesh.png (26.7 KB, 72 views)
dsn is offline   Reply With Quote

Old   April 10, 2015, 18:02
Default
  #4
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

I am not quite sure that I have got what you are trying to achieve (i.e. why use extrude instead of just creating straight lines). I did not checked Gmsh sources yet, but I think, the last value in relative heights should be 1 (at least if you put 1 in your case, error disappears). Also see comment in t3.geo before Extrude command.
alexeym is offline   Reply With Quote

Old   April 10, 2015, 19:28
Default
  #5
dsn
Member
 
Aditya
Join Date: Nov 2014
Posts: 35
Rep Power: 11
dsn is on a distinguished road
Hi,

I am trying to create a structured mesh for this geometry but i am just not able to do it. Also, I am unable to create a structured mesh for a geometry which has two blocks sitting next to each other..can you please help because im really stuck at this...

Code:
Point(1) = {0.9, -0.2, -0, 1.0};
Point(2) = {1, -0.2, 0, 1.0};
Point(3) = {1, -0.1, -0, 1.0};
Point(4) = {1, 0.1, -0, 1.0};
Point(5) = {0.9, 0.1, -0, 1.0};
Point(6) = {1.4, -0.1, 0, 1.0};
Point(7) = {1.4, 0.1, -0, 1.0};
Point(8) = {1.4, -0.2, 0, 1.0};

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

Line Loop(11) = {4, 5, 1, 2, 3};
Plane Surface(12) = {11};
Line Loop(13) = {7, -2, 8, 6};
Plane Surface(14) = {13};

Transfinite Line {7, 8} = 40 Using Progression 1;
Transfinite Line {2, 6} = 40 Using Progression 1;
Transfinite Surface {14} = {7, 6, 3, 4} Left;

Transfinite Line {2, 3, 5} = 40 Using Progression 1;
Transfinite Surface {14} = {4, 3, 6, 7} Right;
Recombine Surface {14};
Transfinite Surface {12} = {1, 2, 4, 5} Right;
Recombine Surface {12};
Transfinite Line {4, 1} = 10 Using Progression 1;
Attached Images
File Type: png plate2.png (38.6 KB, 67 views)
dsn is offline   Reply With Quote

Old   April 11, 2015, 08:36
Default
  #6
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

I was not able to guess what geometry you are trying to mesh (L-shaped channel?). Please find example mesh of two adjacent blocks attached to the message. If you attach just a sketch of the geometry you are trying to mesh, maybe I will be able to help you.
Attached Images
File Type: png two-blocks-mesh-screenshot.png (75.2 KB, 81 views)
Attached Files
File Type: gz two-blocks.geo.gz (965 Bytes, 25 views)
alexeym is offline   Reply With Quote

Old   April 11, 2015, 11:14
Default
  #7
dsn
Member
 
Aditya
Join Date: Nov 2014
Posts: 35
Rep Power: 11
dsn is on a distinguished road
Hi,

Thank you so much for the example. That really helps. I have a question, for the transfinite algorithm to create structured mesh i.e no rtiangles or tetrahedra is it necessary for the lines being selected have equal number of points distributed?
dsn is offline   Reply With Quote

Old   April 11, 2015, 14:27
Default
  #8
Senior Member
 
Alexey Matveichev
Join Date: Aug 2011
Location: Nancy, France
Posts: 1,930
Rep Power: 38
alexeym has a spectacular aura aboutalexeym has a spectacular aura about
Send a message via Skype™ to alexeym
Hi,

In fact I do not know exactly but in my meshes I keep number of points on opposite lines equal. Guess if number of points is different recombination algorithm may fail.
alexeym is offline   Reply With Quote

Old   June 16, 2015, 16:20
Default 2d Mesh
  #9
New Member
 
Alessandro Del Buono
Join Date: May 2015
Posts: 12
Rep Power: 10
Alessandro1589 is on a distinguished road
Hi guys!
What happen if i set Layer >1 and use mesh for 2D simulation in Open Foam,(so set "empty" for the faces that are along 3d dimension)?
Have you got any idea?

Best Regards
Alessandro1589 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[PyFoam] PyFoam 0.6.9 wrong path to gnuplot klausb OpenFOAM Community Contributions 5 March 15, 2018 15:28
[snappyHexMesh] SnappyHexMesh no layers and no decent mesh for complex geometry pizzaspinate OpenFOAM Meshing & Mesh Conversion 1 February 25, 2015 08:05
[Gmsh] Import problem ARC OpenFOAM Meshing & Mesh Conversion 0 February 27, 2010 11:56
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55
Problems of running the parallel computations lorraine FLUENT 17 July 6, 2007 09:08


All times are GMT -4. The time now is 07:33.