Skip to content

Commit

Permalink
Merge pull request #685 from RocketPy-Team/bug/prandtl-glauert-rollback
Browse files Browse the repository at this point in the history
BUG: Rollback Prandtl-Glauert corrections for Tail and Nose.
  • Loading branch information
phmbressan authored Sep 11, 2024
2 parents 9c0b3e7 + 4de4c95 commit c062212
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Attention: The newest changes should be on top -->

### Fixed


- BUG: Rollback Prandtl-Glauert corrections for Tail and Nose. [#685](https://github.com/RocketPy-Team/RocketPy/pull/685)

## [v1.4.2] - 2024-08-03

Expand Down
2 changes: 1 addition & 1 deletion rocketpy/rocket/aero_surface/nose_cone.py
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,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._beta(mach) * self.radius_ratio**2,
lambda mach: 2 * self.radius_ratio**2,
"Mach",
f"Lift coefficient derivative for {self.name}",
)
Expand Down
1 change: 0 additions & 1 deletion rocketpy/rocket/aero_surface/tail.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ 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
Expand Down
37 changes: 20 additions & 17 deletions tests/unit/test_flight.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,9 @@ def test_out_of_rail_stability_margin(flight_calisto_custom_wind):
@pytest.mark.parametrize(
"flight_time, expected_values",
[
("t_initial", (0.17179073815516033, -0.431117, 0)),
("out_of_rail_time", (0.543760, -1.364593, 0)),
("apogee_time", (-0.5874848151271623, -0.7563596, 0)),
("t_initial", (0.171780, -0.431091, 0)),
("out_of_rail_time", (0.546945, -1.372586, 0)),
("apogee_time", (-0.587317, -0.756234, 0)),
("t_final", (0, 0, 0)),
],
)
Expand Down Expand Up @@ -206,10 +206,10 @@ def test_aerodynamic_moments(flight_calisto_custom_wind, flight_time, expected_v
@pytest.mark.parametrize(
"flight_time, expected_values",
[
("t_initial", (1.6542528, 0.65918, -0.067107)),
("out_of_rail_time", (5.05334, 2.01364, -1.7541)),
("apogee_time", (2.366258, -1.830744, -0.875342)),
("t_final", (0, 0, 159.2212)),
("t_initial", (1.654150, 0.659142, -0.067103)),
("out_of_rail_time", (5.052628, 2.01336, -1.75370)),
("apogee_time", (2.352518, -1.826998, -0.878729)),
("t_final", (0, 0, 159.2210)),
],
)
def test_aerodynamic_forces(flight_calisto_custom_wind, flight_time, expected_values):
Expand Down Expand Up @@ -246,9 +246,12 @@ def test_aerodynamic_forces(flight_calisto_custom_wind, flight_time, expected_va
"flight_time, expected_values",
[
("t_initial", (0, 0, 0)),
("out_of_rail_time", (0, 2.248727, 25.703072)),
("apogee_time", (-13.204789, 15.990903, -0.000138)),
("t_final", (5, 2, -5.65998)),
("out_of_rail_time", (0, 2.248540, 25.700928)),
(
"apogee_time",
(-13.214438, 16.052063, -0.000421),
),
("t_final", (5, 2, -5.66015)),
],
)
def test_velocities(flight_calisto_custom_wind, flight_time, expected_values):
Expand Down Expand Up @@ -284,9 +287,9 @@ def test_velocities(flight_calisto_custom_wind, flight_time, expected_values):
"flight_time, expected_values",
[
("t_initial", (0, 0, 0)),
("out_of_rail_time", (0, 7.8068, 89.2325)),
("apogee_time", (0.07534, -0.058127, -9.614386)),
("t_final", (0, 0, 0.0017346294117130806)),
("out_of_rail_time", (0, 7.8067, 89.2315)),
("apogee_time", (0.07532, -0.0581194, -9.614827)),
("t_final", (0, 0, 0.0019548)),
],
)
def test_accelerations(flight_calisto_custom_wind, flight_time, expected_values):
Expand Down Expand Up @@ -334,10 +337,10 @@ def test_rail_buttons_forces(flight_calisto_custom_wind):
"""
test = flight_calisto_custom_wind
atol = 5e-3
assert pytest.approx(3.833613, abs=atol) == test.max_rail_button1_normal_force
assert pytest.approx(1.648938, abs=atol) == test.max_rail_button1_shear_force
assert pytest.approx(1.165307, abs=atol) == test.max_rail_button2_normal_force
assert pytest.approx(0.501229, abs=atol) == test.max_rail_button2_shear_force
assert pytest.approx(3.803078, abs=atol) == test.max_rail_button1_normal_force
assert pytest.approx(1.635804, abs=atol) == test.max_rail_button1_shear_force
assert pytest.approx(1.193331, abs=atol) == test.max_rail_button2_normal_force
assert pytest.approx(0.513283, abs=atol) == test.max_rail_button2_shear_force


def test_max_values(flight_calisto_robust):
Expand Down

0 comments on commit c062212

Please sign in to comment.