From aa7080ce3980fc9bee81bdc77ff488af31a1d7e2 Mon Sep 17 00:00:00 2001 From: Paul Dechamps <paul.dechamps@uliege.be> Date: Mon, 24 Feb 2025 18:55:17 +0100 Subject: [PATCH] (fix) If scipy does not have splrep, we cannot use it --- .gitlab-ci.yml | 2 - blast/interfaces/blSolversInterface.py | 40 +- blast/models/dart/oneraM6.geo | 591 +++++++++++++++++++++++++ blast/tests/t_sections_3D.py | 1 + 4 files changed, 615 insertions(+), 19 deletions(-) create mode 100644 blast/models/dart/oneraM6.geo diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 9191a32..fa9868a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -5,8 +5,6 @@ default: - source /opt/intel/oneapi/tbb/latest/env/vars.sh - echo $(nproc) - printenv | sort - - python3 -m pip install --upgrade pip - - python3 -m pip install scipy==1.15 .global_tag: &global_tag_def tags: diff --git a/blast/interfaces/blSolversInterface.py b/blast/interfaces/blSolversInterface.py index 360e44a..5f3c4cf 100644 --- a/blast/interfaces/blSolversInterface.py +++ b/blast/interfaces/blSolversInterface.py @@ -23,8 +23,6 @@ import blast import tbox from blast.interfaces.blDataStructure import Group - -from scipy.interpolate import make_splprep from scipy.interpolate import griddata from scipy.interpolate import interp1d @@ -451,8 +449,15 @@ class SolversInterface: Notes: ----- - + The sections are created using the inviscid mesh and the + sections are created by interpolating the inviscid mesh using scipy griddata. """ + found_splprep = False + try: + from scipy.interpolate import make_splprep + found_splprep = True + except ImportError: + print('Warning: scipy not found. Cannot smooth leading edge.') ndim = self.getnDim() sections = self.cfg['sections'] @@ -517,20 +522,21 @@ class SolversInterface: data_up = np.delete(data_up, np.where(np.isnan(data_up[:, ndim-1])), axis=0) data_lw = np.delete(data_lw, np.where(np.isnan(data_lw[:, ndim-1])), axis=0) - dummy = np.row_stack((data_up, np.flip(data_lw, axis=0))) - - # Ensure that there is only one point at the leading edge - dummy[0,ndim-1] = 0.5*(dummy[0,ndim-1] + dummy[-1,ndim-1]) - dummy[-1,ndim-1] = dummy[0, ndim-1] - - # Smooth leading edge - mask = dummy[:,0] < (0.1*(np.max(dummy[:,0]) - np.min(dummy[:,0])) + np.min(dummy[:,0])) - _s = self.cfg['smooth_sections'] if 'smooth_sections' in self.cfg else 0.0 - spl_n, u_n = make_splprep([dummy[mask,0], dummy[mask,2]], s=_s) - dummy[mask, 0] = spl_n(u_n)[0] - dummy[mask, 2] = spl_n(u_n)[1] - data_up = dummy[:data_up.shape[0], :] - data_lw = np.flip(dummy[data_up.shape[0]:], axis=0) + if found_splprep: + dummy = np.row_stack((data_up, np.flip(data_lw, axis=0))) + + # Ensure that there is only one point at the leading edge + dummy[0,ndim-1] = 0.5*(dummy[0,ndim-1] + dummy[-1,ndim-1]) + dummy[-1,ndim-1] = dummy[0, ndim-1] + + # Smooth leading edge + mask = dummy[:,0] < (0.1*(np.max(dummy[:,0]) - np.min(dummy[:,0])) + np.min(dummy[:,0])) + _s = self.cfg['smooth_sections'] if 'smooth_sections' in self.cfg else 0.0 + spl_n, u_n = make_splprep([dummy[mask,0], dummy[mask,2]], s=_s) + dummy[mask, 0] = spl_n(u_n)[0] + dummy[mask, 2] = spl_n(u_n)[1] + data_up = dummy[:data_up.shape[0], :] + data_lw = np.flip(dummy[data_up.shape[0]:], axis=0) interpolated_upper.append(data_up) interpolated_lower.append(data_lw) diff --git a/blast/models/dart/oneraM6.geo b/blast/models/dart/oneraM6.geo new file mode 100644 index 0000000..616835e --- /dev/null +++ b/blast/models/dart/oneraM6.geo @@ -0,0 +1,591 @@ +/* Onera M6 wing */ +// Initially generated by unsRgridWingGen.m + +// Parameters +// domain and mesh +DefineConstant[ lgt = { 3.0, Name "Channel half length" } ]; +DefineConstant[ wdt = { 2.0, Name "Channel width" } ]; +DefineConstant[ hgt = { 3.0, Name "Channel half height" } ]; +DefineConstant[ msLeRt = { 0.01, Name "Root leading edge mesh size" } ]; +DefineConstant[ msTeRt = { 0.01, Name "Root trailing edge mesh size" } ]; +DefineConstant[ msLeTp = { 0.01, Name "Tip leading edge mesh size" } ]; +DefineConstant[ msTeTp = { 0.01, Name "Tip trailing edge mesh size" } ]; +DefineConstant[ msF = { 1.0, Name "Farfield mesh size" } ]; + + +//// GEOMETRY + + +/// Points + +// Airfoil 1: oneraM6, 143 points +Point(1) = {0.805900,0.000000,0.000000,msTeRt}; +Point(2) = {0.804129,0.000000,0.000232}; +Point(3) = {0.802038,0.000000,0.000505}; +Point(4) = {0.799569,0.000000,0.000828}; +Point(5) = {0.796652,0.000000,0.001210}; +Point(6) = {0.793208,0.000000,0.001661}; +Point(7) = {0.789139,0.000000,0.002193}; +Point(8) = {0.784331,0.000000,0.002822}; +Point(9) = {0.778649,0.000000,0.003565}; +Point(10) = {0.771932,0.000000,0.004444}; +Point(11) = {0.763989,0.000000,0.005483}; +Point(12) = {0.754592,0.000000,0.006710}; +Point(13) = {0.743470,0.000000,0.008151}; +Point(14) = {0.730299,0.000000,0.009828,msTeRt}; +Point(15) = {0.714691,0.000000,0.011690}; +Point(16) = {0.696182,0.000000,0.013774}; +Point(17) = {0.677546,0.000000,0.015783}; +Point(18) = {0.658809,0.000000,0.017717}; +Point(19) = {0.639970,0.000000,0.019586}; +Point(20) = {0.621026,0.000000,0.021397}; +Point(21) = {0.601980,0.000000,0.023159}; +Point(22) = {0.582826,0.000000,0.024875}; +Point(23) = {0.563568,0.000000,0.026547}; +Point(24) = {0.544202,0.000000,0.028170}; +Point(25) = {0.524729,0.000000,0.029737}; +Point(26) = {0.505147,0.000000,0.031238}; +Point(27) = {0.485455,0.000000,0.032658}; +Point(28) = {0.465652,0.000000,0.033984}; +Point(29) = {0.445738,0.000000,0.035197}; +Point(30) = {0.425711,0.000000,0.036282}; +Point(31) = {0.405570,0.000000,0.037225}; +Point(32) = {0.385317,0.000000,0.038011}; +Point(33) = {0.364947,0.000000,0.038631}; +Point(34) = {0.344460,0.000000,0.039073}; +Point(35) = {0.323856,0.000000,0.039344}; +Point(36) = {0.303135,0.000000,0.039432}; +Point(37) = {0.282293,0.000000,0.039343}; +Point(38) = {0.261331,0.000000,0.039078}; +Point(39) = {0.240248,0.000000,0.038642,1.5*msLeRt}; +Point(40) = {0.219042,0.000000,0.038037}; +Point(41) = {0.197712,0.000000,0.037261}; +Point(42) = {0.176258,0.000000,0.036306}; +Point(43) = {0.154679,0.000000,0.035154}; +Point(44) = {0.132972,0.000000,0.033774}; +Point(45) = {0.111131,0.000000,0.032117}; +Point(46) = {0.092662,0.000000,0.030457}; +Point(47) = {0.077073,0.000000,0.028830}; +Point(48) = {0.063937,0.000000,0.027269}; +Point(49) = {0.052891,0.000000,0.025800}; +Point(50) = {0.043619,0.000000,0.024441}; +Point(51) = {0.035851,0.000000,0.023203}; +Point(52) = {0.029356,0.000000,0.022027}; +Point(53) = {0.023936,0.000000,0.020812}; +Point(54) = {0.019428,0.000000,0.019503}; +Point(55) = {0.015684,0.000000,0.018096}; +Point(56) = {0.012586,0.000000,0.016619}; +Point(57) = {0.010032,0.000000,0.015114}; +Point(58) = {0.007931,0.000000,0.013618}; +Point(59) = {0.006214,0.000000,0.012165}; +Point(60) = {0.004815,0.000000,0.010776}; +Point(61) = {0.003683,0.000000,0.009463}; +Point(62) = {0.002775,0.000000,0.008233}; +Point(63) = {0.002050,0.000000,0.007089}; +Point(64) = {0.001480,0.000000,0.006027}; +Point(65) = {0.001037,0.000000,0.005045}; +Point(66) = {0.000698,0.000000,0.004138}; +Point(67) = {0.000444,0.000000,0.003301}; +Point(68) = {0.000260,0.000000,0.002529}; +Point(69) = {0.000135,0.000000,0.001818}; +Point(70) = {0.000056,0.000000,0.001162}; +Point(71) = {0.000013,0.000000,0.000557}; +Point(72) = {0.000000,0.000000,0.000000,msLeRt}; +Point(73) = {0.000013,0.000000,-0.000557}; +Point(74) = {0.000056,0.000000,-0.001162}; +Point(75) = {0.000135,0.000000,-0.001818}; +Point(76) = {0.000260,0.000000,-0.002529}; +Point(77) = {0.000444,0.000000,-0.003301}; +Point(78) = {0.000698,0.000000,-0.004138}; +Point(79) = {0.001037,0.000000,-0.005045}; +Point(80) = {0.001480,0.000000,-0.006027}; +Point(81) = {0.002050,0.000000,-0.007089}; +Point(82) = {0.002775,0.000000,-0.008233}; +Point(83) = {0.003683,0.000000,-0.009463}; +Point(84) = {0.004815,0.000000,-0.010776}; +Point(85) = {0.006214,0.000000,-0.012165}; +Point(86) = {0.007931,0.000000,-0.013618}; +Point(87) = {0.010032,0.000000,-0.015114}; +Point(88) = {0.012586,0.000000,-0.016619}; +Point(89) = {0.015684,0.000000,-0.018096}; +Point(90) = {0.019428,0.000000,-0.019503}; +Point(91) = {0.023936,0.000000,-0.020812}; +Point(92) = {0.029356,0.000000,-0.022027}; +Point(93) = {0.035851,0.000000,-0.023203}; +Point(94) = {0.043619,0.000000,-0.024441}; +Point(95) = {0.052891,0.000000,-0.025800}; +Point(96) = {0.063937,0.000000,-0.027269}; +Point(97) = {0.077073,0.000000,-0.028830}; +Point(98) = {0.092662,0.000000,-0.030457}; +Point(99) = {0.111131,0.000000,-0.032117}; +Point(100) = {0.132972,0.000000,-0.033774}; +Point(101) = {0.154679,0.000000,-0.035154}; +Point(102) = {0.176258,0.000000,-0.036306}; +Point(103) = {0.197712,0.000000,-0.037261}; +Point(104) = {0.219042,0.000000,-0.038037}; +Point(105) = {0.240248,0.000000,-0.038642,1.5*msLeRt}; +Point(106) = {0.261331,0.000000,-0.039078}; +Point(107) = {0.282293,0.000000,-0.039343}; +Point(108) = {0.303135,0.000000,-0.039432}; +Point(109) = {0.323856,0.000000,-0.039344}; +Point(110) = {0.344460,0.000000,-0.039073}; +Point(111) = {0.364947,0.000000,-0.038631}; +Point(112) = {0.385317,0.000000,-0.038011}; +Point(113) = {0.405570,0.000000,-0.037225}; +Point(114) = {0.425711,0.000000,-0.036282}; +Point(115) = {0.445738,0.000000,-0.035197}; +Point(116) = {0.465652,0.000000,-0.033984}; +Point(117) = {0.485455,0.000000,-0.032658}; +Point(118) = {0.505147,0.000000,-0.031238}; +Point(119) = {0.524729,0.000000,-0.029737}; +Point(120) = {0.544202,0.000000,-0.028170}; +Point(121) = {0.563568,0.000000,-0.026547}; +Point(122) = {0.582826,0.000000,-0.024875}; +Point(123) = {0.601980,0.000000,-0.023159}; +Point(124) = {0.621026,0.000000,-0.021397}; +Point(125) = {0.639970,0.000000,-0.019586}; +Point(126) = {0.658809,0.000000,-0.017717}; +Point(127) = {0.677546,0.000000,-0.015783}; +Point(128) = {0.696182,0.000000,-0.013774}; +Point(129) = {0.714691,0.000000,-0.011690}; +Point(130) = {0.730299,0.000000,-0.009828,msTeRt}; +Point(131) = {0.743470,0.000000,-0.008151}; +Point(132) = {0.754592,0.000000,-0.006710}; +Point(133) = {0.763989,0.000000,-0.005483}; +Point(134) = {0.771932,0.000000,-0.004444}; +Point(135) = {0.778649,0.000000,-0.003565}; +Point(136) = {0.784331,0.000000,-0.002822}; +Point(137) = {0.789139,0.000000,-0.002193}; +Point(138) = {0.793208,0.000000,-0.001661}; +Point(139) = {0.796652,0.000000,-0.001210}; +Point(140) = {0.799569,0.000000,-0.000828}; +Point(141) = {0.802038,0.000000,-0.000505}; +Point(142) = {0.804129,0.000000,-0.000232,msTeRt}; + +// Airfoil 2: oneraM6, 143 points +Point(144) = {1.143427,1.196000,0.000000,msTeTp}; +Point(145) = {1.142432,1.196000,0.000130}; +Point(146) = {1.141256,1.196000,0.000284}; +Point(147) = {1.139869,1.196000,0.000466}; +Point(148) = {1.138230,1.196000,0.000680}; +Point(149) = {1.136294,1.196000,0.000933}; +Point(150) = {1.134007,1.196000,0.001232}; +Point(151) = {1.131305,1.196000,0.001586}; +Point(152) = {1.128112,1.196000,0.002004}; +Point(153) = {1.124337,1.196000,0.002498}; +Point(154) = {1.119873,1.196000,0.003082}; +Point(155) = {1.114592,1.196000,0.003771}; +Point(156) = {1.108341,1.196000,0.004581}; +Point(157) = {1.100939,1.196000,0.005523,1.5*msTeTp}; +Point(158) = {1.092167,1.196000,0.006570}; +Point(159) = {1.081765,1.196000,0.007741}; +Point(160) = {1.071292,1.196000,0.008870}; +Point(161) = {1.060762,1.196000,0.009957}; +Point(162) = {1.050174,1.196000,0.011007}; +Point(163) = {1.039528,1.196000,0.012025}; +Point(164) = {1.028824,1.196000,0.013015}; +Point(165) = {1.018059,1.196000,0.013980}; +Point(166) = {1.007236,1.196000,0.014919}; +Point(167) = {0.996353,1.196000,0.015831}; +Point(168) = {0.985409,1.196000,0.016712}; +Point(169) = {0.974403,1.196000,0.017556}; +Point(170) = {0.963336,1.196000,0.018354}; +Point(171) = {0.952208,1.196000,0.019099}; +Point(172) = {0.941016,1.196000,0.019781}; +Point(173) = {0.929760,1.196000,0.020391}; +Point(174) = {0.918441,1.196000,0.020920}; +Point(175) = {0.907059,1.196000,0.021362}; +Point(176) = {0.895611,1.196000,0.021711}; +Point(177) = {0.884097,1.196000,0.021959}; +Point(178) = {0.872518,1.196000,0.022111}; +Point(179) = {0.860873,1.196000,0.022161}; +Point(180) = {0.849160,1.196000,0.022111}; +Point(181) = {0.837379,1.196000,0.021962}; +Point(182) = {0.825530,1.196000,0.021717,1.5*msLeTp}; +Point(183) = {0.813612,1.196000,0.021377}; +Point(184) = {0.801625,1.196000,0.020941}; +Point(185) = {0.789568,1.196000,0.020404}; +Point(186) = {0.777440,1.196000,0.019757}; +Point(187) = {0.765241,1.196000,0.018981}; +Point(188) = {0.752966,1.196000,0.018050}; +Point(189) = {0.742587,1.196000,0.017117}; +Point(190) = {0.733826,1.196000,0.016203}; +Point(191) = {0.726444,1.196000,0.015325}; +Point(192) = {0.720236,1.196000,0.014500}; +Point(193) = {0.715025,1.196000,0.013736}; +Point(194) = {0.710659,1.196000,0.013040}; +Point(195) = {0.707009,1.196000,0.012379}; +Point(196) = {0.703963,1.196000,0.011696}; +Point(197) = {0.701429,1.196000,0.010961}; +Point(198) = {0.699325,1.196000,0.010170}; +Point(199) = {0.697584,1.196000,0.009340}; +Point(200) = {0.696149,1.196000,0.008494}; +Point(201) = {0.694968,1.196000,0.007654}; +Point(202) = {0.694003,1.196000,0.006837}; +Point(203) = {0.693217,1.196000,0.006056}; +Point(204) = {0.692581,1.196000,0.005318}; +Point(205) = {0.692070,1.196000,0.004627}; +Point(206) = {0.691663,1.196000,0.003984}; +Point(207) = {0.691343,1.196000,0.003387}; +Point(208) = {0.691094,1.196000,0.002835}; +Point(209) = {0.690903,1.196000,0.002325}; +Point(210) = {0.690760,1.196000,0.001855}; +Point(211) = {0.690657,1.196000,0.001421}; +Point(212) = {0.690587,1.196000,0.001022}; +Point(213) = {0.690542,1.196000,0.000653}; +Point(214) = {0.690518,1.196000,0.000313}; +Point(215) = {0.690511,1.196000,0.000000,msLeTp}; +Point(216) = {0.690518,1.196000,-0.000313}; +Point(217) = {0.690542,1.196000,-0.000653}; +Point(218) = {0.690587,1.196000,-0.001022}; +Point(219) = {0.690657,1.196000,-0.001421}; +Point(220) = {0.690760,1.196000,-0.001855}; +Point(221) = {0.690903,1.196000,-0.002325}; +Point(222) = {0.691094,1.196000,-0.002835}; +Point(223) = {0.691343,1.196000,-0.003387}; +Point(224) = {0.691663,1.196000,-0.003984}; +Point(225) = {0.692070,1.196000,-0.004627}; +Point(226) = {0.692581,1.196000,-0.005318}; +Point(227) = {0.693217,1.196000,-0.006056}; +Point(228) = {0.694003,1.196000,-0.006837}; +Point(229) = {0.694968,1.196000,-0.007654}; +Point(230) = {0.696149,1.196000,-0.008494}; +Point(231) = {0.697584,1.196000,-0.009340}; +Point(232) = {0.699325,1.196000,-0.010170}; +Point(233) = {0.701429,1.196000,-0.010961}; +Point(234) = {0.703963,1.196000,-0.011696}; +Point(235) = {0.707009,1.196000,-0.012379}; +Point(236) = {0.710659,1.196000,-0.013040}; +Point(237) = {0.715025,1.196000,-0.013736}; +Point(238) = {0.720236,1.196000,-0.014500}; +Point(239) = {0.726444,1.196000,-0.015325}; +Point(240) = {0.733826,1.196000,-0.016203}; +Point(241) = {0.742587,1.196000,-0.017117}; +Point(242) = {0.752966,1.196000,-0.018050}; +Point(243) = {0.765241,1.196000,-0.018981}; +Point(244) = {0.777440,1.196000,-0.019757}; +Point(245) = {0.789568,1.196000,-0.020404}; +Point(246) = {0.801625,1.196000,-0.020941}; +Point(247) = {0.813612,1.196000,-0.021377}; +Point(248) = {0.825530,1.196000,-0.021717,1.5*msLeTp}; +Point(249) = {0.837379,1.196000,-0.021962}; +Point(250) = {0.849160,1.196000,-0.022111}; +Point(251) = {0.860873,1.196000,-0.022161}; +Point(252) = {0.872518,1.196000,-0.022111}; +Point(253) = {0.884097,1.196000,-0.021959}; +Point(254) = {0.895611,1.196000,-0.021711}; +Point(255) = {0.907059,1.196000,-0.021362}; +Point(256) = {0.918441,1.196000,-0.020920}; +Point(257) = {0.929760,1.196000,-0.020391}; +Point(258) = {0.941016,1.196000,-0.019781}; +Point(259) = {0.952208,1.196000,-0.019099}; +Point(260) = {0.963336,1.196000,-0.018354}; +Point(261) = {0.974403,1.196000,-0.017556}; +Point(262) = {0.985409,1.196000,-0.016712}; +Point(263) = {0.996353,1.196000,-0.015831}; +Point(264) = {1.007236,1.196000,-0.014919}; +Point(265) = {1.018059,1.196000,-0.013980}; +Point(266) = {1.028824,1.196000,-0.013015}; +Point(267) = {1.039528,1.196000,-0.012025}; +Point(268) = {1.050174,1.196000,-0.011007}; +Point(269) = {1.060762,1.196000,-0.009957}; +Point(270) = {1.071292,1.196000,-0.008870}; +Point(271) = {1.081765,1.196000,-0.007741}; +Point(272) = {1.092167,1.196000,-0.006570}; +Point(273) = {1.100939,1.196000,-0.005523,1.5*msTeTp}; +Point(274) = {1.108341,1.196000,-0.004581}; +Point(275) = {1.114592,1.196000,-0.003771}; +Point(276) = {1.119873,1.196000,-0.003082}; +Point(277) = {1.124337,1.196000,-0.002498}; +Point(278) = {1.128112,1.196000,-0.002004}; +Point(279) = {1.131305,1.196000,-0.001586}; +Point(280) = {1.134007,1.196000,-0.001232}; +Point(281) = {1.136294,1.196000,-0.000933}; +Point(282) = {1.138230,1.196000,-0.000680}; +Point(283) = {1.139869,1.196000,-0.000466}; +Point(284) = {1.141256,1.196000,-0.000284}; +Point(285) = {1.142432,1.196000,-0.000130,msTeTp}; + +// Box: +Point(5001) = {-lgt,0.000000,-hgt,msF}; +Point(5002) = {1+lgt,0.000000,-hgt,msF}; +Point(5003) = {-lgt,0.000000,hgt,msF}; +Point(5004) = {1+lgt,0.000000,hgt,msF}; +Point(5005) = {-lgt,wdt,-hgt,msF}; +Point(5006) = {1+lgt,wdt,-hgt,msF}; +Point(5007) = {-lgt,wdt,hgt,msF}; +Point(5008) = {1+lgt,wdt,hgt,msF}; + +// Tip: +Point(5101) = {1.142432,1.196000,0.000000}; +Point(5102) = {1.141256,1.196040,0.000000}; +Point(5103) = {1.139869,1.196088,0.000000}; +Point(5104) = {1.138230,1.196144,0.000000}; +Point(5105) = {1.136294,1.196210,0.000000}; +Point(5106) = {1.134007,1.196289,0.000000}; +Point(5107) = {1.131305,1.196381,0.000000}; +Point(5108) = {1.128112,1.196491,0.000000}; +Point(5109) = {1.124337,1.196620,0.000000}; +Point(5110) = {1.119873,1.196773,0.000000}; +Point(5111) = {1.114592,1.196954,0.000000}; +Point(5112) = {1.108341,1.197168,0.000000}; +Point(5113) = {1.100939,1.197422,0.000000,1.5*msTeTp}; +Point(5114) = {1.092167,1.197722,0.000000}; +Point(5115) = {1.081765,1.198079,0.000000}; +Point(5116) = {1.071292,1.198438,0.000000}; +Point(5117) = {1.060762,1.198798,0.000000}; +Point(5118) = {1.050174,1.199161,0.000000}; +Point(5119) = {1.039528,1.199526,0.000000}; +Point(5120) = {1.028824,1.199893,0.000000}; +Point(5121) = {1.018059,1.200262,0.000000}; +Point(5122) = {1.007236,1.200632,0.000000}; +Point(5123) = {0.996353,1.201005,0.000000}; +Point(5124) = {0.985409,1.201380,0.000000}; +Point(5125) = {0.974403,1.201757,0.000000}; +Point(5126) = {0.963336,1.202137,0.000000}; +Point(5127) = {0.952208,1.202518,0.000000}; +Point(5128) = {0.941016,1.202901,0.000000}; +Point(5129) = {0.929760,1.203287,0.000000}; +Point(5130) = {0.918441,1.203675,0.000000}; +Point(5131) = {0.907059,1.204065,0.000000}; +Point(5132) = {0.895611,1.204457,0.000000}; +Point(5133) = {0.884097,1.204852,0.000000}; +Point(5134) = {0.872518,1.205248,0.000000}; +Point(5135) = {0.860873,1.205648,0.000000}; +Point(5136) = {0.849160,1.206049,0.000000}; +Point(5137) = {0.837379,1.206453,0.000000}; +Point(5138) = {0.825530,1.206859,0.000000,1.5*msLeTp}; +Point(5139) = {0.699294,1.211213,0.000000}; + +// Dummy tip center: +Point(5349) = {1.100939,1.196000,0.000000}; +Point(5350) = {0.825530,1.196000,0.000000}; + + +// Midplane: +Point(5351) = {1+lgt,0.000000,0.000000,msF}; +Point(5352) = {1+lgt,1.196000,0.000000,msF}; +Point(5353) = {1+lgt,wdt,0.000000,msF}; +Point(5354) = {1.143427,wdt,0.000000,msF}; +Point(5355) = {1.100939,wdt,0.000000,msF}; +Point(5356) = {0.825530,wdt,0.000000,msF}; +Point(5357) = {0.690511,wdt,0.000000,msF}; +Point(5358) = {-lgt,wdt,0.000000,msF}; +Point(5359) = {-lgt,1.196000,0.000000,msF}; +Point(5360) = {-lgt,0.000000,0.000000,msF}; + +/// Lines + +// Airfoil 1: +Spline(1) = {1,2,3,4,5,6,7,8,9,10,11,12,13,14}; +Spline(2) = {14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39}; +Spline(3) = {39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72}; +Spline(4) = {72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105}; +Spline(5) = {105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130}; +Spline(6) = {130,131,132,133,134,135,136,137,138,139,140,141,142,1}; + +// Airfoil 2: +Spline(7) = {144,145,146,147,148,149,150,151,152,153,154,155,156,157}; +Spline(8) = {157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182}; +Spline(9) = {182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215}; +Spline(10) = {215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248}; +Spline(11) = {248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273}; +Spline(12) = {273,274,275,276,277,278,279,280,281,282,283,284,285,144}; + + +// Box: +Line(41) = {5001,5002}; +Line(42) = {5003,5004}; +Line(43) = {5005,5006}; +Line(44) = {5007,5008}; +Line(45) = {5001,5005}; +Line(46) = {5002,5006}; +Line(47) = {5003,5007}; +Line(48) = {5004,5008}; +Line(49) = {5001,5360}; +Line(50) = {5002,5351}; +Line(51) = {5003,5360}; +Line(52) = {5004,5351}; +Line(53) = {5005,5358}; +Line(54) = {5006,5353}; +Line(55) = {5007,5358}; +Line(56) = {5008,5353}; + +// Airfoil 1 to airfoil 2: +Line(61) = {1,144}; +Line(62) = {14,157}; +Line(63) = {39,182}; +Line(64) = {72,215}; +Line(65) = {105,248}; +Line(66) = {130,273}; + + +// Tip: +Spline(121) = {144,5101,5102,5103,5104,5105,5106,5107,5108,5109,5110,5111,5112,5113}; +Spline(122) = {5113,5114,5115,5116,5117,5118,5119,5120,5121,5122,5123,5124,5125,5126,5127,5128,5129,5130,5131,5132,5133,5134,5135,5136,5137,5138}; +If(GMSH_MAJOR_VERSION >= 4) + Bezier(123) = {5138,5139,215}; +Else + BSpline(123) = {5138,5139,215}; +EndIf +Ellipse(124) = {157,5349,157,5113}; +Ellipse(125) = {182,5350,182,5138}; +Ellipse(126) = {248,5350,248,5138}; +Ellipse(127) = {273,5349,273,5113}; + +// Midplane: +Line(131) = {5351,5352}; +Line(132) = {5352,5353}; +Line(133) = {5353,5354}; +Line(134) = {5354,5355}; +Line(135) = {5355,5356}; +Line(136) = {5356,5357}; +Line(137) = {5357,5358}; +Line(138) = {5358,5359}; +Line(139) = {5359,5360}; + +// Wing to midplane: +Line(161) = {1,5351}; +Line(162) = {144,5352}; +Line(163) = {144,5354}; +Line(164) = {5113,5355}; +Line(165) = {5138,5356}; +Line(166) = {215,5357}; +Line(167) = {215,5359}; +Line(168) = {72,5360}; + +/// Line loops & Surfaces + +// Box: +Line Loop(1) = {1,2,3,168,-51,42,52,-161}; +Line Loop(2) = {48,56,-132,-131,-52}; +Line Loop(3) = {44,56,133,134,135,136,137,-55}; +Line Loop(4) = {47,55,138,139,-51}; +Line Loop(5) = {42,48,-44,-47}; +Line Loop(6) = {-6,-5,-4,168,-49,41,50,-161}; +Line Loop(7) = {46,54,-132,-131,-50}; +Line Loop(8) = {43,54,133,134,135,136,137,-53}; +Line Loop(9) = {45,53,138,139,-49}; +Line Loop(10) = {41,46,-43,-45}; +Plane Surface(1) = {1}; +Plane Surface(2) = {2}; +Plane Surface(3) = {-3}; +Plane Surface(4) = {-4}; +Plane Surface(5) = {-5}; +Plane Surface(6) = {-6}; +Plane Surface(7) = {-7}; +Plane Surface(8) = {8}; +Plane Surface(9) = {9}; +Plane Surface(10) = {10}; + +// Wing 1: +Line Loop(11) = {1,62,-7,-61}; +Line Loop(12) = {2,63,-8,-62}; +Line Loop(13) = {3,64,-9,-63}; +Line Loop(14) = {4,65,-10,-64}; +Line Loop(15) = {5,66,-11,-65}; +Line Loop(16) = {6,61,-12,-66}; +Surface(11) = {-11}; +Surface(12) = {-12}; +Surface(13) = {-13}; +Surface(14) = {-14}; +Surface(15) = {-15}; +Surface(16) = {-16}; + +// Wingtip: +Line Loop(71) = {7,124,-121}; +Line Loop(72) = {8,125,-122,-124}; +Line Loop(73) = {9,-123,-125}; +Line Loop(74) = {10,126,123}; +Line Loop(75) = {11,127,122,-126}; +Line Loop(76) = {12,121,-127}; +Surface(71) = {-71}; +Surface(72) = {-72}; +Surface(73) = {-73}; +Surface(74) = {-74}; +Surface(75) = {-75}; +Surface(76) = {-76}; + +// Midplane: +Line Loop(81) = {161,131,-162,-61}; +Line Loop(82) = {162,132,133,-163}; +Line Loop(83) = {163,134,-164,-121}; +Line Loop(84) = {164,135,-165,-122}; +Line Loop(85) = {165,136,-166,-123}; +Line Loop(86) = {167,-138,-137,-166}; +Line Loop(87) = {167,139,-168,64}; +Surface(81) = {81}; +Surface(82) = {82}; +Surface(83) = {83}; +Surface(84) = {84}; +Surface(85) = {85}; +Surface(86) = {-86}; +Surface(87) = {87}; + +/// Surface loops & Volumes + +// Upper: +Surface Loop(1) = {11,12,13,71,72,73,1,2,3,4,5,81,82,83,84,85,86,87}; +Volume(1) = {1}; +// Lower: +Surface Loop(2) = {14,15,16,74,75,76,6,7,8,9,10,81,82,83,84,85,86,87}; +Volume(2) = {2}; + + + +//// MESHING ALGORITHM + + +/// 2D: + +///Wing, farfield and symmetry plane: +MeshAlgorithm Surface{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,81,82,83,84,85,86,87} = 5; + +///Tip: +MeshAlgorithm Surface{73,74} = 1; +MeshAlgorithm Surface{71,72,75,76} = 5; + +/// 3D: + +Mesh.Algorithm3D = 2; +Mesh.Optimize = 1; +Mesh.Smoothing = 10; +Mesh.SmoothNormals = 1; + + + +//// PHYSICAL GROUPS + +// Trailing edge and wake tip +Physical Line("wakeTip") = {162}; +Physical Line("te") = {61}; + +// Internal Field: +Physical Volume("field") = {1}; +Physical Volume("field") += {2}; + +// Wing: +Physical Surface("wing") = {11,12,13,71,72,73}; +Physical Surface("wing_") = {14,15,16,74,75,76}; +Physical Surface("wing_upper") = {11,12,13,71,72,73}; +Physical Surface("wing_lower") = {14,15,16,74,75,76}; + +// Tip +//Physical Surface("tip") = {71,72,73,74,75,76}; + +// Symmetry: +Physical Surface("symmetry") = {1}; +Physical Surface("symmetry") += {6}; + +// Farfield: +Physical Surface("upstream") = {10}; +Physical Surface("farfield") = {3,4,5,8,9}; + +// Downstream: +Physical Surface("downstream") = {2}; +Physical Surface("downstream") += {7}; + +// Wake: +Physical Surface("wake") = {81}; + +Coherence; diff --git a/blast/tests/t_sections_3D.py b/blast/tests/t_sections_3D.py index ce1e089..75d015e 100644 --- a/blast/tests/t_sections_3D.py +++ b/blast/tests/t_sections_3D.py @@ -92,6 +92,7 @@ def cfgBlast(verb): 'nPoints': 300, # Number of points on the section # Each section will have nPoints+1 # points because of the duplicate TE + 'smooth_sections': 1e-6, # Solution interpolation 'interpolator': 'Rbf', # Interpolator type -- GitLab