Skip to content

Commit

Permalink
adds more forceful deprecationwarning
Browse files Browse the repository at this point in the history
  • Loading branch information
peterdsharpe committed Mar 30, 2024
1 parent efd7e46 commit 64e69b9
Showing 1 changed file with 1 addition and 13 deletions.
14 changes: 1 addition & 13 deletions aerosandbox/geometry/airfoil/default_airfoil_aerodynamics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,18 @@
import warnings
from aerosandbox.library.aerodynamics.viscous import Cf_flat_plate


warnings.warn(
"This file is deprecated.\n"
"This file is deprecated and will be removed in the subsequent version of ASB.\n"
"You can use `asb.Airfoil.get_aero_from_neuralfoil()` instead\n"
"to get airfoil aerodynamics for any airfoil.",
DeprecationWarning
)

def print_default_warning():
warnings.warn("\n".join([
"Warning: Using a placeholder aerodynamics model for this Airfoil!",
"It's highly recommended that you either:",
"\ta) Specify polar functions in the Airfoil constructor, or",
"\tb) Call Airfoil.generate_polars() to auto-generate these polar functions with XFoil."
]), stacklevel=3)


def default_CL_function(alpha, Re, mach=0, deflection=0):
"""
Lift coefficient.
"""
print_default_warning()
Cl_inc = np.pi * np.sind(2 * alpha)
beta = (1 - mach) ** 2

Expand All @@ -35,7 +25,6 @@ def default_CD_function(alpha, Re, mach=0, deflection=0):
"""
Drag coefficient.
"""
print_default_warning()
Cf = Cf_flat_plate(Re_L=Re, method="hybrid-sharpe-convex")

### Form factor model from Raymer, "Aircraft Design". Section 12.5, Eq. 12.30
Expand All @@ -55,5 +44,4 @@ def default_CM_function(alpha, Re, mach=0, deflection=0):
"""
Pitching moment coefficient, as measured about quarter-chord.
"""
print_default_warning()
return np.zeros_like(alpha)

0 comments on commit 64e69b9

Please sign in to comment.