I've got a file that creates an unstructured mesh using Gmsh - a cuboidal region containing a series of nested cylinders. I would love to make it a structured mesh but have been having problems getting gmsh to do it.
Does anyone know of a straightforward way to make it structured? I fear gmsh may be ill-equipped but I would be very happy to be proven wrong.
Code:
//Inputs
m=1; //scale
w = 0.0126*m;//m width of cell
h = w;//m height of cell
r0 = 0.004095*m;//m pin radius
r1= 0.003738206*m;//zone1 outer radius
r2 = 0.003343553*m; //zone2 outer radius
r3 = 0.002895602*m;//zone3 outer radius
r4= 0.002364249*m;//zone4 outer radius
r5=0.001671777*m;
t = 0.000655*m;//m clad thickness
gridsize = w/6;
cladgrid=w/6;
d = w/10;
//Define cell border
Point(1) = {0, 0, 0, gridsize};
Point(2) = {w, 0, 0, gridsize};
Point(3) = {w, h, 0, gridsize};
Point(4) = {0, h, 0, gridsize};
Point(5) = {w/2, h/2, 0, gridsize};
//Clad outer radius points
Point(6) = {(r0+t+w/2), h/2, 0, cladgrid};
Point(7) = {w/2, (r0+t+h/2), 0, cladgrid};
Point(8) = {(-r0-t+w/2), h/2, 0, cladgrid};
Point(9) = {w/2, (-r0-t+h/2), 0, cladgrid};
//Radius 0
Point(10) = {(r0+w/2), h/2, 0, cladgrid};
Point(11) = {w/2, (r0+h/2), 0, cladgrid};
Point(12) = {(-r0+w/2), h/2, 0, cladgrid};
Point(13) = {w/2, (-r0+h/2), 0, cladgrid};
//Radius 1
Point(14) = {(r1+w/2), h/2, 0, cladgrid};
Point(15) = {w/2, (r1+h/2), 0, cladgrid};
Point(16) = {(-r1+w/2), h/2, 0, cladgrid};
Point(17) = {w/2, (-r1+h/2), 0, cladgrid};
//Radius 2
Point(18) = {(r2+w/2), h/2, 0, cladgrid};
Point(19) = {w/2, (r2+h/2), 0, cladgrid};
Point(20) = {(-r2+w/2), h/2, 0, cladgrid};
Point(21) = {w/2, (-r2+h/2), 0, cladgrid};
//Radius 3
Point(22) = {(r3+w/2), h/2, 0, cladgrid};
Point(23) = {w/2, (r3+h/2), 0, cladgrid};
Point(24) = {(-r3+w/2), h/2, 0, cladgrid};
Point(25) = {w/2, (-r3+h/2), 0, cladgrid};
//Radius 4
Point(26) = {(r4+w/2), h/2, 0, cladgrid};
Point(27) = {w/2, (r4+h/2), 0, cladgrid};
Point(28) = {(-r4+w/2), h/2, 0, cladgrid};
Point(29) = {w/2, (-r4+h/2), 0, cladgrid};
//Radius 5
Point(30) = {(r5+w/2), h/2, 0, cladgrid};
Point(31) = {w/2, (r5+h/2), 0, cladgrid};
Point(32) = {(-r5+w/2), h/2, 0, cladgrid};
Point(33) = {w/2, (-r5+h/2), 0, cladgrid};
//Cell border
Line(1) = {4, 3};
Line(2) = {3, 2};
Line(3) = {2, 1};
Line(4) = {1, 4};
//Clad circumference
Circle(5) = {8, 5, 7};
Circle(6) = {7, 5, 6};
Circle(7) = {6, 5, 9};
Circle(8) = {9, 5, 8};
//Pin R0
Circle(9) = {12, 5, 11};
Circle(10) = {11, 5, 10};
Circle(11) = {10, 5, 13};
Circle(12) = {13, 5, 12};
//R1
Circle(13)={16,5,15};
Circle(14)={15,5,14};
Circle(15)={14,5,17};
Circle(16)={17,5,16};
//R2
Circle(17) = {20,5,19};
Circle(18)={19,5,18};
Circle(19)={18,5,21};
Circle(20)={21,5,20};
//R3
Circle(21)={24,5,23};
Circle(22)={23,5,22};
Circle(23)={22,5,25};
Circle(24)={25,5,24};
//R4
Circle(25)={28,5,27};
Circle(26)={27,5,26};
Circle(27)={26,5,29};
Circle(28)={29,5,28};
//R5
Circle(29)={32,5,31};
Circle(30)={31,5,30};
Circle(31)={30,5,33};
Circle(32)={33,5,32};
Line Loop(1) = {4, 1, 2, 3};
Line Loop(2) = {5, 6, 7, 8};
Line Loop(3) = {9, 10, 11, 12};
Line Loop(4) = {13,14,15,16};
Line Loop(5) = {17,18,19,20};
Line Loop(6) = {21,22,23,24};
Line Loop(7) = {25,26,27,28};
Line Loop(8) = {29,30,31,32};
Plane Surface(1) = {1,2};
Ruled Surface(2) = {2, 3};
Ruled Surface(3) = {3, 4};
Ruled Surface(4) = {4,5};
Ruled Surface(5) = {5,6};
Ruled Surface(6) = {6, 7};
Ruled Surface(7) = {7,8};
Ruled Surface(8) = {8};
surfaceVector[] = Extrude {0, 0, d} {
Surface{1};
Layers{1};
Recombine;};
Physical Volume("moderator") = surfaceVector[1];
Physical Surface("LeftWall")=surfaceVector[2];
Physical Surface("RightWall")=surfaceVector[4];
Physical Surface("BottomWall")=surfaceVector[5];
Physical Surface("TopWall")=surfaceVector[3];
surfaceVector[] = Extrude {0, 0, d} {
Surface{2};
Layers{1};
Recombine;};
Physical Volume ("clad") = surfaceVector[1];
surfaceVector[] = Extrude {0, 0, d} {
Surface{3};
Layers{1};
Recombine;};
Physical Volume ("fuel1") = surfaceVector[1];
surfaceVector[] = Extrude {0, 0, d} {
Surface{4};
Layers{1};
Recombine;};
Physical Volume ("fuel2") = surfaceVector[1];
surfaceVector[] = Extrude {0, 0, d} {
Surface{5};
Layers{1};
Recombine;};
Physical Volume ("fuel3") = surfaceVector[1];
surfaceVector[] = Extrude {0, 0, d} {
Surface{6};
Layers{1};
Recombine;};
Physical Volume ("fuel4") = surfaceVector[1];
surfaceVector[] = Extrude {0, 0, d} {
Surface{7};
Layers{1};
Recombine;};
Physical Volume ("fuel5") = surfaceVector[1];
surfaceVector[] = Extrude {0, 0, d} {
Surface{8};
Layers{1};
Recombine;};
Physical Volume ("fuel6") = surfaceVector[1];