From f405471602748397464887cebf976776af3a4e6c Mon Sep 17 00:00:00 2001 From: AxelDechamps <72997335+AxelDechamps@users.noreply.github.com> Date: Thu, 20 Jan 2022 16:47:52 +0100 Subject: [PATCH] Modify fBuilder for coupling with CUPyDO. Add test cases. --- fpm/models/agard445.geo | 144 ++++++++++++++++++ fpm/models/oneraM6.geo | 327 ++++++++++++++++++++++++++++++++++++++++ fpm/src/fBuilder.cpp | 19 +-- fpm/src/fBuilder.h | 5 +- fpm/src/fProblem.cpp | 8 +- fpm/src/fProblem.h | 3 +- fpm/src/fSolver.h | 3 +- fpm/tests/M6.py | 83 ++++++++++ fpm/tests/a445.py | 84 +++++++++++ 9 files changed, 658 insertions(+), 18 deletions(-) create mode 100644 fpm/models/agard445.geo create mode 100644 fpm/models/oneraM6.geo create mode 100644 fpm/tests/M6.py create mode 100644 fpm/tests/a445.py diff --git a/fpm/models/agard445.geo b/fpm/models/agard445.geo new file mode 100644 index 0000000..c419f7a --- /dev/null +++ b/fpm/models/agard445.geo @@ -0,0 +1,144 @@ +/* AGARD 445 wing */ + +// Mesh parameters +// domain and mesh +DefineConstant[ wNc = { 50, Name "Number of panel along chord" } + wNs= { 10, Name "Number of panel along span" } + bC = { 0.05, Name "Progression along chord" } + pS = { 1.0, Name "Progression along span" } ]; + +//// GEOMETRY +/// Points +// Airfoil 1: agard445, 51 points +Point(1) = {0.559000,0.000000,0.000000}; +Point(2) = {0.531050,0.000000,0.001398}; +Point(3) = {0.503100,0.000000,0.002739}; +Point(4) = {0.475150,0.000000,0.004075}; +Point(5) = {0.447200,0.000000,0.005406}; +Point(6) = {0.419250,0.000000,0.006680}; +Point(7) = {0.391300,0.000000,0.007837}; +Point(8) = {0.363350,0.000000,0.008866}; +Point(9) = {0.335400,0.000000,0.009743}; +Point(10) = {0.307450,0.000000,0.010442}; +Point(11) = {0.279500,0.000000,0.010923}; +Point(12) = {0.251550,0.000000,0.011158}; +Point(13) = {0.223600,0.000000,0.011163}; +Point(14) = {0.195650,0.000000,0.010968}; +Point(15) = {0.167700,0.000000,0.010576}; +Point(16) = {0.139750,0.000000,0.009995}; +Point(17) = {0.111800,0.000000,0.009196}; +Point(18) = {0.083850,0.000000,0.008156}; +Point(19) = {0.055900,0.000000,0.006781}; +Point(20) = {0.041925,0.000000,0.005920}; +Point(21) = {0.027950,0.000000,0.004891}; +Point(22) = {0.013975,0.000000,0.003617}; +Point(23) = {0.006988,0.000000,0.002622}; +Point(24) = {0.004193,0.000000,0.002057}; +Point(25) = {0.002795,0.000000,0.001699}; +Point(26) = {0.000000,0.000000,0.000000}; +Point(27) = {0.002795,0.000000,-0.001699}; +Point(28) = {0.004193,0.000000,-0.002057}; +Point(29) = {0.006988,0.000000,-0.002622}; +Point(30) = {0.013975,0.000000,-0.003617}; +Point(31) = {0.027950,0.000000,-0.004891}; +Point(32) = {0.041925,0.000000,-0.005920}; +Point(33) = {0.055900,0.000000,-0.006781}; +Point(34) = {0.083850,0.000000,-0.008156}; +Point(35) = {0.111800,0.000000,-0.009196}; +Point(36) = {0.139750,0.000000,-0.009995}; +Point(37) = {0.167700,0.000000,-0.010576}; +Point(38) = {0.195650,0.000000,-0.010968}; +Point(39) = {0.223600,0.000000,-0.011163}; +Point(40) = {0.251550,0.000000,-0.011158}; +Point(41) = {0.279500,0.000000,-0.010923}; +Point(42) = {0.307450,0.000000,-0.010442}; +Point(43) = {0.335400,0.000000,-0.009743}; +Point(44) = {0.363350,0.000000,-0.008866}; +Point(45) = {0.391300,0.000000,-0.007837}; +Point(46) = {0.419250,0.000000,-0.006680}; +Point(47) = {0.447200,0.000000,-0.005406}; +Point(48) = {0.475150,0.000000,-0.004075}; +Point(49) = {0.503100,0.000000,-0.002739}; +Point(50) = {0.531050,0.000000,-0.001398}; +// Airfoil 2: agard445, 51 points +Point(52) = {1.178128,0.762000,0.000000}; +Point(53) = {1.159709,0.762000,0.000921}; +Point(54) = {1.141290,0.762000,0.001805}; +Point(55) = {1.122870,0.762000,0.002685}; +Point(56) = {1.104451,0.762000,0.003562}; +Point(57) = {1.086032,0.762000,0.004402}; +Point(58) = {1.067613,0.762000,0.005165}; +Point(59) = {1.049194,0.762000,0.005843}; +Point(60) = {1.030775,0.762000,0.006421}; +Point(61) = {1.012356,0.762000,0.006881}; +Point(62) = {0.993937,0.762000,0.007198}; +Point(63) = {0.975518,0.762000,0.007353}; +Point(64) = {0.957099,0.762000,0.007357}; +Point(65) = {0.938680,0.762000,0.007228}; +Point(66) = {0.920261,0.762000,0.006970}; +Point(67) = {0.901842,0.762000,0.006587}; +Point(68) = {0.883423,0.762000,0.006060}; +Point(69) = {0.865004,0.762000,0.005375}; +Point(70) = {0.846585,0.762000,0.004468}; +Point(71) = {0.837375,0.762000,0.003901}; +Point(72) = {0.828166,0.762000,0.003223}; +Point(73) = {0.818956,0.762000,0.002383}; +Point(74) = {0.814351,0.762000,0.001728}; +Point(75) = {0.812509,0.762000,0.001356}; +Point(76) = {0.811589,0.762000,0.001120}; +Point(77) = {0.809747,0.762000,0.000000}; +Point(78) = {0.811589,0.762000,-0.001120}; +Point(79) = {0.812509,0.762000,-0.001356}; +Point(80) = {0.814351,0.762000,-0.001728}; +Point(81) = {0.818956,0.762000,-0.002383}; +Point(82) = {0.828166,0.762000,-0.003223}; +Point(83) = {0.837375,0.762000,-0.003901}; +Point(84) = {0.846585,0.762000,-0.004468}; +Point(85) = {0.865004,0.762000,-0.005375}; +Point(86) = {0.883423,0.762000,-0.006060}; +Point(87) = {0.901842,0.762000,-0.006587}; +Point(88) = {0.920261,0.762000,-0.006970}; +Point(89) = {0.938680,0.762000,-0.007228}; +Point(90) = {0.957099,0.762000,-0.007357}; +Point(91) = {0.975518,0.762000,-0.007353}; +Point(92) = {0.993937,0.762000,-0.007198}; +Point(93) = {1.012356,0.762000,-0.006881}; +Point(94) = {1.030775,0.762000,-0.006421}; +Point(95) = {1.049194,0.762000,-0.005843}; +Point(96) = {1.067613,0.762000,-0.005165}; +Point(97) = {1.086032,0.762000,-0.004402}; +Point(98) = {1.104451,0.762000,-0.003562}; +Point(99) = {1.122870,0.762000,-0.002685}; +Point(100) = {1.141290,0.762000,-0.001805}; +Point(101) = {1.159709,0.762000,-0.000921}; + +/// Lines +// Airfoil 1: +Spline(1) = {1:26}; +Spline(2) = {26:50,1}; +// Airfoil 2: +Spline(3) = {52:77}; +Spline(4) = {77:101,52}; +// Airfoil 1 to airfoil 2: +Line(61) = {1,52}; +Line(62) = {26,77}; + + +/// Line loops & Surfaces +// Wing 1: +Line Loop(11) = {1,62,-3,-61}; +Line Loop(12) = {2,61,-4,-62}; +Surface(11) = {-11}; +Surface(12) = {-12}; + +//// MESH +Transfinite Line{1,2,3,4} = wNc+ 1 Using Bump bC; +Transfinite Line{61,62} = wNs + 1 Using Progression pS; +Transfinite Surface{11,12}; +Recombine Surface{11,12}; + +//// PHYSICAL GROUPS +// Trailing edge +Physical Line("wTe") = {61}; +// Wing: +Physical Surface("wing") = {11,12}; diff --git a/fpm/models/oneraM6.geo b/fpm/models/oneraM6.geo new file mode 100644 index 0000000..418d940 --- /dev/null +++ b/fpm/models/oneraM6.geo @@ -0,0 +1,327 @@ +/* Onera M6 wing */ + +// Mesh parameters +// domain and mesh +DefineConstant[ wNc = { 50, Name "Number of panel along chord" } + wNs = { 10, Name "Number of panel along span" } + bC = { 0.05, Name "Progression along chord" } + pS = { 1.0, Name "Progression along span" } ]; + +//// GEOMETRY +/// Points +// Airfoil 1: oneraM6, 143 points +Point(1) = {0.805900,0.000000,0.000000}; +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}; +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}; +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}; +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}; +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}; +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}; +// Airfoil 2: oneraM6, 143 points +Point(144) = {1.143427,1.196000,0.000000}; +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}; +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}; +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}; +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}; +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}; +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}; + +/// Lines +// Airfoil 1: +Spline(1) = {1:72}; +Spline(2) = {72:142,1}; +// Airfoil 2: +Spline(3) = {144:215}; +Spline(4) = {215:285,144}; +// Airfoil 1 to airfoil 2: +Line(61) = {1,144}; +Line(62) = {72,215}; + +/// Line loops & Surfaces +// Wing 1: +Line Loop(11) = {1,62,-3,-61}; +Line Loop(12) = {2,61,-4,-62}; +Surface(11) = {-11}; +Surface(12) = {-12}; + +//// MESH +Transfinite Line{1,2,3,4} = wNc + 1 Using Bump bC; +Transfinite Line{61,62} = wNs + 1 Using Progression pS; +Transfinite Surface{11,12}; +Recombine Surface{11,12}; + +//// PHYSICAL GROUPS +// Trailing edge +Physical Line("wTe") = {61}; +// Wing: +Physical Surface("wing") = {11,12}; diff --git a/fpm/src/fBuilder.cpp b/fpm/src/fBuilder.cpp index 7fb90cb..fe5a573 100644 --- a/fpm/src/fBuilder.cpp +++ b/fpm/src/fBuilder.cpp @@ -36,9 +36,8 @@ using namespace fpm; */ Builder::Builder(std::shared_ptr<Problem> _pbl) : pbl(_pbl), valid(false) { - // Check the problem and update element memory + // Check the problem pbl->check(); - pbl->updateMem(); // Setup AIC matrices pbl->field ? nF = pbl->field->tag->elems.size() : nF = 0; @@ -51,15 +50,8 @@ Builder::Builder(std::shared_ptr<Problem> _pbl) : pbl(_pbl), valid(false) Cx = Eigen::MatrixXd::Zero(nP, nF); Cy = Eigen::MatrixXd::Zero(nP, nF); Cz = Eigen::MatrixXd::Zero(nP, nF); -} -/** - * @brief Fill AIC matrices - */ -void Builder::run() -{ // global->local id - std::map<Element *, int> rows; int i = 0; for (auto body : pbl->bodies) for (auto e : body->tag->elems) @@ -67,6 +59,15 @@ void Builder::run() rows[e] = i; i++; } +} + +/** + * @brief Fill AIC matrices + */ +void Builder::run() +{ + // Update element memory + pbl->updateMem(); // body to body - body panels for (auto jbody : pbl->bodies) diff --git a/fpm/src/fBuilder.h b/fpm/src/fBuilder.h index aedb7f4..0e721a8 100644 --- a/fpm/src/fBuilder.h +++ b/fpm/src/fBuilder.h @@ -24,6 +24,7 @@ #include <vector> #include <memory> #include <Eigen/Dense> +#include <map> namespace fpm { @@ -31,11 +32,13 @@ namespace fpm /** * @brief Aerodynamic Influence Coefficients builder * @authors Adrien Crovato and Axel Dechamps - * @todo add symmetry support * @todo implement field AIC computation */ class FPM_API Builder : public fwk::wSharedObject { + +std::map<tbox::Element *, int> rows; ///< map linking an element to a matrix cell + public: std::shared_ptr<Problem> pbl; ///< problem definition diff --git a/fpm/src/fProblem.cpp b/fpm/src/fProblem.cpp index eec0367..5d1b840 100644 --- a/fpm/src/fProblem.cpp +++ b/fpm/src/fProblem.cpp @@ -123,9 +123,9 @@ Eigen::Vector3d Problem::U(tbox::Element &e, std::vector<double> const &mu, doub { // Creation of the Jacobian Eigen::Matrix3d J0; - J0.row(0) = dXi.col(i); - J0.row(1) = dEta.col(i); - J0.row(2) = dZeta.col(i); + J0.row(0) = dXi.col(i).transpose(); + J0.row(1) = dEta.col(i).transpose(); + J0.row(2) = dZeta.col(i).transpose(); // Inversion of the Jacobian Eigen::Matrix3d Jinv = J0.inverse(); @@ -137,7 +137,7 @@ Eigen::Vector3d Problem::U(tbox::Element &e, std::vector<double> const &mu, doub J.col(j) = Jinv.col(j); } - // Import of the potential at the nodes of the panel + // Import of the doublets at the nodes of the panel Eigen::VectorXd mu_element(nVertices); for (int j = 0; j < nVertices; ++j) { diff --git a/fpm/src/fProblem.h b/fpm/src/fProblem.h index d9a98dc..3cdd15c 100644 --- a/fpm/src/fProblem.h +++ b/fpm/src/fProblem.h @@ -27,8 +27,7 @@ namespace fpm /** * @brief Manage the problem - * @authors Adrien Crovato - * @todo check and implement velocity computation + * @authors Adrien Crovato & Axel Dechamps */ class FPM_API Problem : public fwk::wSharedObject { diff --git a/fpm/src/fSolver.h b/fpm/src/fSolver.h index 55b3d6b..c2cdb1a 100644 --- a/fpm/src/fSolver.h +++ b/fpm/src/fSolver.h @@ -30,8 +30,7 @@ namespace fpm /** * @brief Field panel solver - * @authors Adrien Crovato - * @todo check and implement velocity computation + * @authors Adrien Crovato & Axel Dechamps */ class FPM_API Solver : public fwk::wSharedObject { diff --git a/fpm/tests/M6.py b/fpm/tests/M6.py new file mode 100644 index 0000000..702110d --- /dev/null +++ b/fpm/tests/M6.py @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Copyright 2020 University of Liège +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Onera M6 wing +# Axel Dechamps + +from fwk.testing import * +from fwk.coloring import ccolors +import math +import fpm +import tbox +import tbox.gmsh as gmsh + +def main(): + # geometry parameters + S_ref = 1.5057 # Reference surface (full if symY = 0, half if symY = 1) + c_ref = 0.805 # Reference chord + wNc = 100 # Number of panels along the chord + wNs = 10 # Number of panels along the span + bC = 1.0 # Progression along chord + pS = 1.0 # Progression along span + + # flow parameters + AoA = 3.06 * math.pi / 180 # Angle of attack (numeric value given in degrees) + Mach = 0 # Mach number + + # timer + tms = fpm.Timers() + tms['total'].start() + + # mesh + print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) + pars = {'wNc' : wNc, 'wNs' : wNs, 'bC' : bC, 'pS' : pS} + msh = gmsh.MeshLoader('../models/oneraM6.geo', __file__).execute(**pars) + + # problem + pbl = fpm.Problem(msh, AoA, 0., Mach, S_ref, c_ref, 0, 0, 0, True) + wing = fpm.Body(msh, 'wing', ['wTe'], 10) + pbl.add(wing) + + # AIC builder + aic = fpm.Builder(pbl) + aic.run() + + # solver + slv = fpm.Solver(aic) + slv.run() + slv.save(tbox.GmshExport(msh)) + + # end timer + tms['total'].stop() + print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) + print(tms) + + # test + print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) + tests = CTests() + if AoA == 3.06 * math.pi / 180 and Mach == 0: + tests.add(CTest('CL', slv.Cl, 0.0998, 5e-2)) + tests.add(CTest('CD', slv.Cd, 0.0020, 5e-2)) + tests.add(CTest('CS', slv.Cs, 0.0037, 5e-2)) + tests.add(CTest('CM', slv.Cm, -0.0580, 5e-2)) + tests.run() + + # eof + print('') + +if __name__ == '__main__': + main() diff --git a/fpm/tests/a445.py b/fpm/tests/a445.py new file mode 100644 index 0000000..8cd41f6 --- /dev/null +++ b/fpm/tests/a445.py @@ -0,0 +1,84 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- + +# Copyright 2020 University of Liège +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +# Agard 445 wing +# Axel Dechamps + +from fwk.testing import * +from fwk.coloring import ccolors +import math +import fpm +import tbox +import tbox.gmsh as gmsh + +def main(): + # geometry parameters + S_ref = 0.35 # Reference surface (full if symY = 0, half if symY = 1) + c_ref = 0.559 # Reference chord + wNc = 100 # Number of panels along the chord + wNs = 10 # Number of panels along the span + bC = 1.0 # Progression along chord + pS = 1.0 # Progression along span + + # flow parameters + AoA = 1 * math.pi / 180 # Angle of attack (numeric value given in degrees) + Mach = 0 # Mach number + + # timer + tms = fpm.Timers() + tms['total'].start() + + # mesh + print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) + pars = {'wNc' : wNc, 'wNs' : wNs, 'bC' : bC, 'pS' : pS} + msh = gmsh.MeshLoader('../models/agard445.geo', __file__).execute(**pars) + + # problem + pbl = fpm.Problem(msh, AoA, 0., Mach, S_ref, c_ref, 0, 0, 0, True) + wing = fpm.Body(msh, 'wing', ['wTe'], 10) + pbl.add(wing) + + # AIC builder + aic = fpm.Builder(pbl) + aic.run() + + # solver + slv = fpm.Solver(aic) + slv.run() + slv.save(tbox.GmshExport(msh)) + + # end timer + tms['total'].stop() + print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) + print(tms) + + # test + print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) + tests = CTests() + if AoA == 1 * math.pi / 180 and Mach == 0: + tests.add(CTest('CL', slv.Cl, 0.054790, 5e-2)) + tests.add(CTest('CD', slv.Cd, 0.000221, 5e-2)) + tests.add(CTest('CS', slv.Cs, 0.001184, 5e-2)) + tests.add(CTest('CM', slv.Cm, -0.048214, 5e-2)) + tests.run() + + # eof + print('') + +if __name__ == '__main__': + main() + -- GitLab