Questions on Python API (from installation to usage)

205 views
Skip to first unread message

Luca

unread,
Apr 19, 2025, 7:07:46 AM4/19/25
to OpenVSP
I am a new OpenVSP user and with my group in university, we are performing a preliminary design of a Formula Student front wing. I am using Ubuntu 24.04.02 LTS and I have the OpenVSP 3.42.3 version. For our optimisation analysys, it would be amazing to be able to perform a series of tests at the same angle of attack (since it's a front wing), changing just sweep angles, position of second wing, camber and so on. The python API seems interesting, but I am not able to find anything online, any tutorial for installation in linux, anything...
I don't know if my installation was correct, since I can perfectly use the OpenVSP GUI and VspAero and so on, but I don't have anaconda or things like that, so in case, please tell me if I have to do another installation. That said, if my installation is correct, please help me, I am desperate, I don't understand how to import the openvsp modulus in python.
Regards, Luca

Luca

unread,
Apr 19, 2025, 10:42:06 AM4/19/25
to OpenVSP
Ok, no sorry, I have a little update, I actually finally managed to find the python_api, I don't know how I missed to look into that folder, maybe I just need more sleep.
But that problem is solved.
Now there is the other problem: is there a tutorial or something I can use to understand how this python_api is used and the commands I can use to perform the analysys?
Best regards, Luca

Jasper Waldman

unread,
Apr 19, 2025, 11:55:25 AM4/19/25
to ope...@googlegroups.com
API Documentation: https://openvsp.org/api_docs/latest/

Note that when importing the VSP API in python, e.g 
import openvsp as vsp

you'd call the API with the prefix vsp, e.g. vsp.GetParmValUpdate()


--
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 visit https://groups.google.com/d/msgid/openvsp/628ab2fa-9d38-448c-b49e-aeeaa65b200an%40googlegroups.com.

Luca Galati

unread,
Apr 19, 2025, 3:56:47 PM4/19/25
to ope...@googlegroups.com
Thank you so much for your answer and your time, really appreciate it. 
I was very confused about that page, partly because of the syntax, that was appearing wired to me and surely not very python-style and then because it seemed like the guide was not containing the -help informations for all the commands. I will try to do a try and error process to understand better all the types of command available.
Best regards, Luca

Il giorno 19 apr 2025, alle ore 17:55, 'Jasper Waldman' via OpenVSP <ope...@googlegroups.com> ha scritto:



Rob McDonald

unread,
Apr 19, 2025, 5:24:26 PM4/19/25
to OpenVSP
The documentation is available in Python syntax here https://openvsp.org/pyapi_docs/latest/

However, it is not as easy to use.

In general, the API is a 1:1 match between the C/C++ and Python versions.

Rob

Luca

unread,
Apr 25, 2025, 4:37:41 AM4/25/25
to OpenVSP
Sorry guys, but I'm in serious troubles, since I seriously don't understand how to import the packages to make vspAero work. I am on Ubuntu and when I installed OpenVSP I obtained many folders and stuff. 
I saw looking other users conversations that to perform a correct import of the modules I should do:
import openvsp_config
import openvsp as vsp
But the problem is that of course I need to do an append of the path to do it, so what I do, before importing the modules, is:
sys.path.append("/home/liukushka/OpenVSP/repo/src/python_api/packages/openvsp/openvsp")
sys.path.append("/home/liukushka/OpenVSP/repo/src/python_api/packages/openvsp_config/openvsp_config")
But I don't know what's wrong, but it won't work. To be clear, inside openvsp and openvsp_config folders I have:
Screenshot from 2025-04-25 10-36-00.png
and
Screenshot from 2025-04-25 10-36-35.png
but I don't really know if it is correct...
Regards
Luca

Brandon Litherland

unread,
Apr 25, 2025, 2:10:45 PM4/25/25
to OpenVSP
Are you only trying to get VSPAERO to work with the API?  There are several posts in this group related to that if you need examples as well as examples in the scripts folder distributed with OpenVSP.  If there's something specific that you are having trouble with, we can help you.

Luca

unread,
Apr 29, 2025, 9:34:23 AM4/29/25
to OpenVSP
Thank you for your reply Brandon, Rob and Jasper.

I am still learning, but I have implemented a code that takes in input a geometry created using the GUI and asks the user which parameter he wants to change and changes it accordingly. Tanks to your help and all the other users of the group, I've been able to finish it. Unfortunately the code is written in italian, but I will send on this group an english version, so maybe someone will find it useful.
One last thing before I get back to work: using VSPAEROSweep as analysis, I heard that the parasite drag (CD0) is not correctly computed using the vortex lattice method, so is there a fix for this?
Also, for the reynolds number input (ReCRef), by setting it we also set the altitude (Density, Rho)?

Best regards,
Luca

Brandon Litherland

unread,
Apr 29, 2025, 9:48:54 AM4/29/25
to OpenVSP
The VSPAERO CD0 value is not incorrectly computed at all.  Instead, it's just a different way of approximating the parasitic drag of each component by assuming a flat-plate drag model either for lifting or non-lifting bodies.  It's perfectly acceptable to use that value in conceptual design when you don't know the specifics of shape for an aircraft concept.  However, if your design is more mature or you are trying to compare to an existing aircraft/vehicle, the Parasite Drag tool will very likely provide a more comprehensive and flexible method of obtaining parasitic drag.

Luca

unread,
May 2, 2025, 6:05:41 AM5/2/25
to OpenVSP
Thank you so much Brandon.
Best regards
Luca

Reply all
Reply to author
Forward
0 new messages