Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Invalid Center of Pressure for Rockets with Variable Diameter #557

Closed
giovaniceotto opened this issue Feb 14, 2024 · 0 comments · Fixed by #558
Closed

BUG: Invalid Center of Pressure for Rockets with Variable Diameter #557

giovaniceotto opened this issue Feb 14, 2024 · 0 comments · Fixed by #558
Assignees
Labels
Aerodynamics Any problem to be worked on top of RocketPy's Aerodynamic Bug Something isn't working

Comments

@giovaniceotto
Copy link
Member

Describe the bug

When setting up a rocket with multiple fuselage sections with different diameters, RocketPy may calculate the wrong value of center of pressure position.

To Reproduce

Here is an example:

from rocketpy import Rocket, NoseCone, Tail, TrapezoidalFins

radius_1 = 0.1
radius_2 = 0.15

multiple_diameter_rocket = Rocket(
    radius=radius_2,
    mass=1,
    inertia=(1, 1, 1),
    power_off_drag=1,
    power_on_drag=1,
    center_of_mass_without_motor=1,
    coordinate_system_orientation="nose_to_tail",
)

nose = NoseCone(
    length=0.5,
    kind="vonKarman",
    base_radius=radius_1,
    rocket_radius=radius_1,
    bluffness=None,
    name="Nose Cone",
)

transition = Tail(
    length=0.1,
    top_radius=radius_1,
    bottom_radius=radius_2,
    rocket_radius=radius_2,
    name="Transition",
)

fins = TrapezoidalFins(
    n=4,
    span=0.2,
    root_chord=0.3,
    tip_chord=0.2,
    name="Fins",
    rocket_radius=radius_2,
)

boat_tail = Tail(
    length=0.1,
    top_radius=radius_2,
    bottom_radius=radius_2/2,
    rocket_radius=radius_2,
    name="Tail",
)

multiple_diameter_rocket.add_surfaces([nose, transition, fins, boat_tail], [0, 1.5, 2.5, 3])

print(multiple_diameter_rocket.static_margin(0))

Expected behavior

The expected static margin for the example above is: 2.71

The returned value is: 1.75

Screenshots

Current result:

image

Expected result:
image

Additional context

This bug was caught by Faraday Rocketry UPV when attempting to simulate a two-stage rocket.

Workaround
The current workaround is to use all rocket_radius values as the largest rocket radius. This causes the following side-effects:

  • Rocket.draw will return a drawing where the fuselage does not meet the nose cone or transitions appropriately.
  • Lift coefficient interference factors between fins and the fuselage will be badly estimated. This, however, should result in negligible differences in the overall lift coefficient and center of pressure position, for most cases.

Here is an example code:

from rocketpy import Rocket, NoseCone, Tail, TrapezoidalFins

radius_1 = 0.1
radius_2 = 0.15

multiple_diameter_rocket = Rocket(
    radius=radius_2,
    mass=1,
    inertia=(1, 1, 1),
    power_off_drag=1,
    power_on_drag=1,
    center_of_mass_without_motor=1,
    coordinate_system_orientation="nose_to_tail",
)

nose = NoseCone(
    length=0.5,
    kind="vonKarman",
    base_radius=radius_1,
    rocket_radius=radius_1,
    bluffness=None,
    name="Nose Cone",
)

transition = Tail(
    length=0.1,
    top_radius=radius_1,
    bottom_radius=radius_2,
    rocket_radius=radius_2,
    name="Transition",
)

fins = TrapezoidalFins(
    n=4,
    span=0.2,
    root_chord=0.3,
    tip_chord=0.2,
    name="Fins",
    rocket_radius=radius_2,
)

boat_tail = Tail(
    length=0.1,
    top_radius=radius_2,
    bottom_radius=radius_2/2,
    rocket_radius=radius_2,
    name="Tail",
)

multiple_diameter_rocket.add_surfaces([nose, transition, fins, boat_tail], [0, 1.5, 2.5, 3])

print(multiple_diameter_rocket.static_margin(0))

Results in a static margin of: 2.71.

The rocket drawing ends up like this:

image

@giovaniceotto giovaniceotto self-assigned this Feb 14, 2024
@Gui-FernandesBR Gui-FernandesBR changed the title Invalid Center of Pressure for Rockets with Variable Diameter BUG: Invalid Center of Pressure for Rockets with Variable Diameter Feb 14, 2024
@Gui-FernandesBR Gui-FernandesBR added Bug Something isn't working Aerodynamics Any problem to be worked on top of RocketPy's Aerodynamic labels Feb 14, 2024
@Gui-FernandesBR Gui-FernandesBR moved this from Backlog to HotFix in LibDev Roadmap Feb 14, 2024
@Gui-FernandesBR Gui-FernandesBR added this to the Release v1.X.0 milestone Feb 14, 2024
Gui-FernandesBR added a commit that referenced this issue Feb 22, 2024
BUG: Add reference area factor correction to aero surfaces (solves #557)
@github-project-automation github-project-automation bot moved this from HotFix to Closed in LibDev Roadmap Feb 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Aerodynamics Any problem to be worked on top of RocketPy's Aerodynamic Bug Something isn't working
Projects
Status: Closed
Development

Successfully merging a pull request may close this issue.

2 participants