diff --git a/fpm/_src/fpmw.h b/fpm/_src/fpmw.h index 0045215c39bf810698a597711cbbcee3968d4540..c0c92e736bb3756365a9a78d57f4a597db0f379f 100644 --- a/fpm/_src/fpmw.h +++ b/fpm/_src/fpmw.h @@ -16,6 +16,7 @@ #include "fBody.h" #include "fBuilder.h" +#include "fField.h" #include "fProblem.h" #include "fSolver.h" #include "fTimers.h" diff --git a/fpm/_src/fpmw.i b/fpm/_src/fpmw.i index c09a59a21013e225161fc86d546121ac09cd20b2..92054b34c7470cdf523c91fc273e958867deda6c 100644 --- a/fpm/_src/fpmw.i +++ b/fpm/_src/fpmw.i @@ -67,6 +67,9 @@ def __getitem__(self, name): %include <std_shared_ptr.i> +%shared_ptr(fpm::Field); +%include "fField.h" + %shared_ptr(fpm::Body); %immutable fpm::Body::wake; // avoids the creation of the setter method %include "fBody.h" diff --git a/fpm/models/n0012.geo b/fpm/models/n0012.geo index 9a0f91d0573a1bee20544baf3e4deb9762f03c00..c1c0f8047b81e01508d9250f421eaec6a6abcafd 100644 --- a/fpm/models/n0012.geo +++ b/fpm/models/n0012.geo @@ -2,254 +2,575 @@ // Parameters // domain and mesh -DefineConstant[ spn = { 2.0, Name "Wing span" } ]; -DefineConstant[ nC = { 80, Name "Number of cells along chord" } ]; -DefineConstant[ nS = { 10, Name "Number of cells along span" } ]; +DefineConstant[ wSpn = { 2.0, Name "Wing span" } ]; +DefineConstant[ wNc = { 80, Name "Number of cells along wing chord" } ]; +DefineConstant[ wNs = { 10, Name "Number of cells along wing span" } ]; +DefineConstant[ tSpn = { 0.0, Name "Tail span" } ]; +DefineConstant[ tNc = { 40, Name "Number of cells along tail chord" } ]; +DefineConstant[ tNs = { 6, Name "Number of cells along tail span" } ]; +DefineConstant[ fWdt = { 0.0, Name "Field width" } ]; +DefineConstant[ nX = { 10, Name "Number of field cells along X" } ]; +DefineConstant[ nY = { 10, Name "Number of field cells along Y" } ]; +DefineConstant[ nZ = { 10, Name "Number of field cells along Z" } ]; //// GEOMETRY /// Points -// Airfoil 1: naca0012, 101 points -Point(1) = {1.000000,0.000000,0.000000}; -Point(2) = {0.999013,0.000000,0.000143}; -Point(3) = {0.996057,0.000000,0.000572}; -Point(4) = {0.991144,0.000000,0.001280}; -Point(5) = {0.984292,0.000000,0.002260}; -Point(6) = {0.975528,0.000000,0.003501}; -Point(7) = {0.964888,0.000000,0.004990}; -Point(8) = {0.952414,0.000000,0.006710}; -Point(9) = {0.938153,0.000000,0.008643}; -Point(10) = {0.922164,0.000000,0.010770}; -Point(11) = {0.904508,0.000000,0.013071}; -Point(12) = {0.885257,0.000000,0.015523}; -Point(13) = {0.864484,0.000000,0.018106}; -Point(14) = {0.842274,0.000000,0.020795}; -Point(15) = {0.818712,0.000000,0.023569}; -Point(16) = {0.793893,0.000000,0.026405}; -Point(17) = {0.767913,0.000000,0.029279}; -Point(18) = {0.740877,0.000000,0.032168}; -Point(19) = {0.712890,0.000000,0.035048}; -Point(20) = {0.684062,0.000000,0.037896}; -Point(21) = {0.654508,0.000000,0.040686}; -Point(22) = {0.624345,0.000000,0.043394}; -Point(23) = {0.593691,0.000000,0.045992}; -Point(24) = {0.562667,0.000000,0.048455}; -Point(25) = {0.531395,0.000000,0.050754}; -Point(26) = {0.500000,0.000000,0.052862}; -Point(27) = {0.468605,0.000000,0.054749}; -Point(28) = {0.437333,0.000000,0.056390}; -Point(29) = {0.406309,0.000000,0.057755}; -Point(30) = {0.375655,0.000000,0.058819}; -Point(31) = {0.345492,0.000000,0.059557}; -Point(32) = {0.315938,0.000000,0.059947}; -Point(33) = {0.287110,0.000000,0.059971}; -Point(34) = {0.259123,0.000000,0.059614}; -Point(35) = {0.232087,0.000000,0.058863}; -Point(36) = {0.206107,0.000000,0.057712}; -Point(37) = {0.181288,0.000000,0.056159}; -Point(38) = {0.157726,0.000000,0.054206}; -Point(39) = {0.135516,0.000000,0.051862}; -Point(40) = {0.114743,0.000000,0.049138}; -Point(41) = {0.095492,0.000000,0.046049}; -Point(42) = {0.077836,0.000000,0.042615}; -Point(43) = {0.061847,0.000000,0.038859}; -Point(44) = {0.047586,0.000000,0.034803}; -Point(45) = {0.035112,0.000000,0.030473}; -Point(46) = {0.024472,0.000000,0.025893}; -Point(47) = {0.015708,0.000000,0.021088}; -Point(48) = {0.008856,0.000000,0.016078}; -Point(49) = {0.003943,0.000000,0.010884}; -Point(50) = {0.000987,0.000000,0.005521}; -Point(51) = {0.000000,0.000000,0.000000}; -Point(52) = {0.000987,0.000000,-0.005521}; -Point(53) = {0.003943,0.000000,-0.010884}; -Point(54) = {0.008856,0.000000,-0.016078}; -Point(55) = {0.015708,0.000000,-0.021088}; -Point(56) = {0.024472,0.000000,-0.025893}; -Point(57) = {0.035112,0.000000,-0.030473}; -Point(58) = {0.047586,0.000000,-0.034803}; -Point(59) = {0.061847,0.000000,-0.038859}; -Point(60) = {0.077836,0.000000,-0.042615}; -Point(61) = {0.095492,0.000000,-0.046049}; -Point(62) = {0.114743,0.000000,-0.049138}; -Point(63) = {0.135516,0.000000,-0.051862}; -Point(64) = {0.157726,0.000000,-0.054206}; -Point(65) = {0.181288,0.000000,-0.056159}; -Point(66) = {0.206107,0.000000,-0.057712}; -Point(67) = {0.232087,0.000000,-0.058863}; -Point(68) = {0.259123,0.000000,-0.059614}; -Point(69) = {0.287110,0.000000,-0.059971}; -Point(70) = {0.315938,0.000000,-0.059947}; -Point(71) = {0.345492,0.000000,-0.059557}; -Point(72) = {0.375655,0.000000,-0.058819}; -Point(73) = {0.406309,0.000000,-0.057755}; -Point(74) = {0.437333,0.000000,-0.056390}; -Point(75) = {0.468605,0.000000,-0.054749}; -Point(76) = {0.500000,0.000000,-0.052862}; -Point(77) = {0.531395,0.000000,-0.050754}; -Point(78) = {0.562667,0.000000,-0.048455}; -Point(79) = {0.593691,0.000000,-0.045992}; -Point(80) = {0.624345,0.000000,-0.043394}; -Point(81) = {0.654508,0.000000,-0.040686}; -Point(82) = {0.684062,0.000000,-0.037896}; -Point(83) = {0.712890,0.000000,-0.035048}; -Point(84) = {0.740877,0.000000,-0.032168}; -Point(85) = {0.767913,0.000000,-0.029279}; -Point(86) = {0.793893,0.000000,-0.026405}; -Point(87) = {0.818712,0.000000,-0.023569}; -Point(88) = {0.842274,0.000000,-0.020795}; -Point(89) = {0.864484,0.000000,-0.018106}; -Point(90) = {0.885257,0.000000,-0.015523}; -Point(91) = {0.904508,0.000000,-0.013071}; -Point(92) = {0.922164,0.000000,-0.010770}; -Point(93) = {0.938153,0.000000,-0.008643}; -Point(94) = {0.952414,0.000000,-0.006710}; -Point(95) = {0.964888,0.000000,-0.004990}; -Point(96) = {0.975528,0.000000,-0.003501}; -Point(97) = {0.984292,0.000000,-0.002260}; -Point(98) = {0.991144,0.000000,-0.001280}; -Point(99) = {0.996057,0.000000,-0.000572}; -Point(100) = {0.999013,0.000000,-0.000143}; - -// Airfoil 2: naca0012, 101 points -Point(102) = {1.000000,spn,0.000000}; -Point(103) = {0.999013,spn,0.000143}; -Point(104) = {0.996057,spn,0.000572}; -Point(105) = {0.991144,spn,0.001280}; -Point(106) = {0.984292,spn,0.002260}; -Point(107) = {0.975528,spn,0.003501}; -Point(108) = {0.964888,spn,0.004990}; -Point(109) = {0.952414,spn,0.006710}; -Point(110) = {0.938153,spn,0.008643}; -Point(111) = {0.922164,spn,0.010770}; -Point(112) = {0.904508,spn,0.013071}; -Point(113) = {0.885257,spn,0.015523}; -Point(114) = {0.864484,spn,0.018106}; -Point(115) = {0.842274,spn,0.020795}; -Point(116) = {0.818712,spn,0.023569}; -Point(117) = {0.793893,spn,0.026405}; -Point(118) = {0.767913,spn,0.029279}; -Point(119) = {0.740877,spn,0.032168}; -Point(120) = {0.712890,spn,0.035048}; -Point(121) = {0.684062,spn,0.037896}; -Point(122) = {0.654508,spn,0.040686}; -Point(123) = {0.624345,spn,0.043394}; -Point(124) = {0.593691,spn,0.045992}; -Point(125) = {0.562667,spn,0.048455}; -Point(126) = {0.531395,spn,0.050754}; -Point(127) = {0.500000,spn,0.052862}; -Point(128) = {0.468605,spn,0.054749}; -Point(129) = {0.437333,spn,0.056390}; -Point(130) = {0.406309,spn,0.057755}; -Point(131) = {0.375655,spn,0.058819}; -Point(132) = {0.345492,spn,0.059557}; -Point(133) = {0.315938,spn,0.059947}; -Point(134) = {0.287110,spn,0.059971}; -Point(135) = {0.259123,spn,0.059614}; -Point(136) = {0.232087,spn,0.058863}; -Point(137) = {0.206107,spn,0.057712}; -Point(138) = {0.181288,spn,0.056159}; -Point(139) = {0.157726,spn,0.054206}; -Point(140) = {0.135516,spn,0.051862}; -Point(141) = {0.114743,spn,0.049138}; -Point(142) = {0.095492,spn,0.046049}; -Point(143) = {0.077836,spn,0.042615}; -Point(144) = {0.061847,spn,0.038859}; -Point(145) = {0.047586,spn,0.034803}; -Point(146) = {0.035112,spn,0.030473}; -Point(147) = {0.024472,spn,0.025893}; -Point(148) = {0.015708,spn,0.021088}; -Point(149) = {0.008856,spn,0.016078}; -Point(150) = {0.003943,spn,0.010884}; -Point(151) = {0.000987,spn,0.005521}; -Point(152) = {0.000000,spn,0.000000}; -Point(153) = {0.000987,spn,-0.005521}; -Point(154) = {0.003943,spn,-0.010884}; -Point(155) = {0.008856,spn,-0.016078}; -Point(156) = {0.015708,spn,-0.021088}; -Point(157) = {0.024472,spn,-0.025893}; -Point(158) = {0.035112,spn,-0.030473}; -Point(159) = {0.047586,spn,-0.034803}; -Point(160) = {0.061847,spn,-0.038859}; -Point(161) = {0.077836,spn,-0.042615}; -Point(162) = {0.095492,spn,-0.046049}; -Point(163) = {0.114743,spn,-0.049138}; -Point(164) = {0.135516,spn,-0.051862}; -Point(165) = {0.157726,spn,-0.054206}; -Point(166) = {0.181288,spn,-0.056159}; -Point(167) = {0.206107,spn,-0.057712}; -Point(168) = {0.232087,spn,-0.058863}; -Point(169) = {0.259123,spn,-0.059614}; -Point(170) = {0.287110,spn,-0.059971}; -Point(171) = {0.315938,spn,-0.059947}; -Point(172) = {0.345492,spn,-0.059557}; -Point(173) = {0.375655,spn,-0.058819}; -Point(174) = {0.406309,spn,-0.057755}; -Point(175) = {0.437333,spn,-0.056390}; -Point(176) = {0.468605,spn,-0.054749}; -Point(177) = {0.500000,spn,-0.052862}; -Point(178) = {0.531395,spn,-0.050754}; -Point(179) = {0.562667,spn,-0.048455}; -Point(180) = {0.593691,spn,-0.045992}; -Point(181) = {0.624345,spn,-0.043394}; -Point(182) = {0.654508,spn,-0.040686}; -Point(183) = {0.684062,spn,-0.037896}; -Point(184) = {0.712890,spn,-0.035048}; -Point(185) = {0.740877,spn,-0.032168}; -Point(186) = {0.767913,spn,-0.029279}; -Point(187) = {0.793893,spn,-0.026405}; -Point(188) = {0.818712,spn,-0.023569}; -Point(189) = {0.842274,spn,-0.020795}; -Point(190) = {0.864484,spn,-0.018106}; -Point(191) = {0.885257,spn,-0.015523}; -Point(192) = {0.904508,spn,-0.013071}; -Point(193) = {0.922164,spn,-0.010770}; -Point(194) = {0.938153,spn,-0.008643}; -Point(195) = {0.952414,spn,-0.006710}; -Point(196) = {0.964888,spn,-0.004990}; -Point(197) = {0.975528,spn,-0.003501}; -Point(198) = {0.984292,spn,-0.002260}; -Point(199) = {0.991144,spn,-0.001280}; -Point(200) = {0.996057,spn,-0.000572}; -Point(201) = {0.999013,spn,-0.000143}; +// Wing +Point(1) = {1.000000,-wSpn/2,0.000000}; +Point(2) = {0.999013,-wSpn/2,0.000143}; +Point(3) = {0.996057,-wSpn/2,0.000572}; +Point(4) = {0.991144,-wSpn/2,0.001280}; +Point(5) = {0.984292,-wSpn/2,0.002260}; +Point(6) = {0.975528,-wSpn/2,0.003501}; +Point(7) = {0.964888,-wSpn/2,0.004990}; +Point(8) = {0.952414,-wSpn/2,0.006710}; +Point(9) = {0.938153,-wSpn/2,0.008643}; +Point(10) = {0.922164,-wSpn/2,0.010770}; +Point(11) = {0.904508,-wSpn/2,0.013071}; +Point(12) = {0.885257,-wSpn/2,0.015523}; +Point(13) = {0.864484,-wSpn/2,0.018106}; +Point(14) = {0.842274,-wSpn/2,0.020795}; +Point(15) = {0.818712,-wSpn/2,0.023569}; +Point(16) = {0.793893,-wSpn/2,0.026405}; +Point(17) = {0.767913,-wSpn/2,0.029279}; +Point(18) = {0.740877,-wSpn/2,0.032168}; +Point(19) = {0.712890,-wSpn/2,0.035048}; +Point(20) = {0.684062,-wSpn/2,0.037896}; +Point(21) = {0.654508,-wSpn/2,0.040686}; +Point(22) = {0.624345,-wSpn/2,0.043394}; +Point(23) = {0.593691,-wSpn/2,0.045992}; +Point(24) = {0.562667,-wSpn/2,0.048455}; +Point(25) = {0.531395,-wSpn/2,0.050754}; +Point(26) = {0.500000,-wSpn/2,0.052862}; +Point(27) = {0.468605,-wSpn/2,0.054749}; +Point(28) = {0.437333,-wSpn/2,0.056390}; +Point(29) = {0.406309,-wSpn/2,0.057755}; +Point(30) = {0.375655,-wSpn/2,0.058819}; +Point(31) = {0.345492,-wSpn/2,0.059557}; +Point(32) = {0.315938,-wSpn/2,0.059947}; +Point(33) = {0.287110,-wSpn/2,0.059971}; +Point(34) = {0.259123,-wSpn/2,0.059614}; +Point(35) = {0.232087,-wSpn/2,0.058863}; +Point(36) = {0.206107,-wSpn/2,0.057712}; +Point(37) = {0.181288,-wSpn/2,0.056159}; +Point(38) = {0.157726,-wSpn/2,0.054206}; +Point(39) = {0.135516,-wSpn/2,0.051862}; +Point(40) = {0.114743,-wSpn/2,0.049138}; +Point(41) = {0.095492,-wSpn/2,0.046049}; +Point(42) = {0.077836,-wSpn/2,0.042615}; +Point(43) = {0.061847,-wSpn/2,0.038859}; +Point(44) = {0.047586,-wSpn/2,0.034803}; +Point(45) = {0.035112,-wSpn/2,0.030473}; +Point(46) = {0.024472,-wSpn/2,0.025893}; +Point(47) = {0.015708,-wSpn/2,0.021088}; +Point(48) = {0.008856,-wSpn/2,0.016078}; +Point(49) = {0.003943,-wSpn/2,0.010884}; +Point(50) = {0.000987,-wSpn/2,0.005521}; +Point(51) = {0.000000,-wSpn/2,0.000000}; +Point(52) = {0.000987,-wSpn/2,-0.005521}; +Point(53) = {0.003943,-wSpn/2,-0.010884}; +Point(54) = {0.008856,-wSpn/2,-0.016078}; +Point(55) = {0.015708,-wSpn/2,-0.021088}; +Point(56) = {0.024472,-wSpn/2,-0.025893}; +Point(57) = {0.035112,-wSpn/2,-0.030473}; +Point(58) = {0.047586,-wSpn/2,-0.034803}; +Point(59) = {0.061847,-wSpn/2,-0.038859}; +Point(60) = {0.077836,-wSpn/2,-0.042615}; +Point(61) = {0.095492,-wSpn/2,-0.046049}; +Point(62) = {0.114743,-wSpn/2,-0.049138}; +Point(63) = {0.135516,-wSpn/2,-0.051862}; +Point(64) = {0.157726,-wSpn/2,-0.054206}; +Point(65) = {0.181288,-wSpn/2,-0.056159}; +Point(66) = {0.206107,-wSpn/2,-0.057712}; +Point(67) = {0.232087,-wSpn/2,-0.058863}; +Point(68) = {0.259123,-wSpn/2,-0.059614}; +Point(69) = {0.287110,-wSpn/2,-0.059971}; +Point(70) = {0.315938,-wSpn/2,-0.059947}; +Point(71) = {0.345492,-wSpn/2,-0.059557}; +Point(72) = {0.375655,-wSpn/2,-0.058819}; +Point(73) = {0.406309,-wSpn/2,-0.057755}; +Point(74) = {0.437333,-wSpn/2,-0.056390}; +Point(75) = {0.468605,-wSpn/2,-0.054749}; +Point(76) = {0.500000,-wSpn/2,-0.052862}; +Point(77) = {0.531395,-wSpn/2,-0.050754}; +Point(78) = {0.562667,-wSpn/2,-0.048455}; +Point(79) = {0.593691,-wSpn/2,-0.045992}; +Point(80) = {0.624345,-wSpn/2,-0.043394}; +Point(81) = {0.654508,-wSpn/2,-0.040686}; +Point(82) = {0.684062,-wSpn/2,-0.037896}; +Point(83) = {0.712890,-wSpn/2,-0.035048}; +Point(84) = {0.740877,-wSpn/2,-0.032168}; +Point(85) = {0.767913,-wSpn/2,-0.029279}; +Point(86) = {0.793893,-wSpn/2,-0.026405}; +Point(87) = {0.818712,-wSpn/2,-0.023569}; +Point(88) = {0.842274,-wSpn/2,-0.020795}; +Point(89) = {0.864484,-wSpn/2,-0.018106}; +Point(90) = {0.885257,-wSpn/2,-0.015523}; +Point(91) = {0.904508,-wSpn/2,-0.013071}; +Point(92) = {0.922164,-wSpn/2,-0.010770}; +Point(93) = {0.938153,-wSpn/2,-0.008643}; +Point(94) = {0.952414,-wSpn/2,-0.006710}; +Point(95) = {0.964888,-wSpn/2,-0.004990}; +Point(96) = {0.975528,-wSpn/2,-0.003501}; +Point(97) = {0.984292,-wSpn/2,-0.002260}; +Point(98) = {0.991144,-wSpn/2,-0.001280}; +Point(99) = {0.996057,-wSpn/2,-0.000572}; +Point(100) = {0.999013,-wSpn/2,-0.000143}; + +Point(102) = {1.000000,wSpn/2,0.000000}; +Point(103) = {0.999013,wSpn/2,0.000143}; +Point(104) = {0.996057,wSpn/2,0.000572}; +Point(105) = {0.991144,wSpn/2,0.001280}; +Point(106) = {0.984292,wSpn/2,0.002260}; +Point(107) = {0.975528,wSpn/2,0.003501}; +Point(108) = {0.964888,wSpn/2,0.004990}; +Point(109) = {0.952414,wSpn/2,0.006710}; +Point(110) = {0.938153,wSpn/2,0.008643}; +Point(111) = {0.922164,wSpn/2,0.010770}; +Point(112) = {0.904508,wSpn/2,0.013071}; +Point(113) = {0.885257,wSpn/2,0.015523}; +Point(114) = {0.864484,wSpn/2,0.018106}; +Point(115) = {0.842274,wSpn/2,0.020795}; +Point(116) = {0.818712,wSpn/2,0.023569}; +Point(117) = {0.793893,wSpn/2,0.026405}; +Point(118) = {0.767913,wSpn/2,0.029279}; +Point(119) = {0.740877,wSpn/2,0.032168}; +Point(120) = {0.712890,wSpn/2,0.035048}; +Point(121) = {0.684062,wSpn/2,0.037896}; +Point(122) = {0.654508,wSpn/2,0.040686}; +Point(123) = {0.624345,wSpn/2,0.043394}; +Point(124) = {0.593691,wSpn/2,0.045992}; +Point(125) = {0.562667,wSpn/2,0.048455}; +Point(126) = {0.531395,wSpn/2,0.050754}; +Point(127) = {0.500000,wSpn/2,0.052862}; +Point(128) = {0.468605,wSpn/2,0.054749}; +Point(129) = {0.437333,wSpn/2,0.056390}; +Point(130) = {0.406309,wSpn/2,0.057755}; +Point(131) = {0.375655,wSpn/2,0.058819}; +Point(132) = {0.345492,wSpn/2,0.059557}; +Point(133) = {0.315938,wSpn/2,0.059947}; +Point(134) = {0.287110,wSpn/2,0.059971}; +Point(135) = {0.259123,wSpn/2,0.059614}; +Point(136) = {0.232087,wSpn/2,0.058863}; +Point(137) = {0.206107,wSpn/2,0.057712}; +Point(138) = {0.181288,wSpn/2,0.056159}; +Point(139) = {0.157726,wSpn/2,0.054206}; +Point(140) = {0.135516,wSpn/2,0.051862}; +Point(141) = {0.114743,wSpn/2,0.049138}; +Point(142) = {0.095492,wSpn/2,0.046049}; +Point(143) = {0.077836,wSpn/2,0.042615}; +Point(144) = {0.061847,wSpn/2,0.038859}; +Point(145) = {0.047586,wSpn/2,0.034803}; +Point(146) = {0.035112,wSpn/2,0.030473}; +Point(147) = {0.024472,wSpn/2,0.025893}; +Point(148) = {0.015708,wSpn/2,0.021088}; +Point(149) = {0.008856,wSpn/2,0.016078}; +Point(150) = {0.003943,wSpn/2,0.010884}; +Point(151) = {0.000987,wSpn/2,0.005521}; +Point(152) = {0.000000,wSpn/2,0.000000}; +Point(153) = {0.000987,wSpn/2,-0.005521}; +Point(154) = {0.003943,wSpn/2,-0.010884}; +Point(155) = {0.008856,wSpn/2,-0.016078}; +Point(156) = {0.015708,wSpn/2,-0.021088}; +Point(157) = {0.024472,wSpn/2,-0.025893}; +Point(158) = {0.035112,wSpn/2,-0.030473}; +Point(159) = {0.047586,wSpn/2,-0.034803}; +Point(160) = {0.061847,wSpn/2,-0.038859}; +Point(161) = {0.077836,wSpn/2,-0.042615}; +Point(162) = {0.095492,wSpn/2,-0.046049}; +Point(163) = {0.114743,wSpn/2,-0.049138}; +Point(164) = {0.135516,wSpn/2,-0.051862}; +Point(165) = {0.157726,wSpn/2,-0.054206}; +Point(166) = {0.181288,wSpn/2,-0.056159}; +Point(167) = {0.206107,wSpn/2,-0.057712}; +Point(168) = {0.232087,wSpn/2,-0.058863}; +Point(169) = {0.259123,wSpn/2,-0.059614}; +Point(170) = {0.287110,wSpn/2,-0.059971}; +Point(171) = {0.315938,wSpn/2,-0.059947}; +Point(172) = {0.345492,wSpn/2,-0.059557}; +Point(173) = {0.375655,wSpn/2,-0.058819}; +Point(174) = {0.406309,wSpn/2,-0.057755}; +Point(175) = {0.437333,wSpn/2,-0.056390}; +Point(176) = {0.468605,wSpn/2,-0.054749}; +Point(177) = {0.500000,wSpn/2,-0.052862}; +Point(178) = {0.531395,wSpn/2,-0.050754}; +Point(179) = {0.562667,wSpn/2,-0.048455}; +Point(180) = {0.593691,wSpn/2,-0.045992}; +Point(181) = {0.624345,wSpn/2,-0.043394}; +Point(182) = {0.654508,wSpn/2,-0.040686}; +Point(183) = {0.684062,wSpn/2,-0.037896}; +Point(184) = {0.712890,wSpn/2,-0.035048}; +Point(185) = {0.740877,wSpn/2,-0.032168}; +Point(186) = {0.767913,wSpn/2,-0.029279}; +Point(187) = {0.793893,wSpn/2,-0.026405}; +Point(188) = {0.818712,wSpn/2,-0.023569}; +Point(189) = {0.842274,wSpn/2,-0.020795}; +Point(190) = {0.864484,wSpn/2,-0.018106}; +Point(191) = {0.885257,wSpn/2,-0.015523}; +Point(192) = {0.904508,wSpn/2,-0.013071}; +Point(193) = {0.922164,wSpn/2,-0.010770}; +Point(194) = {0.938153,wSpn/2,-0.008643}; +Point(195) = {0.952414,wSpn/2,-0.006710}; +Point(196) = {0.964888,wSpn/2,-0.004990}; +Point(197) = {0.975528,wSpn/2,-0.003501}; +Point(198) = {0.984292,wSpn/2,-0.002260}; +Point(199) = {0.991144,wSpn/2,-0.001280}; +Point(200) = {0.996057,wSpn/2,-0.000572}; +Point(201) = {0.999013,wSpn/2,-0.000143}; + +// Tail +If(tSpn != 0) + Point(301) = {5+1.000000/2,-tSpn/2,0.5+0.000000/2}; + Point(302) = {5+0.999013/2,-tSpn/2,0.5+0.000143/2}; + Point(303) = {5+0.996057/2,-tSpn/2,0.5+0.000572/2}; + Point(304) = {5+0.991144/2,-tSpn/2,0.5+0.001280/2}; + Point(305) = {5+0.984292/2,-tSpn/2,0.5+0.002260/2}; + Point(306) = {5+0.975528/2,-tSpn/2,0.5+0.003501/2}; + Point(307) = {5+0.964888/2,-tSpn/2,0.5+0.004990/2}; + Point(308) = {5+0.952414/2,-tSpn/2,0.5+0.006710/2}; + Point(309) = {5+0.938153/2,-tSpn/2,0.5+0.008643/2}; + Point(310) = {5+0.922164/2,-tSpn/2,0.5+0.010770/2}; + Point(311) = {5+0.904508/2,-tSpn/2,0.5+0.013071/2}; + Point(312) = {5+0.885257/2,-tSpn/2,0.5+0.015523/2}; + Point(313) = {5+0.864484/2,-tSpn/2,0.5+0.018106/2}; + Point(314) = {5+0.842274/2,-tSpn/2,0.5+0.020795/2}; + Point(315) = {5+0.818712/2,-tSpn/2,0.5+0.023569/2}; + Point(316) = {5+0.793893/2,-tSpn/2,0.5+0.026405/2}; + Point(317) = {5+0.767913/2,-tSpn/2,0.5+0.029279/2}; + Point(318) = {5+0.740877/2,-tSpn/2,0.5+0.032168/2}; + Point(319) = {5+0.712890/2,-tSpn/2,0.5+0.035048/2}; + Point(320) = {5+0.684062/2,-tSpn/2,0.5+0.037896/2}; + Point(321) = {5+0.654508/2,-tSpn/2,0.5+0.040686/2}; + Point(322) = {5+0.624345/2,-tSpn/2,0.5+0.043394/2}; + Point(323) = {5+0.593691/2,-tSpn/2,0.5+0.045992/2}; + Point(324) = {5+0.562667/2,-tSpn/2,0.5+0.048455/2}; + Point(325) = {5+0.531395/2,-tSpn/2,0.5+0.050754/2}; + Point(326) = {5+0.500000/2,-tSpn/2,0.5+0.052862/2}; + Point(327) = {5+0.468605/2,-tSpn/2,0.5+0.054749/2}; + Point(328) = {5+0.437333/2,-tSpn/2,0.5+0.056390/2}; + Point(329) = {5+0.406309/2,-tSpn/2,0.5+0.057755/2}; + Point(330) = {5+0.375655/2,-tSpn/2,0.5+0.058819/2}; + Point(331) = {5+0.345492/2,-tSpn/2,0.5+0.059557/2}; + Point(332) = {5+0.315938/2,-tSpn/2,0.5+0.059947/2}; + Point(333) = {5+0.287110/2,-tSpn/2,0.5+0.059971/2}; + Point(334) = {5+0.259123/2,-tSpn/2,0.5+0.059614/2}; + Point(335) = {5+0.232087/2,-tSpn/2,0.5+0.058863/2}; + Point(336) = {5+0.206107/2,-tSpn/2,0.5+0.057712/2}; + Point(337) = {5+0.181288/2,-tSpn/2,0.5+0.056159/2}; + Point(338) = {5+0.157726/2,-tSpn/2,0.5+0.054206/2}; + Point(339) = {5+0.135516/2,-tSpn/2,0.5+0.051862/2}; + Point(340) = {5+0.114743/2,-tSpn/2,0.5+0.049138/2}; + Point(341) = {5+0.095492/2,-tSpn/2,0.5+0.046049/2}; + Point(342) = {5+0.077836/2,-tSpn/2,0.5+0.042615/2}; + Point(343) = {5+0.061847/2,-tSpn/2,0.5+0.038859/2}; + Point(344) = {5+0.047586/2,-tSpn/2,0.5+0.034803/2}; + Point(345) = {5+0.035112/2,-tSpn/2,0.5+0.030473/2}; + Point(346) = {5+0.024472/2,-tSpn/2,0.5+0.025893/2}; + Point(347) = {5+0.015708/2,-tSpn/2,0.5+0.021088/2}; + Point(348) = {5+0.008856/2,-tSpn/2,0.5+0.016078/2}; + Point(349) = {5+0.003943/2,-tSpn/2,0.5+0.010884/2}; + Point(350) = {5+0.000987/2,-tSpn/2,0.5+0.005521/2}; + Point(351) = {5+0.000000/2,-tSpn/2,0.5+0.000000/2}; + Point(352) = {5+0.000987/2,-tSpn/2,0.5-0.005521/2}; + Point(353) = {5+0.003943/2,-tSpn/2,0.5-0.010884/2}; + Point(354) = {5+0.008856/2,-tSpn/2,0.5-0.016078/2}; + Point(355) = {5+0.015708/2,-tSpn/2,0.5-0.021088/2}; + Point(356) = {5+0.024472/2,-tSpn/2,0.5-0.025893/2}; + Point(357) = {5+0.035112/2,-tSpn/2,0.5-0.030473/2}; + Point(358) = {5+0.047586/2,-tSpn/2,0.5-0.034803/2}; + Point(359) = {5+0.061847/2,-tSpn/2,0.5-0.038859/2}; + Point(360) = {5+0.077836/2,-tSpn/2,0.5-0.042615/2}; + Point(361) = {5+0.095492/2,-tSpn/2,0.5-0.046049/2}; + Point(362) = {5+0.114743/2,-tSpn/2,0.5-0.049138/2}; + Point(363) = {5+0.135516/2,-tSpn/2,0.5-0.051862/2}; + Point(364) = {5+0.157726/2,-tSpn/2,0.5-0.054206/2}; + Point(365) = {5+0.181288/2,-tSpn/2,0.5-0.056159/2}; + Point(366) = {5+0.206107/2,-tSpn/2,0.5-0.057712/2}; + Point(367) = {5+0.232087/2,-tSpn/2,0.5-0.058863/2}; + Point(368) = {5+0.259123/2,-tSpn/2,0.5-0.059614/2}; + Point(369) = {5+0.287110/2,-tSpn/2,0.5-0.059971/2}; + Point(370) = {5+0.315938/2,-tSpn/2,0.5-0.059947/2}; + Point(371) = {5+0.345492/2,-tSpn/2,0.5-0.059557/2}; + Point(372) = {5+0.375655/2,-tSpn/2,0.5-0.058819/2}; + Point(373) = {5+0.406309/2,-tSpn/2,0.5-0.057755/2}; + Point(374) = {5+0.437333/2,-tSpn/2,0.5-0.056390/2}; + Point(375) = {5+0.468605/2,-tSpn/2,0.5-0.054749/2}; + Point(376) = {5+0.500000/2,-tSpn/2,0.5-0.052862/2}; + Point(377) = {5+0.531395/2,-tSpn/2,0.5-0.050754/2}; + Point(378) = {5+0.562667/2,-tSpn/2,0.5-0.048455/2}; + Point(379) = {5+0.593691/2,-tSpn/2,0.5-0.045992/2}; + Point(380) = {5+0.624345/2,-tSpn/2,0.5-0.043394/2}; + Point(381) = {5+0.654508/2,-tSpn/2,0.5-0.040686/2}; + Point(382) = {5+0.684062/2,-tSpn/2,0.5-0.037896/2}; + Point(383) = {5+0.712890/2,-tSpn/2,0.5-0.035048/2}; + Point(384) = {5+0.740877/2,-tSpn/2,0.5-0.032168/2}; + Point(385) = {5+0.767913/2,-tSpn/2,0.5-0.029279/2}; + Point(386) = {5+0.793893/2,-tSpn/2,0.5-0.026405/2}; + Point(387) = {5+0.818712/2,-tSpn/2,0.5-0.023569/2}; + Point(388) = {5+0.842274/2,-tSpn/2,0.5-0.020795/2}; + Point(389) = {5+0.864484/2,-tSpn/2,0.5-0.018106/2}; + Point(390) = {5+0.885257/2,-tSpn/2,0.5-0.015523/2}; + Point(391) = {5+0.904508/2,-tSpn/2,0.5-0.013071/2}; + Point(392) = {5+0.922164/2,-tSpn/2,0.5-0.010770/2}; + Point(393) = {5+0.938153/2,-tSpn/2,0.5-0.008643/2}; + Point(394) = {5+0.952414/2,-tSpn/2,0.5-0.006710/2}; + Point(395) = {5+0.964888/2,-tSpn/2,0.5-0.004990/2}; + Point(396) = {5+0.975528/2,-tSpn/2,0.5-0.003501/2}; + Point(397) = {5+0.984292/2,-tSpn/2,0.5-0.002260/2}; + Point(398) = {5+0.991144/2,-tSpn/2,0.5-0.001280/2}; + Point(399) = {5+0.996057/2,-tSpn/2,0.5-0.000572/2}; + Point(400) = {5+0.999013/2,-tSpn/2,0.5-0.000143/2}; + + Point(402) = {5+1.000000/2,tSpn/2,0.5+0.000000/2}; + Point(403) = {5+0.999013/2,tSpn/2,0.5+0.000143/2}; + Point(404) = {5+0.996057/2,tSpn/2,0.5+0.000572/2}; + Point(405) = {5+0.991144/2,tSpn/2,0.5+0.001280/2}; + Point(406) = {5+0.984292/2,tSpn/2,0.5+0.002260/2}; + Point(407) = {5+0.975528/2,tSpn/2,0.5+0.003501/2}; + Point(408) = {5+0.964888/2,tSpn/2,0.5+0.004990/2}; + Point(409) = {5+0.952414/2,tSpn/2,0.5+0.006710/2}; + Point(410) = {5+0.938153/2,tSpn/2,0.5+0.008643/2}; + Point(411) = {5+0.922164/2,tSpn/2,0.5+0.010770/2}; + Point(412) = {5+0.904508/2,tSpn/2,0.5+0.013071/2}; + Point(413) = {5+0.885257/2,tSpn/2,0.5+0.015523/2}; + Point(414) = {5+0.864484/2,tSpn/2,0.5+0.018106/2}; + Point(415) = {5+0.842274/2,tSpn/2,0.5+0.020795/2}; + Point(416) = {5+0.818712/2,tSpn/2,0.5+0.023569/2}; + Point(417) = {5+0.793893/2,tSpn/2,0.5+0.026405/2}; + Point(418) = {5+0.767913/2,tSpn/2,0.5+0.029279/2}; + Point(419) = {5+0.740877/2,tSpn/2,0.5+0.032168/2}; + Point(420) = {5+0.712890/2,tSpn/2,0.5+0.035048/2}; + Point(421) = {5+0.684062/2,tSpn/2,0.5+0.037896/2}; + Point(422) = {5+0.654508/2,tSpn/2,0.5+0.040686/2}; + Point(423) = {5+0.624345/2,tSpn/2,0.5+0.043394/2}; + Point(424) = {5+0.593691/2,tSpn/2,0.5+0.045992/2}; + Point(425) = {5+0.562667/2,tSpn/2,0.5+0.048455/2}; + Point(426) = {5+0.531395/2,tSpn/2,0.5+0.050754/2}; + Point(427) = {5+0.500000/2,tSpn/2,0.5+0.052862/2}; + Point(428) = {5+0.468605/2,tSpn/2,0.5+0.054749/2}; + Point(429) = {5+0.437333/2,tSpn/2,0.5+0.056390/2}; + Point(430) = {5+0.406309/2,tSpn/2,0.5+0.057755/2}; + Point(431) = {5+0.375655/2,tSpn/2,0.5+0.058819/2}; + Point(432) = {5+0.345492/2,tSpn/2,0.5+0.059557/2}; + Point(433) = {5+0.315938/2,tSpn/2,0.5+0.059947/2}; + Point(434) = {5+0.287110/2,tSpn/2,0.5+0.059971/2}; + Point(435) = {5+0.259123/2,tSpn/2,0.5+0.059614/2}; + Point(436) = {5+0.232087/2,tSpn/2,0.5+0.058863/2}; + Point(437) = {5+0.206107/2,tSpn/2,0.5+0.057712/2}; + Point(438) = {5+0.181288/2,tSpn/2,0.5+0.056159/2}; + Point(439) = {5+0.157726/2,tSpn/2,0.5+0.054206/2}; + Point(440) = {5+0.135516/2,tSpn/2,0.5+0.051862/2}; + Point(441) = {5+0.114743/2,tSpn/2,0.5+0.049138/2}; + Point(442) = {5+0.095492/2,tSpn/2,0.5+0.046049/2}; + Point(443) = {5+0.077836/2,tSpn/2,0.5+0.042615/2}; + Point(444) = {5+0.061847/2,tSpn/2,0.5+0.038859/2}; + Point(445) = {5+0.047586/2,tSpn/2,0.5+0.034803/2}; + Point(446) = {5+0.035112/2,tSpn/2,0.5+0.030473/2}; + Point(447) = {5+0.024472/2,tSpn/2,0.5+0.025893/2}; + Point(448) = {5+0.015708/2,tSpn/2,0.5+0.021088/2}; + Point(449) = {5+0.008856/2,tSpn/2,0.5+0.016078/2}; + Point(450) = {5+0.003943/2,tSpn/2,0.5+0.010884/2}; + Point(451) = {5+0.000987/2,tSpn/2,0.5+0.005521/2}; + Point(452) = {5+0.000000/2,tSpn/2,0.5+0.000000/2}; + Point(453) = {5+0.000987/2,tSpn/2,0.5-0.005521/2}; + Point(454) = {5+0.003943/2,tSpn/2,0.5-0.010884/2}; + Point(455) = {5+0.008856/2,tSpn/2,0.5-0.016078/2}; + Point(456) = {5+0.015708/2,tSpn/2,0.5-0.021088/2}; + Point(457) = {5+0.024472/2,tSpn/2,0.5-0.025893/2}; + Point(458) = {5+0.035112/2,tSpn/2,0.5-0.030473/2}; + Point(459) = {5+0.047586/2,tSpn/2,0.5-0.034803/2}; + Point(460) = {5+0.061847/2,tSpn/2,0.5-0.038859/2}; + Point(461) = {5+0.077836/2,tSpn/2,0.5-0.042615/2}; + Point(462) = {5+0.095492/2,tSpn/2,0.5-0.046049/2}; + Point(463) = {5+0.114743/2,tSpn/2,0.5-0.049138/2}; + Point(464) = {5+0.135516/2,tSpn/2,0.5-0.051862/2}; + Point(465) = {5+0.157726/2,tSpn/2,0.5-0.054206/2}; + Point(466) = {5+0.181288/2,tSpn/2,0.5-0.056159/2}; + Point(467) = {5+0.206107/2,tSpn/2,0.5-0.057712/2}; + Point(468) = {5+0.232087/2,tSpn/2,0.5-0.058863/2}; + Point(469) = {5+0.259123/2,tSpn/2,0.5-0.059614/2}; + Point(470) = {5+0.287110/2,tSpn/2,0.5-0.059971/2}; + Point(471) = {5+0.315938/2,tSpn/2,0.5-0.059947/2}; + Point(472) = {5+0.345492/2,tSpn/2,0.5-0.059557/2}; + Point(473) = {5+0.375655/2,tSpn/2,0.5-0.058819/2}; + Point(474) = {5+0.406309/2,tSpn/2,0.5-0.057755/2}; + Point(475) = {5+0.437333/2,tSpn/2,0.5-0.056390/2}; + Point(476) = {5+0.468605/2,tSpn/2,0.5-0.054749/2}; + Point(477) = {5+0.500000/2,tSpn/2,0.5-0.052862/2}; + Point(478) = {5+0.531395/2,tSpn/2,0.5-0.050754/2}; + Point(479) = {5+0.562667/2,tSpn/2,0.5-0.048455/2}; + Point(480) = {5+0.593691/2,tSpn/2,0.5-0.045992/2}; + Point(481) = {5+0.624345/2,tSpn/2,0.5-0.043394/2}; + Point(482) = {5+0.654508/2,tSpn/2,0.5-0.040686/2}; + Point(483) = {5+0.684062/2,tSpn/2,0.5-0.037896/2}; + Point(484) = {5+0.712890/2,tSpn/2,0.5-0.035048/2}; + Point(485) = {5+0.740877/2,tSpn/2,0.5-0.032168/2}; + Point(486) = {5+0.767913/2,tSpn/2,0.5-0.029279/2}; + Point(487) = {5+0.793893/2,tSpn/2,0.5-0.026405/2}; + Point(488) = {5+0.818712/2,tSpn/2,0.5-0.023569/2}; + Point(489) = {5+0.842274/2,tSpn/2,0.5-0.020795/2}; + Point(490) = {5+0.864484/2,tSpn/2,0.5-0.018106/2}; + Point(491) = {5+0.885257/2,tSpn/2,0.5-0.015523/2}; + Point(492) = {5+0.904508/2,tSpn/2,0.5-0.013071/2}; + Point(493) = {5+0.922164/2,tSpn/2,0.5-0.010770/2}; + Point(494) = {5+0.938153/2,tSpn/2,0.5-0.008643/2}; + Point(495) = {5+0.952414/2,tSpn/2,0.5-0.006710/2}; + Point(496) = {5+0.964888/2,tSpn/2,0.5-0.004990/2}; + Point(497) = {5+0.975528/2,tSpn/2,0.5-0.003501/2}; + Point(498) = {5+0.984292/2,tSpn/2,0.5-0.002260/2}; + Point(499) = {5+0.991144/2,tSpn/2,0.5-0.001280/2}; + Point(500) = {5+0.996057/2,tSpn/2,0.5-0.000572/2}; + Point(501) = {5+0.999013/2,tSpn/2,0.5-0.000143/2}; +EndIf + +// Field +If(fWdt != 0) + Point(1000001) = {-2, -fWdt/2, -2}; + Point(1000002) = {8, -fWdt/2, -2}; + Point(1000003) = {8, -fWdt/2, 2}; + Point(1000004) = {-2, -fWdt/2, 2}; + Point(1000005) = {-2, fWdt/2, -2}; + Point(1000006) = {8, fWdt/2, -2}; + Point(1000007) = {8, fWdt/2, 2}; + Point(1000008) = {-2, fWdt/2, 2}; +EndIf /// Lines -// Airfoil 1: +//Wing Spline(1) = {1:51}; Spline(2) = {51:100,1}; - -// Airfoil 2: Spline(5) = {102:152}; Spline(6) = {152:201,102}; +Line(11) = {1,102}; +Line(12) = {51,152}; -// Airfoil 1 to airfoil 2: -Line(61) = {1,102}; -Line(62) = {51,152}; +// Tail +If(tSpn != 0) + Spline(21) = {301:351}; + Spline(22) = {351:400,301}; + Spline(25) = {402:452}; + Spline(26) = {452:501,402}; + Line(31) = {301,402}; + Line(32) = {351,452}; +EndIf + +// Field +If(fWdt != 0) + Line(1000001) = {1000001, 1000002}; + Line(1000002) = {1000002, 1000003}; + Line(1000003) = {1000003, 1000004}; + Line(1000004) = {1000004, 1000001}; + Line(1000005) = {1000005, 1000006}; + Line(1000006) = {1000006, 1000007}; + Line(1000007) = {1000007, 1000008}; + Line(1000008) = {1000008, 1000005}; + Line(1000009) = {1000001, 1000005}; + Line(1000010) = {1000002, 1000006}; + Line(1000011) = {1000003, 1000007}; + Line(1000012) = {1000004, 1000008}; +EndIf /// Line loops & Surfaces -// Wing: -Line Loop(1) = {1,62,-5,-61}; -Line Loop(2) = {2,61,-6,-62}; +// Wing +Line Loop(1) = {1,12,-5,-11}; +Line Loop(2) = {2,11,-6,-12}; Surface(1) = {-1}; Surface(2) = {-2}; +// Tail +If(tSpn != 0) + Line Loop(11) = {21,32,-25,-31}; + Line Loop(12) = {22,31,-26,-32}; + Surface(11) = {-11}; + Surface(12) = {-12}; +EndIf + +// Field +If(fWdt != 0) + Line Loop(101) = {1000001, 1000002, 1000003, 1000004}; + Line Loop(102) = {1000002, 1000011, -1000006, -1000010}; + Line Loop(103) = {1000005, 1000006, 1000007, 1000008}; + Line Loop(104) = {1000004, 1000009, -1000008, -1000012}; + Line Loop(105) = {1000003, 1000012, -1000007, -1000011}; + Line Loop(106) = {1000001, 1000010, -1000005, -1000009}; + Surface(101) = {-101}; + Surface(102) = {102}; + Surface(103) = {103}; + Surface(104) = {104}; + Surface(105) = {105}; + Surface(106) = {106}; +EndIf + +/// Volume +If(fWdt != 0) + Surface Loop(1) = {101:106}; + Volume(1) = {1}; +EndIf + //// MESHING /// Lines -// Wing: -Transfinite Line{1, 2, 5, 6} = nC + 1 Using Bump 0.05; -Transfinite Line{61, 62} = nS + 1; +// Wing +Transfinite Line{1, 2, 5, 6} = wNc + 1 Using Bump 0.05; +Transfinite Line{11, 12} = wNs + 1; + +// Tail +If(tSpn != 0) + Transfinite Line{21, 22, 25, 26} = tNc + 1 Using Bump 0.05; + Transfinite Line{31, 32} = tNs + 1; +EndIf + +// Field +If(fWdt != 0) + Transfinite Line{1000001, 1000003, 1000005, 1000007} = nX + 1; + Transfinite Line{1000009, 1000010, 1000011, 1000012} = nY + 1; + Transfinite Line{1000002, 1000004, 1000006, 1000008} = nZ + 1; +EndIf /// Surfaces + +// Wing Transfinite Surface{1, 2}; Recombine Surface{1, 2}; +// Tail +If(tSpn != 0) + Transfinite Surface{11, 12}; + Recombine Surface{11, 12}; +EndIf + +// Field +If(fWdt != 0) + Transfinite Surface{101:106}; + Recombine Surface{101:106}; +EndIf + +/// Volume + +// Field +If(fWdt != 0) + Transfinite Volume{1}; + Recombine Volume{1}; +EndIf + //// PHYSICAL GROUPS -// Wing: -Physical Line("te") = {61}; +// Wing +Physical Line("wTe") = {11}; Physical Surface("wing") = {1,2}; + +// Tail +If(tSpn != 0) + Physical Line("tTe") = {31}; + Physical Surface("tail") = {11,12}; +EndIf + +// Field +If(fWdt != 0) + Physical Volume("field") = {1}; +EndIf diff --git a/fpm/tests/basic.py b/fpm/models/n0012.py similarity index 74% rename from fpm/tests/basic.py rename to fpm/models/n0012.py index 8228946bcb6a0a529840386a0aeacd235a2f3a61..aecc9643019973c1bd99ca46931031d028adc151 100644 --- a/fpm/tests/basic.py +++ b/fpm/models/n0012.py @@ -15,27 +15,31 @@ # See the License for the specific language governing permissions and # limitations under the License. -# Dummy test +# Naca 0012 model # Adrien Crovato import fpm import tbox import tbox.gmsh as gmsh -from fwk.testing import * from fwk.coloring import ccolors -def main(): +def main(p, tail=False, field=False): # timer tms = fpm.Timers() tms['total'].start() # mesh print(ccolors.ANSI_BLUE + 'PyMeshing...' + ccolors.ANSI_RESET) - pars = {'spn' : 5, 'nC' : 80, 'nS' : 10} - msh = gmsh.MeshLoader('../models/n0012.geo', __file__).execute(**pars) + msh = gmsh.MeshLoader('n0012.geo', __file__).execute(**p['pars']) # problem - pbl = fpm.Problem(msh, 0, 0, 0, 5., 1., 0., 0., 0.) - wing = fpm.Body(msh, 'wing', ['te'], 5) + pbl = fpm.Problem(msh, p['aoa'], p['aos'], p['mach'], p['spn'], 1, 0, 0, 0) + wing = fpm.Body(msh, 'wing', ['wTe'], 10) pbl.add(wing) + if tail: + tail = fpm.Body(msh, 'tail', ['tTe'], 10) + pbl.add(tail) + if field: + field = fpm.Field(msh, 'field') + pbl.set(field) # AIC builder aic = fpm.Builder(pbl) aic.run() @@ -49,14 +53,6 @@ def main(): print(ccolors.ANSI_BLUE + 'PyTiming...' + ccolors.ANSI_RESET) print(tms) - # test - print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) - tests = CTests() - tests.run() - - # eof - print('') - if __name__ == '__main__': main() diff --git a/fpm/src/fBuilder.cpp b/fpm/src/fBuilder.cpp index fc7bfddd435976f80a5a42f9d13986a7ea97eef5..720b3b879a74ecf2e7d028357a4f5bef5bd4325d 100644 --- a/fpm/src/fBuilder.cpp +++ b/fpm/src/fBuilder.cpp @@ -16,7 +16,7 @@ #include "fBuilder.h" #include "fProblem.h" -//#include "fField.h" +#include "fField.h" #include "fBody.h" #include "fWake.h" @@ -40,16 +40,16 @@ Builder::Builder(std::shared_ptr<Problem> _pbl) : pbl(_pbl), valid(false) pbl->updateMem(); // Setup AIC matrices - nF = 0; //pbl->field->tag->elems.size(); + pbl->field ? nF = pbl->field->tag->elems.size() : nF = 0; nP = 0; for (auto body : pbl->bodies) nP += body->tag->elems.size(); - A.resize(nP, nP); - B.resize(nP, nP); - C.resize(nP, nF); - Cx.resize(nP, nF); - Cy.resize(nP, nF); - Cz.resize(nP, nF); + A = Eigen::MatrixXd::Zero(nP, nP); + B = Eigen::MatrixXd::Zero(nP, nP); + C = Eigen::MatrixXd::Zero(nP, nF); + Cx = Eigen::MatrixXd::Zero(nP, nF); + Cy = Eigen::MatrixXd::Zero(nP, nF); + Cz = Eigen::MatrixXd::Zero(nP, nF); } /** @@ -90,15 +90,16 @@ void Builder::run() } // field to body - //for (auto body : pbl->bodies) - // for (auto e : body->tag->elems) - // for (size_t j = 0; j < field->tag->elems.size(); ++j) - // { - // C(rows.at(ei), j) = sigma(ei, field->tag->elems[j]); - // Cx(rows.at(ei), j) = sigmaX(ei, field->tag->elems[j]); - // Cy(rows.at(ei), j) = sigmaY(ei, field->tag->elems[j]); - // Cz(rows.at(ei), j) = sigmaY(ei, field->tag->elems[j]); - // } + if (pbl->field) + for (auto body : pbl->bodies) + for (auto e : body->tag->elems) + for (size_t j = 0; j < pbl->field->tag->elems.size(); ++j) + { + C(rows.at(e), j) = sigma(e, pbl->field->tag->elems[j]); + Cx(rows.at(e), j) = sigmaX(e, pbl->field->tag->elems[j]); + Cy(rows.at(e), j) = sigmaY(e, pbl->field->tag->elems[j]); + Cz(rows.at(e), j) = sigmaY(e, pbl->field->tag->elems[j]); + } valid = true; } diff --git a/fpm/src/fField.cpp b/fpm/src/fField.cpp new file mode 100644 index 0000000000000000000000000000000000000000..37f76c14f7c00553bb30e9df1bfbb06482f5ce37 --- /dev/null +++ b/fpm/src/fField.cpp @@ -0,0 +1,26 @@ +/* + * 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. + */ + +#include "fField.h" +#include "wTag.h" + +using namespace tbox; +using namespace fpm; + +void Field::write(std::ostream &out) const +{ + out << "fpm::Field " << *tag << std::endl; +} diff --git a/fpm/src/fField.h b/fpm/src/fField.h new file mode 100644 index 0000000000000000000000000000000000000000..6ef5bb8d99a16907ecf09a473d848a04d23348d1 --- /dev/null +++ b/fpm/src/fField.h @@ -0,0 +1,43 @@ +/* + * 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. + */ + +#ifndef FFIELD_H +#define FFIELD_H + +#include "fpm.h" +#include "wGroup.h" + +namespace fpm +{ + +/** + * @brief Manage the fluid field + * @authors Adrien Crovato + */ +class FPM_API Field : public tbox::Group +{ +public: + Field(std::shared_ptr<tbox::MshData> _msh, std::string const &name) : Group(_msh, name) {} + ~Field() { std::cout << "~Field()\n"; } + +#ifndef SWIG + virtual void write(std::ostream &out) const override; +#endif +}; + +} // namespace fpm + +#endif //FFIELD_H diff --git a/fpm/src/fProblem.cpp b/fpm/src/fProblem.cpp index c2b666e9943bed48315d94c8f9a5fb54c3e46de2..ef7843fcf82507b88da160f5a1342998b93a611f 100644 --- a/fpm/src/fProblem.cpp +++ b/fpm/src/fProblem.cpp @@ -15,6 +15,7 @@ */ #include "fProblem.h" +#include "fField.h" #include "fBody.h" #include "wTag.h" #include "wElement.h" @@ -31,6 +32,13 @@ Problem::Problem(std::shared_ptr<MshData> _msh, double aoa, double aos, double m xR(2) = zref; } +/** + * @brief Set the fluid field + */ +void Problem::set(std::shared_ptr<Field> f) +{ + field = f; +} /** * @brief Add a non-lifting body */ @@ -84,9 +92,7 @@ double Problem::Cp(tbox::Element &e, std::vector<double> const &phi) { Eigen::Vector3d u = U(e, phi); if (mach == 0) - { return 1 - u.dot(u); - } else { //particularized: 2 / (gamma * mInf * mInf) * (pow(1 + 0.5 * (gamma - 1) * mInf * mInf * (1 - gradU2), gamma / (gamma - 1)) - 1); @@ -100,6 +106,10 @@ double Problem::Cp(tbox::Element &e, std::vector<double> const &phi) */ void Problem::updateMem() { + // Update volume Jacobian + if (field) + for (auto e : field->tag->elems) + e->getVMem().update(true); // Update surface Jacobian for (auto s : bodies) for (auto e : s->tag->elems) @@ -114,9 +124,29 @@ void Problem::check() const // Sanity checks if (bodies.empty()) throw std::runtime_error("No lifting bodies provided!\n"); + if (mach != 0 && !field) + { + std::stringstream err; + err << "Compressible computation requested for Mach " + << mach << ", but no field provided!\n"; + throw std::runtime_error(err.str()); + } + if (mach == 0 && field) + std::cout << "Incompressible computation requested, but a field was provided. This will result in unnecessary computations!\n" + << std::endl; // Three-dimension problem - // Surface element type + // Volume elements + if (field) + for (auto e : field->tag->elems) + if (e->type() != ELTYPE::HEX8) + { + std::stringstream err; + err << "FPM solver is only implemented for surface elements of type " + << ELTYPE::HEX8 << " (" << e->type() << " was given)!\n"; + throw std::runtime_error(err.str()); + } + // Surface elements for (auto b : bodies) for (auto e : b->tag->elems) if (e->type() != ELTYPE::QUAD4) diff --git a/fpm/src/fProblem.h b/fpm/src/fProblem.h index 7c8714537384f63befa5552b0dd923cc3e5270c9..4bf8c33f16ec4457509bac8e2282d77d7684b16e 100644 --- a/fpm/src/fProblem.h +++ b/fpm/src/fProblem.h @@ -35,6 +35,7 @@ class FPM_API Problem : public fwk::wSharedObject public: std::shared_ptr<tbox::MshData> msh; ///< mesh data structure #ifndef SWIG + std::shared_ptr<Field> field; ///< fluid field std::vector<std::shared_ptr<Body>> bodies; ///< bodies in fluid #endif // Reference values @@ -48,6 +49,7 @@ public: Problem(std::shared_ptr<tbox::MshData> _msh, double aoa, double aos, double mch, double sref, double cref, double xref, double yref, double zref); ~Problem() { std::cout << "~Problem()\n"; } + void set(std::shared_ptr<Field> f); void add(std::shared_ptr<Body> b); // Functions diff --git a/fpm/src/fSolver.cpp b/fpm/src/fSolver.cpp index 1769580d86d10db06ec63b1ee127bfe1b407fb97..a9905ea3f8c27e5e5970efebf4123bb6db93f571 100644 --- a/fpm/src/fSolver.cpp +++ b/fpm/src/fSolver.cpp @@ -53,7 +53,7 @@ Solver::Solver(std::shared_ptr<Builder> _aic) : aic(_aic), Cl(0), Cd(0), Cs(0), std::cout << "*******************************************************************************" << std::endl << std::endl; - // Setup variables (unkwown vector) + // Setup variables phi.resize(aic->pbl->msh->nodes.size(), 0.); vPhi.resize(aic->pbl->msh->nodes.size(), 0.); U.resize(aic->pbl->msh->elems.size(), Eigen::Vector3d::Zero()); @@ -70,9 +70,11 @@ void Solver::run() if (!aic->valid) throw std::runtime_error("fpm::Solver:run() AIC matrices are not up-to-date!\n"); - // @todo compute sigma from an interpolator and compute volume flow + // @todo compute sigma from an interpolator and compute volume flow (interpolation should be performed only once BEFORE run) std::cout << "Computing field sources... " << std::flush; - Eigen::VectorXd sigma = Eigen::VectorXd::Zero(aic->nF); + Eigen::VectorXd sigma(aic->nF); + if (aic->pbl->field) + sigma = Eigen::VectorXd::Zero(aic->nF); Eigen::VectorXd uX = aic->Cx * sigma; Eigen::VectorXd uY = aic->Cy * sigma; Eigen::VectorXd uZ = aic->Cz * sigma; diff --git a/fpm/src/fpm.h b/fpm/src/fpm.h index b9b586efeb139c9cdd1fe7828948ea7e4cc2875e..676bbd8ed209d11f4c9c44c34d6a32571e924f10 100644 --- a/fpm/src/fpm.h +++ b/fpm/src/fpm.h @@ -40,6 +40,7 @@ class Timers; // problem definition class Problem; +class Field; class Body; class Wake; diff --git a/fpm/tests/n12.py b/fpm/tests/n12.py new file mode 100644 index 0000000000000000000000000000000000000000..663229ff5856bd0559a2b0ec899987939c67f465 --- /dev/null +++ b/fpm/tests/n12.py @@ -0,0 +1,45 @@ +#!/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. + +# Naca 0012 wing +# Adrien Crovato + +from fwk.testing import * + +def main(): + p = {} + # geometry parameters + p['pars'] = {'wSpn' : 5, 'wNc' : 80, 'wNs' : 10} + p['spn'] = 5 + # flow parameters + p['aoa'] = 0 + p['aos'] = 0 + p['mach'] = 0 + # run + import fpm.models.n0012 as n12 + n12.main(p) + # test + print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) + tests = CTests() + tests.run() + + # eof + print('') + +if __name__ == '__main__': + main() + diff --git a/fpm/tests/n12f.py b/fpm/tests/n12f.py new file mode 100644 index 0000000000000000000000000000000000000000..edd633a49a2c1cb2d0cb92eb8544df45e4a99ff4 --- /dev/null +++ b/fpm/tests/n12f.py @@ -0,0 +1,45 @@ +#!/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. + +# Naca 0012 wing +# Adrien Crovato + +from fwk.testing import * + +def main(): + p = {} + # geometry parameters + p['pars'] = {'wSpn' : 5, 'wNc' : 80, 'wNs' : 10, 'fWdt' : 10, 'nX' : 10, 'nY' : 10, 'nZ' : 4} + p['spn'] = 5 + # flow parameters + p['aoa'] = 0 + p['aos'] = 0 + p['mach'] = 0.8 + # run + import fpm.models.n0012 as n12 + n12.main(p, field=True) + # test + print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) + tests = CTests() + tests.run() + + # eof + print('') + +if __name__ == '__main__': + main() + diff --git a/fpm/tests/n12t.py b/fpm/tests/n12t.py new file mode 100644 index 0000000000000000000000000000000000000000..783473542549519c8f9f35a778528b94e3128cdb --- /dev/null +++ b/fpm/tests/n12t.py @@ -0,0 +1,45 @@ +#!/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. + +# Naca 0012 wing +# Adrien Crovato + +from fwk.testing import * + +def main(): + p = {} + # geometry parameters + p['pars'] = {'wSpn' : 5, 'wNc' : 80, 'wNs' : 10, 'tSpn' : 3, 'tNc' : 40, 'tNs' : 5} + p['spn'] = 5 + # flow parameters + p['aoa'] = 0 + p['aos'] = 0 + p['mach'] = 0 + # run + import fpm.models.n0012 as n12 + n12.main(p, tail=True) + # test + print(ccolors.ANSI_BLUE + 'PyTesting...' + ccolors.ANSI_RESET) + tests = CTests() + tests.run() + + # eof + print('') + +if __name__ == '__main__': + main() +