New Member
Antonio
Join Date: Dec 2024
Posts: 1
Rep Power: 0
|
Hi all,
I am trying to generate an unstructured mesh with Gmsh for an airfoil. I managed to impose periodicity on a structured mesh, but every time I try to do the same procedure for an unstructured case I keep getting the following:
"Failed to find periodic counterpart of node 13 of curve 5002 on curve 5"
Please, if anyone has experience with unstructured meshes, could you give me some suggestions? Thanks!
Quote:
// NACA 0012
Mesh.MshFileVersion = 2.2;
Mesh.ElementOrder = 3;
Geometry.Tolerance=1e-15;
//Mesh.Smoothing=1000;
extrude=1;
full_mesh=1;
Lz = 25; Nz=25;
factor = 1;
Nfoil = Floor(768/factor);
Ntail = Floor(512/factor);
Nnorm = Floor(512/factor);
// angle of attack
porder = 3;
alpha_d = 0;
alpha = (Pi * alpha_d) /180;
////// Test 3D case
// 3D case
Lz = 0.0; Nz=25;
Nx1 = 20; Rx1 = 1; /// circles
Nx2 = 60; Rx2 = 1; // airfoil
Nx3 = 20; Rx3 = 1.00; Rx_wake=1.0; //blocks
Nx4 =20; //inlet
Nx6= 2; // small parts
Ny = 61; Ry = 1.15; Ry_wake=1.05;
xc = 1.0; yc=0.0;
Rad = 20.0;
th_far_u = 80-alpha_d;
th_far_l = 80+alpha_d;
th_far_u = (Pi * (90-th_far_u)) /180;
th_far_l = (Pi * (90-th_far_l)) /180;
Nelx = 2*(Nx3-1)+2*(Nx1-1)+Nx2-1;
Nely = (Ny-1);
Nelz = (Nz-1);
delx = 2.0/Nelx/porder;
dely = Rad*(Ry-1)/(Ry^(Ny-1)-1)/porder;
delz = Lz/Nelz/porder;
////////////// airfoil coordinates
Point(1) = {1, -2.498e-17, 0, 1};
Point(2) = {0.999748, 5.48742e-05, 0, 1};
Point(3) = {0.998993, 0.000219334, 0, 1};
Point(4) = {0.997736, 0.000492892, 0, 1};
Point(5) = {0.995977, 0.00087474, 0, 1};
Point(6) = {0.993719, 0.00136375, 0, 1};
Point(7) = {0.990964, 0.0019585, 0, 1};
Point(8) = {0.987715, 0.00265726, 0, 1};
Point(9) = {0.983974, 0.00345801, 0, 1};
Point(10) = {0.979746, 0.00435847, 0, 1};
Point(11) = {0.975036, 0.0053561, 0, 1};
Point(12) = {0.969846, 0.00644811, 0, 1};
Point(13) = {0.964184, 0.0076315, 0, 1};
Point(14) = {0.958054, 0.00890305, 0, 1};
Point(15) = {0.951463, 0.0102594, 0, 1};
Point(16) = {0.944418, 0.0116969, 0, 1};
Point(17) = {0.936925, 0.0132119, 0, 1};
Point(18) = {0.928992, 0.0148005, 0, 1};
Point(19) = {0.920627, 0.0164589, 0, 1};
Point(20) = {0.911838, 0.0181828, 0, 1};
Point(21) = {0.902635, 0.0199682, 0, 1};
Point(22) = {0.893027, 0.0218109, 0, 1};
Point(23) = {0.883022, 0.0237066, 0, 1};
Point(24) = {0.872632, 0.025651, 0, 1};
Point(25) = {0.861867, 0.0276397, 0, 1};
Point(26) = {0.850737, 0.0296684, 0, 1};
Point(27) = {0.839255, 0.0317327, 0, 1};
Point(28) = {0.82743, 0.0338282, 0, 1};
Point(29) = {0.815276, 0.0359504, 0, 1};
Point(30) = {0.802805, 0.0380949, 0, 1};
Point(31) = {0.790028, 0.0402573, 0, 1};
Point(32) = {0.77696, 0.042433, 0, 1};
Point(33) = {0.763613, 0.0446176, 0, 1};
Point(34) = {0.75, 0.0468066, 0, 1};
Point(35) = {0.736136, 0.0489953, 0, 1};
Point(36) = {0.722033, 0.0511792, 0, 1};
Point(37) = {0.707708, 0.0533535, 0, 1};
Point(38) = {0.693173, 0.0555137, 0, 1};
Point(39) = {0.678443, 0.0576549, 0, 1};
Point(40) = {0.663534, 0.0597723, 0, 1};
Point(41) = {0.64846, 0.061861, 0, 1};
Point(42) = {0.633237, 0.063916, 0, 1};
Point(43) = {0.617879, 0.0659323, 0, 1};
Point(44) = {0.602403, 0.0679048, 0, 1};
Point(45) = {0.586824, 0.0698282, 0, 1};
Point(46) = {0.571157, 0.0716973, 0, 1};
Point(47) = {0.555419, 0.0735067, 0, 1};
Point(48) = {0.539625, 0.0752512, 0, 1};
Point(49) = {0.523791, 0.0769252, 0, 1};
Point(50) = {0.507933, 0.0785233, 0, 1};
Point(51) = {0.492067, 0.0800401, 0, 1};
Point(52) = {0.476209, 0.0814702, 0, 1};
Point(53) = {0.460375, 0.082808, 0, 1};
Point(54) = {0.444581, 0.0840482, 0, 1};
Point(55) = {0.428843, 0.0851855, 0, 1};
Point(56) = {0.413176, 0.0862148, 0, 1};
Point(57) = {0.397597, 0.0871309, 0, 1};
Point(58) = {0.382121, 0.087929, 0, 1};
Point(59) = {0.366763, 0.0886043, 0, 1};
Point(60) = {0.35154, 0.0891525, 0, 1};
Point(61) = {0.336466, 0.0895692, 0, 1};
Point(62) = {0.321557, 0.0898505, 0, 1};
Point(63) = {0.306827, 0.0899927, 0, 1};
Point(64) = {0.292292, 0.0899927, 0, 1};
Point(65) = {0.277967, 0.0898473, 0, 1};
Point(66) = {0.263864, 0.0895543, 0, 1};
Point(67) = {0.25, 0.0891112, 0, 1};
Point(68) = {0.236387, 0.0885166, 0, 1};
Point(69) = {0.22304, 0.0877692, 0, 1};
Point(70) = {0.209972, 0.0868681, 0, 1};
Point(71) = {0.197195, 0.0858131, 0, 1};
Point(72) = {0.184724, 0.0846043, 0, 1};
Point(73) = {0.17257, 0.0832422, 0, 1};
Point(74) = {0.160745, 0.0817281, 0, 1};
Point(75) = {0.149263, 0.0800634, 0, 1};
Point(76) = {0.138133, 0.0782502, 0, 1};
Point(77) = {0.127368, 0.0762907, 0, 1};
Point(78) = {0.116978, 0.0741879, 0, 1};
Point(79) = {0.106973, 0.0719449, 0, 1};
Point(80) = {0.0973649, 0.0695652, 0, 1};
Point(81) = {0.0881617, 0.0670527, 0, 1};
Point(82) = {0.0793732, 0.0644115, 0, 1};
Point(83) = {0.0710083, 0.0616458, 0, 1};
Point(84) = {0.0630753, 0.0587603, 0, 1};
Point(85) = {0.0555823, 0.0557596, 0, 1};
Point(86) = {0.0485367, 0.0526484, 0, 1};
Point(87) = {0.0419458, 0.0494316, 0, 1};
Point(88) = {0.035816, 0.046114, 0, 1};
Point(89) = {0.0301537, 0.0427003, 0, 1};
Point(90) = {0.0249644, 0.0391953, 0, 1};
Point(91) = {0.0202535, 0.0356035, 0, 1};
Point(92) = {0.0160256, 0.0319292, 0, 1};
Point(93) = {0.0122851, 0.0281767, 0, 1};
Point(94) = {0.00903565, 0.0243496, 0, 1};
Point(95) = {0.00628056, 0.0204517, 0, 1};
Point(96) = {0.00402259, 0.0164862, 0, 1};
Point(97) = {0.00226404, 0.012456, 0, 1};
Point(98) = {0.00100666, 0.00836355, 0, 1};
Point(99) = {0.000251729, 0.00421098, 0, 1};
Point(100) = {0, 0, 0, 1};
Point(101) = {0.000251729, -0.00421098, 0, 1};
Point(102) = {0.00100666, -0.00836355, 0, 1};
Point(103) = {0.00226404, -0.012456, 0, 1};
Point(104) = {0.00402259, -0.0164862, 0, 1};
Point(105) = {0.00628056, -0.0204517, 0, 1};
Point(106) = {0.00903565, -0.0243496, 0, 1};
Point(107) = {0.0122851, -0.0281767, 0, 1};
Point(108) = {0.0160256, -0.0319292, 0, 1};
Point(109) = {0.0202535, -0.0356035, 0, 1};
Point(110) = {0.0249644, -0.0391953, 0, 1};
Point(111) = {0.0301537, -0.0427003, 0, 1};
Point(112) = {0.035816, -0.046114, 0, 1};
Point(113) = {0.0419458, -0.0494316, 0, 1};
Point(114) = {0.0485367, -0.0526484, 0, 1};
Point(115) = {0.0555823, -0.0557596, 0, 1};
Point(116) = {0.0630753, -0.0587603, 0, 1};
Point(117) = {0.0710083, -0.0616458, 0, 1};
Point(118) = {0.0793732, -0.0644115, 0, 1};
Point(119) = {0.0881617, -0.0670527, 0, 1};
Point(120) = {0.0973649, -0.0695652, 0, 1};
Point(121) = {0.106973, -0.0719449, 0, 1};
Point(122) = {0.116978, -0.0741879, 0, 1};
Point(123) = {0.127368, -0.0762907, 0, 1};
Point(124) = {0.138133, -0.0782502, 0, 1};
Point(125) = {0.149263, -0.0800634, 0, 1};
Point(126) = {0.160745, -0.0817281, 0, 1};
Point(127) = {0.17257, -0.0832422, 0, 1};
Point(128) = {0.184724, -0.0846043, 0, 1};
Point(129) = {0.197195, -0.0858131, 0, 1};
Point(130) = {0.209972, -0.0868681, 0, 1};
Point(131) = {0.22304, -0.0877692, 0, 1};
Point(132) = {0.236387, -0.0885166, 0, 1};
Point(133) = {0.25, -0.0891112, 0, 1};
Point(134) = {0.263864, -0.0895543, 0, 1};
Point(135) = {0.277967, -0.0898473, 0, 1};
Point(136) = {0.292292, -0.0899927, 0, 1};
Point(137) = {0.306827, -0.0899927, 0, 1};
Point(138) = {0.321557, -0.0898505, 0, 1};
Point(139) = {0.336466, -0.0895692, 0, 1};
Point(140) = {0.35154, -0.0891525, 0, 1};
Point(141) = {0.366763, -0.0886043, 0, 1};
Point(142) = {0.382121, -0.087929, 0, 1};
Point(143) = {0.397597, -0.0871309, 0, 1};
Point(144) = {0.413176, -0.0862148, 0, 1};
Point(145) = {0.428843, -0.0851855, 0, 1};
Point(146) = {0.444581, -0.0840482, 0, 1};
Point(147) = {0.460375, -0.082808, 0, 1};
Point(148) = {0.476209, -0.0814702, 0, 1};
Point(149) = {0.492067, -0.0800401, 0, 1};
Point(150) = {0.507933, -0.0785233, 0, 1};
Point(151) = {0.523791, -0.0769252, 0, 1};
Point(152) = {0.539625, -0.0752512, 0, 1};
Point(153) = {0.555419, -0.0735067, 0, 1};
Point(154) = {0.571157, -0.0716973, 0, 1};
Point(155) = {0.586824, -0.0698282, 0, 1};
Point(156) = {0.602403, -0.0679048, 0, 1};
Point(157) = {0.617879, -0.0659323, 0, 1};
Point(158) = {0.633237, -0.063916, 0, 1};
Point(159) = {0.64846, -0.061861, 0, 1};
Point(160) = {0.663534, -0.0597723, 0, 1};
Point(161) = {0.678443, -0.0576549, 0, 1};
Point(162) = {0.693173, -0.0555137, 0, 1};
Point(163) = {0.707708, -0.0533535, 0, 1};
Point(164) = {0.722033, -0.0511792, 0, 1};
Point(165) = {0.736136, -0.0489953, 0, 1};
Point(166) = {0.75, -0.0468066, 0, 1};
Point(167) = {0.763613, -0.0446176, 0, 1};
Point(168) = {0.77696, -0.042433, 0, 1};
Point(169) = {0.790028, -0.0402573, 0, 1};
Point(170) = {0.802805, -0.0380949, 0, 1};
Point(171) = {0.815276, -0.0359504, 0, 1};
Point(172) = {0.82743, -0.0338282, 0, 1};
Point(173) = {0.839255, -0.0317327, 0, 1};
Point(174) = {0.850737, -0.0296684, 0, 1};
Point(175) = {0.861867, -0.0276397, 0, 1};
Point(176) = {0.872632, -0.025651, 0, 1};
Point(177) = {0.883022, -0.0237066, 0, 1};
Point(178) = {0.893027, -0.0218109, 0, 1};
Point(179) = {0.902635, -0.0199682, 0, 1};
Point(180) = {0.911838, -0.0181828, 0, 1};
Point(181) = {0.920627, -0.0164589, 0, 1};
Point(182) = {0.928992, -0.0148005, 0, 1};
Point(183) = {0.936925, -0.0132119, 0, 1};
Point(184) = {0.944418, -0.0116969, 0, 1};
Point(185) = {0.951463, -0.0102594, 0, 1};
Point(186) = {0.958054, -0.00890305, 0, 1};
Point(187) = {0.964184, -0.0076315, 0, 1};
Point(188) = {0.969846, -0.00644811, 0, 1};
Point(189) = {0.975036, -0.0053561, 0, 1};
Point(190) = {0.979746, -0.00435847, 0, 1};
Point(191) = {0.983974, -0.00345801, 0, 1};
Point(192) = {0.987715, -0.00265726, 0, 1};
Point(193) = {0.990964, -0.0019585, 0, 1};
Point(194) = {0.993719, -0.00136375, 0, 1};
Point(195) = {0.995977, -0.00087474, 0, 1};
Point(196) = {0.997736, -0.000492892, 0, 1};
Point(197) = {0.998993, -0.000219334, 0, 1};
Point(198) = {0.999748, -5.48742e-05, 0, 1};
//Define foil spline and trailing edge
Spline(1000) = {1:9};
Spline(2000) = {9:85};
Spline(3000) = {85:115}; /// center part
Spline(4000) = {115:191};
Spline(5000) = {191:198,1};
Compound Curve{1000,2000,3000,4000,5000};
Rotate {{0, 0, 1}, {1, 0, 0}, -alpha } {
Curve{ 1000,2000,3000,4000,5000};
}
//Define bounding box corners
Point(1001) = { Rad, 0.000000, 0.0000000, 1.0};
Point(1002) = { xc, Rad, 0.0000000, 1.0};
Point(1003) = { xc, -Rad, 0.0000000, 1.0};
Point(1004) = { Rad, Rad, 0.0000000, 1.0};
Point(1005) = { Rad, -Rad, 0.0000000, 1.0};
Point(1006) = { -Rad*Cos(th_far_u)+xc, Rad*Sin(th_far_u)+yc, 0.0000000, 1.0};
Point(1007) = { -Rad*Cos(th_far_l)+xc, -Rad*Sin(th_far_l)-yc, 0.0000000, 1.0};
//Boundary and Blocks
//+
Circle(5) = {1002, 1, 1006};
//+
Circle(6) = {1006, 1, 1007};
//+
Circle(7) = {1007, 1, 1003};
//+
////////////// block
Line(8) = {1002, 1004}; Transfinite Line {8} = Nx3 Using Progression Rx_wake;
//+
Line(9) = {1004, 1001}; Transfinite Line {-9} = Nx3 Using Progression Ry_wake;
//+
Line(10) = {1001, 1005}; Transfinite Line {10} = Nx3 Using Progression Ry_wake;
//+
Line(11) = {1005, 1003}; Transfinite Line {-11} = Nx3 Using Progression Rx_wake;
/////////////// circles
Transfinite Line {5} = Nx3 Using Progression 1; //
Transfinite Line {7} = Nx3 Using Progression 1;
Transfinite Line {6} = Nx3/2 Using Progression 1;
/// airfoil
Transfinite Line {1000} = Nx6 Using Bump Rx1; // small part
Transfinite Line {2000} = Nx2 Using Bump Rx1;
Transfinite Line {3000} = Nx4 Using Bump Rx1; // center
Transfinite Line {4000} = Nx2 Using Bump Rx1;
Transfinite Line {5000} = Nx6 Using Bump Rx1; // small part
//+
Curve Loop(1) = {5, 6, 7, -11, -10, -9, -8};
//+
Curve Loop(2) = {1000, 2000, 3000, 4000, 5000};
//+
Plane Surface(1) = {1, 2};
//----------Extrude 2D surfaces in z-direction----------//
Extrude {0,0, 0.25}
{
Surface{1}; Layers {25}; Recombine;
}
//+
Physical Surface("inlet", 1) = {5017, 5025, 5029, 5021};
//+
Physical Surface("outlet", 2) = {5041, 5037};
//+
Physical Surface("airfoil", 3) = {5057, 5049, 5053,5061,5045};
//
Physical Surface("periodic", 4) = {1,5062};
//+
Physical Volume("volume", 6) = {Volume{:}};
Mesh 3; //+ Volumetric mesh
// periodicity, according to previous threads this should fix the error but it doesn't
Periodic Surface {5062} = {1} Translate {0, 0, 0.25};
|
|