Skip to content
Open
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
1 change: 0 additions & 1 deletion rocketpy/rocket/parachute.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ def __init__(
- 0.25975 * self.porosity**2
+ 1.2626 * self.porosity**3
)

alpha, beta = self.noise_corr
self.noise_function = lambda: alpha * self.noise_signal[-1][
1
Expand Down
60 changes: 49 additions & 11 deletions rocketpy/simulation/flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -763,10 +763,12 @@ def __simulate(self, verbose):
lambda self, parachute_cd_s=parachute.cd_s: setattr(
self, "parachute_cd_s", parachute_cd_s
),
lambda self, parachute_radius=parachute.radius: setattr(
lambda self,
parachute_radius=parachute.radius: setattr(
self, "parachute_radius", parachute_radius
),
lambda self, parachute_height=parachute.height: setattr(
lambda self,
parachute_height=parachute.height: setattr(
self, "parachute_height", parachute_height
),
lambda self, parachute_porosity=parachute.porosity: setattr(
Expand Down Expand Up @@ -2003,7 +2005,6 @@ def u_dot_parachute(self, t, u, post_processing=False):

# Get the mass of the rocket
mp = self.rocket.dry_mass

# to = 1.2
# eta = 1
# Rdot = (6 * R * (1 - eta) / (1.2**6)) * (
Expand All @@ -2014,21 +2015,58 @@ def u_dot_parachute(self, t, u, post_processing=False):
# tf = 8 * nominal diameter / velocity at line stretch

# Calculate added mass
ma = (
self.parachute_added_mass_coefficient
* rho
* (2 / 3)
* np.pi
* self.parachute_radius**2
* self.parachute_height
)
# ma = (
# self.parachute_added_mass_coefficient
# * rho
# * (2 / 3)
# * np.pi
# * self.parachute_radius**2
# * self.parachute_height
# )

# Calculate freestream speed
freestream_x = vx - wind_velocity_x
freestream_y = vy - wind_velocity_y
freestream_z = vz
free_stream_speed = (freestream_x**2 + freestream_y**2 + freestream_z**2) ** 0.5

# Initialize parachute state parameters if necessary (wouldn't work for more than one parachute)
self.parachute_inflated_radius = getattr(
self, "parachute_inflated_radius", self.rocket.radius
)
self.volume = getattr(self, "volume", 0)

radius = self.parachute_radius
height = self.parachute_height
inflated_radius = self.parachute_inflated_radius
inflated_height = inflated_radius * height / radius

# Calculate the surface area of the parachute
if radius > height:
e = math.sqrt(1 - (inflated_height**2) / (inflated_radius**2))
surface_area = math.pi * inflated_radius**2 * (1 + (1 - e**2) / e * math.atanh(e))
else:
e = math.sqrt(1 - (inflated_radius**2) / (inflated_height**2))
surface_area = (
math.pi * inflated_radius**2 * (1 + inflated_height / (e * inflated_radius) * math.asin(e))
)

volume_flow = (
rho
* freestream_z # considering parachute as vertical
* (
(math.pi * inflated_radius**2)
- (self.parachute_porosity * surface_area)
)
)
self.volume += volume_flow # * time_step
self.inflated_radius = ((3 * self.volume * radius) / (4 * math.pi * height)) ** (
1 / 3
)

# Dragged air mass
ma = self.volume * rho

# Determine drag force
pseudo_drag = -0.5 * rho * self.parachute_cd_s * free_stream_speed
# pseudo_drag = pseudo_drag - ka * rho * 4 * np.pi * (R**2) * Rdot
Expand Down
Loading