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

Wing aspect ratio value seems not correct #827

Closed
aidanjungo opened this issue Sep 6, 2021 · 7 comments · Fixed by #848
Closed

Wing aspect ratio value seems not correct #827

aidanjungo opened this issue Sep 6, 2021 · 7 comments · Fixed by #848
Milestone

Comments

@aidanjungo
Copy link

// Returns the aspect ratio of a wing: AR=b**2/A=((2s)**2)/(2A_half)
// b: full span; A: Reference area of full wing (wing + symmetrical wing)
// s: half span; A_half: Reference area of wing without symmetrical wing
double CCPACSWing::GetAspectRatio()
{
return 2.0*(pow_int(GetWingspan(),2)/GetReferenceArea(GetSymmetryAxis()));
}

I am not sure I completely understand how the formula to calculate AR has been changed recently, but when I use 'get_aspect_ratio()' for wing 1 of the D150 i got 526.71 before this change the value was 9.4.

>>> aircraft_tigl.get_wing(1).get_aspect_ratio()
526.7133945257066

It seems to me that it use the wrong reference area for the wing in the AR formula

If we use:

AR = (Span**2)/4 / RefArea *2

Before I think it was:

>>> 33.91522073785017*33.91522073785017/4/61.162786877005146*2
9.40312121494867

But now it seems to be:

>>> 33.91522073785017*33.91522073785017/4.3676208338421665*2
526.7133945257066
@aidanjungo
Copy link
Author

I just checked, if I change "x-z-plane" by "x-y-plane" for the symmetry of wing 1, it gives the correct value, so it seems that "get_aspect_ratio()" did not use the correct reference area projection to calculate the AR.

@rainman110
Copy link
Collaborator

Hi @aidanjungo . Thanks for pointing this out. I'll have a look, why this has changed. Which TiGL version have you been using before (which didn't have this bug)?

@aidanjungo
Copy link
Author

I am not sure of which version I was using because I installed cpacscreator via Conda. But now, I feel that Tigl3 has been update but maybe not cpacscreator, is it correct?
I saw the function "get_half_span" has been replace by "get_wingspan" in Tigl3, but it seems it does not exist (yet) in cpacscreator.

@rainman110
Copy link
Collaborator

Indeed, we have not updated cpacs creator yet. It still uses tigl 3.0.0 as a basis.

@rainman110 rainman110 added this to the TiGL 3.2.2 milestone Nov 8, 2021
rainman110 added a commit that referenced this issue Nov 9, 2021
I also made the code more const correct

Addresses #827
@rainman110
Copy link
Collaborator

I can reproduce this error. The error actually already existed in tigl 3.0.0.

The reason for the error is, that the wing reference area is computed incorrectly, because wrong projection planes are passed to the reference area computation.

@rainman110
Copy link
Collaborator

@rainman110
Copy link
Collaborator

Apparently, Malo fixed the bug back then in the cpacs creator. I'll backport the fix into tigl.

rainman110 added a commit that referenced this issue Nov 9, 2021
I backported the code from cpacs creator,
which already solved the problem.

Fixes #827
rainman110 added a commit that referenced this issue Nov 10, 2021
Added copyright header to winghelpers.

Closes #827
rainman110 added a commit that referenced this issue Nov 10, 2021
I also made the code more const correct

Addresses #827
rainman110 added a commit that referenced this issue Nov 10, 2021
I backported the code from cpacs creator,
which already solved the problem.

Fixes #827
rainman110 added a commit that referenced this issue Nov 10, 2021
Added copyright header to winghelpers.

Closes #827
rainman110 added a commit that referenced this issue Nov 12, 2021
I also added unit tests for the TiglWingHelperFunctions.

Addresses #827
rainman110 added a commit that referenced this issue Nov 12, 2021
I also made the code more const correct

Addresses #827
rainman110 added a commit that referenced this issue Nov 12, 2021
I backported the code from cpacs creator,
which already solved the problem.

Fixes #827
rainman110 added a commit that referenced this issue Nov 12, 2021
Added copyright header to winghelpers.

Closes #827
rainman110 added a commit that referenced this issue Nov 12, 2021
I also added unit tests for the TiglWingHelperFunctions.

Addresses #827
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

Successfully merging a pull request may close this issue.

2 participants