Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions rocketpy/AeroSurface.py
Original file line number Diff line number Diff line change
Expand Up @@ -566,24 +566,24 @@ def evaluate_lift_coefficient(self):
"""
if not self.airfoil:
# Defines clalpha2D as 2*pi for planar fins
clalpha2D = Function(lambda mach: 2 * np.pi / self.__beta(mach))
clalpha2D_incompressible = 2 * np.pi
else:
# Defines clalpha2D as the derivative of the
# lift coefficient curve for a specific airfoil
# Defines clalpha2D as the derivative of the lift coefficient curve
# for the specific airfoil
self.airfoil_cl = Function(
self.airfoil[0],
interpolation="linear",
)

# Differentiating at x = 0 to get cl_alpha
clalpha2D_mach0 = self.airfoil_cl.differentiate(x=1e-3, dx=1e-3)
# Differentiating at alpha = 0 to get cl_alpha
clalpha2D_incompressible = self.airfoil_cl.differentiate(x=1e-3, dx=1e-3)

# Convert to radians if needed
if self.airfoil[1] == "degrees":
clalpha2D_mach0 *= 180 / np.pi
clalpha2D_incompressible *= 180 / np.pi

# Correcting for compressible flow
clalpha2D = Function(lambda mach: clalpha2D_mach0 / self.__beta(mach))
# Correcting for compressible flow (apply Prandtl-Glauert correction)
clalpha2D = Function(lambda mach: clalpha2D_incompressible / self.__beta(mach))

# Diederich's Planform Correlation Parameter
FD = 2 * np.pi * self.AR / (clalpha2D * np.cos(self.gamma_c))
Expand Down
9 changes: 6 additions & 3 deletions rocketpy/plots/aero_surface_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,9 @@ def airfoil(self):
None
"""

if self.aero_surface.airfoil: # TODO: see issue #144
self.aero_surface.airfoil_cl.plot1D()
if self.aero_surface.airfoil:
print("Airfoil lift curve:")
self.aero_surface.airfoil_cl.plot1D(force_data=True)
return None

def roll(self):
Expand All @@ -122,7 +123,8 @@ def roll(self):
-------
None
"""
# lacks a title in the plots
print("Roll parameters:")
# TODO: lacks a title in the plots
self.aero_surface.roll_parameters[0]()
self.aero_surface.roll_parameters[1]()
return None
Expand All @@ -138,6 +140,7 @@ class for more information on how this plot is made. Also, this method
-------
None
"""
print("Lift coefficient:")
self.aero_surface.cl()
self.aero_surface.clalpha_single_fin()
self.aero_surface.clalpha_multiple_fins()
Expand Down
9 changes: 7 additions & 2 deletions rocketpy/prints/aero_surface_prints.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,12 @@ def airfoil(self):
if self.aero_surface.airfoil:
print(f"Airfoil information:")
print(f"--------------------")
print(f"Hey, this will be implemented later!\n") # TODO: issue #144
print(
f"Number of points defining the lift curve: {len(self.aero_surface.airfoil_cl.x_array)}"
)
print(
f"Lift coefficient derivative at Mach 0 and AoA 0: {self.aero_surface.clalpha(0):.5f} 1/rad\n"
)
return None

def roll(self):
Expand All @@ -166,7 +171,7 @@ def roll(self):
f"Damping interference factor: {self.aero_surface.roll_damping_interference_factor:.3f} rad"
)
print(
"Forcing interference factor: {self.aero_surface.rollForcingInterferenceFactor:.3f} rad\n"
f"Forcing interference factor: {self.aero_surface.roll_forcing_interference_factor:.3f} rad\n"
)
return None

Expand Down