diff --git a/rocketpy/rocket/aero_surface.py b/rocketpy/rocket/aero_surface.py index 2e71c3210..0a371fd78 100644 --- a/rocketpy/rocket/aero_surface.py +++ b/rocketpy/rocket/aero_surface.py @@ -34,6 +34,30 @@ def __init__(self, name): self.name = name return None + # Defines beta parameter + def _beta(_, mach): + """Defines a parameter that is often used in aerodynamic + equations. It is commonly used in the Prandtl factor which + corrects subsonic force coefficients for compressible flow. + + Parameters + ---------- + mach : int, float + Number of mach. + + Returns + ------- + beta : int, float + Value that characterizes flow speed based on the mach number. + """ + + if mach < 0.8: + return np.sqrt(1 - mach**2) + elif mach < 1.1: + return np.sqrt(1 - 0.8**2) + else: + return np.sqrt(mach**2 - 1) + @abstractmethod def evaluate_center_of_pressure(self): """Evaluates the center of pressure of the aerodynamic surface in local @@ -465,7 +489,7 @@ def evaluate_lift_coefficient(self): # It must be set as a Function because it will be called and treated # as a function of mach in the simulation. self.clalpha = Function( - lambda mach: 2 * self.radius_ratio**2, + lambda mach: 2 / self._beta(mach) * self.radius_ratio**2, "Mach", f"Lift coefficient derivative for {self.name}", ) @@ -781,7 +805,7 @@ def evaluate_lift_coefficient(self): clalpha2D_incompressible *= 180 / np.pi # Correcting for compressible flow (apply Prandtl-Glauert correction) - clalpha2D = Function(lambda mach: clalpha2D_incompressible / self.__beta(mach)) + 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)) @@ -857,30 +881,6 @@ def evaluate_roll_parameters(self): self.roll_parameters = [clf_delta, cld_omega, self.cant_angle_rad] return self.roll_parameters - # Defines beta parameter - def __beta(_, mach): - """Defines a parameter that is often used in aerodynamic - equations. It is commonly used in the Prandtl factor which - corrects subsonic force coefficients for compressible flow. - - Parameters - ---------- - mach : int, float - Number of mach. - - Returns - ------- - beta : int, float - Value that characterizes flow speed based on the mach number. - """ - - if mach < 0.8: - return np.sqrt(1 - mach**2) - elif mach < 1.1: - return np.sqrt(1 - 0.8**2) - else: - return np.sqrt(mach**2 - 1) - # Defines number of fins factor def __fin_num_correction(_, n): """Calculates a correction factor for the lift coefficient of multiple @@ -1748,6 +1748,7 @@ def evaluate_lift_coefficient(self): # as a function of mach in the simulation. self.clalpha = Function( lambda mach: 2 + / self._beta(mach) * ( (self.bottom_radius / self.rocket_radius) ** 2 - (self.top_radius / self.rocket_radius) ** 2