module 'openvsp' has no attribute 'VORTEX_LATTICE'

40 views
Skip to first unread message

Julien

unread,
Feb 10, 2026, 5:49:05 AM (13 days ago) Feb 10
to OpenVSP
Hi everyone,

I wanted to run a simple code using the Python API to create the most basic wing and run VSPAero (e.g. print CL vs alpha). Looking at some codes I found on the forum I should use vsp.VORTEX_LATTICE at one point but then when using it I get:
AttributeError: module 'openvsp' has no attribute 'VORTEX_LATTICE'

The same error appears when I try to use vsp.SetAnalysisInputDefaults

I couldn't find in the python API documentation any mention of this VORTEX_LATTICE so maybe the syntax has changed... At first, I thought I did not correctly installed the API but when running python test.py I don't get any error:
SET_ALL =  0
('POD', 'FUSELAGE', 'WING', 'STACK', 'BLANK', 'ELLIPSOID', 'BODYOFREVOLUTION', 'HUMAN', 'PROP', 'GEAR', 'HINGE', 'CONFORMAL', 'ROUTING', 'AUXILIARY', 'COBRA')
All geoms in Vehicle.
('EUOJPXETRD', 'AWDRUJOYDO', 'ZDOQNLYVAY')
All geoms in Vehicle.
()
End of second use case, all geoms in Vehicle.
('KWVMUBJCBZ',)
Start of third use case, read in first-case file.
All geoms in Vehicle.
('EUOJPXETRD', 'AWDRUJOYDO', 'ZDOQNLYVAY')

My code is in the same folder as test.py and I can run functions such as: vsp.AddGeom and vsp.PrintResults but not vsp.VORTEX_LATTICE or vsp.SetAnalysisInputDefaults.In fact when I run print(dir(vsp)) I get a lot of attributes:
['ABS', 'ALIGN_BOTTOM', 'ALIGN_CENTER', 'ALIGN_LEFT', 'ALIGN_MIDDLE', 'ALIGN_PIXEL', 'ALIGN_RIGHT', 'ALIGN_TOP', 'ALL_DIR', 'ALL_GDEV_TYPES', 'ALL_GEOM_SCREENS', 'ANG_0', 'ANG_180', 'ANG_270', 'ANG_90', 'ANG_DEG', 'ANG_RAD', 'APPROX_CEDIT', 'AREA_WSECT_DRIVER', 'AREA_XSEC_DRIVER', 'AR_WSECT_DRIVER', 'ATMOS_TYPE_HERRINGTON_1966', 'ATMOS_TYPE_MANUAL_P_R', 'ATMOS_TYPE_MANUAL_P_T', 'ATMOS_TYPE_MANUAL_RE_L', 'ATMOS_TYPE_MANUAL_R_T', 'ATMOS_TYPE_US_STANDARD_1976', 'ATTACH_ROT_COMP', 'ATTACH_ROT_EtaMN', 'ATTACH_ROT_LMN', 'ATTACH_ROT_NONE', 'ATTACH_ROT_NUM_TYPES', 'ATTACH_ROT_RST', 'ATTACH_ROT_UV', 'ATTACH_TRANS_COMP', 'ATTACH_TRANS_EtaMN', 'ATTACH_TRANS_LMN', 'ATTACH_TRANS_NONE', 'ATTACH_TRANS_NUM_TYPES', 'ATTACH_TRANS_RST', 'ATTACH_TRANS_UV', 'ATTROBJ_ADVLINK', 'ATTROBJ_ATTR', 'ATTROBJ_COLLECTION', 'ATTROBJ_FREE', 'ATTROBJ_GEOM', ...]

Can you help me solve this issue please? Also could you give an example of a python script to print cl vs span (or any aerodynamic coefficient) on the most basic wing?

Thanks, in advance!

Brandon Litherland

unread,
Feb 10, 2026, 7:12:45 AM (13 days ago) Feb 10
to OpenVSP
I assume that you're using OpenVSP 3.46 or greater.  VSPAERO, and thus the API, no longer has VLM and Panel modes as separate.  The hybrid mode using Thick and Thin surfaces is how we do things now.  Unfortunately, I don't think the script or API examples have been updated yet to illustrate this. (Sorry about that).  You have to tell VSPAERO what surfaces or Sets belong where as in the code example below. You will be able to pull the spanwise results from the VSPAERO_Load result.



# -*- coding: utf-8 -*-
"""
Created on Tue Apr 25 13:15:15 2023

Successful test with OpenVSP 3.46.0 on Dec 11, 2025 ~10am

@author: Brandon Litherland
"""
# Tested on 4/25 and works.

import openvsp as vsp
stdout = vsp.cvar.cstdout
errorMgr = vsp.ErrorMgrSingleton.getInstance()

# If you are making a model from scratch, reading the file isn't needed. I recommend starting from a VSP3 file though.
path = path to your file
fname = 'vspaero_apitest.vsp3'
vsp.VSPRenew() # Clears out VSP memory and refreshes everything.  Don't use this if you need to keep things around.

# Read the VSP3 model
vsp.ReadVSPFile((path+fname))
# Check for all geoms if you like to make sure they are found (nice sanity check but not needed)
geoms = vsp.FindGeoms()
print("All geoms in Vehicle:")
print(geoms)

# Try this with new VSPAERO and VSP 3.46+
compgeom = "VSPAEROComputeGeometry"
# May not be necessary to get the defaults but I like to anyway
thick_set = vsp.GetIntAnalysisInput(compgeom, "GeomSet")
thin_set = vsp.GetIntAnalysisInput(compgeom, "ThinGeomSet")
# Define what sets go to thick or thin
thick_set = [vsp.SET_NONE]
thin_set = [vsp.SET_ALL]
# Set the thick and thin for CompGeom and create the hybrid geometry for analysis
vsp.SetIntAnalysisInput(compgeom, "GeomSet", thick_set)
vsp.SetIntAnalysisInput(compgeom, "ThinGeomSet", thin_set)
vsp.PrintAnalysisInputs(compgeom)
# Results stored for later if you want.
comp_res_id = vsp.ExecAnalysis(compgeom)


# run vspaero sweep next
analysis_name = "VSPAEROSweep"
vsp.SetAnalysisInputDefaults(analysis_name)
# Set some inputs to whatever you need
vsp.SetDoubleAnalysisInput(analysis_name, "AlphaStart", (0,), 0)
vsp.SetDoubleAnalysisInput(analysis_name, "AlphaEnd", (10,), 0)
vsp.SetIntAnalysisInput(analysis_name, "AlphaNpts", (3,), 0)
vsp.Update()
# Run the VSPAERO Sweep
res_id = vsp.ExecAnalysis(analysis_name)
# Do some things with the results...
rid_vec = vsp.GetStringResults(res_id, 'ResultsVec')
rid_polar = vsp.FindResultsID('VSPAERO_Polar')
alpha_list = vsp.GetDoubleResults(rid_polar, 'Alpha')
vsp.PrintResults(rid_polar)

Julien

unread,
Feb 10, 2026, 11:50:40 AM (13 days ago) Feb 10
to OpenVSP
Thank you Brandon! As everyone already underlined, it is amazing to have this google group where we can directly ask the developers and who always answer quickly! I figured out how to properly export to csv the StringResults, but could you please explain this concept of thin and thick surfaces? From what I heard during the workshop videos (maybe I am mixing everything up) essentially thin surfaces are the surfaces we would obtain with the degen geom and that are used with VLM for wings, whereas for the fuselage we should use thick surfaces (associated with PM) thus two different methods of calculation are automatically used when running a file with hybrid sets. Also in the code I don't understand how we can manually change the sets associated to thick_set and thin_set as "geoms" is not even an argument
thick_set = vsp.GetIntAnalysisInput(compgeom, "GeomSet")
thin_set = vsp.GetIntAnalysisInput(compgeom, "ThinGeomSet")

Thanks in advance!

Brandon Litherland

unread,
Feb 10, 2026, 12:45:59 PM (13 days ago) Feb 10
to OpenVSP
So I made a bit of a typing error.  CompGeom (the analysis) is not part of this process.  The first analysis is "VSPAEROComputeGeometry" which in prior versions would depend on whether you were in VLM or Panel mode to produce either a DegenGeom or thick geometry.  Now the geometry uses both thick and thin and you have to tell VSPAERO what components belong to what set.  In my example above, I set ALL to the thin set and NONE to the thick set.  However, if you have a Set called "Thin" with your wings and tails, then you could assign those components using, thin_set = [vsp.GetSetIndex('Thin')], for example.  These Sets correspond to the Thin and Thick options under Case Setup in the VSPAERO GUI.  The image below shows a pod as a thick body and the wing and tails as thin surfaces.

Again, as I commented in the code example, you don't have to Get the values of the existing default set assignments.  I just do that for my own peace of mind.
As mentioned in a couple of other posts here, you have to be careful mixing thick and thin to ensure that the thin surface doesn't exactly intersect a thick body right on one of the thick edges or it can cause problems, usually presented as nans in the first iteration.  Rotate your body component slightly to separate these features.
hybrid_vspaero_viewer_result.png

Brandon Litherland

unread,
Feb 10, 2026, 12:57:35 PM (13 days ago) Feb 10
to OpenVSP
If you aren't aware yet, the latest API documentation is found here: https://openvsp.org/api_docs/latest/.  This is the AngelScript format for VSPSCRIPT; however, the mapping from AS to Python is almost one to one. (enumeration is a bit different as you've seen above).  The Python API is also documented with the distribution you downloaded under <OpenVSP path>/python/openvsp/doc.  Just open the HTML file called openvsp to bring up a browser with all the functions and calls.

Julien

unread,
Feb 11, 2026, 10:41:21 AM (12 days ago) Feb 11
to OpenVSP
Thanks for the answer! 
Reply all
Reply to author
Forward
0 new messages