Skip to content

Conversation

@MateusStano
Copy link
Member

@MateusStano MateusStano commented Jan 4, 2022

Pull request type

Please check the type of change your PR introduces:

  • Code base additions (bugfix, features)
  • Code maintenance (refactoring, formatting, renaming, tests)
  • ReadMe, Docs and GitHub maintenance
  • Other (please describe):

Pull request checklist

Please check if your PR fulfills the following requirements, depending on the type of PR:

  • ReadMe, Docs and GitHub maintenance:

    • Spelling has been verified
    • Code docs are working correctly
  • Code base maintenance (refactoring, formatting, renaming):

    • Docs have been reviewed and added / updated if needed
    • Lint (black rocketpy) has passed locally and any fixes were made
    • All tests (pytest --runslow) have passed locally
  • Code base additions (for bug fixes / features):

    • Tests for the changes have been added
    • Docs have been reviewed and added / updated if needed
    • Lint (black rocketpy) has passed locally and any fixes were made
    • All tests (pytest --runslow) have passed locally

What is the current behavior?

The current calculation of the normal force coefficient derivative for airfoil fins assumes that the term where the derivative of the lift coefficient is multiplied by alpha is a constant value. However, for curves that are not linear that simplification does not apply due to another intermediate derivative term.

What is the new behavior?

The calculations now use a generic formula of the lift coefficient derivative based on thin airfoil theory, which is more in the lines of what Barrowman showed in his paper. This calculation works for any fin shape, with airfoil or not. It is not as exact as the formula that is currently used for trapezoidal fins but is a good approximation.

Does this introduce a breaking change?

  • Yes
  • No

Other information

Since the new calculation of the lift coefficient derivative takes into account the number of Mach I had to change a bit more of the code than just what relates to the fins. The changes are nothing major but they can be useful when adding supersonic calculations. I also made a pdf with more in-depth documentation.

@MateusStano MateusStano requested a review from a team January 4, 2022 18:25
@Gui-FernandesBR
Copy link
Member

A masterpiece!!!!!!!!!!!!!!!!!!!!!!!!! @MateusStano thanks for showing up... Great contribution

" It is not as exact as the formula that is currently used for trapezoidal fins but is a good approximation."

  • Do you have the equations with you? Could you share with us (if it is of easy access)?

@MateusStano
Copy link
Member Author

MateusStano commented Jan 5, 2022

  • Do you have the equations with you? Could you share with us (if it is of easy access)?

The equations are documented here: docs/technical/aerodynamics/Fins_Lift_Coefficient.pdf

I wrote it as an explanation/documentation. I don't know if its any good but everything I used should be in there

@Gui-FernandesBR
Copy link
Member

Gui-FernandesBR commented Jan 5, 2022

Great Stano, really appreciate your expertise writing this document, it will definetely help a lot!

I think the best candidates to revivew the calculations here are @Lucas-KB and @lucasfourier , as they were working on aerodynamic. Perhaps in the next week they will be able to review and merge.

Otherwise, I hope @giovaniceotto could hep earlier, or evene @brunosorban .
Bruno, would u give us the honor?

Copy link
Member

@giovaniceotto giovaniceotto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MateusStano, incredible work! I still need to understand the equations a little bit better before I can fully review your code, but for now, here is a suggestion:

  • When defining a Function object based on a callable (i.e. a python function or a lambda), it does not make sence to set interpolation and extrapolation methods. Example:

This:

cldata = Function(
    lambda x, mach: clalpha * x,
    ["Alpha (rad)", "Mach"],
    "Cl",
    interpolation="linear",
    extrapolation="natural",
)

Can be replaced by:

cldata = Function(
    source=lambda alpha, mach: clalpha * alpha,
    inputs=["Alpha (rad)", "Mach"],
    outputs="Cl",
)

One question: how different are equations 6 and 15 of the theory you submitted? In termos of relative change, what's the percentage difference for a typical fin?

@MateusStano
Copy link
Member Author

  • it does not make sence to set interpolation and extrapolation methods.

Ah good to know! Will change that right now

One question: how different are equations 6 and 15 of the theory you submitted? In termos of relative change, what's the percentage difference for a typical fin?

The difference seems to be that equation 6 gives a result 63% smaller then equation 15. In other words, the lift generated by the airfoils is 63% bigger than with trapezoildal plane fins.

Here is a comparison with the compareFunction method:
image

The yellow line is the airfoiled one.

@giovaniceotto
Copy link
Member

To be honest, I am quite intrigued by the difference. I would like to first review this difference before proceeding to merging this PR.

@Gui-FernandesBR Gui-FernandesBR added the Bug Something isn't working label Jan 31, 2022
@Gui-FernandesBR Gui-FernandesBR removed request for a team and brunosorban January 31, 2022 02:59
@MateusStano MateusStano changed the title BUG: Airfoil fins normal force coefficient derivative calculation. WIP: Airfoil fins normal force coefficient derivative calculation. Feb 11, 2022
@MateusStano MateusStano merged commit 5d8d8a1 into RocketPy-Team:develop Feb 15, 2022
@MateusStano MateusStano mentioned this pull request Feb 15, 2022
@Gui-FernandesBR Gui-FernandesBR changed the title WIP: Airfoil fins normal force coefficient derivative calculation. enh:Airfoil fins normal force coefficient derivative calculation. Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants