@@ -2015,21 +2015,58 @@ def u_dot_parachute(self, t, u, post_processing=False):
20152015 # tf = 8 * nominal diameter / velocity at line stretch
20162016
20172017 # Calculate added mass
2018- ma = (
2019- self .parachute_added_mass_coefficient
2020- * rho
2021- * (2 / 3 )
2022- * np .pi
2023- * self .parachute_radius ** 2
2024- * self .parachute_height
2025- )
2018+ # ma = (
2019+ # self.parachute_added_mass_coefficient
2020+ # * rho
2021+ # * (2 / 3)
2022+ # * np.pi
2023+ # * self.parachute_radius**2
2024+ # * self.parachute_height
2025+ # )
20262026
20272027 # Calculate freestream speed
20282028 freestream_x = vx - wind_velocity_x
20292029 freestream_y = vy - wind_velocity_y
20302030 freestream_z = vz
20312031 free_stream_speed = (freestream_x ** 2 + freestream_y ** 2 + freestream_z ** 2 ) ** 0.5
20322032
2033+ # Initialize parachute state parameters if necessary (wouldn't work for more than one parachute)
2034+ self .parachute_inflated_radius = getattr (
2035+ self , "parachute_inflated_radius" , self .rocket .radius
2036+ )
2037+ self .volume = getattr (self , "volume" , 0 )
2038+
2039+ radius = self .parachute_radius
2040+ height = self .parachute_height
2041+ inflated_radius = self .parachute_inflated_radius
2042+ inflated_height = inflated_radius * height / radius
2043+
2044+ # Calculate the surface area of the parachute
2045+ if radius > height :
2046+ e = math .sqrt (1 - (inflated_height ** 2 ) / (inflated_radius ** 2 ))
2047+ surface_area = math .pi * inflated_radius ** 2 * (1 + (1 - e ^ 2 ) / e * math .atanh (e ))
2048+ else :
2049+ e = math .sqrt (1 - (inflated_radius ** 2 ) / (inflated_height ** 2 ))
2050+ surface_area = (
2051+ math .pi * inflated_radius ** 2 * (1 + inflated_height / (e * inflated_radius ) * math .asin (e ))
2052+ )
2053+
2054+ volume_flow = (
2055+ rho
2056+ * freestream_z # considering parachute as vertical
2057+ * (
2058+ (math .pi * inflated_radius ** 2 )
2059+ - (self .parachute_porosity * surface_area )
2060+ )
2061+ )
2062+ self .volume += volume_flow # * time_step
2063+ self .inflated_radius = ((3 * self .volume * radius ) / (4 * math .pi * height )) ** (
2064+ 1 / 3
2065+ )
2066+
2067+ # Dragged air mass
2068+ ma = self .volume * rho
2069+
20332070 # Determine drag force
20342071 pseudo_drag = - 0.5 * rho * self .parachute_cd_s * free_stream_speed
20352072 # pseudo_drag = pseudo_drag - ka * rho * 4 * np.pi * (R**2) * Rdot
0 commit comments