Closed Aviatims closed 2 years ago
I believe the optimization setup (i.e., whether aero or aerostruct) doesn't matter for generate_vsp_surfaces
function. Thus if vsp_model.vsp3
works with aerodynamic optimization cases but not for aerostructural with wing box, then the issue might be in plot_wingbox
or in runscript. I'm not sure though.
Could you try plotting the surfaces
by yourself using matplotlib (but not the plot_wingbox function of OAS) to see if it looks fine?
I will have a try at plotting the surfaces. I included the runscript in the description above. To create this I followed the steps as described. I first assumed it has something to do with the symmetry, as I noticed in the wing_box example from the documentation, that the one side of the wingbox was represented correctly while the other was displaying a sharp edge, as if some nodes of the wingbox are missing in the plotwingbox command. See the following two pictures: right side: left side:
And if you look closely in the picture provided in the first bug description the center of the wingbox also has a sharp edge while the other side is a rectangular cross section.
This however did not lead to an improvement. Have you tried running the attached runscript to see if you get a similar issue?
All of these observations lead me to the conclusion that the problem is probably in the file which generates the wingbox. Maybe in the wingbox_group.py file in the structures folder.
But I will look into the plot_wingbox file to see if it is a plotting error.
Hello, I just wanted to ask whether there is an update on if the problem also occurs for you/other users. I have tried a couple of things but haven't solved the issue yet.
Sorry Tim, we don't have time to work on this issue for a while.
I have figured out the issue. The mesh that is being generated in the generate_vsp_surfaces function located in the utils folder needs to be of a different convention for the aerostructural case compared to the aerodynamic case. I achieved this by including the following lines: x=x[::-1] # for aerostruct mesh y=y[::-1] # for aerostruct mesh z=z[::-1] # for aerostruct mesh
and modifying:
mesh[:, :, 1] = np.flipud(y.T)*-1 #-1 for aerostruct mesh
This creates the right mesh format needed for the aerostructural case.
I finally had time to reproduce the bug by myself.
The generate_vsp_surfaces
function generates a symmetric wing on the right-side plane (whose spanwise coordinate y
is positive), whereas most of the other examples in OAS use a left-side wing (whose y
is negative). And it seems that aerostructural analysis (both tubular and wingbox) only works with left-side wings and only the aero analysis can handle the right-side wing.
I consider this bug to be of aerostructural analysis rather than the VSP import. I'll close this issue and open another one. A workaround is to convert the right-side wing to the left-side wing as you posted above. Thanks for finding this out.
Description
When importing a wing into openaerostruct using the generate_vsp function, the wing from OpenVSP gets overlapped with another straight unswept wing. This only happens for aerostructural optimization with a wingbox and not for an aerodynamic optimization, here the generate_vsp functionality works great.
Steps to reproduce issue
Attached you will find the code I have used for this issue.
To recreate this code:
Current behavior
A rectangular wing is added at the end of the wingtips connecting the originally imported wing.
Expected behavior
The imported wing was expected to be correctly represented, just like in OpenVSP
Code versions
Code
Code file: TestWingbox.txt