diff --git a/regression/scripts/Vehicles/Propellers/APC_11x4_Propeller.py b/regression/scripts/Vehicles/Propellers/APC_11x4_Propeller.py index 37cc76c0f7..784e33525a 100644 --- a/regression/scripts/Vehicles/Propellers/APC_11x4_Propeller.py +++ b/regression/scripts/Vehicles/Propellers/APC_11x4_Propeller.py @@ -34,8 +34,8 @@ def APC_11x4_Propeller(): [0.2952380952380953, 21.8436873747495 ],[0.3500000000000001, 20.741482965931866 ],[0.4023809523809523, 19.138276553106213 ], [0.44761904761904736, 17.434869739478955 ],[0.5, 15.6312625250501 ],[0.5500000000000003, 14.07815631262525 ], [0.6000000000000001, 12.725450901803606 ],[0.6499999999999999, 11.57314629258517 ],[0.6976190476190478, 10.470941883767534 ], - [0.7476190476190476, 9.569138276553108 ], [0.7976190476190479, 8.667334669338675 ],[0.8500000000000001, 7.665330661322642 ], - [0.8999999999999999, 6.6633266533066156 ],[0.9500000000000002, 5.360721442885772 ],[0.99, 3.9579158316633247 ]]) + [0.7476190476190476, 9.569138276553108 ], [0.7976190476190479, 8.667334669338675 ],[0.8500000000000001, 7.665330661322642 ], + [0.8999999999999999, 6.6633266533066156 ],[0.9500000000000002, 5.360721442885772 ],[0.99, 3.9579158316633247 ]]) r_R = dimensionless_radius_chord[:,0] b_R = dimensionless_radius_chord[:,1] @@ -56,16 +56,17 @@ def APC_11x4_Propeller(): prop.radius_distribution = r_R*prop.tip_radius prop.mid_chord_alignment = np.zeros_like(prop.chord_distribution) prop.thickness_to_chord = prop.max_thickness_distribution/prop.chord_distribution - ospath = os.path.abspath(__file__) - separator = os.path.sep - rel_path = os.path.dirname(ospath) + separator - airfoil = SUAVE.Components.Airfoils.Airfoil() - airfoil.coordinate_file = rel_path +'../Airfoils/Clark_y.txt' - airfoil.polar_files = [rel_path +'../Airfoils/Polars/Clark_y_polar_Re_50000.txt', - rel_path +'../Airfoils/Polars/Clark_y_polar_Re_100000.txt',rel_path +'../Airfoils/Polars/Clark_y_polar_Re_200000.txt', - rel_path +'../Airfoils/Polars/Clark_y_polar_Re_500000.txt',rel_path +'../Airfoils/Polars/Clark_y_polar_Re_1000000.txt'] - airfoil.geometry = import_airfoil_geometry(airfoil.coordinate_file,airfoil.number_of_points) - airfoil.polars = compute_airfoil_properties(airfoil.geometry,airfoil.polar_files) + ospath = os.path.abspath(__file__) + separator = os.path.sep + rel_path = os.path.dirname(ospath) + separator + airfoil = SUAVE.Components.Airfoils.Airfoil() + airfoil.number_of_points = 300 + airfoil.coordinate_file = rel_path +'../Airfoils/Clark_y.txt' + airfoil.polar_files = [rel_path +'../Airfoils/Polars/Clark_y_polar_Re_50000.txt', + rel_path +'../Airfoils/Polars/Clark_y_polar_Re_100000.txt',rel_path +'../Airfoils/Polars/Clark_y_polar_Re_200000.txt', + rel_path +'../Airfoils/Polars/Clark_y_polar_Re_500000.txt',rel_path +'../Airfoils/Polars/Clark_y_polar_Re_1000000.txt'] + airfoil.geometry = import_airfoil_geometry(airfoil.coordinate_file,airfoil.number_of_points) + airfoil.polars = compute_airfoil_properties(airfoil.geometry,airfoil.polar_files) prop.append_airfoil(airfoil) - prop.airfoil_polar_stations = list(np.zeros(len(prop.radius_distribution)).astype(int)) + prop.airfoil_polar_stations = list(np.zeros(len(prop.radius_distribution)).astype(int)) return prop \ No newline at end of file diff --git a/regression/scripts/airfoil_import/Transition1.txt b/regression/scripts/airfoil_import/Transition1.txt index 2eecd852bf..e0bff610b7 100644 --- a/regression/scripts/airfoil_import/Transition1.txt +++ b/regression/scripts/airfoil_import/Transition1.txt @@ -6,99 +6,99 @@ Airfoil Transition 1 between Clark_y.txt and E63.txt 0.0010333445462750398 0.0029214569119531074 0.0023891129947937804 0.005979981210001954 0.0063782255032844995 0.010967119592765449 -0.011488629935611281 0.01591857544480739 -0.020932982115795314 0.02383139787294719 +0.01148862993561128 0.015918575444807386 +0.020932982115795314 0.023831397872947198 0.03212242236869531 0.0310485029775829 0.0441301474042336 0.03711724236613887 -0.056605303011244126 0.042401348884712614 -0.07815337323853717 0.05020141729299135 -0.09997256580755073 0.05673009485835369 +0.05660530301124411 0.042401348884712614 +0.07815337323853716 0.05020141729299135 +0.09997256580755072 0.05673009485835369 0.12264248725423472 0.06241597637104842 -0.14586593080879168 0.06728793094934461 -0.1696753102609578 0.07143352001736718 -0.1940348803690683 0.07483750255861966 -0.2189134009821199 0.07753863431546326 -0.24427485198917706 0.07964692073912095 -0.27007531293366377 0.08128229584757717 -0.29627378298756557 0.08255289486056692 +0.14586593080879168 0.0672879309493446 +0.16967531026095775 0.07143352001736718 +0.1940348803690683 0.07483750255861965 +0.21891340098211987 0.07753863431546326 +0.24427485198917703 0.07964692073912095 +0.2700753129336637 0.08128229584757717 +0.29627378298756557 0.08255289486056691 0.32282875935744043 0.08351568756401376 -0.3496929657008141 0.08415302675254809 +0.34969296570081404 0.08415302675254807 0.3768152923677993 0.08443397693673776 -0.40414429987732364 0.08433237904233983 -0.4316292380270218 0.08384473348618728 -0.4592160908167326 0.08297935074723937 -0.4868521929495892 0.08175732281878534 -0.514485682932589 0.08021069197244658 -0.5420597705185082 0.07834934739975473 -0.5695203800378059 0.07618260345992738 -0.5968162844284558 0.07372105608161496 -0.6238963538686588 0.07096436501092838 -0.6507089703535398 0.06793030600179534 -0.6772033624097192 0.06464247545467883 -0.703330810209409 0.06111512413200635 -0.7290436045159441 0.05738052376873901 -0.7542966188362384 0.05346581878412209 -0.7790482020742341 0.04937826870816631 -0.8032594318209234 0.04513745619321115 -0.8268917095674151 0.04075721118108272 -0.8499087162231408 0.036248278424735436 -0.8722816115035328 0.03163901353506582 -0.893977227840118 0.026940655819973947 -0.9149473515675894 0.02215749837388536 -0.9352615988770601 0.017266668166453225 -0.9549679210212746 0.012290605584394577 -0.9722537078425361 0.007746930890588101 -0.9817702187551454 0.0050694222406991755 -0.991408226259411 0.0025165617331137967 +0.4041442998773236 0.08433237904233983 +0.43162923802702174 0.08384473348618726 +0.45921609081673254 0.08297935074723935 +0.4868521929495891 0.08175732281878534 +0.5144856829325889 0.08021069197244657 +0.542059770518508 0.07834934739975473 +0.5695203800378058 0.07618260345992736 +0.5968162844284556 0.07372105608161493 +0.6238963538686586 0.07096436501092836 +0.6507089703535396 0.06793030600179534 +0.6772033624097191 0.06464247545467883 +0.703330810209409 0.06111512413200634 +0.729043604515944 0.057380523768739006 +0.7542966188362384 0.053465818784122085 +0.7790482020742341 0.049378268708166306 +0.8032594318209233 0.045137456193211134 +0.8268917095674149 0.04075721118108271 +0.8499087162231407 0.03624827842473543 +0.8722816115035327 0.03163901353506581 +0.8939772278401178 0.026940655819973947 +0.9149473515675892 0.02215749837388536 +0.93526159887706 0.017266668166453225 +0.9549679210212746 0.012290605584394574 +0.9722537078425362 0.007746930890588101 +0.9817702187551455 0.0050694222406991755 +0.9914082262594109 0.002516561733113797 1.0 0.00039933333333333335 0.0 -0.00041 -0.0012034134764724962 -0.004200357258618933 +0.0012034134764724966 -0.004200357258618933 0.003064649052009731 -0.005488475160577639 0.006099852223786702 -0.00744497046517467 -0.011549072507251151 -0.01035774346147757 -0.018009676079944237 -0.012443025181397949 +0.01154907250725115 -0.01035774346147757 +0.018009676079944234 -0.012443025181397947 0.028736432149490447 -0.014706287355509731 0.041101917757177954 -0.015959624278606567 -0.054171828218801524 -0.016802257583624476 +0.05417182821880153 -0.016802257583624473 0.06759758089306872 -0.01710057030870387 -0.0899850801924746 -0.017463329032203254 -0.1125245931815257 -0.017345947913570744 +0.08998508019247459 -0.017463329032203254 +0.1125245931815257 -0.01734594791357074 0.1357929306135279 -0.01687440836015201 -0.159494436744123 -0.016087126780003878 -0.1836649947817783 -0.015054130346955295 -0.20826902947840892 -0.013838836123154036 -0.23327651291210807 -0.0124998371608733 +0.15949443674412297 -0.016087126780003874 +0.18366499478177828 -0.015054130346955292 +0.20826902947840892 -0.013838836123154032 +0.23327651291210802 -0.012499837160873297 0.2586561462715306 -0.011090559319069437 -0.284373215341306 -0.009658859952579316 +0.2843732153413059 -0.009658859952579313 0.31039123758195586 -0.008247065575523259 0.3366736355754126 -0.006895713259442864 -0.3631829427523795 -0.005616776718831474 -0.38987856955254363 -0.004409775481864362 -0.4167188599386917 -0.0032747856331150973 -0.4436613438419579 -0.002222009044679136 -0.47066188710112655 -0.00125865311534425 +0.3631829427523794 -0.0056167767188314704 +0.38987856955254363 -0.004409775481864359 +0.4167188599386917 -0.0032747856331150904 +0.4436613438419578 -0.002222009044679136 +0.4706618871011265 -0.00125865311534425 0.4976744562880269 -0.0003867748824070566 0.5246543818682187 0.00038789149393268427 -0.5515578453950654 0.0010550678669264332 -0.5783385093144886 0.001615760026754308 -0.6049498460743795 0.002074983767216102 -0.6313499068770243 0.0024314422013670955 -0.6574971711304278 0.002684490928285946 -0.6833479337587203 0.0028416778695688344 -0.7088594001384116 0.0029086387271731982 -0.733990805288136 0.002883870999573766 -0.75870310643572 0.002775808560369193 +0.5515578453950652 0.0010550678669264332 +0.5783385093144885 0.001615760026754308 +0.6049498460743794 0.002074983767216102 +0.6313499068770241 0.002431442201367092 +0.6574971711304276 0.0026844909282859424 +0.6833479337587202 0.002841677869568836 +0.7088594001384116 0.002908638727173193 +0.7339908052881359 0.0028838709995737642 +0.75870310643572 0.002775808560369195 0.7829587801744456 0.00259663758482254 -0.8067207429026988 0.0023548448064921023 -0.829953451529614 0.002055298915645286 -0.852628446137845 0.001708621474799707 -0.874714546881402 0.0013269755548658418 -0.8961680952170253 0.0009143554773901538 -0.9169228103806013 0.0004913332809055922 -0.9370017380451255 0.00011341700652931592 -0.9563910549616278 -0.00016144847704611465 -0.973257638979786 -0.00034086498177666904 -0.9823029612519154 -0.0005895776331160119 -0.9915526644918705 -0.0006006645997105569 +0.8067207429026987 0.0023548448064921006 +0.8299534515296138 0.0020552989156452824 +0.8526284461378449 0.001708621474799707 +0.8747145468814019 0.0013269755548658401 +0.8961680952170251 0.0009143554773901547 +0.9169228103806011 0.0004913332809055931 +0.9370017380451254 0.00011341700652931679 +0.9563910549616279 -0.00016144847704611465 +0.9732576389797861 -0.00034086498177666904 +0.9823029612519154 -0.0005895776331160116 +0.9915526644918704 -0.0006006645997105569 1.0 -0.00039933333333333335 diff --git a/regression/scripts/airfoil_import/Transition2.txt b/regression/scripts/airfoil_import/Transition2.txt index 3afaefd4a6..0e5b1ff095 100644 --- a/regression/scripts/airfoil_import/Transition2.txt +++ b/regression/scripts/airfoil_import/Transition2.txt @@ -2,103 +2,103 @@ Airfoil Transition 2 between Clark_y.txt and E63.txt 61. 61. 0.0 -0.00082 -0.0006618401905067536 -0.0003483181868544319 +0.0006618401905067537 -0.0003483181868544319 0.000686237467774914 0.0012852798374433415 -0.0016680550431353758 0.004277839808261783 -0.005153144537702958 0.008647024005099167 -0.010238930585453186 0.01324868700372896 -0.01846077677603085 0.019480458968575923 +0.0016680550431353758 0.0042778398082617825 +0.005153144537702959 0.008647024005099169 +0.010238930585453184 0.013248687003728958 +0.01846077677603085 0.019480458968575927 0.028573824983999234 0.0254474461783648 0.040118180996516026 0.030879816487096645 -0.05290095313687888 0.03591929266019363 +0.05290095313687887 0.03591929266019363 0.07120535981331984 0.04218017368426559 0.0906160905946668 0.04773959285813495 0.11139736548966844 0.052788781553289504 -0.13336514818072426 0.05731870695729524 +0.13336514818072423 0.057318706957295226 0.15649368065141578 0.06135105264419513 0.18072273767840788 0.06486933299490627 -0.20599008546794217 0.06787714858544622 -0.2322231712171972 0.0704119339961892 -0.2593342992395953 0.07253083872216275 -0.287241443633766 0.07427529156790207 -0.3158616003181051 0.07566337069595015 -0.3451002171207037 0.07669107552117198 -0.3748550745312801 0.0773336283273312 -0.40502329363208434 0.07757520292926232 -0.4355033740132703 0.07742434751636872 -0.4661872836742727 0.07687290586988295 -0.49696969202162816 0.07593402197126208 -0.5277468760692596 0.07464100512440741 -0.5584052553227309 0.07299291714646094 -0.5888366784429557 0.07100385013181083 -0.6189386913059015 0.06869511708727978 -0.64860903426792 0.06606504396862803 -0.6777444713191114 0.06314281081214043 -0.7062434595151188 0.05995928720387041 -0.734008559185977 0.05652063496608091 -0.7609443519091438 0.052870340292966486 +0.20599008546794217 0.0678771485854462 +0.23222317121719718 0.0704119339961892 +0.2593342992395952 0.07253083872216273 +0.287241443633766 0.07427529156790205 +0.3158616003181051 0.07566337069595014 +0.34510021712070366 0.07669107552117196 +0.3748550745312801 0.07733362832733119 +0.40502329363208434 0.0775752029292623 +0.4355033740132703 0.07742434751636869 +0.46618728367427265 0.07687290586988293 +0.4969696920216281 0.07593402197126206 +0.5277468760692595 0.0746410051244074 +0.5584052553227308 0.07299291714646093 +0.5888366784429556 0.07100385013181082 +0.6189386913059014 0.06869511708727978 +0.6486090342679199 0.06606504396862801 +0.6777444713191113 0.06314281081214042 +0.7062434595151188 0.0599592872038704 +0.734008559185977 0.056520634966080896 +0.7609443519091438 0.05287034029296647 0.7869605846740226 0.04904416215286028 -0.8119739541722835 0.045051515535976604 -0.8359066245615503 0.040928943769911366 -0.8586813581619683 0.03670277618994731 -0.8802256054724515 0.032392667287771605 -0.9004820583493978 0.028047731400694297 -0.9193793568873223 0.02368908592607743 -0.9368497313509598 0.01931061699443361 -0.9529370734435272 0.014882995200492228 -0.9677381021067958 0.010458657278713352 +0.8119739541722835 0.0450515155359766 +0.8359066245615502 0.04092894376991136 +0.8586813581619681 0.0367027761899473 +0.8802256054724514 0.0323926672877716 +0.9004820583493977 0.028047731400694293 +0.9193793568873221 0.02368908592607743 +0.9368497313509596 0.01931061699443361 +0.9529370734435271 0.014882995200492228 +0.9677381021067959 0.01045865727871335 0.9804046289267611 0.006424386731088767 0.9882322648397839 0.0037006690652119307 -0.9950203398283113 0.0015422654911687486 +0.9950203398283113 0.0015422654911687488 1.0 0.00019966666666666668 0.0 -0.00082 -0.0018170549495923692 -0.0033296417856501113 -0.004748846479244297 -0.00431954164510056 -0.009089533501121218 -0.00540844079777646 +0.00181705494959237 -0.0033296417856501113 +0.004748846479244296 -0.004319541645100561 +0.00908953350112122 -0.00540844079777646 0.015494838545636259 -0.0067733836413159205 -0.023281022874119095 -0.007539783860793755 +0.02328102287411909 -0.0075397838607937535 0.034067676843421116 -0.008206472270591613 0.04653281576096452 -0.008191610960060342 -0.060201542625651874 -0.007821370358700761 -0.07488550890052807 -0.007048365257168666 -0.0948687737211947 -0.0061931273306117494 -0.11572014534261676 -0.005003276644018648 +0.060201542625651874 -0.007821370358700758 +0.07488550890052809 -0.007048365257168666 +0.09486877372119469 -0.006193127330611746 +0.11572014534261675 -0.005003276644018645 0.13769825220825482 -0.003562813978700192 -0.16062216005138688 -0.0019116859384296359 -0.1844730496930568 -0.00010414822942696536 -0.20919103589708915 0.0018111998299462848 -0.23471630932791854 0.0037850779195625697 -0.26098575978190436 0.005767994252318623 -0.28793010405487973 0.007721292805104963 -0.3154763528225467 0.009612840617001916 -0.3435513527540495 0.01140180220322817 -0.3720801712238344 0.01306169191187841 -0.40098162890076877 0.014585872668673412 -0.4301724137548205 0.015965450053098573 +0.16062216005138688 -0.0019116859384296324 +0.18447304969305678 -0.00010414822942696189 +0.20919103589708912 0.0018111998299462882 +0.2347163093279185 0.0037850779195625697 +0.2609857597819043 0.005767994252318623 +0.2879301040548797 0.0077212928051049665 +0.3154763528225467 0.009612840617001912 +0.3435513527540495 0.011401802203228166 +0.3720801712238344 0.013061691911878413 +0.40098162890076877 0.014585872668673415 +0.43017241375482046 0.015965450053098577 0.45956758564314243 0.017176158796546315 0.48907887624306057 0.018203209220195856 0.5186142186985037 0.019045669774246796 -0.5480842739405191 0.019692679128510315 -0.5774014050758454 0.020126034694331465 +0.548084273940519 0.01969267912851031 +0.5774014050758454 0.02012603469433146 0.606472936996321 0.0203479659422045 -0.6352058145977492 0.020367710839154268 -0.663516140284651 0.02018184447022914 -0.6913208728728875 0.019789192462857184 -0.718532602213121 0.019204465584986473 -0.7450657390439822 0.018438144671024084 -0.7708387534535277 0.017489652862162995 -0.7957735598729859 0.016373668499296116 -0.8197951103727066 0.015116315620714658 -0.842829246725101 0.013733228234818337 -0.864804842086366 0.012234549893029838 -0.8856650653018601 0.010642232487612875 -0.9053479291051363 0.00897912428425238 -0.9237610916411371 0.007254593880597946 -0.9408006489769835 0.005509950198933564 -0.9564173517796581 0.0038525063781433247 -0.9705843699875024 0.0023993859933530625 -0.982412491201261 0.0012355856711804309 -0.9892977498333237 0.0003270495481592923 -0.9953092162932303 -0.00015341013974953409 +0.6352058145977489 0.020367710839154268 +0.6635161402846507 0.020181844470229134 +0.6913208728728872 0.019789192462857177 +0.7185326022131209 0.019204465584986473 +0.7450657390439822 0.018438144671024073 +0.7708387534535275 0.017489652862162988 +0.7957735598729858 0.016373668499296116 +0.8197951103727065 0.015116315620714657 +0.8428292467251008 0.013733228234818332 +0.8648048420863659 0.012234549893029831 +0.88566506530186 0.010642232487612875 +0.9053479291051362 0.008979124284252377 +0.9237610916411368 0.007254593880597946 +0.9408006489769833 0.0055099501989335645 +0.9564173517796581 0.0038525063781433256 +0.9705843699875024 0.002399385993353062 +0.9824124912012611 0.0012355856711804304 +0.9892977498333237 0.00032704954815929274 +0.9953092162932302 -0.00015341013974953398 1.0 -0.00019966666666666668 diff --git a/regression/scripts/noise_fidelity_one/propeller_noise.py b/regression/scripts/noise_fidelity_one/propeller_noise.py index 320773fe7c..5112ab5e4a 100644 --- a/regression/scripts/noise_fidelity_one/propeller_noise.py +++ b/regression/scripts/noise_fidelity_one/propeller_noise.py @@ -20,7 +20,7 @@ # the analysis functions from F8745_D4_Propeller import F8745_D4_Propeller -from APC_11x4_Propeller import APC_11x4_Propeller +from APC_11x4_Propeller import APC_11x4_Propeller # ---------------------------------------------------------------------- # Main # ---------------------------------------------------------------------- diff --git a/regression/scripts/rotor_design_functions/rotor_design_tests.py b/regression/scripts/rotor_design_functions/rotor_design_tests.py index 9b2762f94a..0a6d49af81 100644 --- a/regression/scripts/rotor_design_functions/rotor_design_tests.py +++ b/regression/scripts/rotor_design_functions/rotor_design_tests.py @@ -170,16 +170,16 @@ def propeller_design_test(): plot_results(output, prop,'red','-','o') # Truth values for propeller with airfoil geometry defined - F_a_truth = 3040.827940585338 + F_a_truth = 3040.8279405853377 Q_a_truth = 888.55038334 P_a_truth = 184073.52335802 Cplast_a_truth = 0.10448797 # Truth values for propeller without airfoil geometry defined - F_truth = 2374.846923311773 - Q_truth = 711.53739878 - P_truth = 147403.22940515 - Cplast_truth = 0.08367235 + F_truth = 2423.475147297527 + Q_truth = 727.12650888 + P_truth = 150632.69447246 + Cplast_truth = 0.08550553 # Store errors error = Data() diff --git a/trunk/SUAVE/Methods/Geometry/Two_Dimensional/Cross_Section/Airfoil/compute_airfoil_properties.py b/trunk/SUAVE/Methods/Geometry/Two_Dimensional/Cross_Section/Airfoil/compute_airfoil_properties.py index 64dbf3953e..d1dce60547 100644 --- a/trunk/SUAVE/Methods/Geometry/Two_Dimensional/Cross_Section/Airfoil/compute_airfoil_properties.py +++ b/trunk/SUAVE/Methods/Geometry/Two_Dimensional/Cross_Section/Airfoil/compute_airfoil_properties.py @@ -290,12 +290,12 @@ def compute_boundary_layer_properties(airfoil_geometry,Airfoil_Data): airfoil_geometry = compute_naca_4series(a_names, npoints= 100) AoA_sweep = np.array([-4,0,2,4,8,10,14])*Units.degrees - Re_sweep = np.array([1,5,10,30,50,75,100])*1E4 + Re_sweep = np.array([1,5,10,30,50,75,100,200])*1E4 AoA_vals = np.tile(AoA_sweep[None,:],(len(Re_sweep) ,1)) Re_vals = np.tile(Re_sweep[:,None],(1, len(AoA_sweep))) # run airfoil analysis - af_res = airfoil_analysis(airfoil_geometry,AoA_vals,Re_vals) + af_res = airfoil_analysis(airfoil_geometry,AoA_vals,Re_vals) # store data Airfoil_Data.aoa_from_polar = np.tile(AoA_sweep[None,:],(len(Re_sweep),1)) diff --git a/trunk/SUAVE/Methods/Noise/Fidelity_One/Propeller/compute_broadband_noise.py b/trunk/SUAVE/Methods/Noise/Fidelity_One/Propeller/compute_broadband_noise.py index b1e3d526dc..b648e79322 100644 --- a/trunk/SUAVE/Methods/Noise/Fidelity_One/Propeller/compute_broadband_noise.py +++ b/trunk/SUAVE/Methods/Noise/Fidelity_One/Propeller/compute_broadband_noise.py @@ -114,154 +114,73 @@ def compute_broadband_noise(freestream,angle_of_attack,bspv, res.SPL_prop_azimuthal_broadband_spectrum = np.zeros_like(res.p_pref_azimuthal_broadband) res.SPL_prop_azimuthal_broadband_spectrum_dBA = np.zeros_like(res.p_pref_azimuthal_broadband) else: + delta = np.zeros((num_cpt,num_mic,num_rot,num_sec,num_azi,num_cf,2)) # control points , number rotors, number blades , number sections , sides of airfoil delta_star = np.zeros_like(delta) dp_dx = np.zeros_like(delta) tau_w = np.zeros_like(delta) Ue = np.zeros_like(delta) Theta = np.zeros_like(delta) - - lower_surface_theta = np.zeros((num_sec,num_azi)) - lower_surface_delta = np.zeros_like(lower_surface_theta) - lower_surface_delta_star = np.zeros_like(lower_surface_theta) - lower_surface_cf = np.zeros_like(lower_surface_theta) - lower_surface_Ue = np.zeros_like(lower_surface_theta) - lower_surface_dp_dx = np.zeros_like(lower_surface_theta) - upper_surface_theta = np.zeros_like(lower_surface_theta) - upper_surface_delta = np.zeros_like(lower_surface_theta) - upper_surface_delta_star = np.zeros_like(lower_surface_theta) - upper_surface_cf = np.zeros_like(lower_surface_theta) - upper_surface_Ue = np.zeros_like(lower_surface_theta) - upper_surface_dp_dx = np.zeros_like(lower_surface_theta) - - if rotor.nonuniform_freestream: - - # return the 1D Cl and CDval of shape (ctrl_pts, Nr) - theta_ls = np.zeros((num_cpt,num_sec,num_azi)) - delta_ls = np.zeros((num_cpt,num_sec,num_azi)) - delta_star_ls = np.zeros((num_cpt,num_sec,num_azi)) - Ue_Vinf_ls = np.zeros((num_cpt,num_sec,num_azi)) - cf_ls = np.zeros((num_cpt,num_sec,num_azi)) - dcp_dx_ls = np.zeros((num_cpt,num_sec,num_azi)) - theta_us = np.zeros((num_cpt,num_sec,num_azi)) - delta_us = np.zeros((num_cpt,num_sec,num_azi)) - delta_star_us = np.zeros((num_cpt,num_sec,num_azi)) - Ue_Vinf_us = np.zeros((num_cpt,num_sec,num_azi)) - cf_us = np.zeros((num_cpt,num_sec,num_azi)) - dcp_dx_us = np.zeros((num_cpt,num_sec,num_azi)) - - for i_azi in range(num_azi): - for jj,airfoil in enumerate(airfoils): - bl = airfoil.polars.boundary_layer - local_aoa = alpha_blade[:,:,i_azi] - local_Re = Re_blade[:,:,i_azi] - - theta_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.theta_lower_surface[:,:,bstei]) - delta_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_lower_surface[:,:,bstei]) - delta_star_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_star_lower_surface[:,:,bstei]) - Ue_Vinf_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.Ue_Vinf_lower_surface[:,:,bstei]) - cf_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.cf_lower_surface[:,:,bstei]) - dcp_dx_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.dcp_dx_lower_surface[:,:,bstei]) - theta_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.theta_upper_surface[:,:,ustei]) - delta_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_upper_surface[:,:,ustei]) - delta_star_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_star_upper_surface[:,:,ustei]) - Ue_Vinf_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.Ue_Vinf_upper_surface[:,:,ustei]) - cf_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.cf_upper_surface[:,:,ustei]) - dcp_dx_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.dcp_dx_upper_surface[:,:,ustei]) - locs = np.where(np.array(a_loc) == jj ) - - theta_ls[:,locs,i_azi] = theta_ls_data[:,locs] - delta_ls[:,locs,i_azi] = delta_ls_data[:,locs] - delta_star_ls[:,locs,i_azi] = delta_star_ls_data[:,locs] - Ue_Vinf_ls[:,locs,i_azi] = Ue_Vinf_ls_data[:,locs] - cf_ls[:,locs,i_azi] = cf_ls_data[:,locs] - dcp_dx_ls[:,locs,i_azi] = dcp_dx_ls_data[:,locs] - theta_us[:,locs,i_azi] = theta_us_data[:,locs] - delta_us[:,locs,i_azi] = delta_us_data[:,locs] - delta_star_us[:,locs,i_azi] = delta_star_us_data[:,locs] - Ue_Vinf_us[:,locs,i_azi] = Ue_Vinf_us_data[:,locs] - cf_us[:,locs,i_azi] = cf_us_data[:,locs] - dcp_dx_us[:,locs,i_azi] = dcp_dx_us_data[:,locs] - - blade_chords_3d = np.tile(np.tile(blade_chords[None,:],(num_cpt,1))[:,:,None],(1,1,num_azi)) - dP_dX_ls = dcp_dx_ls*(0.5*rho_blade*U_blade**2)/blade_chords_3d - dP_dX_us = dcp_dx_us*(0.5*rho_blade*U_blade**2)/blade_chords_3d - - lower_surface_theta = theta_ls - lower_surface_delta = delta_ls - lower_surface_delta_star = delta_star_ls - lower_surface_cf = cf_ls - lower_surface_Ue = Ue_Vinf_ls*U_blade - lower_surface_dp_dx = dP_dX_ls - upper_surface_theta = theta_us - upper_surface_delta = delta_us - upper_surface_delta_star = delta_star_us - upper_surface_cf = cf_us - upper_surface_Ue = Ue_Vinf_us*U_blade - upper_surface_dp_dx = dP_dX_us - - else: - theta_ls = np.zeros((num_cpt,num_sec)) - delta_ls = np.zeros((num_cpt,num_sec)) - delta_star_ls = np.zeros((num_cpt,num_sec)) - Ue_Vinf_ls = np.zeros((num_cpt,num_sec)) - cf_ls = np.zeros((num_cpt,num_sec)) - dcp_dx_ls = np.zeros((num_cpt,num_sec)) - theta_us = np.zeros((num_cpt,num_sec)) - delta_us = np.zeros((num_cpt,num_sec)) - delta_star_us = np.zeros((num_cpt,num_sec)) - Ue_Vinf_us = np.zeros((num_cpt,num_sec)) - cf_us = np.zeros((num_cpt,num_sec)) - dcp_dx_us = np.zeros((num_cpt,num_sec)) - local_aoa = alpha_blade[:,:,0] - local_Re = Re_blade[:,:,0] - - for jj,airfoil in enumerate(airfoils): - bl = airfoil.polars.boundary_layer - theta_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.theta_lower_surface[:,:,bstei]) - delta_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_lower_surface[:,:,bstei]) - delta_star_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_star_lower_surface[:,:,bstei]) - Ue_Vinf_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.Ue_Vinf_lower_surface[:,:,bstei]) - cf_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.cf_lower_surface[:,:,bstei]) - dcp_dx_ls_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.dcp_dx_lower_surface[:,:,bstei]) - theta_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.theta_upper_surface[:,:,ustei]) - delta_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_upper_surface[:,:,ustei]) - delta_star_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_star_upper_surface[:,:,ustei]) - Ue_Vinf_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.Ue_Vinf_upper_surface[:,:,ustei]) - cf_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.cf_upper_surface[:,:,ustei]) - dcp_dx_us_data = interp2d(local_Re,local_aoa,bl.reynolds_numbers, bl.angle_of_attacks, bl.dcp_dx_upper_surface[:,:,ustei]) - - locs = np.where(np.array(a_loc) == jj ) - - theta_ls[:,locs] = theta_ls_data[:,locs] - delta_ls[:,locs] = delta_ls_data[:,locs] - delta_star_ls[:,locs] = delta_star_ls_data[:,locs] - Ue_Vinf_ls[:,locs] = Ue_Vinf_ls_data[:,locs] - cf_ls[:,locs] = cf_ls_data[:,locs] - dcp_dx_ls[:,locs] = dcp_dx_ls_data[:,locs] - theta_us[:,locs] = theta_us_data[:,locs] - delta_us[:,locs] = delta_us_data[:,locs] - delta_star_us[:,locs] = delta_star_us_data[:,locs] - Ue_Vinf_us[:,locs] = Ue_Vinf_us_data[:,locs] - cf_us[:,locs] = cf_us_data[:,locs] - dcp_dx_us[:,locs] = dcp_dx_us_data[:,locs] - - blade_chords_2d = np.tile(blade_chords[None,:],(num_cpt,1)) - dP_dX_ls = dcp_dx_ls*(0.5*rho_blade[:,:,0]*(U_blade[:,:,0]**2))/blade_chords_2d - dP_dX_us = dcp_dx_us*(0.5*rho_blade[:,:,0]*(U_blade[:,:,0]**2))/blade_chords_2d - - lower_surface_theta = np.tile(theta_ls[:,:,None],(1,1,num_azi)) - lower_surface_delta = np.tile((blade_chords_2d*delta_ls)[:,:,None],(1,1,num_azi)) - lower_surface_delta_star = np.tile(delta_star_ls[:,:,None],(1,1,num_azi)) - lower_surface_cf = np.tile(cf_ls[:,:,None],(1,1,num_azi)) - lower_surface_Ue = np.tile(Ue_Vinf_ls[:,:,None],(1,1,num_azi))*U_blade - lower_surface_dp_dx = np.tile(dP_dX_ls[:,:,None],(1,1,num_azi)) - upper_surface_theta = np.tile(theta_us[:,:,None],(1,1,num_azi)) - upper_surface_delta = np.tile((blade_chords_2d*delta_us)[:,:,None],(1,1,num_azi)) - upper_surface_delta_star = np.tile(delta_star_us[:,:,None],(1,1,num_azi)) - upper_surface_cf = np.tile(cf_us[:,:,None],(1,1,num_azi)) - upper_surface_Ue = np.tile(Ue_Vinf_us[:,:,None],(1,1,num_azi))*U_blade - upper_surface_dp_dx = np.tile(dP_dX_us[:,:,None],(1,1,num_azi)) + + # return the 1D Cl and CDval of shape (ctrl_pts, Nr) + lower_surface_theta = np.zeros((num_cpt,num_sec,num_azi)) + lower_surface_delta = np.zeros_like(lower_surface_theta) + lower_surface_delta_star = np.zeros_like(lower_surface_theta) + lower_surface_Ue = np.zeros_like(lower_surface_theta) + lower_surface_cf = np.zeros_like(lower_surface_theta) + lower_surface_dcp_dx = np.zeros_like(lower_surface_theta) + upper_surface_theta = np.zeros_like(lower_surface_theta) + upper_surface_delta = np.zeros_like(lower_surface_theta) + upper_surface_delta_star = np.zeros_like(lower_surface_theta) + upper_surface_Ue = np.zeros_like(lower_surface_theta) + upper_surface_cf = np.zeros_like(lower_surface_theta) + upper_surface_dcp_dx = np.zeros_like(lower_surface_theta) + + aloc = np.atleast_3d(np.array(a_loc)) + aloc = np.broadcast_to(aloc,np.shape(lower_surface_theta)) + + for jj,airfoil in enumerate(airfoils): + lstei = 1 # lower surface trailing edge index + ustei = -lstei # upper surface trailing edge index + bl = airfoil.polars.boundary_layer + theta_ls_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.theta_lower_surface[:,:,bstei]) + delta_ls_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_lower_surface[:,:,bstei]) + delta_star_ls_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_star_lower_surface[:,:,bstei]) + Ue_Vinf_ls_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.Ue_Vinf_lower_surface[:,:,bstei]) + cf_ls_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.cf_lower_surface[:,:,bstei]) + dcp_dx_ls_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.dcp_dx_lower_surface[:,:,bstei]) + theta_us_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.theta_upper_surface[:,:,ustei]) + delta_us_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_upper_surface[:,:,ustei]) + delta_star_us_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.delta_star_upper_surface[:,:,ustei]) + Ue_Vinf_us_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.Ue_Vinf_upper_surface[:,:,ustei]) + cf_us_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.cf_upper_surface[:,:,ustei]) + dcp_dx_us_data = interp2d(Re_blade,alpha_blade,bl.reynolds_numbers, bl.angle_of_attacks, bl.dcp_dx_upper_surface[:,:,ustei]) + + locs = np.where(np.array(a_loc) == jj ) + lower_surface_theta[:,locs,:] = theta_ls_data[:,locs] + lower_surface_delta[:,locs,:] = delta_ls_data[:,locs] + lower_surface_delta_star[:,locs,:] = delta_star_ls_data[:,locs] + lower_surface_Ue[:,locs,:] = Ue_Vinf_ls_data[:,locs] + lower_surface_cf[:,locs,:] = cf_ls_data[:,locs] + lower_surface_dcp_dx[:,locs,:] = dcp_dx_ls_data[:,locs] + upper_surface_theta[:,locs,:] = theta_us_data[:,locs] + upper_surface_delta[:,locs,:] = delta_us_data[:,locs] + upper_surface_delta_star[:,locs,:] = delta_star_us_data[:,locs] + upper_surface_Ue[:,locs,:] = Ue_Vinf_us_data[:,locs] + upper_surface_cf[:,locs,:] = cf_us_data[:,locs] + upper_surface_dcp_dx[:,locs,:] = dcp_dx_us_data[:,locs] + + blade_chords_3d = np.tile(np.tile(blade_chords[None,:],(num_cpt,1))[:,:,None],(1,1,num_azi)) + dP_dX_ls = lower_surface_dcp_dx*(0.5*rho_blade*U_blade**2)/blade_chords_3d + dP_dX_us = upper_surface_dcp_dx*(0.5*rho_blade*U_blade**2)/blade_chords_3d + + lower_surface_delta = lower_surface_delta*blade_chords_3d + upper_surface_delta = upper_surface_delta*blade_chords_3d + lower_surface_Ue = lower_surface_Ue*U_blade + upper_surface_Ue = upper_surface_Ue*U_blade + lower_surface_dp_dx = dP_dX_ls + upper_surface_dp_dx = dP_dX_us + # ------------------------------------------------------------ # ****** TRAILING EDGE BOUNDARY LAYER PROPERTY CALCULATIONS ******