|
1 | 1 | import aerosandbox.numpy as np |
2 | 2 | from typing import Literal |
| 3 | +import warnings |
3 | 4 |
|
4 | 5 |
|
5 | 6 | def Cd_cylinder( |
@@ -196,9 +197,6 @@ def Cd_flat_plate_normal(): |
196 | 197 | return 2.202 |
197 | 198 |
|
198 | 199 |
|
199 | | -import warnings |
200 | | - |
201 | | - |
202 | 200 | def Cl_2412(alpha, Re_c): |
203 | 201 | # A curve fit I did to a NACA 2412 airfoil, 2D XFoil data |
204 | 202 | # Within -2 < alpha < 12 and 10^5 < Re_c < 10^7, has R^2 = 0.9892 |
@@ -337,25 +335,19 @@ def Cd_wave_e216(Cl, mach, sweep=0.0): |
337 | 335 | mach = np.fmax(mach, 0) |
338 | 336 | mach_perpendicular = mach * np.cosd(sweep) # Relation from FVA Eq. 8.176 |
339 | 337 | Cl_perpendicular = Cl / np.cosd(sweep) ** 2 # Relation from FVA Eq. 8.177 |
340 | | - |
341 | | - # Coeffs |
342 | | - c0 = 7.2685945744797997e-01 |
343 | | - c1 = -1.5483144040727698e-01 |
344 | | - c3 = 2.1305118052118968e-01 |
345 | | - c4 = 7.8812272501525316e-01 |
346 | | - c5 = 3.3888938102072169e-03 |
347 | | - l0 = 1.5298928303149546e00 |
348 | | - l1 = 5.2389999717540392e-01 |
349 | | - |
350 | | - m = mach_perpendicular |
351 | | - l = Cl_perpendicular |
352 | | - |
353 | | - Cd_wave = ( |
354 | | - np.fmax(m - (c0 + c1 * np.sqrt(c3 + (l - c4) ** 2) + c5 * l), 0) * (l0 + l1 * l) |
| 338 | + return ( |
| 339 | + np.fmax( |
| 340 | + mach_perpendicular |
| 341 | + - ( |
| 342 | + 7.2685945744797997e-01 |
| 343 | + + -1.5483144040727698e-01 * np.sqrt(2.1305118052118968e-01 + (Cl_perpendicular - 7.8812272501525316e-01) ** 2) |
| 344 | + + 3.3888938102072169e-03 * Cl_perpendicular |
| 345 | + ), |
| 346 | + 0 |
| 347 | + ) |
| 348 | + * (1.5298928303149546e00 + 5.2389999717540392e-01 * Cl_perpendicular) |
355 | 349 | ) ** 2 |
356 | 350 |
|
357 | | - return Cd_wave |
358 | | - |
359 | 351 |
|
360 | 352 | def Cl_rae2822(alpha, Re_c): |
361 | 353 | # A curve fit I did to a RAE2822 airfoil, 2D XFoil data. Incompressible flow. |
@@ -451,20 +443,14 @@ def Cd_wave_rae2822(Cl, mach, sweep=0.0): |
451 | 443 | mach = np.fmax(mach, 0) |
452 | 444 | mach_perpendicular = mach * np.cosd(sweep) # Relation from FVA Eq. 8.176 |
453 | 445 | Cl_perpendicular = Cl / np.cosd(sweep) ** 2 # Relation from FVA Eq. 8.177 |
454 | | - |
455 | | - # Coeffs |
456 | | - c2 = 4.5776476424519119e00 |
457 | | - mc0 = 9.5623337929607111e-01 |
458 | | - mc1 = 2.0552787101770234e-01 |
459 | | - mc2 = 1.1259268018737063e00 |
460 | | - mc3 = 1.9538856688443659e-01 |
461 | | - |
462 | | - m = mach_perpendicular |
463 | | - l = Cl_perpendicular |
464 | | - |
465 | | - Cd_wave = np.fmax(m - (mc0 - mc1 * np.sqrt(mc2 + (l - mc3) ** 2)), 0) ** 2 * c2 |
466 | | - |
467 | | - return Cd_wave |
| 446 | + return np.fmax( |
| 447 | + mach_perpendicular |
| 448 | + - ( |
| 449 | + 9.5623337929607111e-01 |
| 450 | + - 2.0552787101770234e-01 * np.sqrt(1.1259268018737063e00 + (Cl_perpendicular - 1.9538856688443659e-01) ** 2) |
| 451 | + ), |
| 452 | + 0 |
| 453 | + ) ** 2 * 4.5776476424519119e00 |
468 | 454 |
|
469 | 455 |
|
470 | 456 | def fuselage_upsweep_drag_area( |
|
0 commit comments