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

[Gmsh] Gmsh: Unstructured to Structured Mesh geometry

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 22, 2016, 12:55
Default Gmsh: Unstructured to Structured Mesh geometry
  #1
New Member
 
Paul
Join Date: Jun 2016
Posts: 21
Rep Power: 9
ChasingNeutrons is on a distinguished road
Hi all,

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.

Cheers.

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];
ChasingNeutrons is offline   Reply With Quote

Reply


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
How to mesh a domain around a rounded geometry with structured grid quarkz Pointwise & Gridgen 2 March 5, 2019 22:05
Gambit problems Althea FLUENT 22 January 4, 2017 03:19
[ICEM] Why Icem can't craeate Unstructured 2d Mesh on Circular Geometry Jvb ANSYS Meshing & Geometry 6 January 2, 2012 11:41
[ICEM] Unstructure Meshing Around Imported Plot3D Structured Mesh ICEM kawamatt2 ANSYS Meshing & Geometry 17 December 20, 2011 11:45
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 11:55


All times are GMT -4. The time now is 14:01.