Cannot access actuator disk or set RPM/CT/CP after ComputeGeometry (Python API, v3.46.0)

21 views
Skip to first unread message

Steven Zhu

unread,
Oct 9, 2025, 6:24:35 PM (22 hours ago) Oct 9
to OpenVSP
Hi, I found a reproducible issue with the Python API in 3.46.0 on Windows and would appreciate help confirming whether this is a bug or a user mistake.  

I add a PROP in disk mode via the Python API and run ExecAnalysis("VSPAEROComputeGeometry"). If I do not add a WING first, I can access the actuator disk and set/read RotorRPM, RotorCT, RotorCP. If I add a WING before running compute-geometry, the disk becomes inaccessible: GetNumActuatorDisks() returns 0 and FindActuatorDisk(0) raises FindActuatorDisk::disk_index 0 out of range, so I cannot read or modify RPM/CT/CP after the analysis.

I attach a minimal reproducible Python script that toggles the add-wing / no-wing cases. Is this a known regression in 3.46.0, or is there a required analysis input I should set so the actuator disk remains accessible?

Thanks.

Steven

disktest.py

Rob McDonald

unread,
Oct 9, 2025, 6:32:29 PM (21 hours ago) Oct 9
to OpenVSP
You're likely using the 'Shown' Set for your analysis.

When the geometry is prepared, the geometry is no-show'ed.  That makes the Shown Set empty -- which means that the actuator disk is not in the active analysis Set anymore.

Use an explicit Set, put your desired geometry (including the actuator disk) into that Set.  It should work as desired from there.

Rob

Steven Zhu

unread,
Oct 9, 2025, 6:40:19 PM (21 hours ago) Oct 9
to OpenVSP
Hi, 

Thank you for your reply. I created the prop using following command:     
prop_id = vsp.AddGeom( "PROP", "" )
vsp.SetParmVal( prop_id, "PropMode", "Design", vsp.PROP_DISK )
vsp.SetSetFlag(prop_id, vsp.SET_FIRST_USER + 0, True)
vsp.Update()

I should have put the disk in set 3, which is the set after shown and not-shown, and the problems persists. 

Thank you

Yixuan


Rob McDonald

unread,
Oct 9, 2025, 6:52:12 PM (21 hours ago) Oct 9
to OpenVSP
That places the prop in the desired Set, but you also have to tell VSPAERO to use that Set.  And you have to tell it twice -- once for the geometry preparation, another time for the analysis.

You should use Sets for all your Geom's (including the wing, etc).

vsp.SetIntAnalysisInput(compgeom_name, 'GeomSet', [vsp.SET_NONE], 0) # Thick geometry
vsp.SetIntAnalysisInput(compgeom_name, 'ThinGeomSet', [vsp.SET_FIRST_USER + 0], 0) # Thin geometry - VLM

vsp.SetIntAnalysisInput(analysis_name, 'GeomSet', [vsp.SET_NONE], 0)
 # Thick geometry
vsp.SetIntAnalysisInput(analysis_name, 'ThinGeomSet', [vsp.SET_FIRST_USER + 0], 0) # Thin geometry - VLM

My main recommendation is to start with the GUI -- and to start simple.  Get something simple working, then start adding features and complexity a bit at a time.

Once you have something working in the GUI, then start over in the API.  Start simple, add complexity a little at a time.

Rob

Steven Zhu

unread,
Oct 9, 2025, 7:17:25 PM (21 hours ago) Oct 9
to OpenVSP
I tried put prop and wing in an expilcit set and successfully set the Ct, Cp and RPM in GUI. In API, I put prop and wing in  vsp.SET_FIRST_USER + 0, set and used  
vsp.SetIntAnalysisInput(analysis_name, 'GeomSet', [vsp.SET_NONE], 0) # Thick geometry
vsp.SetIntAnalysisInput(analysis_name, 'ThinGeomSet', [vsp.SET_FIRST_USER + 0], 0) # Thin geometry - VLM
before executing the ComputeGeometry analysis, but after the analysis I was still unable to edit the Ct, Cp and RPM. I tried edit Ct, Cp and RPM before compute geometry, but the edited value were not written to vsp3 file. I have copied my code here. 

import openvsp as vsp
import os

def runaero():
    vsp.DeleteAllResults()
    compgeom_name = "VSPAEROComputeGeometry"
    # Set defaults
    vsp.SetAnalysisInputDefaults( compgeom_name )
    vsp.SetIntAnalysisInput(compgeom_name, 'GeomSet', [vsp.SET_NONE], 0) # Thick geometry
    vsp.SetIntAnalysisInput(compgeom_name, 'ThinGeomSet', [vsp.SET_FIRST_USER + 0], 0) # Thin geometry - VLM

    disk_id = vsp.FindActuatorDisk(0)
    parm_ct  = vsp.FindParm(disk_id, "RotorCT",  "Rotor")
    print("Before ExecAnalysis: disk", "CT=", vsp.GetParmVal(parm_ct))

    print( "\tExecuting..." )
    compgeom_resid = vsp.ExecAnalysis( compgeom_name)
    print( "COMPLETE" )
    # Get & Display Results
    vsp.PrintResults( compgeom_resid )
   
    disk_id = vsp.FindActuatorDisk(0)
    vsp.SetParmValUpdate( vsp.FindParm(disk_id, "RotorRPM", "Rotor"), 1000 )  
    vsp.SetParmValUpdate( vsp.FindParm(disk_id, "RotorCT",  "Rotor"),  0.1)
    vsp.SetParmValUpdate( vsp.FindParm(disk_id, "RotorCP",  "Rotor"),  0.1)

script_dir = os.path.dirname(os.path.abspath(__file__))
output_dir = os.path.join(script_dir, "outputs")
os.makedirs(output_dir, exist_ok=True)
os.chdir(output_dir)

vsp.ClearVSPModel()
#Add prop
prop_id = vsp.AddGeom( "PROP", "" )
vsp.SetParmVal( prop_id, "PropMode", "Design", vsp.PROP_DISK )
vsp.SetSetFlag(prop_id, vsp.SET_FIRST_USER + 0, True)
vsp.Update()
#Add wing
wid = vsp.AddGeom( "WING", "" ) # if don't add a wing, no error
vsp.SetSetFlag(wid, vsp.SET_FIRST_USER + 0, True)
vsp.Update()
runaero()

Thank you for your time.

Steven
Reply all
Reply to author
Forward
0 new messages