Skip to content

Commit 159cce8

Browse files
committed
ENH: implementing previous comments
1 parent 4fcb406 commit 159cce8

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

rocketpy/rocket/parachute.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,7 @@ def __init__(
194194
self.noisy_pressure_signal_function = Function(0)
195195
self.noise_signal_function = Function(0)
196196
self.parachute_radius = parachute_radius
197-
if parachute_height is None:
198-
parachute_height = parachute_radius
199-
self.parachute_height = parachute_height
197+
self.parachute_height = parachute_height or parachute_radius
200198
self.porosity = porosity
201199

202200
alpha, beta = self.noise_corr

rocketpy/simulation/flight.py

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1992,18 +1992,12 @@ def u_dot_parachute(self, t, u, post_processing=False):
19921992
wind_velocity_x = self.env.wind_velocity_x.get_value_opt(z)
19931993
wind_velocity_y = self.env.wind_velocity_y.get_value_opt(z)
19941994

1995-
# Get Parachute data
1996-
cd_s = self.parachute_cd_s
1997-
parachute_radius = self.parachute_radius
1998-
parachute_height = self.parachute_height
1999-
porosity = self.parachute_porosity
2000-
20011995
# Get the mass of the rocket
20021996
mp = self.rocket.dry_mass
20031997

20041998
# Define constants
20051999
ka = 1.068 * (
2006-
1 - 1.465 * porosity - 0.25975 * porosity**2 + 1.2626 * porosity**3
2000+
1 - 1.465 * self.parachute_porosity - 0.25975 * self.parachute_porosity**2 + 1.2626 * self.parachute_porosity**3
20072001
)
20082002
# to = 1.2
20092003
# eta = 1
@@ -2015,7 +2009,7 @@ def u_dot_parachute(self, t, u, post_processing=False):
20152009
# tf = 8 * nominal diameter / velocity at line stretch
20162010

20172011
# Calculate added mass
2018-
ma = ka * rho * (4 / 3) * np.pi * parachute_radius**2 * parachute_height
2012+
ma = ka * rho * (4 / 3) * np.pi * self.parachute_radius**2 * self.parachute_height
20192013

20202014
# Calculate freestream speed
20212015
freestream_x = vx - wind_velocity_x
@@ -2024,7 +2018,7 @@ def u_dot_parachute(self, t, u, post_processing=False):
20242018
free_stream_speed = (freestream_x**2 + freestream_y**2 + freestream_z**2) ** 0.5
20252019

20262020
# Determine drag force
2027-
pseudo_drag = -0.5 * rho * cd_s * free_stream_speed
2021+
pseudo_drag = -0.5 * rho * self.parachute_cd_s * free_stream_speed
20282022
# pseudo_drag = pseudo_drag - ka * rho * 4 * np.pi * (R**2) * Rdot
20292023
Dx = pseudo_drag * freestream_x # add eta efficiency for wake
20302024
Dy = pseudo_drag * freestream_y

0 commit comments

Comments
 (0)