All;
I created what I thought was a closed volume, but GMSH doesn't agree. I've
attached the offending file, does anyone know why it's not working?
Regards,
...Dan
// author: Danny Holstein
conv = 0.0254 ; // units are inches
// compute anode position for magnetics, h = 0.0200
// anode_dis=0.0630
h = 0.0200*conv ; //
width = 0.100*conv ; //
height = h ; // beam tunnel height
crad =1.0300*3*h ; // cathode radius
cthick = 1.0200*2*h ; // cathode thickness
cthick2 = cthick/2 ;
anode_dis = 1.0500*3*h ; // anode-cathode gap
anode_cntr = 1.0100*1.4*cthick2 ; // anode center diameter
anode_od = 0.9800*anode_cntr*2 ; // anode od
anode_rad = 1*h/10 ; // anode radius of curvature
anode_prot = 0.9600*.7*h ; // anode protrusion from plane
bfe_gap = .002*conv ; // BFE gap
bfe_off = 1*.006*conv ; // BFE axial offset from cathode corner
bfe_rad = 0.9900*1.5*h + cthick2 ; // BFE radius
bfe_ang = 58*Pi/180 ; // BFE angle
bfe_len = 1.0200*h/3 ; // BFE length, projected from
intersection point
bfe_crv = 0.9800*h/3 ; // BFE radius of curvature
length = 2*anode_dis; // beam tunnel length
mesh_len = height/2;
/* gun */
Point(1) = {length, height/2, 0.0, mesh_len/2} ; // beam out top
Point(2) = {length, 0.0, 0.0, mesh_len/2} ; // beam out on
sym-plane
Point(3) = {-length/2, 0.0, 0.0, mesh_len/4} ; // origin
x = -length/2 ; y = height/2 ;
Point(4) = {x, cthick2, 0.0, mesh_len/2} ;
x = x + crad ;
Point(5) = {x, 0.0, 0.0, 0.0} ;
// cathode radius center (not part of mesh)
y = cthick/2 ;
Point(6) = {x - Sqrt(crad*crad - cthick2*cthick2), y, 0.0, mesh_len/4} ;
// cathode edge/corner
x = -length/2 ; y = y + bfe_gap ;
Point(7) = {x, y, 0.0, mesh_len/4} ;
// cathode stalk
x = -length/2 + bfe_off ;
Point(8) = {x, y, 0.0, mesh_len/4} ;
x = x + (bfe_rad - cthick/2)/Tan(bfe_ang) ; y = bfe_rad ;
Point(9) = {x, y, 0.0, mesh_len} ;
// BFE outer radius
x = x + (Fabs(bfe_len)+.5)*bfe_crv ;
Point(10) = {x, y, 0.0, mesh_len} ;
y = y + bfe_crv ;
Point(11) = {x, y, 0.0, mesh_len} ;
x = x + bfe_crv ;
Point(12) = {x, y, 0.0, mesh_len} ;
x = -length/2 + anode_dis ;
Point(13) = {x, y, 0.0, mesh_len} ;
y = anode_od/2 ;
Point(14) = {x, y, 0.0, mesh_len} ;
x = x - anode_prot ; y = anode_cntr/2 ;
tmp = anode_od/2 - anode_cntr/2 ;
c = Sqrt(anode_prot*anode_prot + tmp*tmp) ;
t1 = Atan(anode_prot/tmp) ; t2 = Asin(anode_rad/c) ; t3 = Pi/2 - t1 - t2 ;
Point(15) = {x, y, 0.0, mesh_len} ;
// anode center of radius
Point(16) = {x - anode_rad*Sin(t3), y + anode_rad*Cos(t3), 0.0, mesh_len} ;
// anode top tangent
Point(17) = {x - anode_rad, y, 0.0, mesh_len} ;
// anode tip
Point(18) = {-length/2 + anode_dis, height/2, 0.0, mesh_len/2} ;
// anode/beam hole interface
tmp = anode_cntr/2 - height/2 ;
c = Sqrt(anode_prot*anode_prot + tmp*tmp) ;
t1 = Atan(anode_prot/tmp) ; t2 = Asin(anode_rad/c) ; t3 = Pi/2 - t1 - t2 ;
Point(19) = {x - anode_rad*Sin(t3), y - anode_rad*Cos(t3), 0.0, mesh_len/2} ;
// anode bottom tangent
Line(1) = {1,2};
Line(2) = {2,3};
Circle (3) = {3, 5, 6};
Line(4) = {18,1};
Line(5) = {6,4};
Line(6) = {4,7};
Line(7) = {7,8};
Line(8) = {8,9};
Line(9) = {9,10};
Circle (10) = {10,11,12};
Line(11) = {12,13};
Line(12) = {13,14};
Line(13) = {14,16};
Circle (14) = {16,15,17};
Circle (15) = {17,15,19};
Line(16) = {19,18};
Physical Line("cathode") = {3};
Physical Line("cathode-stalk") = {5};
Physical Line("neumann") = {6,11};
Physical Line("bfe") = {7,8,9,10};
Physical Line("anode") = {12,13,14,15,16,4};
Physical Line("beam-out") = {1};
Physical Line("mirror") = {2};
Translate {0, width/2, 0} {
Line{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
}
Translate { 0, -width/2, 0 }
{
Duplicata { Line{2}; }
}
Line(18) = {3, 21};
Line(19) = {2, 20};
Line(20) = {6, 8};
Line Loop(21) = {7, -20, 5, 6};
Plane Surface(22) = {21};
Line Loop(23) = {8, 9, 10, 11, 12, 13, 14, 15, 16, 4, 1, 19, 17, -18, 3, 20};
Plane Surface(24) = {23};
Extrude {{-1, 0, 0}, {1, 0, 0}, Pi} {
Surface{24, 22};
}
Delete {
Volume{2, 1};
}
Delete {
Surface{88, 85, 61, 81, 77, 65, 69, 73, 57, 53, 49, 45, 100, 92, 96, 110,
118, 122};
}
Delete {
Line{80, 56, 60, 76, 43, 84, 117, 108, 72, 64, 68, 48, 52, 44, 91, 95};
}
// Extrude {{1, width/4, 0}, {-1, width/4, 0}, Pi/2} {
// Line{3, 20, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 1};
// }
// Extrude {0, -width, 0} {
// Line{124, 172, 168, 176, 128, 164, 156, 160, 152, 148, 144, 140, 136, 132,
180, 184};
// }
// Extrude {{1, -width/4, 0}, {-1, -width/4, 0}, Pi/2} {
// Line{188, 200, 192, 196, 204, 208, 216, 212, 220, 224, 228, 232, 236, 240,
244, 248};
// }
Extrude {{1, width/4, 0}, {-1, width/4, 0}, Pi/2} {
Line{3, 20, 8, 9, 10, 11, 12, 13, 14, 15, 16, 4, 1};
}
Extrude {{1, width/4, 0}, {-1, width/4, 0}, Pi/2} {
Line{20, 5, 6, 7};
}
Extrude {0, -width, 0} {
Line{124, 128, 132, 136, 140, 144, 148, 152, 156, 160, 164, 168, 172};
}
Extrude {0, -width, 0} {
Line{128, 184, 180, 176};
}
Extrude {{1, -width/4, 0}, {-1, -width/4, 0}, Pi/2} {
Line{188, 192, 196, 200, 204, 208, 212, 216, 220, 224, 228, 232, 236};
}
Extrude {{1, -width/4, 0}, {-1, -width/4, 0}, Pi/2} {
Line{192, 240, 244, 248};
}
Delete {
Surface{22, 187, 247, 183, 243, 123, 307, 315, 311, 215, 251, 179};
}
Line Loop(315) = {210, 212, -214, -148};
Plane Surface(316) = {315};
_______________________________________________
gmsh mailing list
[email protected]
http://www.geuz.org/mailman/listinfo/gmsh