|
[Sponsors] |
[Gmsh] GMSH: Structured mesh of a square inside a circle |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 26, 2015, 09:13 |
GMSH: Structured mesh of a square inside a circle
|
#1 |
New Member
Join Date: Jul 2014
Posts: 13
Rep Power: 12 |
Hi everyone!
I am trying to make in GMSH a fully structured mesh consisting of a small square inside a large circular domain, see the attached picture. One of my attempts is the following: Code:
// ---------------- Parameters ---------------- nLayers = 5; // Number of layers of the circular mesh part (in radial direction) elem_close = 0.1; // Element size radius = 1; // Radius of the circle width_st = 0.4; // Width of the strucured box height_st = 0.4; // Height of the structured box width_n = 20; // Elements in the x-direction height_n = 20; // Elements in the y-direction // ---------------- Circle ---------------- Point(1) = {0, 0, 0, 1e22}; Point(2) = {radius, 0, 0, 1e22}; Point(3) = {-radius, 0, 0, 1e22}; Point(4) = {0, -radius, 0, 1e22}; Point(5) = {0, radius, 0, 1e22}; Circle(1) = {5, 1, 2}; Circle(2) = {2, 1, 4}; Circle(3) = {4, 1, 3}; Circle(4) = {3, 1, 5}; Line Loop(6) = {1, 2, 3, 4}; Transfinite Line{1, 2, 3, 4} = nLayers Using Progression 1; // ---------------- Box part ----------------- Point(10) = {-width_st/2,-height_st/2, 0, elem_close}; Point(11) = {width_st/2,-height_st/2, 0, elem_close}; Point(12) = {width_st/2,height_st/2, 0, elem_close}; Point(13) = {-width_st/2, height_st/2, 0, elem_close}; Line(10) = {10,11}; Line(11) = {11,12}; Line(12) = {12,13}; Line(13) = {13,10}; Line Loop(10) = {10,11,12,13}; // Surfaces Plane Surface(10) = {10}; Transfinite Line{10,12} = width_n; Transfinite Line{11,13} = height_n; Transfinite Surface(10); Recombine Surface(10); // hexahedra's // Surface between square and circle Plane Surface(1) = {6,10}; Extrude {0,0,5} { Surface{1,10}; Layers{1}; Recombine; } Thanks a lot! |
|
January 26, 2015, 09:26 |
|
#2 |
Senior Member
|
Hi,
Transfinite algorithm can be used for surfaces with 3 or 4 corners or for volumes with 5 or 6 faces (http://www.geuz.org/gmsh/doc/texinfo...ructured-grids). Volume around inner cuboid does not have required number of faces, so it is meshed with tetrahedra. If you are trying to mesh a cylinder, you should divide outer circle other way. See for example - https://bitbucket.org/mrklein/gmsh-m...cylinder-1.geo. |
|
January 26, 2015, 09:37 |
|
#3 |
New Member
Join Date: Jul 2014
Posts: 13
Rep Power: 12 |
Wow that was quick! And it also solved it, great!
Thank you very much. |
|
September 18, 2019, 17:13 |
GMSH; Mesh occurs inside airfoil geometry
|
#4 |
New Member
Akbalom
Join Date: Aug 2019
Location: Istanbul, Turkey
Posts: 7
Rep Power: 7 |
Hi,,
When spline command is used to connect points airfoil geometry, after the mesh construct, there would be a mesh inside de airfoil layer. Whereas, plane surface is defined outer layer of airfoil. Attachment is here. |
|
Tags |
circle+square, gmsh, mesh for aero-acoustics |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Gmsh] Gmsh: Structured Mesh problems | skrishnamoorthy | OpenFOAM Meshing & Mesh Conversion | 3 | August 9, 2017 23:48 |
[Gmsh] Gmsh: Unstructured to Structured Mesh geometry | ChasingNeutrons | OpenFOAM Meshing & Mesh Conversion | 0 | November 22, 2016 13:55 |
[snappyHexMesh] Layers:problem with curvature | giulio.topazio | OpenFOAM Meshing & Mesh Conversion | 10 | August 22, 2012 10:03 |
Structured Mesh in GMSH | vitor | Main CFD Forum | 4 | April 28, 2010 09:15 |
unstructured vs. structured grids | Frank Muldoon | Main CFD Forum | 1 | January 5, 1999 11:09 |