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

Incorrect Inviscid Airfoil Analysis #54

Closed
GodotMisogi opened this issue May 7, 2021 · 4 comments
Closed

Incorrect Inviscid Airfoil Analysis #54

GodotMisogi opened this issue May 7, 2021 · 4 comments

Comments

@GodotMisogi
Copy link

GodotMisogi commented May 7, 2021

Bug Description

Running an inviscid analysis on a NACA 0012 airfoil at 0 degrees angle of attack produces non-zero lift coefficient.

Steps to Reproduce

from aerosandbox import Airfoil, AirfoilInviscid, OperatingPoint
a = AirfoilInviscid(
    airfoil=[
        Airfoil("naca0012")
            .repanel(50)
    ],
    op_point=OperatingPoint(
        velocity=1,
        alpha=0,
    )
)
print(f"CL: {a.Cl}")

CL: -0.17311351475463538

Expected Behavior

CL: 0

System Information

  • Operating System: Windows 10
  • Python Version: 3.9
  • AeroSandbox Version: 3.0.13
@peterdsharpe
Copy link
Owner

Interesting! Looks like a bug with how the trailing-edge panel is being handled; here's the C_p distribution for the NACA0012 run: (plotted via a.draw_cp())
image

I think I figured out what's wrong. The source panel that's created to bridge the nonzero trailing edge gap had source strength that linearly varied between gamma_TE and -gamma_TE; instead it needs to be uniform and equal to gamma_TE.

I just fixed this bug and can verify that the NACA0012 is returning C_L = 0 to within machine precision. Now, we get the correct C_p distribution, without the trailing edge funkiness:
image

We can also plot the streamlines (via a.draw_streamlines()):
image

And this looks like about what we would expect.

Thank you so much for catching this! :) I'm surprised this wasn't caught in unit testing - looks like I need to add more tests for nonzero-TE cases!

Patch will be pushed in a few minutes.

@peterdsharpe
Copy link
Owner

Version 3.0.14 just pushed, which includes this fix c43e79a! Should be available via pip install --upgrade aerosandbox in just a few minutes after automated tests run.

@peterdsharpe
Copy link
Owner

Also, a unit test has been added for this case: 749cab5

@GodotMisogi
Copy link
Author

GodotMisogi commented May 7, 2021

Great, thanks for the quick fix! I suspected as much that there was some issue with the trailing edge after visualising the pressure coefficient distribution, but I assumed it may be due to an issue in enforcement of the Kutta condition. Some techniques, such as the constant-strength doublet-source panel method, do suffer from similar "spikes" at the trailing edge, and blunt ones are sometimes pretty screwy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants