Skip to content

Commit

Permalink
lower default spanwise resolution (10 is overkill) and add first test…
Browse files Browse the repository at this point in the history
…s on a possible corrector heuristic
  • Loading branch information
peterdsharpe committed Oct 6, 2023
1 parent 12f5c13 commit b32296a
Showing 1 changed file with 48 additions and 3 deletions.
51 changes: 48 additions & 3 deletions aerosandbox/aerodynamics/aero_3D/lifting_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self,
model_size: str = "medium",
run_symmetric_if_possible: bool = False,
verbose: bool = False,
spanwise_resolution: int = 10,
spanwise_resolution: int = 4,
spanwise_spacing_function: Callable[[float, float, float], np.ndarray] = np.cosspace,
vortex_core_radius: float = 1e-8,
align_trailing_vortices_with_wind: bool = False,
Expand Down Expand Up @@ -1225,7 +1225,7 @@ def draw(self,
airfoil=asb.Airfoil("naca0012")
),
]
).subdivide_sections(20)
)
]
)

Expand All @@ -1237,9 +1237,54 @@ def draw(self,
beta=0,
),
xyz_ref=[0.25, 0, 0],
spanwise_resolution=1,
spanwise_resolution=5,
)

aero = ll.run()

print(aero["CL"])
print(aero["CL"] / aero["CD"])


@np.vectorize
def get_aero(resolution):
return LiftingLine(
airplane=airplane,
op_point=OperatingPoint(
velocity=100,
alpha=5,
beta=0,
),
xyz_ref=[0.25, 0, 0],
spanwise_resolution=resolution,
).run()

resolutions = 1 + np.arange(20)
aeros = get_aero(resolutions)

import matplotlib.pyplot as plt
import aerosandbox.tools.pretty_plots as p

fig, ax = plt.subplots(3, 1)
ax[0].semilogx(
resolutions,
[aero["CL"] for aero in aeros]
)
ax[0].plot(
resolutions,
np.array([aero["CL"] for aero in aeros]) * (resolutions) / (resolutions + 0.3),
# np.array([aero["CL"] for aero in aeros]) * (resolutions) / (resolutions + 0.3),
)
ax[1].plot(
resolutions,
[aero["CD"] for aero in aeros]
)
ax[1].plot(
resolutions,
np.array([aero["CD"] for aero in aeros]) * (resolutions + 0.2) / (resolutions),
)
ax[2].plot(
resolutions,
[aero["CL"] / aero["CD"] for aero in aeros]
)
p.show_plot()

0 comments on commit b32296a

Please sign in to comment.