mdolab / OpenAeroStruct

OpenAeroStruct is a lightweight tool that performs aerostructural optimization using OpenMDAO.
Apache License 2.0
191 stars 116 forks source link

Reference frame of section forces #429

Closed fmamitrotta closed 2 months ago

fmamitrotta commented 2 months ago

Hi all, first of all thanks for the great work on this open source tool!

For my PhD work I’m trying to couple OpenAeroStruct with Nastran, using MELD and Mphys, and I wanted to ask a clarification regarding the reference frame of the section forces.

I’ve run a quick aerodynamic analysis on the following two meshes, the first being a simple rectangular wing, the second being taken from this Mphys example.

image image

I’ve checked the section forces of the two models (output aero_states.panel_forces_surf.wing_sec_force) and I’ve found out that in both cases the x-components (so mostly drag) are negative.

My confusion originates from the fact that the freestream should be oriented along the positive global x-direction and for this reason I would expect the x-components of the section forces to be positive. At this point my understanding is that the section forces must be expressed in some kind of body reference frame, with the x-axis pointing forward. Do I understand correctly?

kanekosh commented 2 months ago

I believe you're correct. Do you get expected integrated values (L, D, CL, CD)? You can find the code for surface integration here

fmamitrotta commented 2 months ago

Yes, I do get the expected integrated values and looking at the code for surface integration I think I was actually wrong on the reference frame of the section forces.

These are the lines of code computing the integrated lift and drag:

        # Compute the induced lift force on each lifting surface
        outputs["L"] = np.sum(-forces[:, 0] * sina + forces[:, 2] * cosa)

        # Compute the induced drag force on each lifting surface
        outputs["D"] = np.sum(forces[:, 0] * cosa * cosb - forces[:, 1] * sinb + forces[:, 2] * sina * cosb)

The expressions coincide with those in Anderson's book (assuming a null yaw angle):

image image

So the reference frame of the section forces must be the same to that used in Anderson's book, that is to say with the x-axis pointing "backward" and not "forward".

The fact that the x-components of the section forces (corresponding to the vector A in Anderson's figure) are negative is counterintuitive but possible when the local drag is very small compared to the local lift. See the illustration below as an example.

LiftDrag

So I would say everything appears to be in order.

If I can give a constructive feedback from the point of view of someone completely new to OpenAeroStruct, it would be useful to expand the documentation on stuff like reference frames, mesh generation (e.g. how to get a left oriented vs a right oriented mesh), simple aerodynamic analysis and how to visualize results (e.g. plotting the lift distribution over the span - which output to access). I think it would smoothen the learning process of this great open source tool.

I would be very happy to expand myself the documentation on these things, maybe extending the quick example section, or creating new sections. I don't have time for that right now, but in a few weeks I could start working on it if you agree it would be something useful for the community.

shamsheersc19 commented 2 months ago

I think it would be great if you can begin expanding the documentation where you see holes. Then we can work with you to finalize them.

Also, please create more issues for the gaps that you see and put a note that you will work on them. That way others will know that someone is looking into it and can offer to collaborate.

Thanks again!

fmamitrotta commented 2 months ago

Thanks for your answer @shamsheersc19 , happy to help on this open source project!

I'll close this issue for now and I'll create a more appropriate issue when I start working on expanding the documentation, so that I can properly list the items that I have in mind 😊