# [Gmsh] Boundary Layer around hemi sphere in a cube

Nilanka Indunil Kumari Ekanayake nekanayake at student.unimelb.edu.au
Sat Sep 30 11:33:17 CEST 2017

```Hi,

I've created the following mesh. For the boundary layer I've used extrude
command. As I need to define physical volume for the farfield (bounded by
the box and hemisphere). Here I considered two volumes created by a
seperate Surface loops. One is volume is the extruded volume and the other
volume is outside extruded surface (bounded by the block).

However, when I check the surface face, I see some overlapping in the
boundary and around it (specially in volume surface).

Also I would like to have have qaud dominated mesh in the volume? Any
method to get it ?

The critical task was to define the cut plane.

d = 0.0002; //partical diameter
L = 0.002; //length of channel
l = L/2; //half length of channel
H = 0.002; //height of channel
h = H/2; //half of channel height
W = 0.002; // width of channel
w = W/2; //half width of the channel
lc = 0.0001; // characteristic length of channel mesh
lc2 = 0.00001; //characteristic lengteh of sphere

//lc = H/10; charasteric length in box
//lc_s = r/40;charasteristic length in sphere

Point(1) = {0.0,0.0,0.0,lc2};
Point(2) = {r,0.0,0.0,lc2};
Point(3) = {0,r,0.0,lc2};
Circle(1) = {2,1,3};
Point(4) = {-r,0,0.0,lc2};
Point(5) = {0,-r,0.0,lc2};
Circle(2) = {3,1,4};
Circle(3) = {4,1,5};
Circle(4) = {5,1,2};
Point(6) = {0,0,-r,lc2};
//Point(7) = {0,0,0,lc2};
Circle(5) = {3,1,6};
Circle(6) = {6,1,5};
//Circle(7) = {5,1,7};
//Circle(8) = {7,1,3};
//Circle(9) = {2,1,7};
//Circle(10) = {7,1,4};
Circle(11) = {4,1,6};
Circle(12) = {6,1,2};
//Ellipse(013) = {5, 1, 1, 3};
//Ellipse(014) = {3, 1, 1, 2};
//Ellipse(015) = {2, 1, 1, 4};
//Ellipse(016) = {4, 1, 1, 5};

//Line Loop(13) = {2,8,-10};
//Ruled Surface(14) = {13};
//Line Loop(15) = {10,3,7};
//Ruled Surface(16) = {15};
//Line Loop(17) = {-8,-9,1};
//Ruled Surface(18) = {17};
Line Loop(19) = {-11,-2,5};
Ruled Surface(20) = {19};
Line Loop(21) = {-5,-12,-1};
Ruled Surface(22) = {21};
Line Loop(23) = {-3,11,6};
Ruled Surface(24) = {23};
//Line Loop(25) = {-7,4,9};
//Ruled Surface(26) = {25};
Line Loop(27) = {-4,12,-6};
Ruled Surface(28) = {27};
Line Loop(29) = {1,2,3,4}; //Circle created by the particle at the symmetry
plane
//Recombine Surface{20,22,24,28};

//Geometry option ExtrudeReturnLateralEntities: Add lateral entities in
lists returned by extrusion commands? Default value: 1,Saved in:
General.OptionsFileName
//tmp is a list that all entities due to extrution are saved

old = Geometry.ExtrudeReturnLateralEntities;
Geometry.ExtrudeReturnLateralEntities = 0;
tmp[] = Extrude {
Surface{20,22,24,28}; Layers{10, lc}; Recombine;
};
Geometry.ExtrudeReturnLateralEntities = old;

Point(100) = {-l,-h,-w, lc};
Point(101) = {-l,h,-w, lc};
Point(102) = {l,-h,-w, lc};
Point(103) = {l,h,-w, lc};
Point(104) = {-l,-h,0, lc};
Point(105) = {-l,h,0, lc};
Point(106) = {l,-h,0, lc};
Point(107) = {l,h,0, lc};
Line(165) = {100, 102};
Line(166) = {102, 103};
Line(167) = {103, 101};
Line(168) = {101, 100};
Line(169) = {100, 104};
Line(170) = {104, 106};
Line(171) = {106, 102};
Line(172) = {101, 105};
Line(173) = {105, 107};
Line(174) = {107, 103};
Line(175) = {105, 104};
Line(176) = {106, 107};
Line Loop(177) = {167, 168, 165, 166};
Plane Surface(178) = {177};
Line Loop(179) = {166, -174, -176, 171};
Plane Surface(180) = {179};
Line Loop(181) = {171, -165, 169, 170};
Plane Surface(182) = {181};
Line Loop(183) = {176, -173, 175, 170}; //symmetry plane exterior line loop
//Plane Surface(184) = {183,29};
Line Loop(185) = {172, 175, -169, -168};
Plane Surface(186) = {185};
Line Loop(187) = {172, 173, 174, 167};
Plane Surface(188) = {187};

Line Loop(10000) = {49,82,65,32}; //Line loop of boundary layer outer
circle in symmetry plane
Plane Surface(10084) = {10000,183}; //plane surface bounded by the outer
line loop of boundary layer and the symmetry plane exterior lines

//Recombine Surface{178,180,182,186,188,10084};

Physical Surface("<inlet>") = {186};
Physical Surface("<outlet>") = {180};
Physical Surface ("<symmetry_plane>") = {10084,41,58,88,71}; //41,58,88,71
are outer surfaces projected on the symmetry plane due to extrusion -
examined
//Physical Surface ("<symmetry_plane>") = {183,29};

Physical Surface("<top>") = {188};
Physical Surface("<bottom>") = {182};
//Physical Surface("<front>") = {184};
Physical Surface("<wall>") = {178};

Physical Surface("<particle_wall>") = {22,20,28,24}; // curved surfaces of
particle wall

Surface Loop(1000) = {22,20,28,24}; // the sphere (only need for internal
mesh)
Surface Loop(1001) = {tmp[{0:6:2}]};  // The outside of the BL - index of
0,2,4,6 represent the curved surfaces of the outer boundary layer in tmp
list
//Surface Loop(1001) = {46,63,80,97};  // The outside of the BL
Surface Loop(1002) = {188, 186, 10084, 180, 178, 182}; // the exterior
surfaces bounded by the boundary layer exterior surface
//Surface Loop(1002) = {188, 186, 184, 180, 178, 182};

//Volume(1000) = {1000}; /// inside the sphere
//Volume(1001) = {1002, 1001}; /// FarField
Volume(1002) = {1001, 1002}; /// FarField outside the boundary layer
//Volume(1002) = {1000, 1002}; /// FarField outside the boundary layer

//Physical Volume("<flow domain>") = {1002,1,2,3,4}; //1,2,3,4 are boundary
layer volumes + farfield outside the boundary layer

Mesh.Algorithm3D = 4;

Surface mesh with surface edges
[image: Inline image 1]

Volume faces - Non uniformity around  boundary layer (Due to face
overlapping?)
[image: Inline image 3]
[image: Inline image 2]

Cheers,
Nilanka
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://onelab.info/pipermail/gmsh/attachments/20170930/bfaee467/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 155707 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20170930/bfaee467/attachment-0003.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 77969 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20170930/bfaee467/attachment-0004.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 257561 bytes
Desc: not available
URL: <http://onelab.info/pipermail/gmsh/attachments/20170930/bfaee467/attachment-0005.png>
```