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