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

Taper Function, Problems when mesh has offset #360

Open
berga007 opened this issue Jul 18, 2021 · 2 comments
Open

Taper Function, Problems when mesh has offset #360

berga007 opened this issue Jul 18, 2021 · 2 comments

Comments

@berga007
Copy link

Description

In the openaerostruct/geometry/utils.py module the Taper Function, taper, that is implemented produces wrong results when the mesh has an offset in the y (spanwise) direction.

Steps to reproduce issue

  1. Use the generate_mesh function available in the same module to produce a rectangular wing with an offset in the y direction:

from openaerostruct.geometry.utils import (
generate_mesh,
taper
)

mesh_dict = {'num_y' : num_y_outboard,
'num_x' : num_x,
'wing_type' : 'rect',
'symmetry' : True,
'span_cos_spacing' : 0.5,
'span' : 2.5,
'root_chord' : 0.399,
'offset' : np.array([0, -0.75, 0])
}

mesh = generate_mesh(mesh_dict)

  1. Use the taper function to change the geometry of the mesh:

mesh = taper(
mesh=mesh,
taper_ratio=0.55,
symmetry=True
)

Current behavior

mesh[0, -1, 0] returns a value for the x-coordinate of the Leading Edge root different than the original value defined when calling the generate_mesh helper function.

mesh[-1, -1, 0] also returns a different value than previously defined by the generate_function helper function.

Expected behavior

mesh[0, -1, 0] and mesh[0, -1, 0] to return the same value as given by the generate_function helper function.
The x-coordinates of the wing root should be the same after calling the taper function.

Code versions

  • Python 3.9.5
  • OpenMDAO 3.6.0
  • OpenAeroStruct 2.3.0
@berga007
Copy link
Author

I believe the issue is related to the way the interpolation is being defined:

taper = np.interp(x.real, xp.real, fp.real)

xp is defined as a ndarray [-span, 0] so the interpolation will use [-span, taper_ratio] as the first data point and will use
[0, 1] as the 2nd data point to produce the linear interpolation function.

If there is an offset in the y-coordinate then -span and the y-coordinate at the wing tip will not match.

I believe that by defining the variable xp as:

xp = np.array([x[0], x[-1]])

The problem will be fixed.

@kanekosh
Copy link
Contributor

@berga007 Thank you for opening an issue, I will take at look and fix soon.

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