Possibility of assigning chord length to panel sections via the python API

76 views
Skip to first unread message

Tim S.

unread,
Aug 12, 2022, 3:48:05 AM8/12/22
to OpenVSP
Hello,

I would like to assign a chord length or twist distribution at an individual panel section rather that the predefined "X_sec" sections in OpenVSP. This is for data transfer from OpenAeroStruct to OpenVSP, to map the exact twist/chord distribution. I can use the split section function and then lower the tesselation density to achieve a similar distribution, but for complex geometries the wing might get slighty distorted.

I am using python to automatically assign the paramters to OpenVSP, so I was wondering if there is a command to do this for individual panel sections without splitting the surfaces.

Thanks!

Brandon Litherland

unread,
Aug 12, 2022, 11:43:01 PM8/12/22
to OpenVSP
To model this, try using a Prop instead of a Wing.  I'm fact, if you want to speed it up, convert your inputs to a BEM format and import it.

Rob McDonald

unread,
Aug 13, 2022, 11:26:30 AM8/13/22
to OpenVSP
OpenVSP's wing only allows you to specify twist angle at the wing section boundaries.  

If you want to work with a smooth continuous twist distribution, then using a propeller as a wing is probably what you want to do for now.

Rob

Tim S.

unread,
Aug 17, 2022, 8:47:48 AM8/17/22
to OpenVSP
As I already have the geometry as a wing I split the wing in different sections. Works fine for now, but thanks for the idea of using a prop instead of a wing.

Tim S.

unread,
Sep 9, 2022, 8:11:04 AM9/9/22
to OpenVSP
Hi, 

I ran into an issue when inserting the chord length to a certain XSection. When updating a couple of values for different XSec using the python API, the wing will get scaled down. Even though at the end of my script I add the function vsp.SetParmVal(vsp.FindParm(wing_1,"TotalSpan","WingGeom"),13.5) it does not show a wing span of 13.5 but 12.93, also all of the imported values for the chord lengths (at the different XSec) gets scaled down by the factor 13.5/12.93...Have you ran into this issue before? When I use the GUI to do the exact same thing it works fine.

All the best,
Tim

Rob McDonald

unread,
Sep 9, 2022, 1:00:20 PM9/9/22
to OpenVSP
I suspect you need to do an Update() before you set TotalSpan.

TotalSpan (and related parms) work by scaling all of a wing's Parms by the ratio of the last Span to the desired Span.  However, if you've changed a bunch of Parms -- meaning the stored Span is out of date -- then it will use the wrong scale factor.

Multi section wings can be a real hassle to update from the API.  There are two reasons.  One is that you have the option to choose the driver groups for each wing section (AR, span, area, taper, cr, ct, cave, secsw) and the second is that depending on those settings, changing a wing section's parameters can actually change the prior or next wing section.  I.e. the root chord of a section is the tip chord of the prior section -- and the tip chord is the root chord of the next section.

When using the API, it is generally best to use root chord, tip chord, span as your driver variables and to move from root to tip when setting the chords. 

Rob

Tim S.

unread,
Sep 9, 2022, 3:30:34 PM9/9/22
to OpenVSP

Hi Rob,

thanks for your rapid response! I tried using vsp.Update() as I assumed this as well, this did not work until I now used the update function after every assignment of a new chord length. Now it works.

All the best,
Tim

Rob McDonald

unread,
Sep 9, 2022, 4:05:21 PM9/9/22
to ope...@googlegroups.com
You shouldn't have to go quite that far, but it will do the job.

You might try setting both root and tip chord for each wing section -- and set them starting at the root and moving to the tip.

Reducing the calls to Update() will make your script run faster.

Rob


--
You received this message because you are subscribed to the Google Groups "OpenVSP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openvsp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openvsp/7cab53ef-c3d1-4e79-881c-a5f299720ff5n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages